/* ========================================================================
   STRM Video · 深夜影院
   Design Tokens + 全局布局 + 组件库
   ======================================================================== */

/* ========== 1. 设计 Token ========== */
:root {
    /* 背景层级 */
    --bg-0: #0c0d14;          /* 最深，页面底色 */
    --bg-1: #13151e;          /* 导航 */
    --bg-2: #1a1d2b;          /* 卡片 */
    --bg-3: #222639;          /* 悬停 */
    --bg-4: #2d324a;          /* 活跃 */

    /* 边框 */
    --border-subtle: rgba(255,255,255,0.04);
    --border: rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.14);

    /* 文字 */
    --text-1: #fafbff;        /* 主 */
    --text-2: #b4b9cf;        /* 次 */
    --text-3: #717792;        /* 弱 */
    --text-4: #4a4f66;        /* 禁用 */

    /* 品牌色 — 琥珀金 */
    --amber: #f0a830;
    --amber-2: #f7c668;
    --amber-3: #fff3d6;
    --amber-glow: rgba(240, 168, 48, 0.35);

    /* 辅助色 */
    --cyan: #5cc8c4;
    --cyan-glow: rgba(92, 200, 196, 0.2);
    --violet: #8b6fd4;
    --violet-glow: rgba(139, 111, 212, 0.2);

    /* 类型色 */
    --c-movie: #f0a830;       /* 电影 */
    --c-tv: #5cc8c4;          /* 电视剧 */
    --c-anime: #ff7b9c;       /* 动漫 */
    --c-variety: #8b6fd4;     /* 综艺 */
    --c-doc: #7dc97d;         /* 纪录片 */

    /* 字体 */
    --font-display: 'Cinzel', 'Noto Serif SC', serif;
    --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* 圆角 */
    --r-xs: 4px;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 24px;
    --r-full: 999px;

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 28px rgba(0,0,0,0.45);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.55);
    --shadow-glow: 0 0 48px var(--amber-glow);

    /* 动效 */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

    /* 容器 */
    --container-max: 1680px;
    --nav-h: 64px;
}

/* ========== 2. 基础重置 ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--bg-0);
    color: var(--text-1);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { max-width: 100%; display: block; }
input { font: inherit; color: inherit; }
svg { display: block; }
kbd { font-family: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
::selection { background: var(--amber); color: var(--bg-0); }

/* ========== 3. 背景层 ========== */
.bg-aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.aurora-blob {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.45;
    animation: aurora-float 22s ease-in-out infinite;
}
.blob-1 {
    background: radial-gradient(circle, #1a2650 0%, transparent 70%);
    top: -200px; left: -150px;
    animation-delay: 0s;
}
.blob-2 {
    background: radial-gradient(circle, #3d1e5f 0%, transparent 70%);
    top: 40%; right: -200px;
    animation-delay: -8s;
    width: 500px; height: 500px;
}
.blob-3 {
    background: radial-gradient(circle, #3a2a0f 0%, transparent 70%);
    bottom: -250px; left: 30%;
    animation-delay: -14s;
    opacity: 0.3;
}
@keyframes aurora-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.08); }
    66% { transform: translate(-30px, 40px) scale(0.95); }
}

.bg-grain {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    opacity: 0.06;
    mix-blend-mode: overlay;
}

/* ========== 4. 容器 ========== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 48px);
    position: relative;
    z-index: 1;
}

/* ========== 5. 导航 ========== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(12, 13, 20, 0.72);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: var(--nav-h);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.logo-mark {
    width: 32px; height: 32px;
    color: var(--amber);
    display: grid; place-items: center;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg, rgba(240,168,48,0.15), rgba(240,168,48,0.05));
    border: 1px solid rgba(240,168,48,0.25);
}
.logo-mark svg { width: 18px; height: 18px; }
/* 品牌 Logo 图片（assets/img/logo.svg，自身含琥珀色描边+白色播放三角） */
.logo-mark img {
    width: 24px; height: 24px;
    display: block;
    object-fit: contain;
}
.logo-mark.small { width: 24px; height: 24px; }
.logo-mark.small svg { width: 14px; height: 14px; }
.logo-text {
    display: flex; gap: 3px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
}
.logo-brand { color: var(--text-1); }
.logo-brand.accent { color: var(--amber); }

/* 搜索 */
.search-box {
    flex: 0 1 460px;
    max-width: 560px;
    margin-left: auto;   /* PC 端靠导航栏右侧 */
    position: relative;
}
.search-icon {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--text-3);
    pointer-events: none;
}
.search-input {
    width: 100%;
    height: 42px;
    padding: 0 90px 0 46px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-1);
    font-size: 14px;
    transition: all 0.2s var(--ease-out);
    outline: none;
}
.search-input::placeholder { color: var(--text-4); }
.search-input:hover { border-color: var(--border-strong); }
.search-input:focus {
    border-color: var(--amber);
    background: var(--bg-2);
    box-shadow: 0 0 0 3px var(--amber-glow);
}
.search-shortcut {
    position: absolute;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    padding: 2px 8px;
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    font-size: 11px;
    color: var(--text-3);
    font-weight: 500;
}

/* ========== 6. Hero ========== */
.hero {
    padding: clamp(40px, 7vw, 96px) 0 clamp(24px, 3vw, 48px);
    position: relative;
    background: url('../img/bj.jpg') center 30% / cover no-repeat;
}
/* 背景图压暗层：保证文字可读性，底部渐隐融入页面背景 */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(12,13,20,0.55) 0%, rgba(12,13,20,0.72) 60%, #0c0d14 100%);
    pointer-events: none;
}
.hero-inner {
    max-width: 900px;
    position: relative;
    z-index: 1;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: 12px;
    letter-spacing: 0.5px;
    color: var(--text-2);
    margin-bottom: 24px;
    font-weight: 500;
}
.eyebrow-dot {
    width: 6px; height: 6px;
    background: var(--amber);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--amber-glow);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}
/* Hero 标题前置 Logo，尺寸随标题字号等比缩放 */
.hero-logo {
    display: inline-block;
    width: 1.5em; height: 1.5em;
    vertical-align: -0.4em;
    margin-right: 0.01em;
}
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 6vw, 72px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -1px;
    margin-bottom: 14px;
    position: relative;
}
.hero-title em {
    font-style: normal;
    background: linear-gradient(135deg, var(--amber-2) 0%, var(--amber-3) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}
.hero-subtitle-inline {
    display: block;
    font-family: var(--font-sans);
    font-size: clamp(14px, 1.6vw, 17px);
    font-weight: 400;
    color: var(--text-3);
    letter-spacing: 0;
    margin-top: 12px;
    font-style: italic;
}

/* ========== 7. 控制栏 ========== */
.control-bar {
    position: sticky;
    top: var(--nav-h);
    z-index: 50;
    background: rgba(12, 13, 20, 0.82);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border-bottom: 1px solid var(--border-subtle);
    padding: 5px 0 5px;
}
.control-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* 分类 Tab：横向可滑动，隐藏滚动条；按钮宽度随文字自适应 */
.category-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tabs.dragging { cursor: grabbing; user-select: none; }
.cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;      /* 不收缩，宽度由文字撑开 */
    padding: 9px 16px;
    background: transparent;
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-3);
    white-space: nowrap;
    transition: all 0.2s var(--ease-out);
    position: relative;
}
.cat-tab:hover { color: var(--text-1); background: rgba(255,255,255,0.04); }
.cat-tab.active {
    color: var(--bg-0);
    background: var(--amber);
    box-shadow: 0 4px 16px var(--amber-glow);
    font-weight: 700;
}
.cat-icon { font-size: 14px; }
/* 分类自定义图标（分类目录内 home.svg） */
.cat-icon-img {
    width: 15px;
    height: 15px;
    object-fit: contain;
    vertical-align: -2px;
    pointer-events: none;
}

/* ========== 8. 主区域 ========== */
.main-area { padding-top: 28px; padding-bottom: 64px; }

/* 加载动画 */
.loader-wrap {
    padding: 80px 20px;
    text-align: center;
}
.cinema-loader {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
}
.film-reel {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 3px solid var(--bg-3);
    border-top-color: var(--amber);
    position: relative;
    animation: spin 1.2s linear infinite;
}
.film-reel::before,
.film-reel::after {
    content: '';
    position: absolute;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--bg-3);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 14px -14px 0 var(--bg-3), -14px 14px 0 var(--bg-3),
                14px 14px 0 var(--bg-3), -14px -14px 0 var(--bg-3);
}
.reel-left { animation-direction: normal; }
.reel-right { animation-direction: reverse; }
.film-strip {
    width: 60px; height: 16px;
    background: repeating-linear-gradient(
        90deg,
        var(--amber) 0px, var(--amber) 8px,
        var(--bg-3) 8px, var(--bg-3) 16px
    );
    animation: film-slide 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes film-slide {
    0% { background-position: 0 0; }
    100% { background-position: -16px 0; }
}
.loader-text {
    font-size: 13px;
    color: var(--text-3);
    letter-spacing: 1px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}
.empty-state[hidden] { display: none; }
.empty-illustration {
    width: 200px; height: 150px;
    margin: 0 auto 20px;
    opacity: 0.5;
}
.empty-title {
    font-size: 20px;
    color: var(--text-2);
    margin-bottom: 8px;
    font-weight: 600;
}
.empty-desc {
    font-size: 14px;
    color: var(--text-3);
}
.empty-desc a {
    color: var(--amber);
    text-decoration: underline;
}

/* ========== 9. 网格 ========== */
.grid {
    display: grid;
    gap: clamp(14px, 1.8vw, 22px);
    /* min(100%, 260px)：窄屏自动降为每排 1 列，布局与 PC 端一致 */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

/* ========== 10. 视频卡片 ========== */
.card {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-2);
    cursor: pointer;
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
    aspect-ratio: 16 / 10;
    isolation: isolate;
}
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 35%, rgba(12,13,20,0.85) 80%, var(--bg-0) 100%);
    transition: opacity 0.3s;
}
.card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    z-index: 4;
    pointer-events: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.card:hover {
    transform: translateY(-8px) scale(1.015);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.card:hover::after {
    border-color: rgba(240,168,48,0.35);
    box-shadow: inset 0 0 0 1px rgba(240,168,48,0.1);
}

/* 封面 */
.card-cover {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-3);
    transition: transform 0.6s var(--ease-out), filter 0.6s;
    /* 暗遮罩：压暗封面降低噪点感，悬停时恢复 */
    filter: brightness(0.5) saturate(0.95);
}
.card:hover .card-cover { transform: scale(1.1); filter: brightness(1); }
.card-cover.placeholder {
    background:
        radial-gradient(ellipse at 30% 30%, rgba(240,168,48,0.08), transparent 60%),
        linear-gradient(135deg, #1a1d2b 0%, #252a40 50%, #1a1d2b 100%);
    display: grid;
    place-items: center;
}
.card-cover.placeholder::before {
    content: '';
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(240,168,48,0.1);
    border: 1px solid rgba(240,168,48,0.25);
    position: relative;
}
.card-cover.placeholder::after {
    content: '';
    position: absolute;
    width: 0; height: 0;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent var(--amber);
    transform: translate(-4px, 0);
}

/* 顶部徽章 */
.card-badges {
    position: absolute;
    top: 12px; left: 12px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.badge {
    padding: 3px 10px;
    border-radius: var(--r-xs);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}
.badge-cat {
    color: var(--bg-0);
}
.badge-cat.movie { background: var(--c-movie); }
.badge-cat.tv    { background: var(--c-tv); }
.badge-cat.anime { background: var(--c-anime); }
.badge-cat.variety { background: var(--c-variety); }
.badge-cat.doc   { background: var(--c-doc); }
.badge-year {
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-2);
    text-transform: none;
    letter-spacing: 0;
}
.badge-count {
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--cyan);
    text-transform: none;
    letter-spacing: 0;
}

/* 播放按钮 hover */
.card-play-hint {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
}
.card:hover .card-play-hint { opacity: 1; }
.play-btn {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--amber);
    color: var(--bg-0);
    display: grid;
    place-items: center;
    box-shadow: 0 0 40px var(--amber-glow), 0 8px 24px rgba(0,0,0,0.5);
    transform: scale(0.7);
    transition: transform 0.3s var(--ease-out);
    position: relative;
}
.card:hover .play-btn { transform: scale(1); }
.play-btn::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--amber);
    opacity: 0;
    animation: play-ring 1.6s var(--ease-out) infinite;
}
@keyframes play-ring {
    0% { opacity: 0.6; transform: scale(0.9); }
    100% { opacity: 0; transform: scale(1.2); }
}
.play-btn svg { width: 24px; height: 24px; margin-left: 3px; }

/* 卡片信息区 */
.card-info {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 16px 18px 14px;
    z-index: 5;
}
.card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
    color: var(--text-1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}
.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-3);
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.card-dot { width: 3px; height: 3px; background: var(--text-4); border-radius: 50%; }
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}
.card-tag {
    padding: 2px 7px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--r-xs);
    font-size: 10px;
    color: var(--text-3);
    backdrop-filter: blur(6px);
}

/* 卡片出现动画 */
.card {
    animation: card-in 0.5s var(--ease-out) backwards;
}
@keyframes card-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.grid .card:nth-child(1) { animation-delay: 0.02s; }
.grid .card:nth-child(2) { animation-delay: 0.06s; }
.grid .card:nth-child(3) { animation-delay: 0.1s; }
.grid .card:nth-child(4) { animation-delay: 0.14s; }
.grid .card:nth-child(5) { animation-delay: 0.18s; }
.grid .card:nth-child(6) { animation-delay: 0.22s; }
.grid .card:nth-child(7) { animation-delay: 0.26s; }
.grid .card:nth-child(8) { animation-delay: 0.3s; }
.grid .card:nth-child(n+9) { animation-delay: 0.32s; }

/* ========== 11. 页脚 ========== */
.footer {
    border-top: 1px solid var(--border-subtle);
    padding: 28px 0;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-3);
}
.footer-meta { font-size: 12px; color: var(--text-4); }

/* ========== 12. 播放器页面 ========== */
body.player-page { background: #000; }

.player-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px clamp(16px, 3vw, 5px);
    background: rgba(12, 13, 20, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: 13px;
    color: var(--text-2);
    transition: all 0.2s var(--ease-out);
}
.back-btn:hover {
    background: var(--bg-3);
    color: var(--amber);
    border-color: var(--border-strong);
}
.back-btn svg { width: 14px; height: 14px; }
.player-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-wrapper {
    position: relative;
    width: 100%;
    background: #000;
    aspect-ratio: 16 / 9;
    /* 宽屏时限高为视口减去顶栏，避免视频底部（含控制条）超出窗口；
       高度受限时 video 的 object-fit:contain 会自动两侧留黑边，不变形 */
    max-height: calc(100vh - 64px);
    margin: 0 auto;
}
#video-player {
    width: 100%; height: 100%;
    background: #000;
}

/* 美化原生 video 控件 */
#video-player::-webkit-media-controls-panel {
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
}

/* 播放器信息 */
.player-info {
    padding: clamp(20px, 3vw, 40px);
    max-width: 1400px;
    margin: 0 auto;
}
.info-header { margin-bottom: 28px; }
.info-title {
    font-size: clamp(22px, 2.6vw, 32px);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}
.info-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--text-2);
    font-size: 14px;
    align-items: center;
}
.info-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.info-path {
    padding: 4px 10px;
    background: var(--bg-1);
    border-radius: var(--r-sm);
    font-size: 12px;
    color: var(--text-3);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.info-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

/* 集数面板 */
.episodes-section { margin-top: 32px; }
.episodes-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-2);
    margin-bottom: 14px;
}
.episodes-title::before {
    content: '';
    width: 3px; height: 16px;
    background: var(--amber);
    border-radius: 2px;
}
.episodes-title .ep-count {
    font-size: 12px;
    color: var(--text-4);
    font-weight: 400;
    margin-left: auto;
}
.episodes-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.episode-btn {
    padding: 12px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    text-align: left;
    transition: all 0.2s var(--ease-out);
    color: var(--text-2);
    position: relative;
    overflow: hidden;
}
.episode-btn:hover {
    background: var(--bg-3);
    border-color: var(--border-strong);
    color: var(--text-1);
    transform: translateY(-1px);
}
.episode-btn.active {
    background: rgba(240,168,48,0.1);
    border-color: var(--amber);
    color: var(--amber-2);
    box-shadow: 0 0 0 1px rgba(240,168,48,0.15);
}
.episode-btn.active::after {
    content: '▶';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--amber);
}
.ep-num {
    font-size: 13px;
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}
.ep-name {
    font-size: 11px;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* 播放错误 */
.player-error {
    padding: 80px 20px;
    text-align: center;
    color: var(--text-3);
}
.player-error-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.4;
}

/* ========== 13. 响应式 ========== */

/* 搜索状态：隐藏 Hero、分类控制栏与继续观看，聚焦结果列表 */
body.searching .hero,
body.searching .control-bar,
body.searching .recents-section { display: none; }

/* 返回顶部 */
.back-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 90;
    width: 46px; height: 46px;
    display: grid;
    place-items: center;
    background: var(--bg-1);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-full);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.25s var(--ease-out);
}
.back-top img {
    width: 24px; height: 24px;
    object-fit: contain;
    pointer-events: none;
}
.back-top:hover {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-glow), 0 6px 24px rgba(0, 0, 0, 0.45);
}
.back-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
@media (max-width: 768px) {
    .back-top { right: 14px; bottom: 14px; width: 42px; height: 42px; }
    .back-top img { width: 21px; height: 21px; }
}

/* 平板 */
@media (max-width: 1024px) {
    :root { --nav-h: 60px; }
}

/* 手机 */
@media (max-width: 768px) {
    :root { --nav-h: 56px; }

    /* 搜索框：隐藏文字 Logo 后在导航栏内真正居中 */
    .nav-inner { position: relative; }
    .logo-text { display: none; }
    .search-box {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        width: min(calc(100vw - 128px), 420px);
        max-width: none;
        margin-left: 0;
    }
    .search-shortcut { display: none; }
    .search-input { padding: 0 20px 0 44px; }

    .hero { padding: 32px 0 20px; }
    .hero-eyebrow { margin-bottom: 16px; }

    .control-bar { top: var(--nav-h); }
    .control-inner { gap: 10px; }

    /* 分类按钮：宽度随文字自适应，整体横向滑动 */
    .category-tabs { gap: 0px; padding-bottom: 2px; }
    .cat-tab { padding: 8px 14px; font-size: 12.5px; }
    .cat-icon { display: none; }

    .filter-row { flex-wrap: wrap; }
    .clear-filters { width: 100%; justify-content: center; }

    /* 网格与 PC 端保持同一布局（由基础规则 min(100%, 260px) 自适应） */
    .grid { gap: 12px; }
    .card-badges { top: 8px; left: 8px; }
    .badge { padding: 2px 7px; font-size: 10px; }
    .play-btn { width: 48px; height: 48px; }
    .play-btn svg { width: 18px; height: 18px; }
}

/* 小屏手机 */
@media (max-width: 380px) {
    .search-box { width: calc(100vw - 112px); }
    .cat-tab { padding: 7px 11px; font-size: 11.5px; }
}

/* 横屏手机 */
@media (max-height: 500px) and (orientation: landscape) {
    .video-wrapper { aspect-ratio: 16 / 6; }
}

/* 暗色模式检测（默认就是暗色，这里保留扩展点） */
@media (prefers-color-scheme: dark) {
    /* 已适配 */
}

/* 减弱动画（无障碍） */
@media (prefers-reduced-motion: reduce) {
    .aurora-blob { animation: none; }
    .card { animation: none; }
    .film-reel { animation: none; }
    .film-strip { animation: none; }
    .eyebrow-dot { animation: none; }
    .card, .card-cover, .play-btn { transition: none !important; }
}

/* ========== 14. 最近观看区 ========== */
.recents-section {
    padding: clamp(24px, 3vw, 40px) 0 16px;
    position: relative;
    z-index: 1;
}
.recents-section[hidden] { display: none !important; }

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}
.section-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-1);
}
.section-icon {
    font-size: 20px;
}
.section-hint {
    font-size: 12px;
    color: var(--text-3);
}
button.clear-recents {
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: var(--r-sm);
    transition: color 0.2s, background 0.2s;
}
button.clear-recents:hover {
    color: var(--amber);
    background: var(--bg-2);
}

.recents-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 8px;
    scrollbar-width: thin;
}
.recents-row::-webkit-scrollbar { height: 4px; }
.recents-row::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 2px; }

.recent-item {
    position: relative;
    flex-shrink: 0;
    width: 200px;
    background: var(--bg-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
    display: flex;
    flex-direction: column;
}
.recent-item:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}
/* 单条记录删除按钮（右上角） */
.recent-del {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    color: var(--text-2);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, color 0.2s;
}
.recent-item:hover .recent-del { opacity: 1; }
.recent-del:hover {
    background: #c0392b;
    border-color: transparent;
    color: #fff;
}
/* 触屏设备无 hover，始终显示删除按钮 */
@media (hover: none) {
    .recent-del { opacity: 1; }
}
.recent-cover {
    width: 100%;
    height: 112px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-3);
    flex-shrink: 0;
}
.recent-cover.placeholder {
    background: linear-gradient(135deg, #1a1d2b, #252a40);
    display: grid;
    place-items: center;
    color: var(--amber);
    font-size: 32px;
    opacity: 0.4;
}
.recent-body {
    padding: 10px 12px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.recent-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recent-ep {
    font-size: 11px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recent-progress-bar {
    width: 100%;
    height: 3px;
    background: var(--bg-4);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}
.recent-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--amber), var(--amber-2));
    border-radius: 2px;
    transition: width 0.3s ease;
}
.recent-meta {
    font-size: 10px;
    color: var(--text-4);
    margin-top: 2px;
}

@media (max-width: 768px) {
    .recent-item { width: 150px; }
    .recent-cover { height: 84px; }
    .section-title { font-size: 15px; }
}

/* ========== 15. 无限滚动加载指示器 ========== */
.load-more {
    padding: 40px 20px 20px;
    text-align: center;
}
.load-more[hidden] { display: none; }

.load-more-text {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 10px;
}
.load-more-spinner {
    width: 28px; height: 28px;
    margin: 0 auto;
    border: 2px solid var(--bg-4);
    border-top-color: var(--amber);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.load-more-end {
    font-size: 12px;
    color: var(--text-4);
    letter-spacing: 1px;
}

/* ========== 16. 播放器 — 恢复观看 Banner ========== */
.resume-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, rgba(240,168,48,0.12), rgba(240,168,48,0.04));
    border: 1px solid rgba(240,168,48,0.3);
    border-radius: var(--r-md);
    animation: slide-down 0.35s var(--ease-out);
}
@keyframes slide-down {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.resume-banner span {
    font-size: 14px;
    color: var(--text-2);
    flex: 1;
}
.resume-banner strong {
    color: var(--amber);
    font-weight: 700;
}
.resume-btn {
    padding: 7px 18px;
    background: var(--amber);
    color: var(--bg-0);
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
}
.resume-btn:hover { background: var(--amber-2); }
.resume-dismiss {
    padding: 7px 14px;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-full);
    color: var(--text-3);
    font-size: 12px;
    transition: all 0.2s;
}
.resume-dismiss:hover { color: var(--text-1); background: var(--bg-3); }

/* 集数按钮已观看进度 */
.episode-btn.watched {
    border-color: rgba(92, 200, 196, 0.3);
}
.episode-btn .ep-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    background: var(--cyan);
    border-radius: 0 2px 0 0;
    opacity: 0.7;
    pointer-events: none;
}
