/* ========== Reset ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #08080f;
    --bg2: #0d0d1a;
    --bg3: #141424;
    --bg4: #1c1c30;
    --border: rgba(255,255,255,0.06);
    --border2: rgba(255,255,255,0.1);
    --text: #f0f0f5;
    --text2: #9494b0;
    --text3: #5c5c78;
    --primary: #8b5cf6;
    --primary2: #a78bfa;
    --accent: #14b8a6;
    --accent2: #2dd4bf;
    --radius: 10px;
    --radius2: 16px;
    --shadow: 0 8px 40px rgba(0,0,0,0.5);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --mobile-header-h: 142px;
    --mobile-nav-h: 62px;
}
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
body.filter-open {
    overflow: hidden;
}
body.filter-open .mheader {
    transform: none !important;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
::selection { background: rgba(139,92,246,0.3); }

/* ========== Toast ========== */
#toast-root {
    position: fixed; top: 16px; right: 16px; z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    padding: 12px 20px;
    background: rgba(20,20,36,0.95);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 10px;
    font-size: 14px;
    animation: tIn 0.35s var(--ease), tOut 0.35s var(--ease) 2.8s forwards;
    max-width: 360px;
}
.toast i { font-size: 16px; }
.toast.ok i { color: var(--accent2); }
.toast.err i { color: #ef4444; }
@keyframes tIn { from { transform: translateX(40px); opacity: 0; } }
@keyframes tOut { to { transform: translateX(40px); opacity: 0; } }

/* ========== Desktop Nav ========== */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(8,8,15,0.85);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
}
.nav-inner {
    max-width: 1400px; width: 100%; margin: 0 auto;
    display: flex; align-items: center; gap: 16px;
}
.nav-brand {
    font-size: 22px; font-weight: 800;
    background: linear-gradient(135deg, #a78bfa, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; white-space: nowrap;
    flex-shrink: 0;
}
.nav-brand i { font-size: 24px; }
.nav-search {
    flex: 1; max-width: 480px;
    position: relative;
    display: flex; align-items: center;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    padding: 0 4px 0 16px;
    transition: 0.25s ease;
}
.nav-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
.nav-search > i { color: var(--text3); font-size: 14px; flex-shrink: 0; }
.nav-search input {
    flex: 1; border: none; background: transparent;
    padding: 10px 12px;
    color: var(--text); font-size: 14px;
    outline: none; min-width: 0;
}
.nav-search input::placeholder { color: var(--text3); }
.nav-search button {
    background: none; border: none; color: var(--text3);
    cursor: pointer; padding: 8px; font-size: 16px;
    display: flex; align-items: center;
}

/* Search Dropdown */
.search-drop {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius2);
    box-shadow: var(--shadow);
    max-height: 380px; overflow-y: auto;
    display: none; z-index: 50;
}
.search-drop.show { display: block; animation: sdIn 0.2s var(--ease); }
@keyframes sdIn { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
.sd-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.sd-item:last-child { border-bottom: none; }
.sd-item:hover { background: rgba(139,92,246,0.08); }
.sd-pic {
    width: 32px; height: 44px; border-radius: 4px;
    object-fit: cover; background: var(--bg4); flex-shrink: 0;
}
.sd-info { flex: 1; min-width: 0; }
.sd-name { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-meta { font-size: 12px; color: var(--text3); margin-top: 2px; }

.nav-actions { display: flex; gap: 6px; flex-shrink: 0; }
.nav-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--bg3); border: 1px solid var(--border);
    color: var(--text2); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s ease; font-size: 15px;
}
.nav-btn:hover {
    border-color: var(--primary);
    color: var(--primary2);
    background: rgba(139,92,246,0.1);
}

/* ========== Nav Filters ========== */
.nav-filters {
    display: flex; align-items: center; gap: 8px;
    flex-shrink: 0;
}
.nav-filter {
    position: relative;
}
.nav-filter-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 100px;
    background: var(--bg3); border: 1px solid var(--border);
    color: var(--text2); font-size: 13px;
    cursor: pointer; white-space: nowrap;
    transition: 0.2s ease;
}
.nav-filter-btn:hover {
    border-color: var(--border2); color: var(--text);
    background: var(--bg4);
}
.nav-filter-btn.active {
    border-color: var(--primary); color: var(--primary2);
    background: rgba(139,92,246,0.1);
}
.nav-filter-btn i:first-child { font-size: 12px; }
.nav-filter-btn i:last-child { font-size: 10px; opacity: 0.6; }
.nav-filter-drop {
    position: absolute; top: calc(100% + 8px); left: 0;
    min-width: 180px; max-height: 320px; overflow-y: auto;
    background: var(--bg3); border: 1px solid var(--border2);
    border-radius: var(--radius); box-shadow: var(--shadow);
    display: none; z-index: 60;
}
.nav-filter-drop.show { display: block; animation: fdIn 0.2s var(--ease); }
@keyframes fdIn { from { opacity: 0; transform: translateY(-8px); } }
.nav-filter-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; cursor: pointer;
    color: var(--text2); font-size: 13px;
    transition: 0.15s ease;
}
.nav-filter-item:hover {
    background: rgba(139,92,246,0.08); color: var(--text);
}
.nav-filter-item.active {
    color: var(--primary2); background: rgba(139,92,246,0.12);
}
.nav-filter-item.active::before {
    content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    font-size: 11px; margin-left: auto;
}
.nav-filter-item .src-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent); flex-shrink: 0;
}
.nav-filter-item .src-dot.offline { background: #ef4444; }

/* ========== Mobile Header ========== */
.mheader {
    display: none; padding: 12px 16px 8px; gap: 8px; flex-direction: column;
    transition: transform 0.28s var(--ease);
}
.mheader-row { display: flex; align-items: center; justify-content: space-between; }
.mheader-actions { display: flex; gap: 6px; }
.mheader-search {
    display: flex; align-items: center; gap: 8px;
    position: relative;
    background: var(--bg3); border: 1.5px solid var(--border);
    border-radius: 100px; padding: 0 16px;
}
.mheader-search input {
    flex: 1; border: none; background: transparent;
    min-width: 0; padding: 10px 0; color: var(--text); font-size: 14px; outline: none;
}
.mheader-search i { color: var(--text3); font-size: 14px; }
.mheader-search button {
    width: 30px; height: 30px; border: none; background: transparent;
    color: var(--text3); align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px; flex-shrink: 0;
}
.mheader-filters {
    display: flex; gap: 8px; overflow-x: auto;
    scrollbar-width: none; padding: 4px 0;
}
.mheader-filters::-webkit-scrollbar { display: none; }

/* ========== Hero ========== */
.hero {
    position: relative;
    max-width: 1400px; margin: 80px auto 0;
    padding: 0 16px;
    height: 380px;
}
.hero-track {
    height: 100%; border-radius: var(--radius2);
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, var(--bg3), var(--bg4));
}
.hero-rail {
    height: 100%; display: flex;
    transition: transform 0.6s var(--ease);
    will-change: transform;
}
.hero-slide {
    flex: 0 0 100%; width: 100%; height: 100%;
    position: relative; flex-shrink: 0;
    display: flex; align-items: center; justify-content: flex-start;
    gap: 42px;
    padding: 48px 64px;
    cursor: pointer;
    isolation: isolate;
    overflow: hidden;
}
.hero-slide > img.hero-bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 6s ease;
    filter: blur(18px) saturate(1.08);
    transform: scale(1.08);
    opacity: 0.48;
}
.hero-slide:hover > img.hero-bg { transform: scale(1.14); }
.hero-slide::after {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(circle at 78% 24%, rgba(20,184,166,0.24), transparent 34%),
        linear-gradient(90deg, rgba(8,8,15,0.95) 0%, rgba(8,8,15,0.72) 42%, rgba(8,8,15,0.18) 100%),
        linear-gradient(to top, rgba(8,8,15,0.96) 0%, rgba(8,8,15,0.26) 58%, transparent 100%);
}
.hero-poster {
    position: relative; z-index: 2;
    width: 210px; aspect-ratio: 3/4;
    border-radius: 10px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: 0 18px 58px rgba(0,0,0,0.48);
    flex-shrink: 0;
}
.hero-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-content {
    position: relative; z-index: 2;
    max-width: min(680px, calc(100% - 260px));
    animation: hcIn 0.6s var(--ease) backwards;
}
@keyframes hcIn { from { opacity: 0; transform: translateY(20px); } }
.hero-content .tag {
    display: inline-block; padding: 3px 10px; border-radius: 4px;
    background: var(--primary); font-size: 11px; font-weight: 600;
    margin-bottom: 10px; color: #fff;
}
.hero-content h1 {
    font-size: clamp(24px, 3.5vw, 42px); font-weight: 800;
    line-height: 1.2; margin-bottom: 8px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.hero-content p {
    font-size: 14px; color: var(--text2);
    text-shadow: 0 1px 8px rgba(0,0,0,0.4);
    line-height: 1.75;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-meta {
    margin-top: 12px; font-size: 12px; color: var(--text2);
}
.hero-cta {
    margin-top: 16px; min-height: 38px; padding: 0 16px;
    border-radius: 100px; border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.1); color: #fff;
    display: inline-flex; align-items: center; gap: 8px;
    cursor: pointer; transition: 0.2s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.hero-cta:hover { background: var(--primary); border-color: var(--primary); }
.hero-slide:not(.has-poster)::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(139,92,246,0.42), rgba(20,184,166,0.28));
}
.hero-dots {
    position: absolute; bottom: 20px; right: 40px; z-index: 5;
    display: flex; gap: 6px;
}
.hero-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255,255,255,0.25); cursor: pointer;
    transition: 0.3s ease;
}
.hero-dot.active { background: #fff; width: 28px; border-radius: 4px; }
.hero-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 42px; height: 42px; border-radius: 50%;
    background: rgba(0,0,0,0.5); border: 1px solid var(--border2);
    color: #fff; cursor: pointer; z-index: 5;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; opacity: 0; transition: 0.3s ease;
}
.hero:hover .hero-arrow { opacity: 1; }
.hero-arrow:hover { background: var(--primary); border-color: var(--primary); }
.hero-arrow.left { left: 28px; }
.hero-arrow.right { right: 28px; }

/* ========== Container ========== */
.container { max-width: 1400px; margin: 0 auto; padding: 0 16px 80px; }

/* ========== Sections ========== */
.sec { padding: 24px 0; }
.sec-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.sec-head h2 {
    font-size: 17px; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
}
.sec-head h2 i { color: var(--primary2); font-size: 15px; }
.sec-count { font-size: 13px; color: var(--text3); }
.sec-add {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--bg3); border: 1px solid var(--border);
    color: var(--text2); cursor: pointer; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s ease;
}
.sec-add:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ========== Chips ========== */
.chips {
    display: flex; gap: 8px; flex-wrap: wrap;
    scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 16px; border-radius: 100px;
    background: var(--bg3); border: 1px solid var(--border);
    color: var(--text2); font-size: 13px;
    cursor: pointer; user-select: none;
    transition: 0.2s ease; white-space: nowrap;
    flex-shrink: 0;
}
.chip:hover { border-color: var(--border2); color: var(--text); background: var(--bg4); }
.chip.active {
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    border-color: transparent; color: #fff;
    box-shadow: 0 4px 16px rgba(139,92,246,0.3);
}
.chip:active { transform: scale(0.95); }

/* ========== Skeleton ========== */
.skeleton { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.sk-card { border-radius: var(--radius); overflow: hidden; }
.sk-img {
    width: 100%; aspect-ratio: 3/4; border-radius: var(--radius);
    background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
    background-size: 200% 100%; animation: skShine 1.5s infinite;
}
.sk-line {
    height: 12px; margin-top: 10px; border-radius: 4px;
    background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
    background-size: 200% 100%; animation: skShine 1.5s infinite;
}
@keyframes skShine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ========== Grid ========== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.card {
    border-radius: var(--radius);
    overflow: hidden; cursor: pointer;
    background: var(--bg3); border: 1px solid var(--border);
    transition: 0.3s var(--ease);
    position: relative;
    animation: cardUp 0.45s var(--ease) backwards;
}
.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: 0.04s; }
.card:nth-child(3) { animation-delay: 0.08s; }
.card:nth-child(4) { animation-delay: 0.12s; }
.card:nth-child(5) { animation-delay: 0.16s; }
.card:nth-child(6) { animation-delay: 0.20s; }
.card:nth-child(7) { animation-delay: 0.24s; }
.card:nth-child(8) { animation-delay: 0.28s; }
@keyframes cardUp { from { opacity: 0; transform: translateY(20px); } }
.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(139,92,246,0.2);
}
.card:active { transform: translateY(-2px) scale(1.01); }
.card-img {
    position: relative; width: 100%; aspect-ratio: 3/4;
    background: var(--bg4); overflow: hidden;
}
.card-img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: 0.5s ease;
}
.card:hover .card-img img { transform: scale(1.1); }
.card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent 50%);
    opacity: 0; transition: 0.3s ease;
    display: flex; align-items: center; justify-content: center;
}
.card:hover .card-overlay { opacity: 1; }
.card-play {
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(139,92,246,0.9); border: none; color: #fff;
    font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transform: scale(0.8); transition: 0.3s var(--ease);
    backdrop-filter: blur(4px);
}
.card:hover .card-play { transform: scale(1); }
.card-play:hover { background: var(--primary); transform: scale(1.1) !important; }
.card-badge {
    position: absolute; top: 8px; left: 8px;
    padding: 2px 8px; border-radius: 4px;
    font-size: 11px; font-weight: 600; z-index: 2;
    background: var(--primary); color: #fff;
}
.card-badge.score {
    left: auto; right: 8px;
    background: rgba(251,191,36,0.2);
    color: #fbbf24; border: 1px solid rgba(251,191,36,0.2);
}
.card-body { padding: 12px; }
.card-title {
    font-size: 14px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-meta {
    font-size: 12px; color: var(--text3);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 4px;
}

/* ========== Status ========== */
.status {
    display: none; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 60px 20px; color: var(--text3);
}
.status i { font-size: 44px; margin-bottom: 14px; opacity: 0.4; }
.status p { font-size: 15px; }

/* ========== Pagination ========== */
.pagination { display: flex; justify-content: center; gap: 4px; padding: 28px 0; flex-wrap: wrap; }
.pagination button {
    min-width: 36px; height: 36px; border-radius: 8px;
    font-size: 13px; font-weight: 500;
    background: var(--bg3); border: 1px solid var(--border);
    color: var(--text2); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0 10px; transition: 0.2s ease;
}
.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary2); }
.pagination button.active {
    background: var(--primary); border-color: var(--primary);
    color: #fff; box-shadow: 0 4px 12px rgba(139,92,246,0.3);
}
.pagination button:disabled { opacity: 0.35; cursor: default; }
.pagination .ellip { color: var(--text3); padding: 0 4px; }

/* ========== Buttons ========== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; border-radius: 8px;
    font-size: 14px; cursor: pointer; white-space: nowrap;
    background: var(--bg3); border: 1px solid var(--border);
    color: var(--text); transition: 0.2s ease;
}
.btn:hover { border-color: var(--border2); background: var(--bg4); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: #7c3aed; }
.btn:active { transform: scale(0.97); }

/* ========== Overlay / Panel ========== */
.overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); z-index: 200;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.overlay.show { display: flex; align-items: flex-start; justify-content: flex-end; }
.overlay.video-overlay.show { align-items: center; justify-content: center; background: rgba(0,0,0,0.9); }
.panel {
    width: 440px; max-width: 92vw; max-height: 100vh;
    background: var(--bg2); border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    animation: pSlide 0.35s var(--ease);
}
@keyframes pSlide { from { transform: translateX(100%); } }
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.panel-head h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.panel-body { flex: 1; overflow-y: auto; padding: 8px 20px 20px; }
.panel-close {
    background: none; border: none; color: var(--text2);
    cursor: pointer; font-size: 18px; padding: 4px;
    display: flex; transition: color 0.2s;
}
.panel-close:hover { color: #fff; }

/* ========== Modal ========== */
.modal {
    width: 460px; max-width: 92vw;
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius2); overflow: hidden;
    box-shadow: var(--shadow);
    margin: auto;
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-body { padding: 12px 20px; }
.modal-foot {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 12px 20px; border-top: 1px solid var(--border);
}
.field { margin-bottom: 14px; }
.field label {
    display: block; font-size: 13px; color: var(--text2);
    margin-bottom: 6px; font-weight: 500;
}
.field input, .field select {
    width: 100%; padding: 10px 14px;
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 14px;
    outline: none; transition: 0.2s ease;
}
.field input:focus, .field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}

/* ========== TVBox Steps ========== */
.steps { padding: 8px 0; }
.step { display: flex; gap: 16px; margin-bottom: 20px; }
.step-num {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    color: #fff; display: flex; align-items: center;
    justify-content: center; font-weight: 700; font-size: 14px;
    flex-shrink: 0;
}
.step-body { flex: 1; }
.step-body h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.step-body p { font-size: 13px; color: var(--text2); line-height: 1.5; }
.url-box {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; padding: 10px 14px; margin: 8px 0;
    font-size: 12px; color: var(--accent2); word-break: break-all;
    cursor: pointer; font-family: 'SF Mono', monospace;
    transition: 0.2s;
}
.url-box:hover { border-color: var(--accent); }

/* Source Item */
.src-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-radius: 8px;
    margin-bottom: 4px; background: var(--bg);
    border: 1px solid var(--border); cursor: pointer;
    transition: 0.2s ease;
}
.src-item:hover { border-color: var(--border2); background: var(--bg3); }
.src-item:active { transform: scale(0.99); }
.src-name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.src-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent); flex-shrink: 0;
}
.src-dot.offline { background: #ef4444; }
.src-dot.loading {
    background: #f59e0b;
    animation: srcPulse 1s infinite;
}
@keyframes srcPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ========== Detail Modal ========== */
.modal-detail {
    width: 100%; max-width: 800px; max-height: 100vh;
    background: var(--bg2); overflow: hidden;
    display: flex; flex-direction: column;
    position: relative; margin: auto;
}
.detail-bg {
    position: absolute; top: 0; left: 0; right: 0; height: 320px;
    background-size: cover; background-position: center;
    opacity: 0.12;
    mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
}
.detail-top {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; position: sticky; top: 0; z-index: 3;
    background: linear-gradient(to bottom, var(--bg2), transparent);
}
.detail-top-title { flex: 1; font-size: 16px; font-weight: 700; text-align: center; }
.detail-source-chips {
    display: flex; gap: 6px; margin-top: 10px;
    overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
}
.detail-source-chips::-webkit-scrollbar { display: none; }
.detail-source-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 6px;
    background: var(--bg); border: 1px solid var(--border);
    color: var(--text2); font-size: 12px;
    cursor: pointer; white-space: nowrap; flex-shrink: 0;
    transition: 0.2s ease;
}
.detail-source-chip:hover { border-color: var(--primary); color: var(--primary2); }
.detail-source-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.detail-source-chip i { font-size: 10px; }
.detail-source-chip .ep-num { opacity: 0.7; }
.detail-scroll { flex: 1; overflow-y: auto; padding: 4px 20px 40px; position: relative; z-index: 1; }
.detail-hero {
    display: flex; gap: 24px; margin-bottom: 24px;
}
.detail-poster {
    width: 200px; flex-shrink: 0;
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow);
}
.detail-poster img {
    width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block;
}
.detail-info { flex: 1; min-width: 0; padding-top: 8px; }
.detail-info h1 { font-size: 24px; font-weight: 800; margin-bottom: 12px; line-height: 1.3; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.detail-tag {
    padding: 3px 10px; border-radius: 100px;
    background: rgba(139,92,246,0.12);
    color: var(--primary2); font-size: 12px;
    border: 1px solid rgba(139,92,246,0.2);
}
.detail-tag.gold {
    background: rgba(251,191,36,0.12);
    color: #fbbf24; border-color: rgba(251,191,36,0.2);
}
.detail-meta { font-size: 13px; color: var(--text2); line-height: 2; }
.detail-meta strong { color: var(--text); font-weight: 500; margin-right: 4px; }
.detail-actions { display: flex; gap: 10px; margin-top: 16px; }
.detail-desc {
    margin: 20px 0; padding: 16px 20px;
    border-radius: var(--radius); background: var(--bg3);
    border: 1px solid var(--border);
}
.detail-desc h4 { font-size: 15px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.detail-desc p { font-size: 14px; color: var(--text2); line-height: 1.8; }
.detail-play { margin-top: 16px; }
.detail-play > h4 { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.ep-order { margin-bottom: 10px; }
.ep-order-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 6px;
    background: var(--bg3); border: 1px solid var(--border);
    color: var(--text2); font-size: 12px; cursor: pointer;
    transition: 0.2s ease;
}
.ep-order-btn:hover { border-color: var(--primary); color: var(--primary2); }
.eps {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.ep {
    padding: 6px 14px; border-radius: 6px;
    background: var(--bg3); border: 1px solid var(--border);
    color: var(--text2); font-size: 13px; cursor: pointer;
    transition: 0.2s ease;
}
.ep:hover { border-color: var(--primary); color: var(--primary2); background: rgba(139,92,246,0.08); }
.ep:active { transform: scale(0.95); }
.ep.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Source Tabs in Detail */
.src-section { margin-bottom: 12px; }
.src-section-label { font-size: 12px; color: var(--text3); margin-bottom: 8px; }
.src-tabs {
    display: flex; gap: 8px; overflow-x: auto;
    padding-bottom: 4px;
}
.src-tab {
    padding: 8px 18px; border-radius: 100px;
    font-size: 13px; cursor: pointer; white-space: nowrap;
    background: var(--bg3); border: 1.5px solid var(--border);
    color: var(--text2); transition: 0.2s ease; flex-shrink: 0;
    display: flex; align-items: center; gap: 6px;
}
.src-tab i { font-size: 11px; }
.src-tab:hover { border-color: var(--border2); color: var(--text); }
.src-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ========== Player ========== */
.player {
    width: 100%; max-width: 960px;
    background: #000; overflow: hidden;
    display: flex; flex-direction: column;
    height: 100vh; max-height: 100vh;
}
.player-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px;
    background: rgba(0,0,0,0.8);
    flex-shrink: 0;
}
.player-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.player-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-sub { font-size: 12px; color: var(--text3); }
.player-wrap { position: relative; flex: 1; min-height: 0; background: #000; }
.player-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.player-load {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 14px; color: var(--text3); font-size: 14px;
    background: #000; z-index: 1;
}
.player-load.hide { display: none; }
.spin {
    width: 32px; height: 32px; border-radius: 50%;
    border: 3px solid var(--border2); border-top-color: var(--primary);
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.player-bot {
    background: rgba(0,0,0,0.85);
    border-top: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0; max-height: 130px; overflow: hidden;
}
.player-eps {
    display: flex; gap: 6px; padding: 8px 16px;
    flex-wrap: wrap; max-height: 70px; overflow-y: auto;
}
.player-eps button {
    padding: 5px 12px; border-radius: 6px; font-size: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text2); cursor: pointer; transition: 0.2s ease;
}
.player-eps button:hover { border-color: var(--primary); color: #fff; background: rgba(139,92,246,0.2); }
.player-eps button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.player-srcs {
    display: flex; gap: 6px; padding: 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    overflow-x: auto;
}
.player-srcs button {
    padding: 5px 14px; border-radius: 100px; font-size: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text2); cursor: pointer; white-space: nowrap;
    transition: 0.2s ease;
    display: inline-flex; align-items: center; gap: 5px;
}
.player-srcs button i { font-size: 10px; }
.player-srcs button:hover { border-color: var(--primary); color: #fff; }
.player-srcs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ========== Bottom Nav ========== */
.bnav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: rgba(8,8,15,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
}
.bnav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; gap: 2px;
    background: none; border: none; color: var(--text3);
    cursor: pointer; padding: 6px 0; font-size: 10px;
    transition: 0.2s ease;
}
.bnav-item i { font-size: 20px; }
.bnav-item:hover { color: var(--text2); }
.bnav-item.active, .bnav-item.active i { color: var(--primary2); }

/* ========== Go Top ========== */
.gotop {
    position: fixed; bottom: 80px; right: 20px;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary); color: #fff; border: none;
    cursor: pointer; font-size: 16px; z-index: 50;
    display: none; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(139,92,246,0.35);
    transition: 0.3s ease;
}
.gotop:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(139,92,246,0.45); }
.gotop:active { transform: translateY(0); }

/* ========== Footer ========== */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px 16px; text-align: center;
}
.footer-inner { max-width: 1400px; margin: 0 auto; }
.footer-brand {
    font-size: 18px; font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}
.footer p { font-size: 13px; color: var(--text3); }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .nav-filters { gap: 4px; }
    .nav-filter-btn { padding: 5px 10px; font-size: 12px; }
}
@media (max-width: 768px) {
    html { scroll-padding-top: var(--mobile-header-h); }
    body {
        min-height: 100dvh;
        padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
        overscroll-behavior-y: contain;
    }
    #toast-root { top: calc(12px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; }
    .toast { max-width: none; width: 100%; padding: 11px 14px; }
    .nav { display: none; }
    .mheader {
        display: flex;
        position: sticky; top: 0; z-index: 120;
        padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 8px;
        background: rgba(8,8,15,0.92);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(22px) saturate(1.2);
        -webkit-backdrop-filter: blur(22px) saturate(1.2);
    }
    .mheader-row { min-height: 40px; }
    .mheader .nav-brand { font-size: 19px; }
    .mheader .nav-brand i { font-size: 21px; }
    .mheader-actions .nav-btn,
    .nav-btn { width: 40px; height: 40px; }
    .mheader-search { min-height: 42px; padding: 0 12px; }
    .mheader-filters {
        margin: 0 -12px; padding: 4px 12px 2px;
        scroll-snap-type: x proximity;
    }
    .mheader-filters .nav-filter { scroll-snap-align: start; }
    .nav-filter-btn { min-height: 38px; padding: 8px 12px; font-size: 13px; }
    .bnav { display: flex; }
    .bnav {
        min-height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
        padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
    }
    .bnav-item { min-height: 48px; padding: 7px 0; }
    .bnav-item i { font-size: 19px; }
    .hero { margin-top: 10px; height: 232px; padding: 0 12px; }
    .hero-track { border-radius: 12px; }
    .hero-slide { padding: 24px 18px 28px; gap: 16px; align-items: flex-end; }
    .hero-slide::after {
        background:
            linear-gradient(to top, rgba(8,8,15,0.96) 0%, rgba(8,8,15,0.62) 58%, rgba(8,8,15,0.2) 100%);
    }
    .hero-poster { width: 92px; border-radius: 8px; }
    .hero-content { max-width: calc(100% - 108px); }
    .hero-content h1 { font-size: 20px; }
    .hero-content p {
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
        overflow: hidden; font-size: 13px; line-height: 1.5;
    }
    .hero-meta { margin-top: 8px; font-size: 11px; }
    .hero-cta { min-height: 34px; margin-top: 10px; padding: 0 12px; font-size: 12px; }
    .hero-arrow { display: none !important; }
    .hero-dots { right: 24px; bottom: 14px; }
    .container { padding: 0 12px 22px; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .skeleton { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .sec { padding: 16px 0; }
    .sec-head { align-items: center; gap: 10px; }
    .sec-head h2 { font-size: 16px; }
    .card { border-radius: 8px; }
    .card:hover { transform: none; box-shadow: none; }
    .card-overlay { display: none; }
    .card-body { padding: 9px 10px 10px; }
    .card-title { font-size: 13px; line-height: 1.35; }
    .card-meta { font-size: 11px; }
    .pagination {
        justify-content: flex-start; flex-wrap: nowrap;
        overflow-x: auto; padding: 20px 0 10px;
        scrollbar-width: none;
    }
    .pagination::-webkit-scrollbar { display: none; }
    .pagination button { min-width: 38px; height: 38px; flex-shrink: 0; }
    .overlay.show { align-items: flex-end; justify-content: center; }
    .panel {
        width: 100vw; max-width: 100vw; max-height: 88dvh;
        border-left: none; border-radius: var(--radius2) var(--radius2) 0 0;
        animation: sheetUp 0.28s var(--ease);
    }
    .panel-head { padding: 16px 18px; }
    .panel-body { padding: 8px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
    .panel-close { min-width: 40px; min-height: 40px; align-items: center; justify-content: center; }
    .modal {
        border-radius: var(--radius2) var(--radius2) 0 0;
        max-width: 100vw; width: 100vw; max-height: 88dvh; margin: 0;
        animation: sheetUp 0.28s var(--ease);
    }
    .modal-detail {
        border-radius: 0; max-width: 100vw; width: 100vw;
        height: 100dvh; max-height: 100dvh; margin: 0;
    }
    .modal-body { padding: 14px 18px; }
    .modal-foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px)); }
    .field input, .field select { min-height: 44px; font-size: 16px; }
    .detail-bg { height: 260px; }
    .detail-top {
        padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
        background: rgba(13,13,26,0.86);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }
    .detail-scroll { padding: 12px 16px calc(22px + env(safe-area-inset-bottom, 0px)); }
    .detail-hero { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
    .detail-poster { width: min(42vw, 156px); }
    .detail-info { padding-top: 0; width: 100%; }
    .detail-info h1 { font-size: 21px; }
    .detail-tags, .detail-actions { justify-content: center; }
    .detail-actions .btn { min-height: 42px; }
    .detail-desc { margin: 16px 0; padding: 14px; text-align: left; }
    .detail-top-title { font-size: 14px; }
    .src-tabs, .detail-source-chips { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
    .src-tabs::-webkit-scrollbar, .detail-source-chips::-webkit-scrollbar { display: none; }
    .src-tab, .ep, .ep-order-btn { min-height: 38px; }
    .eps { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; scrollbar-width: none; }
    .eps::-webkit-scrollbar { display: none; }
    .ep { flex-shrink: 0; padding: 8px 14px; }
    .overlay.video-overlay.show { align-items: stretch; padding: 0; }
    .player { height: 100dvh; max-height: 100dvh; max-width: 100vw; }
    .player-top { padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; }
    .player-wrap { flex: 1 1 auto; min-height: 220px; }
    .player-bot { max-height: 34dvh; padding-bottom: env(safe-area-inset-bottom, 0px); }
    .player-srcs { padding: 9px 12px; scrollbar-width: none; }
    .player-srcs::-webkit-scrollbar { display: none; }
    .player-srcs button { min-height: 34px; }
    .player-eps {
        flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
        max-height: none; padding: 8px 12px 10px; scrollbar-width: none;
    }
    .player-eps::-webkit-scrollbar { display: none; }
    .player-eps button { min-height: 34px; flex-shrink: 0; }
    .gotop { bottom: 72px; right: 16px; width: 36px; height: 36px; }
    .footer { padding: 22px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
    .search-drop {
        position: fixed; top: auto; left: 10px; right: 10px;
        bottom: calc(var(--mobile-nav-h) + 10px + env(safe-area-inset-bottom, 0px));
        max-height: min(54dvh, 420px);
        border-radius: var(--radius2);
        z-index: 180;
    }
    .m-search-drop { display: none; }
    .m-search-drop.show { display: block; animation: sheetUp 0.24s var(--ease); }
    .sd-item { min-height: 58px; padding: 10px 14px; }
    .nav-filter-drop {
        position: fixed; top: auto; left: 0; right: 0;
        bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
        width: 100vw;
        min-width: 0;
        max-height: 54vh;
        max-height: min(54dvh, 430px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius2) var(--radius2) 0 0;
        z-index: 170;
        padding: 8px 0 calc(10px + env(safe-area-inset-bottom, 0px));
        animation: sheetUp 0.24s var(--ease);
    }
    .nav-filter-item { min-height: 44px; padding: 12px 18px; font-size: 14px; }
}

@keyframes sheetUp { from { opacity: 0; transform: translateY(18px); } }

@media (min-width: 1200px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (max-width: 400px) {
    :root { --mobile-header-h: 136px; }
    .mheader { padding-left: 10px; padding-right: 10px; }
    .mheader-filters { margin-left: -10px; margin-right: -10px; padding-left: 10px; padding-right: 10px; }
    .hero { height: 216px; padding: 0 10px; }
    .hero-poster { display: none; }
    .hero-content { max-width: 100%; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .card-body { padding: 8px 10px; }
    .card-title { font-size: 13px; }
}

/* ========== Disclaimer Modal ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal-box {
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius2);
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow);
    animation: modalIn 0.3s var(--ease);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-box .modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-box .modal-header i {
    font-size: 24px;
    color: #f59e0b;
}
.modal-box .modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-box .modal-body {
    padding: 20px 24px;
}
.modal-box .modal-body p {
    color: var(--text2);
    margin-bottom: 12px;
    font-size: 14px;
}
.modal-box .modal-body ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.modal-box .modal-body li {
    color: var(--text2);
    font-size: 13px;
    padding-left: 16px;
    position: relative;
}
.modal-box .modal-body li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

.modal-box .modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 20px;
    justify-content: flex-end;
}
.modal-box .modal-btn {
    padding: 10px 24px;
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.modal-box .modal-btn-reject {
    background: var(--bg4);
    color: var(--text2);
    border: 1px solid var(--border2);
}
.modal-box .modal-btn-reject:hover {
    background: var(--border2);
    color: var(--text);
}
.modal-box .modal-btn-accept {
    background: var(--primary);
    color: #fff;
}
.modal-box .modal-btn-accept:hover {
    background: var(--primary2);
}
