@charset "utf-8";

/* ================= 基础样式 ================= */
html { 
    overflow-y: scroll; 
    touch-action: manipulation;
    /* ★★★ 核心修复：Light 模式下，强制 html 背景为纯白 ★★★ */
    background-color: #ffffff; 
    transition: background-color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

/* ★★★ 核心修复：Dark 模式下，强制 html 背景为深色 (与 Header 颜色一致) ★★★ */
html.dark {
    background-color: #121212; 
}

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
    /* body 背景设为透明，让 html 的背景透出来，保证一致性 */
    background-color: transparent; 
    touch-action: manipulation;
    color: #1f2937;
    transition: color 0.3s;
    min-height: 100vh;
}

/* 电脑端最大宽度限制 */
@media (min-width: 1024px) {
    #main-content-wrapper { 
        max-width: 1152px !important; 
        margin-top: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}

/* ================= 轮播图样式 ================= */
#banner-track {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.banner-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
}
.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.banner-text-bg {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    padding: 1rem; color: white; pointer-events: none;
}
#banner-dots {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 6px; z-index: 10;
}
.banner-dot {
    width: 6px; height: 6px; border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.4); transition: all 0.3s ease;
}
.banner-dot.active {
    width: 18px; background-color: #ffffff; box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

/* ================= 通用工具样式 ================= */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.category-btn { padding-bottom: 4px; transition: color 0.3s ease; cursor: pointer; white-space: nowrap; }
.category-btn.active { color: #dc2626; font-weight: 700; }
.category-btn.inactive { color: #4b5563; font-weight: 500; }

.episode-item-new {
    display: block; width: 100%; padding: 8px 0; text-align: center;
    border-radius: 6px; font-size: 0.875rem; font-weight: 600; cursor: pointer;
    transition: all 0.2s; border: 1px solid #e5e7eb; background: #f9fafb; color: #374151;
}
.episode-item-new.active { background-color: #dc2626; color: white; border-color: #dc2626; }

/* 弹窗遮罩 */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85); display: flex; align-items: center; justify-content: center;
    z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.3s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-container { transform: scale(0.9); transition: transform 0.3s; }
.modal-overlay.open .modal-container { transform: scale(1); }

/* 视频容器 */
.video-container { position: relative; width: 100%; padding-top: 56.25%; background-color: black; }
#video-player { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

/* =================================================================
   🌙 黑夜模式样式 (修改为 html.dark 选择器)
   ================================================================= */
html.dark body {
    color: #e5e7eb;
}

html.dark #main-content-wrapper,
html.dark .bg-gray-100,
html.dark .bg-white {
    background-color: #121212 !important;
    color: #e5e7eb;
}

html.dark #header-wrapper {
    background-color: #121212 !important;
    border-color: #333;
}
html.dark .border-b {
    border-color: #333 !important;
}

html.dark .text-gray-600,
html.dark .text-gray-700,
html.dark .text-gray-800,
html.dark .text-gray-500 {
    color: #9ca3af !important;
}
html.dark .text-gray-900 {
    color: #ffffff !important;
}

html.dark #search-container input {
    color: #fff;
}

html.dark #search-box-wrapper {
    background-color: #1f2937;
    border-color: #374151;
}
html.dark #search-box-wrapper:focus-within {
    background-color: #374151;
    border-color: #ef4444; 
}

html.dark #source-dropdown {
    background-color: #1f2937;
    border-color: #374151;
}
html.dark .dropdown-item:hover {
    background-color: #374151;
}

html.dark #search-container,
html.dark #category-tabs-container {
    background-color: transparent !important; 
}

html.dark .category-btn.inactive {
    color: #9ca3af;
}

html.dark .bg-gray-200 {
    background-color: #1f2937;
}

html.dark .episode-item-new {
    background-color: #1f2937;
    border-color: #374151;
    color: #d1d5db;
}
html.dark .episode-item-new.active {
    background-color: #dc2626;
    border-color: #dc2626;
    color: white;
}

html.dark a[onclick="loadMore()"] {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #9ca3af !important;
}

html.dark .modal-container {
    background-color: #1f2937;
    color: #fff;
}
html.dark .bg-blue-50 {
    background-color: #111827;
    border-color: #374151;
}
html.dark .bg-gray-50 {
    background-color: #111827;
    border-color: #374151;
}

/* 切换按钮 */
#theme-toggle-btn {
    position: fixed;
    bottom: 30px; 
    right: 0; 
    width: 32px;
    height: 32px;
    border-top-left-radius: 50%;
    border-bottom-left-radius: 50%;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: -2px 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    cursor: pointer;
    transition: all 0.3s;
    color: #f59e0b;
}
html.dark #theme-toggle-btn {
    background-color: rgba(55, 65, 81, 0.95);
    color: #fbbf24;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.5);
}

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-transition: color 9999s ease-out, background-color 9999s ease-out;
    -webkit-transition-delay: 9999s;
    transition: color 9999s ease-out, background-color 9999s ease-out;
    transition-delay: 9999s;
}