* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 防止所有元素导致横向滚动 */
* {
    max-width: 100%;
}

img,
video,
canvas {
    max-width: 100%;
    height: auto;
}

/* Toast提示样式 */
.toast-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    pointer-events: none;
}

/* iOS全屏横屏提示 */
@keyframes fadeInOut {
    0% {
        opacity: 0;
    }

    15% {
        opacity: 1;
    }

    85% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

html,
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #1a1a2e;
    color: #ffffff;
    min-height: 100vh;
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    /* 防止横向滚动 */
    width: 100%;
    max-width: 100vw;
}

.app {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* 防止横向滚动 */
}

/* 播放页面特定样式 */
.app.player-page {
    overflow: hidden;
    /* 完全隐藏溢出 */
    width: 100vw;
    max-width: 100vw;
}

/* 确保所有主要容器都不溢出 */
.main-content,
.player-content,
.video-container,
.video-controls,
.danmaku-container,
.fullscreen-episodes-panel,
.episode-list,
.episode-grid,
.source-list,
.recommend-grid,
.detail-section {
    max-width: 100%;
    overflow-x: hidden;
    width: 100%;
}

/* 确保视频相关元素不溢出 */
.video-player {
    width: 100%;
    max-width: 100%;
    object-fit: contain;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 6px;
}

.header-search {
    display: flex;
    gap: 8px;
}

.header-search input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 14px;
    outline: none;
}

.header-search input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-btn {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.nav-tabs {
    display: flex;
    background: #16213e;
    padding: 0 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.tab-item {
    flex-shrink: 0;
    padding: 14px 18px;
    color: #a0a0a0;
    font-size: 14px;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}

.tab-item.active {
    color: #fff;
    font-weight: bold;
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.main-content {
    flex: 1;
    padding: 12px;
    overflow-x: hidden;
    /* 防止横向滚动 */
    width: 100%;
    max-width: 100%;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #888;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #333;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.video-card {
    background: #16213e;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.video-card:active {
    transform: scale(0.98);
}

.video-card .poster {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: #0f0f23;
}

.video-card .info {
    padding: 8px;
}

.video-card .title {
    font-size: 13px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-card .meta {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.video-card .rating {
    color: #ffd700;
}

.load-more {
    text-align: center;
    padding: 20px;
}

.load-more-btn {
    padding: 12px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 25px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
}

.back-btn,
.share-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
}

.video-container {
    position: relative;
    width: 100%;
    background: #000;
    aspect-ratio: 16/9;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-player::-webkit-media-controls {
    display: none !important;
}

.video-player::-webkit-media-controls-enclosure {
    display: none !important;
}

.video-player::-webkit-media-controls-panel {
    display: none !important;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 5;
}

.video-play-overlay.hidden {
    display: none;
}

.video-play-overlay .play-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.video-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.video-controls.hidden {
    opacity: 0;
    pointer-events: none;
}

.video-controls.hidden .controls-top,
.video-controls.hidden .controls-bottom {
    pointer-events: none;
}

.controls-top {
    background: linear-gradient(rgba(0, 0, 0, 0.8), transparent);
    padding: 12px;
    display: none;
    align-items: center;
    pointer-events: auto;
}

.controls-top.show {
    display: flex;
}

.fullscreen-back-btn {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 12px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.video-info {
    flex: 1;
    overflow: hidden;
}

.video-title {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-episode {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

.controls-bottom {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 30px 16px 12px;
    pointer-events: auto;
    margin-top: auto;
    /* 确保在底部 */
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
}

@media (min-width: 768px) {
    .controls-bottom {
        padding: 30px 40px 12px;
    }
}

@media (min-width: 1024px) {
    .controls-bottom {
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;
    }
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    flex: 1;
    min-width: 0;
}

.progress-played {
    height: 100%;
    background: #667eea;
    border-radius: 2px;
    width: 0%;
}

.progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.control-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.time-display {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.episodes-btn {
    font-size: 14px;
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
    padding: 6px 12px;
    transition: background 0.3s;
}

.episodes-btn.hidden {
    display: none;
}

.episodes-btn:hover {
    background: rgba(102, 126, 234, 0.8);
}

.fullscreen-episodes-panel {
    position: absolute;
    top: 0;
    right: -100%;
    left: auto;
    width: 45%;
    max-width: 200px;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    transition: right 0.3s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    opacity: 0;
}

.fullscreen-episodes-panel.show {
    right: 0;
    left: auto;
    pointer-events: auto;
    opacity: 1;
}

.episodes-panel-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.episodes-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}

.episodes-panel-close {
    display: none;
}

.episodes-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.episodes-panel-body::-webkit-scrollbar {
    width: 4px;
}

.episodes-panel-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.episodes-panel-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.fullscreen-episodes-panel .episode-grid .episode-item {
    text-align: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    padding: 10px 8px;
}

.fullscreen-episodes-panel .episode-grid .episode-item.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    color: #4ade80;
}

.fullscreen-episodes-panel .episode-grid .playing-indicator {
    height: 16px;
}

.fullscreen-episodes-panel .episode-grid .playing-indicator i {
    width: 4px;
    background: #4ade80;
    border-radius: 3px;
}

.fullscreen-episodes-panel .episode-grid .episode-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.danmaku-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 40px;
    overflow: hidden;
    pointer-events: none;
}

.danmaku-item {
    position: absolute;
    white-space: nowrap;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    animation: danmakuMove linear forwards;
    pointer-events: none;
}

@keyframes danmakuMove {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(-100%);
    }
}

.player-tabs {
    display: flex;
    background: #16213e;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    align-items: center;
    max-width: 100%;
    /* 防止超出父容器 */
    width: 100%;
}

.danmaku-input-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.danmaku-input-inline input {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #2a2a4a;
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    outline: none;
    width: 120px;
}

.danmaku-input-inline input::placeholder {
    color: #666;
}

.danmaku-icon {
    font-size: 18px;
    cursor: default;
}

.player-tabs::-webkit-scrollbar {
    display: none;
}

.ptab-item {
    flex-shrink: 0;
    padding: 12px 16px;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.ptab-item.active {
    color: #fff;
    border-bottom: 2px solid #667eea;
}

.player-content {
    padding: 12px;
    padding-bottom: 20px;
    overflow-x: hidden;
    /* 防止横向滚动 */
    width: 100%;
    max-width: 100%;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.detail-info {
    display: flex;
    gap: 12px;
}

.detail-poster {
    width: 100px;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    background: #0f0f23;
}

.detail-meta {
    flex: 1;
}

.detail-title {
    font-size: 18px;
    margin: 0;
    line-height: 1.4;
}

.detail-title-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-episodes {
    font-size: 13px;
    color: #667eea;
    font-weight: normal;
}

.detail-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0;
}

.intro-toggle {
    font-size: 14px;
    color: #888;
    cursor: default;
}

.detail-actions {
    display: flex;
    margin-top: 12px;
}

.action-btn {
    font-size: 11px;
    color: #a0b0ff;
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 50px;
}

.action-btn .icon {
    font-size: 16px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.detail-tags .tag {
    padding: 2px 8px;
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
    font-size: 11px;
    color: #a0b0ff;
}

.detail-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #888;
}

.detail-stats strong {
    color: #ffd700;
}

.detail-desc {
    font-size: 12px;
    color: #aaa;
    line-height: 1.6;
}

.detail-section {
    margin-top: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 0;
    padding-bottom: 8px;
}

.comment-input,
.danmaku-input {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.comment-input input,
.danmaku-input input {
    flex: 1;
    padding: 10px 14px;
    background: #16213e;
    border: 1px solid #2a2a4a;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.danmaku-input select {
    padding: 10px;
    background: #16213e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    color: #fff;
    outline: none;
}

.send-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: #16213e;
    border-radius: 8px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-user {
    font-size: 13px;
    color: #a0b0ff;
    margin-bottom: 4px;
}

.comment-text {
    font-size: 14px;
    color: #ddd;
    line-height: 1.5;
}

.comment-time {
    font-size: 11px;
    color: #666;
    margin-top: 6px;
}

.danmaku-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.danmaku-history-item {
    padding: 10px 12px;
    background: #16213e;
    border-radius: 8px;
    font-size: 13px;
}

.danmaku-history-item .time {
    color: #667eea;
    margin-right: 8px;
}

.intro-content {
    font-size: 14px;
    color: #ccc;
    line-height: 1.8;
}

.source-list {
    display: flex;
    gap: 10px;
}

.source-item {
    padding: 14px 16px;
    background: #16213e;
    border-radius: 8px;
    cursor: pointer;
    max-width: 200px;
}

.source-item.active {
    border: 1px solid #667eea;
}

.source-name {
    font-size: 14px;
}

.source-quality {
    font-size: 12px;
    color: #ffd700;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.expand-btn {
    font-size: 12px;
    color: #a0b0ff;
    cursor: pointer;
    padding: 4px 12px;
    background: rgba(102, 126, 234, 0.3);
    border-radius: 20px;
}

.episode-list {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
}

.episode-list::-webkit-scrollbar {
    display: none;
}

.episode-item {
    padding: 10px 16px;
    background: #16213e;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.episode-grid .episode-item {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 12px 16px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.episode-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.playing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
    vertical-align: middle;
    height: 12px;
}

.playing-indicator i {
    display: inline-block;
    width: 3px;
    height: 100%;
    background: currentColor;
    border-radius: 2px;
    animation: playingWave 0.8s ease-in-out infinite;
}

.playing-indicator i:nth-child(1) {
    animation-delay: 0s;
    height: 40%;
}

.playing-indicator i:nth-child(2) {
    animation-delay: 0.15s;
    height: 80%;
}

.playing-indicator i:nth-child(3) {
    animation-delay: 0.3s;
    height: 60%;
}

@keyframes playingWave {
    0%, 100% {
        transform: scaleY(0.5);
        opacity: 0.6;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.episode-item.vip {
    position: relative;
}

.episode-item.vip::after {
    content: 'VIP';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    background: #ffd700;
    color: #000;
    padding: 1px 3px;
    border-radius: 2px;
}

.episode-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.episode-modal.show {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border-radius: 20px 20px 0 0;
    max-height: calc(100vh - 300px);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a4a;
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.sort-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: #888;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.sort-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sort-btn.active {
    color: #667eea;
}

.sort-icon {
    width: 18px;
    height: 18px;
}

.layout-icon {
    width: 22px;
    height: 22px;
    display: block;
    pointer-events: none;
}

.modal-close {
    font-size: 24px;
    color: #888;
    cursor: pointer;
    padding: 4px;
}

.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.episode-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.episode-grid.layout-double {
    grid-template-columns: 1fr 1fr;
}

.episode-grid .episode-item {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
}

.recommend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.recommend-card {
    background: #16213e;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.recommend-card .poster {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: #0f0f23;
}

.recommend-card .title {
    padding: 8px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hidden {
    display: none !important;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.header-top .header-title {
    margin-bottom: 0;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(15deg);
}

body.light-mode {
    background-color: #f5f5f5;
    color: #333333;
}

body.light-mode .nav-tabs {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

body.light-mode .tab-item {
    color: #888888;
}

body.light-mode .tab-item.active {
    color: #667eea;
}

body.light-mode .main-content {
    background: #f5f5f5;
}

body.light-mode .video-card {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.light-mode .video-card .title {
    color: #333;
}

body.light-mode .video-card .meta {
    color: #888;
}

body.light-mode .ptab-item {
    color: #888;
}

body.light-mode .ptab-item.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

body.light-mode .player-content {
    background: #f5f5f5;
}

body.light-mode .detail-poster {
    background: #e0e0e0;
}

body.light-mode .detail-tags .tag {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
}

body.light-mode .detail-stats {
    color: #888;
}

body.light-mode .detail-desc {
    color: #666;
}

body.light-mode .comment-input input,
body.light-mode .danmaku-input input,
body.light-mode .danmaku-input select {
    background: #ffffff;
    border-color: #e0e0e0;
    color: #333;
}

body.light-mode .comment-item {
    background: #ffffff;
}

body.light-mode .comment-user {
    color: #667eea;
}

body.light-mode .comment-text {
    color: #333;
}

body.light-mode .comment-time {
    color: #aaa;
}

body.light-mode .danmaku-history-item {
    background: #ffffff;
    color: #333;
}

body.light-mode .intro-content {
    color: #555;
}

body.light-mode .source-item {
    background: #ffffff;
    color: #333;
}

body.light-mode .source-item.active {
    border-color: #667eea;
}

body.light-mode .episode-item {
    background: #ffffff;
    color: #333;
}

body.light-mode .episode-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

body.light-mode .episodes-btn {
    background: rgba(102, 126, 234, 0.3);
    color: #333;
}

body.light-mode .episodes-btn:hover {
    background: rgba(102, 126, 234, 0.5);
}

body.light-mode .expand-btn {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

body.light-mode .recommend-card {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.light-mode .recommend-card .poster {
    background: #e0e0e0;
}

body.light-mode .recommend-card .title {
    color: #333;
}

body.light-mode .loading {
    color: #888;
}

body.light-mode .loading-spinner {
    border-color: #e0e0e0;
    border-top-color: #667eea;
}

body.light-mode .load-more-btn {
    background: #667eea;
    color: #fff;
}

body.light-mode .modal-content {
    background: #ffffff;
}

body.light-mode .modal-header {
    border-bottom: 1px solid #e0e0e0;
}

body.light-mode .modal-title {
    color: #333;
}

body.light-mode .sort-btn {
    color: #666;
}

body.light-mode .sort-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

body.light-mode .sort-btn.active {
    color: #667eea;
}

body.light-mode .episode-grid .episode-item {
    background: #f5f5f5;
    color: #333;
}

body.light-mode .episode-grid .episode-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

/* iOS CSS 全屏模式 */
body.ios-fullscreen-active {
    overflow: hidden;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #000;
    overflow: hidden;
}

/* 隐藏非视频区域 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen>*:not(.video-container) {
    display: none !important;
}

/* 视频容器填满屏幕 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    background: #000;
    z-index: 10000;
    overflow: hidden;
}

/* 视频元素 - 铺满整个屏幕 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    z-index: 1;
    background: #000;
}

/* 自定义控件 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-controls {
    display: block !important;
    position: absolute;
    z-index: 100;
    width: 100%;
    left: 0;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-top {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 999998 !important;
    width: 100%;
    padding-top: env(safe-area-inset-top, 20px);
    padding-left: 12px;
    padding-right: 12px;
    background: transparent;
    flex-direction: row !important;
    align-items: center !important;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-bottom {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 999999 !important;
    width: 100%;
    padding: 12px 16px;
    padding-bottom: env(safe-area-inset-bottom, 20px);
    background: transparent;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
}

/* iOS全屏模式 - 底部控件元素对齐 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-bottom .play-btn,
body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-bottom .episodes-btn,
body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-bottom .fullscreen-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    min-height: 36px !important;
    height: 36px !important;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-bottom .progress-bar {
    display: flex !important;
    align-items: center !important;
    height: 4px !important;
    min-height: 4px !important;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-bottom .time-display {
    display: flex !important;
    align-items: center !important;
    white-space: nowrap !important;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen .danmaku-container {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
}

/* 横屏优化 */
@media screen and (orientation: landscape) {

    /* 顶部控件 - 横屏时确保flex布局 */
    body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-top {
        padding-top: env(safe-area-inset-top, 10px);
    }

    /* 视频元素高度 - 铺满整个屏幕 */
    body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-player {
        height: 100vh !important;
        max-height: 100vh !important;
    }

    /* 底部控件 - 横屏时强制在最上层 */
    body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-controls {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 70px !important;
        padding: 0 16px !important;
        padding-bottom: env(safe-area-inset-bottom, 10px) !important;
        background: rgba(0, 0, 0, 0.9) !important;
        z-index: 99999 !important;
        -webkit-transform: translate3d(0, 0, 0) !important;
        transform: translate3d(0, 0, 0) !important;
    }

    /* 弹幕容器高度调整 */
    body.ios-fullscreen-active .app.player-page.ios-fullscreen .danmaku-container {
        height: 100vh !important;
        max-height: 100vh !important;
    }
}

/* 微信浏览器全屏模式特殊处理 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen.wechat-env .video-player {
    /* 微信环境下额外调整 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

/* 微信环境下确保控件在最上层 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen.wechat-env .video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: transparent;
    z-index: 9999 !important;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen.wechat-env .controls-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999 !important;
    background: transparent;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

/* 微信环境下强制重绘，确保控件显示 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen.wechat-env .video-controls .control-btn,
body.ios-fullscreen-active .app.player-page.ios-fullscreen.wechat-env .video-controls .progress-bar {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

/* 详情页集数信息 - 浅色模式 */
body.light-mode .detail-episodes {
    color: #667eea;
}

/* iOS横屏模式 - 确保进度条和控件元素可见 */
@media screen and (orientation: landscape) {

    body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-controls .control-btn,
    body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-controls .progress-bar,
    body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-controls .time-display {
        position: relative !important;
        z-index: 100000 !important;
        -webkit-transform: translate3d(0, 0, 0) !important;
        transform: translate3d(0, 0, 0) !important;
    }

    body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-controls .progress-bar {
        flex: 1 !important;
        height: 4px !important;
        min-height: 4px !important;
    }

    body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-controls .controls-bottom {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        gap: 12px !important;
    }
}

/* iOS横屏模式 - 微信环境额外优化 */
@media screen and (orientation: landscape) {
    body.ios-fullscreen-active .app.player-page.ios-fullscreen.wechat-env .video-controls {
        position: fixed !important;
        bottom: 0 !important;
        z-index: 999999 !important;
        background: transparent !important;
    }

    body.ios-fullscreen-active .app.player-page.ios-fullscreen.wechat-env .video-player {
        height: 100vh !important;
        max-height: 100vh !important;
    }
}

/* iOS全屏模式 - video-info布局优化 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-top .video-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-top .video-title {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-top .video-episode {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* iOS横屏模式 - video-info布局优化 */
@media screen and (orientation: landscape) {
    body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-top .video-info {
        flex: 1;
        display: flex;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px;
        min-width: 0;
    }

    body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-top .video-title {
        flex-shrink: 1;
        font-size: 13px;
    }

    body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-top .video-episode {
        flex-shrink: 0;
        font-size: 11px;
        margin-top: 0;
    }
}

/* iOS全屏模式 - 强制隐藏所有非视频元素 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .header,
body.ios-fullscreen-active .app.player-page.ios-fullscreen .header.player-header,
body.ios-fullscreen-active .app.player-page.ios-fullscreen .main-content,
body.ios-fullscreen-active .app.player-page.ios-fullscreen .player-tabs,
body.ios-fullscreen-active .app.player-page.ios-fullscreen .player-content {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* iOS全屏模式 - 确保video-container的子元素正常显示 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-container>* {
    display: block !important;
}

/* iOS全屏模式 - 控件和弹幕容器可见 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-controls,
body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-top,
body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-bottom,
body.ios-fullscreen-active .app.player-page.ios-fullscreen .danmaku-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* iOS全屏模式 - 选集面板默认隐藏 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .fullscreen-episodes-panel {
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    left: auto !important;
    width: 70% !important;
    max-width: 320px !important;
    height: 100% !important;
    z-index: 1000 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: right 0.3s ease, opacity 0.3s ease !important;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen .fullscreen-episodes-panel.show {
    right: 0 !important;
    left: auto !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* video-play-overlay 只在暂停时显示 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 80px;
    z-index: 50;
    background: transparent;
    pointer-events: auto;
}

/* 隐藏播放图标 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-play-overlay .play-icon {
    display: none !important;
}

/* 隐藏播放覆盖层 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-play-overlay.hidden {
    display: none !important;
    pointer-events: none;
}

/* iOS全屏模式 - 移除所有间距和滚动 */
body.ios-fullscreen-active {
    overflow: hidden !important;
    width: 100vw !important;
    height: 100vh !important;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen {
    margin: 0 !important;
    padding: 0 !important;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-container {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* iOS全屏模式 - 确保body没有滚动条 */
body.ios-fullscreen-active html,
body.ios-fullscreen-active body {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* iOS全屏模式 - 完全固定页面，禁止滚动 */
body.ios-fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    z-index: 9999 !important;
}

/* iOS全屏模式 - 超强力隐藏规则 */
body.ios-fullscreen-active header,
body.ios-fullscreen-active .header,
body.ios-fullscreen-active .header.player-header,
body.ios-fullscreen-active .player-tabs,
body.ios-fullscreen-active .player-content {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* 确保video-container是唯一可见的顶层元素 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen> :not(.video-container) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* video-container内部元素显示 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-container,
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-container>* {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
}

/* iOS环境 - 页面加载时就隐藏header（可选） */
.is-ios-device .header.player-header {
    /* 如果想一开始就隐藏header，取消下面的注释 */
    /* display: none !important; */
}

/* ========================================
   iOS 全屏模式 - 终极修复方案
   ======================================== */

/* 方案1: 使用否定选择器 - 但排除video-container内的元素 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen {
    display: flex !important;
    flex-direction: column !important;
}

/* 只隐藏video-container的兄弟元素，不影响其内部元素 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen>.header,
body.ios-fullscreen-active .app.player-page.ios-fullscreen>.player-tabs,
body.ios-fullscreen-active .app.player-page.ios-fullscreen>.player-content {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -10000px !important;
    top: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* 确保video-container及其子元素可见 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen>.video-container,
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-container>* {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
}

/* 方案2: 直接针对要隐藏的元素 */
body.ios-fullscreen-active header,
body.ios-fullscreen-active .header,
body.ios-fullscreen-active .player-tabs,
body.ios-fullscreen-active main.player-content {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: fixed !important;
    left: -100vw !important;
    top: -100vh !important;
    z-index: -9999 !important;
}

/* 方案3: 确保video-container可见 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1 !important;
}

/* 方案4: 强制覆盖可能的inline样式 */
body.ios-fullscreen-active header[style],
body.ios-fullscreen-active .header[style] {
    display: none !important;
}

/* iOS全屏模式 - 确保controls-top始终在顶部 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-top {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    z-index: 99998 !important;
    margin: 0 !important;
    padding: 12px !important;
    padding-top: calc(env(safe-area-inset-top, 20px) + 12px) !important;
}

/* 确保controls-top的子元素正确显示 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-top>* {
    position: relative !important;
    display: inline-block !important;
}

/* 返回按钮固定在左侧 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-top .fullscreen-back-btn {
    position: relative !important;
    margin-right: 12px !important;
    flex-shrink: 0 !important;
    /* background: rgba(255, 255, 255, 0.2) !important; */
    pointer-events: auto !important;
    touch-action: manipulation !important;
    z-index: 10002 !important;
}

/* 全屏状态下按钮透明背景 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .control-btn {
    background: transparent !important;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen .episodes-btn {
    background: transparent !important;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen .fullscreen-btn {
    background: transparent !important;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen .play-btn {
    background: transparent !important;
}

/* video-info占据剩余空间 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .controls-top .video-info {
    flex: 1 !important;
    min-width: 0 !important;
    position: relative !important;
}

/* iOS全屏模式 - video-controls不应该影响controls-top的定位 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-controls {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: auto !important;
    z-index: 99999 !important;
}

/* iOS全屏模式 - controls-top独立定位，不受video-controls影响 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-controls .controls-top {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    z-index: 99999 !important;
}

/* iOS全屏模式 - controls-bottom保持在底部 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-controls .controls-bottom {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
}

/* iOS微信环境 - 确保controls-top在顶部 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen.wechat-env .controls-top {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 999999 !important;
    -webkit-transform: none !important;
    transform: none !important;
}

/* 确保层级关系正确 */
body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-player {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    z-index: 1 !important;
}

body.ios-fullscreen-active .app.player-page.ios-fullscreen .danmaku-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 100vh !important;
    z-index: 2 !important;
}

/* 横屏模式 - 确保controls-top始终在顶部 */
@media screen and (orientation: landscape) {
    body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-controls .controls-top {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        z-index: 99999 !important;
    }

    body.ios-fullscreen-active .app.player-page.ios-fullscreen .video-player {
        height: 100vh !important;
        z-index: 1 !important;
    }

    body.ios-fullscreen-active .app.player-page.ios-fullscreen .danmaku-container {
        height: 100vh !important;
        z-index: 2 !important;
    }
}

.diy-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.diy-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

.diy-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diy-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
}

.diy-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    background: #1a1a2e;
    overflow-y: auto;
    z-index: 1;
}

.diy-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a4a;
    background: #1a1a2e;
}

.diy-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    text-align: center;
}

.diy-clear-cache-btn {
    padding: 6px 12px;
    font-size: 12px;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.diy-clear-cache-btn:hover {
    background: rgba(255, 107, 107, 0.25);
    border-color: rgba(255, 107, 107, 0.5);
}

.diy-tip {
    padding: 10px 16px;
    background: rgba(102, 126, 234, 0.1);
    color: #a0b0ff;
    font-size: 13px;
    text-align: center;
    border-bottom: 1px solid #2a2a4a;
}

.diy-close {
    font-size: 24px;
    color: #888;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.diy-body {
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.diy-form-item {
    margin-bottom: 18px;
}

.diy-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #ccc;
    margin-bottom: 8px;
}

.diy-input {
    width: 100%;
    padding: 12px 14px;
    background: #16213e;
    border: 1px solid #2a2a4a;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.diy-input:focus {
    border-color: #667eea;
}

.diy-input::placeholder {
    color: #555;
}

.diy-upload-area {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    border: 2px dashed #2a2a4a;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.3s;
}

.diy-upload-row {
    display: flex;
    gap: 16px;
}

.diy-upload-row .diy-form-item {
    flex: 1;
}

.diy-upload-area:hover {
    border-color: #667eea;
}

.diy-upload-placeholder {
    color: #666;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.diy-preview-img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.diy-video-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    background: #000;
}

.diy-video-name {
    color: #a0b0ff;
    font-size: 13px;
    word-break: break-all;
    padding: 12px;
}

.diy-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 25px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity 0.3s, transform 0.2s;
    text-align: center;
}

.diy-submit-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.diy-skip-btn {
    background: transparent;
    border: 1px solid #667eea;
    color: #667eea;
    margin-top: 12px;
}

.diy-skip-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* ===== 全面屏安全区适配（viewport-fit=cover） ===== */
.header {
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
}

body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}