/* ========================================================
   🎬 影音屋 - 现代极简双主题自适应样式表
   ======================================================== */
:root {
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.85);
    --bg-sub: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(226, 232, 240, 0.9);
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: rgba(37, 99, 235, 0.08);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 12px 28px -6px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.03);
    --radius-lg: 16px;
    --radius-md: 12px;
}

:root[data-theme="dark"] {
    --bg-primary: #0b0f19;
    --bg-card: #131a26;
    --bg-header: rgba(19, 26, 38, 0.85);
    --bg-sub: #1c2536;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-color: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-light: rgba(59, 130, 246, 0.15);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 14px 32px -6px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-color); }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.25s ease, color 0.25s ease;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* 顶部流光进度条 */
#top-progress {
    position: fixed;
    top: 0; left: 0;
    width: 0%; height: 3px;
    background: linear-gradient(90deg, #2563eb, #7c3aed, #f43f5e);
    z-index: 9999;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.7);
    transition: width 0.25s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

/* 头部导航 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-logo {
    font-size: 21px;
    font-weight: 800;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    cursor: pointer;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-item {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.nav-item:hover {
    color: var(--accent-color);
    background: var(--accent-light);
}
.nav-item.active {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.search-input {
    padding: 7px 14px 7px 34px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    width: 180px;
    transition: all 0.25s ease;
}
.search-input:focus {
    outline: none;
    width: 230px;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.search-icon {
    position: absolute;
    left: 11px;
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
}

.icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
}
.icon-btn:hover {
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}
.btn-outline:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    border: none;
    color: #ffffff;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
    opacity: 0.94;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

/* 主体容器 */
.main-container {
    max-width: 1280px;
    width: 100%;
    margin: 24px auto;
    padding: 0 20px;
    flex: 1;
}

/* 优雅简洁的 Hero 横幅 */
.hero-banner {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px 28px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.hero-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}
.hero-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
}
.hero-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-color);
    background: var(--accent-light);
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

/* 列表标题栏 */
.section-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.section-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.count-pill {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2px 10px;
    border-radius: 12px;
}

/* 影视网格 */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 20px;
}
@media (max-width: 640px) {
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .hero-banner { flex-direction: column; align-items: flex-start; padding: 18px; }
    .search-input { width: 130px; }
    .search-input:focus { width: 160px; }
}

.movie-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

.poster-wrapper {
    position: relative;
    width: 100%;
    padding-top: 142%;
    background: var(--bg-sub);
    overflow: hidden;
}
.poster-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.movie-card:hover .poster-img { transform: scale(1.05); }

.score-badge {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(6px);
    color: #fbbf24;
    font-weight: 700;
    font-size: 11.5px;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.vip-badge {
    position: absolute;
    top: 8px; left: 8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-weight: 700;
    font-size: 10.5px;
    padding: 2px 7px;
    border-radius: 6px;
}

.category-tag {
    position: absolute;
    bottom: 8px; left: 8px;
    background: rgba(37, 99, 235, 0.88);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}

.card-info {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}
.card-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}
.card-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tag-playable {
    color: #10b981;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* 骨架屏 */
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding-top: 165%;
    animation: skPulse 1.4s infinite ease-in-out;
}
@keyframes skPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 36px;
}
.page-btn {
    padding: 7px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.page-btn:hover:not(:disabled) {
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ================== 独立沉浸式详情页视图 ================== */
.detail-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    animation: fadeSlide 0.25s ease-out;
}
@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.breadcrumb-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 10px;
}
.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.breadcrumb a { color: var(--text-secondary); cursor: pointer; }
.breadcrumb a:hover { color: var(--accent-color); }

.detail-hero {
    display: flex;
    gap: 28px;
    margin-bottom: 28px;
}
@media (max-width: 768px) {
    .detail-hero { flex-direction: column; align-items: center; text-align: center; }
    .detail-wrapper { padding: 18px; }
}
.detail-poster-box {
    width: 210px;
    flex-shrink: 0;
}
.detail-poster-box img {
    width: 100%;
    aspect-ratio: 1/1.42;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}
.detail-meta-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.detail-title {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.3;
}
.detail-orig {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: -6px;
}
.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
@media (max-width: 768px) {
    .detail-badges { justify-content: center; }
}
.badge-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--bg-sub);
    color: var(--text-secondary);
}
.badge-score {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    font-weight: 700;
}
.detail-credits {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.7;
}
.detail-summary {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.75;
    background: var(--bg-sub);
    padding: 14px 16px;
    border-radius: var(--radius-md);
}

/* 在线播放器区 */
.player-section {
    margin: 24px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #000;
}
.player-header {
    background: var(--bg-sub);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    font-weight: 600;
}
.artplayer-box {
    width: 100%;
    height: 440px;
}
@media (max-width: 640px) {
    .artplayer-box { height: 240px; }
}

/* 下载资源面板 */
.download-panel {
    background: var(--bg-sub);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 24px;
}
.download-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}
.download-panel-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.download-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.download-item:last-child { margin-bottom: 0; }
.pan-tag {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}
.pan-quark { background: rgba(37, 99, 235, 0.14); color: #3b82f6; }
.pan-aliyun { background: rgba(99, 102, 241, 0.14); color: #6366f1; }
.pan-baidu { background: rgba(239, 68, 68, 0.14); color: #ef4444; }
.pan-magnet { background: rgba(168, 85, 247, 0.14); color: #a855f7; }
.pan-default { background: var(--accent-light); color: var(--accent-color); }

.login-unlock-box {
    text-align: center;
    padding: 28px 16px;
    background: var(--bg-card);
    border: 1px dashed var(--accent-color);
    border-radius: 12px;
}

/* ================== 自适应轻量弹窗 (登录/投稿/后台) ================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
}
.modal-card.modal-lg { max-width: 820px; }
.modal-scroll {
    overflow-y: auto;
    padding: 24px;
}
.modal-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-sub);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--accent-color); border-color: var(--accent-color); }

.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.form-control {
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13.5px;
    outline: none;
}
.form-control:focus { border-color: var(--accent-color); }

.tab-bar {
    display: flex; gap: 6px; margin: 12px 0; flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color); padding-bottom: 10px;
}
.tab-btn {
    padding: 6px 12px; border-radius: 8px; border: none; font-size: 12.5px; font-weight: 600;
    background: var(--bg-sub); color: var(--text-secondary); cursor: pointer;
}
.tab-btn.active { background: var(--accent-color); color: #fff; }

/* 页脚 */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 24px 20px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 40px;
}
