/* ──────────────────────────────────────────────
   video.site_new — base stylesheet
   다크 테마, 모바일 우선 반응형
   ────────────────────────────────────────────── */

:root {
    /* 베이스: 깊은 네이비 + 옅은 보라 톤 */
    --bg: #060814;
    --bg-2: #0a0e1c;
    --surface: #111729;
    --surface-2: #182039;
    --surface-3: #232b4a;
    --border: #232c47;
    --border-2: #3a4670;
    --text: #e6ebf5;
    --text-2: #9aa5c4;
    --text-3: #5d6788;

    /* 미래 액센트: 일렉트릭 시안 → 바이올렛 그라데이션 */
    --brand: #22d3ee;
    --brand-2: #a855f7;
    --brand-grad: linear-gradient(135deg, #22d3ee 0%, #6366f1 50%, #a855f7 100%);
    --brand-glow: 0 0 24px rgba(34, 211, 238, 0.45);
    --brand-glow-soft: 0 4px 18px rgba(168, 85, 247, 0.18);

    --success: #34e8b6;
    --warn: #f5b245;
    --danger: #ff5d7a;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 18px;

    --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    --topbar-h: 60px;
    --t-fast: 0.18s ease;
    --t-base: 0.28s cubic-bezier(0.4, 0, 0.2, 1);

    color-scheme: dark;
}

/* 전역 글로벌 디자인 보강 */
body {
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, 0.10) 0%, transparent 50%),
        radial-gradient(1000px 500px at 110% 110%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
        var(--bg);
    background-attachment: fixed;
}

/* 그라데이션 텍스트 (브랜드, 큰 제목) */
.brand {
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: -0.5px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* 페이지 전환 시 흰색 플래시 방지 — 빈 프레임도 다크 배경 */
html { -webkit-text-size-adjust: 100%; background: #060814; }
body {
    /* 배경 그라데이션은 위 body 규칙에서 설정됨 — 여기서 덮어쓰지 않음 */
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
                 "Malgun Gothic", "맑은 고딕", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

a { color: var(--text); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand); }

/* 전역 스크롤바 (webkit) */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--border-2); background-clip: padding-box; }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }

/* 텍스트 선택 색 */
::selection { background: rgba(34, 211, 238, 0.30); color: #fff; }

/* ── 빈 상태 ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 70px 20px;
    gap: 6px;
}
.empty-state-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 10px;
    filter: grayscale(0.2) drop-shadow(0 4px 16px rgba(34,211,238,0.18));
    opacity: 0.9;
}
.empty-state-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.empty-state-desc {
    font-size: 13px;
    color: var(--text-3);
    max-width: 380px;
    line-height: 1.6;
}
.empty-state-cta { margin-top: 16px; text-decoration: none; }

/* ── 토스트 알림 ── */
.toast-host {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    min-width: 200px;
    max-width: 90vw;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-2);
    box-shadow: 0 12px 36px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.3s var(--t-base), transform 0.3s var(--t-base);
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast-success { border-color: rgba(52,232,182,0.5); box-shadow: 0 12px 36px rgba(0,0,0,0.5), 0 0 20px rgba(52,232,182,0.15); }
.toast-success::before { content: "✓ "; color: var(--success); }
.toast-error { border-color: rgba(255,93,122,0.5); box-shadow: 0 12px 36px rgba(0,0,0,0.5), 0 0 20px rgba(255,93,122,0.15); }
.toast-error::before { content: "✕ "; color: var(--danger); }
.toast-info::before { content: "ℹ "; color: var(--brand); }

h1, h2, h3 { margin: 0 0 14px; letter-spacing: -0.4px; font-weight: 700; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 12px; }

.muted { color: var(--text-3); }
.small { font-size: 12px; }
.center { text-align: center; }
.hint { color: var(--text-3); font-size: 12px; margin: 6px 0 0; }

/* ── 레이아웃 ── */
.page { padding: 0; }
body.centered .page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5vh 18px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 24px 80px;
}
@media (prefers-reduced-motion: reduce) {
    .library-card-thumb::after { animation: none; }
}

/* ── 카드 ── */
.card-narrow, .card-wide {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 32px 32px 28px;
}
.card-narrow { max-width: 420px; }
.card-wide { max-width: 720px; }
.card-head { margin-bottom: 20px; }

/* ── 인증 카드 (그라데이션 글로우 보더) ── */
.auth-card {
    position: relative;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.auth-card::before {
    /* 상단 그라데이션 라인 */
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--brand-grad);
    opacity: 0.9;
}
.auth-card::after {
    /* 은은한 코너 글로우 */
    content: "";
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(99,102,241,0.18), transparent 70%);
    pointer-events: none;
}
.auth-title {
    font-size: 24px;
    margin: 4px 0 20px;
}

/* 브랜드 마크 (로고 + 텍스트) */
.brandmark {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}
.brandmark-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.35));
}
.brandmark-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
}
.brandmark-text span {
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 인증 카드: 풀폭 제출 버튼 + 푸터 링크 */
.auth-card .actions { justify-content: stretch; margin-top: 6px; }
.auth-card .actions .btn-primary,
.auth-card .actions button { width: 100%; padding: 13px; font-size: 15px; }
.auth-card .center a { color: var(--text-2); font-weight: 600; }
.auth-card .center a:hover { color: var(--brand); }

/* ── 폼 ── */
form { display: flex; flex-direction: column; gap: 14px; }
fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px 18px;
    background: var(--surface-2);
    margin: 0 0 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
legend {
    padding: 0 8px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
}
label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--text-2);
    font-size: 13px;
}
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
}
input[type="text"],
input[type="password"],
input[type="email"],
input:not([type]),
select,
textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 11px 13px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    width: 100%;
    font-family: inherit;
    transition: border-color var(--t-fast), background var(--t-fast);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--surface-3);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
select { cursor: pointer; }

button, .btn {
    background: var(--surface-3);
    color: var(--text);
    border: 1px solid var(--border-2);
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--t-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}
button:hover, .btn:hover {
    background: var(--surface-2);
    border-color: var(--brand);
    color: var(--text);
}
.btn-primary {
    background: var(--brand-grad);
    border: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    position: relative;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5), var(--brand-glow);
    color: #fff;
}
.btn-primary:active { transform: translateY(0); }

/* 키보드 포커스 가시성 (a11y) — 마우스 클릭엔 안 뜨고 키보드 탐색에만 표시 */
button:focus-visible, a:focus-visible, select:focus-visible, [tabindex]:focus-visible,
.btn:focus-visible, .btn-sm:focus-visible, .sidebar-link:focus-visible,
.vc-btn:focus-visible, .center-toggle:focus-visible, .chip:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}
.actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}
.actions .btn, .actions button { min-width: 120px; }

/* ── 알림 ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 14px;
    border: 1px solid transparent;
}
.alert-error {
    background: rgba(255, 93, 122, 0.08);
    border-color: rgba(255, 93, 122, 0.4);
    color: #ff9eaf;
}
.alert-success {
    background: rgba(52, 232, 182, 0.08);
    border-color: rgba(52, 232, 182, 0.4);
    color: #6cffd0;
}
.alert-warn {
    background: rgba(245, 178, 69, 0.08);
    border-color: rgba(245, 178, 69, 0.4);
    color: #ffcb6b;
}

/* ── 상단 바 — 글래스모피즘 ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(6, 8, 20, 0.65);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
    height: var(--topbar-h);
    display: flex;
    align-items: center;
}
.topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand {
    font-size: 19px;
    font-weight: 800;
    color: var(--brand);
    letter-spacing: -0.3px;
}
.brand:hover { color: var(--brand-2); }
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
}
.topbar-nav a { color: var(--text-2); }
.topbar-nav a:hover { color: var(--text); }

/* ── 상단바 검색 입력 ─────────────────── */
.topbar-search {
    flex: 1;
    max-width: 480px;
    margin: 0 24px;
}
.topbar-search input[type="search"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-family: inherit;
    transition: all var(--t-fast);
}
.topbar-search input[type="search"]::placeholder { color: var(--text-3); }
.topbar-search input[type="search"]:focus {
    outline: none;
    border-color: var(--brand);
    background: rgba(34, 211, 238, 0.06);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

/* 상단 admin 전용 전체 스캔 버튼 */
.topbar-scan-form { margin: 0; flex-shrink: 0; }
.topbar-scan-btn {
    background: rgba(34, 211, 238, 0.10);
    border: 1px solid rgba(34, 211, 238, 0.32);
    color: var(--brand);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-family: inherit;
}
.topbar-scan-btn:hover {
    background: rgba(34, 211, 238, 0.20);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}
.topbar-scan-btn:disabled { opacity: 0.6; cursor: wait; }
.topbar-scan-ico { display: inline-block; font-size: 14px; line-height: 1; }

@media (max-width: 700px) {
    .topbar-scan-btn { padding: 6px 10px; font-size: 12px; }
    .topbar-scan-btn span:not(.topbar-scan-ico) { display: none; }
}

/* ── 사용자 드롭다운 ──────────────────── */
.user-menu { position: relative; flex-shrink: 0; }
.user-menu-trigger {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-2);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    transition: all var(--t-fast);
}
.user-menu-trigger:hover {
    color: var(--text);
    border-color: var(--brand);
    background: rgba(34, 211, 238, 0.06);
}
.user-menu .caret { font-size: 10px; color: var(--text-3); transition: transform var(--t-fast); }
.user-menu.open .caret { transform: rotate(180deg); color: var(--brand); }

.user-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(10, 14, 26, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    min-width: 180px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(34, 211, 238, 0.05);
    padding: 6px;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all var(--t-fast);
}
.user-menu.open .user-menu-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.user-menu-panel a {
    display: block;
    padding: 9px 14px;
    color: var(--text-2);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: all 0.12s;
}
.user-menu-panel a:hover {
    background: rgba(34, 211, 238, 0.10);
    color: var(--brand);
}
.user-menu-panel hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 4px 8px;
}

@media (max-width: 700px) {
    .topbar-search { margin: 0 10px; }
    .topbar-search input[type="search"] { font-size: 13px; padding: 7px 12px; }
    .user-menu-trigger { padding: 6px 10px; font-size: 12px; }
    .user-menu .um-name {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }
}

/* ── 플레이스홀더 ── */
.placeholder {
    padding: 20px 24px;
    background: var(--surface);
    border: 1px dashed var(--border-2);
    border-radius: var(--radius);
    color: var(--text-3);
    font-size: 14px;
    margin-top: 20px;
}
.placeholder ul { margin: 6px 0 0; padding-left: 20px; }
.placeholder li { margin: 2px 0; }

/* ── 모바일 ── */
@media (max-width: 700px) {
    body { font-size: 14px; }
    h1 { font-size: 22px; }
    h2 { font-size: 18px; }

    body.centered .page {
        padding: 0;
        align-items: stretch;
    }
    .card-narrow, .card-wide {
        max-width: 100%;
        border-radius: 0;
        border: none;
        box-shadow: none;
        padding: 24px 18px 32px;
        min-height: 100vh;
    }

    .grid-2 { grid-template-columns: 1fr; }

    input[type="text"],
    input[type="password"],
    input:not([type]),
    select {
        font-size: 16px; /* iOS zoom 방지 */
        padding: 12px 13px;
    }

    button, .btn {
        font-size: 16px;
        padding: 13px 22px;
    }
    .actions { flex-direction: column; }
    .actions .btn, .actions button { width: 100%; min-width: 0; }

    .topbar-inner { padding: 0 14px; }
    .topbar-nav { gap: 12px; font-size: 13px; }

    .container { padding: 18px 14px 60px; }
}

/* ──────────────────────────────────────────────
   설치 마법사 — DB 종류 라디오 카드
   ────────────────────────────────────────────── */
.db-type-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 4px 0 14px;
}
.db-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    cursor: pointer;
    transition: all var(--t-fast);
}
.db-radio:hover { border-color: var(--border-2); background: var(--surface-3); }
.db-radio.is-active {
    border-color: var(--brand);
    background: rgba(34, 211, 238, 0.08);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.4);
}
.db-radio input[type="radio"] {
    accent-color: var(--brand);
    width: 18px; height: 18px;
    margin: 0;
    flex-shrink: 0;
}
.db-radio strong { color: #fff; display: block; }
.db-radio .small { display: block; margin-top: 2px; }
.db-block { display: flex; flex-direction: column; gap: 12px; }

@media (max-width: 700px) {
    .db-type-tabs { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────────────
   Admin 레이아웃 (사이드바 + 메인)
   ────────────────────────────────────────────── */
.admin-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: calc(100vh - var(--topbar-h));
    align-items: stretch;
}
.admin-sidebar {
    background: linear-gradient(180deg, rgba(17, 23, 41, 0.7) 0%, rgba(10, 14, 28, 0.7) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--border);
    padding: 18px 0 30px;
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
}
.admin-sidebar nav { display: flex; flex-direction: column; gap: 1px; }
.sidebar-section {
    padding: 16px 20px 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 1.4px;
}
.sidebar-section:not(:first-child) { margin-top: 8px; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--t-fast);
    border-left: 3px solid transparent;
    position: relative;
}
.sidebar-link .ico {
    font-size: 12px;
    color: var(--text-3);
    width: 14px;
    text-align: center;
    transition: color var(--t-fast);
}
.sidebar-link:hover {
    color: var(--text);
    background: rgba(255,255,255,0.03);
    border-left-color: var(--border-2);
}
.sidebar-link:hover .ico { color: var(--text); }
.sidebar-link.is-active {
    color: var(--brand);
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.10) 0%, transparent 100%);
    border-left-color: var(--brand);
    font-weight: 600;
}
.sidebar-link.is-active .ico { color: var(--brand); }
.sidebar-tag {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--warn);
    background: rgba(245, 178, 69, 0.12);
    border: 1px solid rgba(245, 178, 69, 0.3);
    padding: 1px 6px;
    border-radius: 999px;
    white-space: nowrap;
}

.admin-main {
    padding: 30px 38px 60px;
    max-width: 1300px;
    width: 100%;
    min-width: 0;   /* grid 1fr 트랙이 콘텐츠(긴 경로 등) 최소너비에 갇히지 않고 줄어들도록 */
}

@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: static;
        height: auto;
        padding: 8px 0;
        overflow-x: auto;
    }
    .admin-sidebar nav {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0;
        padding: 0 8px;
    }
    .sidebar-section { display: none; }
    .sidebar-link {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 10px 14px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .sidebar-link.is-active {
        background: transparent;
        border-bottom-color: var(--brand);
    }
    .admin-main { padding: 18px 14px 40px; }
}

/* ──────────────────────────────────────────────
   Admin / data table / badge / 카드 섹션
   ────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin: 20px 0 32px;
}
.stat-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    text-decoration: none;
    transition: all var(--t-fast);
    color: var(--text);
}
.stat-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    color: var(--text);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.25), 0 8px 24px rgba(34, 211, 238, 0.10);
}
.stat-card.stat-warn { border-color: var(--warn); }
.stat-card.stat-warn:hover { box-shadow: 0 0 0 1px rgba(245, 178, 69, 0.4), 0 8px 24px rgba(245, 178, 69, 0.12); }
.stat-num {
    font-size: 32px;
    font-weight: 800;
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    line-height: 1;
}
.stat-label {
    font-size: 13px;
    color: var(--text-3);
    margin-top: 8px;
}

.card-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px 24px;
    margin: 24px 0;
}
.card-section h2 { margin-top: 0; }

.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── 스파크라인 (대시보드) ── */
.spark-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.sparkline {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 130px;
}
.spark-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    justify-content: flex-end;
}
.spark-bar-track {
    width: 100%;
    max-width: 44px;
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.spark-bar {
    width: 100%;
    max-width: 44px;
    min-height: 3px;
    border-radius: 6px 6px 0 0;
    background: var(--brand-grad);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.25);
    transition: height var(--t-base);
}
.spark-val { font-size: 12px; font-weight: 700; color: var(--text); }
.spark-label { font-size: 11px; color: var(--text-3); }

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    margin: 16px 0;
    -webkit-overflow-scrolling: touch;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table thead {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.data-table th, .data-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.data-table th {
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}
.data-table code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 13px;
    color: var(--text);
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 3px;
}
.data-table code.path {
    color: var(--text-2);
    background: transparent;
    padding: 0;
    font-size: 12px;
}

.actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.actions-cell form.inline,
form.inline {
    display: inline-flex;
    margin: 0;
}

.btn-sm {
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    background: var(--surface-3);
    border: 1px solid var(--border-2);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    transition: all var(--t-fast);
}
.btn-sm:hover { background: var(--border-2); color: var(--text); }
.btn-sm.btn-primary {
    background: var(--brand-grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.btn-sm.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
    color: #fff;
}
.btn-sm.btn-danger { background: transparent; border-color: rgba(255,77,77,0.35); color: #ff8a8a; }
.btn-sm.btn-danger:hover { background: rgba(255,77,77,0.15); border-color: var(--danger); color: var(--danger); }
.btn-danger {
    background: rgba(255,77,77,0.12);
    border-color: rgba(255,77,77,0.4);
    color: #ff8a8a;
}
.btn-danger:hover {
    background: rgba(255,77,77,0.22);
    color: #ff8a8a;
}

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    letter-spacing: 0.3px;
}
.badge-brand { background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.4); color: #6ee2f5; }
.badge-ok { background: rgba(52, 232, 182, 0.13); border-color: rgba(52, 232, 182, 0.4); color: #6cffd0; }
.badge-warn { background: rgba(245, 178, 69, 0.15); border-color: rgba(245, 178, 69, 0.4); color: #ffcb6b; }

.check-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
}
.check-row {
    display: grid;
    grid-template-columns: 28px auto 1fr auto;
    gap: 8px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    cursor: pointer;
    flex-direction: row;
    color: var(--text);
    transition: border-color var(--t-fast), background var(--t-fast);
}
.check-row:hover { border-color: var(--border-2); background: var(--surface-2); }
.check-row input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--brand);
    margin: 0;
}
.path-mini {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 11px;
    color: var(--text-3);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* 컨텍스트 메뉴 (관리자 우클릭) */
.ctx-menu {
    position: absolute;
    z-index: 10000;
    background: rgba(10, 14, 26, 0.94);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 10px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(34, 211, 238, 0.04);
    padding: 6px;
    min-width: 200px;
    user-select: none;
}
.ctx-menu button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-2);
    padding: 9px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.ctx-menu button:hover {
    background: rgba(34, 211, 238, 0.10);
    color: var(--brand);
}
body[data-is-admin="1"] [data-video-key] { cursor: default; }

/* 파일 탐색기 */
.explorer-dirs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin: 14px 0;
}
.explorer-dir-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    color: var(--text);
    text-decoration: none;
    transition: all var(--t-fast);
}
.explorer-dir-card:hover {
    border-color: var(--brand);
    background: var(--surface-2);
    color: var(--text);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.3);
}
.explorer-dir-ico {
    font-size: 22px;
    color: var(--brand);
}
.explorer-dir-body { min-width: 0; flex: 1; }
.explorer-dir-name { font-weight: 700; font-size: 15px; color: #fff; }
.explorer-dir-path code {
    font-size: 11px;
    color: var(--text-3);
    background: transparent;
    padding: 0;
}

.explorer-table .ex-name {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.explorer-table .ex-name:not(.muted):hover { color: var(--brand); }
.explorer-table .ex-ico { font-size: 16px; }

/* 필터 칩 & 페이저 */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 16px;
    flex-wrap: wrap;
}
.chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--t-fast);
}
.chip:hover { border-color: var(--border-2); color: var(--text); }
.chip-active {
    background: var(--brand-grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.chip-active:hover { color: #fff; }

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 24px 0 60px;
}
.ua-cell {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 카드 × 삭제 버튼 (개별) */
.card-item { position: relative; }
.card-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(6, 8, 20, 0.78);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 16px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity var(--t-fast), transform var(--t-fast), background var(--t-fast), border-color var(--t-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-item:hover .card-remove,
.card-remove:focus-visible { opacity: 1; transform: scale(1); }
.card-remove:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.card-remove:disabled { opacity: 0.4; cursor: wait; }

@media (max-width: 700px) {
    /* 모바일은 hover 없으니 항상 표시 */
    .card-remove { opacity: 0.85; transform: scale(1); }
}

/* 시청 기록 진행률 (카드 안) */
.card-progress-row {
    margin-top: 10px;
}
.progress-track {
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    overflow: hidden;
}
.progress-track .progress-fill {
    height: 100%;
    background: var(--brand-grad);
    transition: width 0.4s ease;
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.4);
}

/* 폼 행 (label들 가로 배치) */
.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-top: 12px;
}
.form-row label { flex: 1; min-width: 200px; margin-bottom: 0; }
.form-row button { flex-shrink: 0; }

/* 검색 폼 */
.search-form {
    display: flex;
    gap: 10px;
    margin: 14px 0 20px;
    max-width: 760px;
}
.search-form input[type="search"] {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: all var(--t-fast);
}
.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--surface-2);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.search-form .btn-primary { white-space: nowrap; }

@media (max-width: 700px) {
    .search-form { flex-direction: column; }
    .search-form input[type="search"] { font-size: 16px; }
}

@media (max-width: 700px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 16px 18px; }
    .stat-num { font-size: 26px; }
    .data-table th, .data-table td { padding: 9px 10px; }
    .actions-cell { flex-direction: column; align-items: stretch; gap: 4px; }
    .actions-cell .btn-sm, .actions-cell form.inline { width: 100%; }
    .actions-cell .btn-sm { justify-content: center; }
    .check-row {
        grid-template-columns: 28px auto 1fr;
        grid-template-areas: "ck name flex" "ck path path";
        row-gap: 4px;
    }
    .check-row input { grid-area: ck; }
    .path-mini { grid-area: path; text-align: left; }
}

/* ──────────────────────────────────────────────
   Browse: 라이브러리 카드, 가로 스크롤, breadcrumb
   ────────────────────────────────────────────── */

.row-section { margin: 24px 0 32px; }
.section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
}
.section-head .section-title { margin: 0; }
.section-action { margin-left: auto; }
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 14px;
    letter-spacing: -0.3px;
}

/* "더 보기" 버튼 (페이지네이션) */
.row-more-wrap {
    text-align: center;
    margin-top: 16px;
}
.btn-more {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    padding: 9px 22px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    min-width: 160px;
}
.btn-more:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: rgba(34, 211, 238, 0.06);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.10);
}

/* 접힘 가능한 섹션 (details/summary 기반) */
details.row-section { margin: 24px 0 32px; }
details.row-section > summary.collapsible-summary {
    cursor: pointer;
    user-select: none;
    list-style: none;
    padding: 4px 6px 4px 0;
    margin: 0 0 12px;
    border-radius: var(--radius-sm);
    transition: background var(--t-fast);
    display: flex;
    align-items: center;
    gap: 10px;
}
details.row-section > summary.collapsible-summary:hover {
    background: rgba(255,255,255,0.03);
}
details.row-section .section-action { margin-left: auto; }
details.row-section > summary::-webkit-details-marker { display: none; }
details.row-section > summary::marker { content: ''; }
details.row-section .chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    color: var(--text-3);
    font-size: 13px;
    transition: transform var(--t-fast), color var(--t-fast);
}
details.row-section[open] .chevron {
    transform: rotate(90deg);
    color: var(--brand);
}
details.row-section[open] > summary.collapsible-summary {
    margin-bottom: 14px;
}
.section-title .count {
    font-size: 11px;
    background: var(--surface-3);
    color: var(--text-2);
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.grid-card {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.library-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
    transition: all var(--t-fast);
}
.library-card {
    transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-fast), background var(--t-fast);
}
.library-card:hover {
    border-color: var(--brand);
    transform: translateY(-4px);
    color: var(--text);
    background: var(--surface-2);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.35), 0 16px 40px rgba(8, 12, 24, 0.7), 0 0 28px rgba(34, 211, 238, 0.12);
}
/* 썸네일 cover 이미지 줌 (호버) */
.library-card-thumb { transition: transform var(--t-base); }
.library-card:hover .library-card-thumb { transform: scale(1.05); }
.library-card-icon { display: none; }

/* 썸네일 영역 (16:9) — 로드 전 shimmer */
.library-card-thumb {
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-color: var(--surface-2);
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}
.library-card-thumb::after {
    /* 썸네일이 cover로 채워지면 가려지고, 빈(=배경 미로딩) 동안만 보이는 은은한 shimmer */
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(100deg,
        transparent 30%, rgba(255,255,255,0.04) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: thumb-shimmer 1.6s linear infinite;
    pointer-events: none;
}
@keyframes thumb-shimmer {
    0%   { background-position: 150% 0; }
    100% { background-position: -50% 0; }
}
.library-card-thumb.folder-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background:
        linear-gradient(135deg, rgba(34, 211, 238, 0.10), rgba(168, 85, 247, 0.18)),
        var(--surface-2);
    color: rgba(255,255,255,0.65);
}
.thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: rgba(255,255,255,0.0);
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.4) 100%);
    transition: color var(--t-fast), background var(--t-fast);
}
.library-card:hover .thumb-play {
    color: rgba(255,255,255,0.9);
    background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.55) 100%);
}
.thumb-progress {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: rgba(255,255,255,0.18);
}
.thumb-progress .progress-fill {
    height: 100%;
    background: var(--brand);
}

/* 폴더 카드 배지 (분류 vs 컨텐츠) */
.card-badge {
    position: absolute;
    top: 10px; left: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2;
}
.card-badge-brand {
    background: #e50914;          /* 레드 재생 버튼 */
    color: #fff;
    border-radius: 6px;           /* 사각형 + 라운드 (pill 아님) */
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.45);
}
.card-badge-soft {
    background: rgba(0, 0, 0, 0.65);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.library-card.folder-card .library-card-thumb { position: relative; }

.library-card-body { padding: 12px 14px 14px; }
.library-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.35em * 2);  /* 2줄 분 고정 — 카드 높이 일정 */
}
.library-card-sub {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.library-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 70px;
}
.library-card-sub code {
    background: var(--surface-3);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: var(--text-2);
}
.library-card.video-card { border-left: 3px solid var(--brand); }
.progress-fill { height: 100%; background: var(--brand); }

/* ── 폴더 카드 "스택"(여러 영상) 효과 ──
   box-shadow 시트 기법 (overflow:hidden 에 안 잘림, 호버 시 글로우로 전환) */
.folder-card {
    margin-top: 9px;
    box-shadow:
        0 -4px 0 -2px var(--surface-2),
        0 -8px 0 -4px var(--surface-3);
}

/* ── 섹션 제목 그라데이션 액센트 바 (이모지 대체) ── */
.sec-accent {
    display: inline-block;
    width: 4px;
    height: 18px;
    border-radius: 999px;
    margin-right: 2px;
    flex-shrink: 0;
    background: var(--brand-grad);
}
.sec-accent-fav      { background: linear-gradient(180deg, #ff5d7a, #a855f7); }
.sec-accent-continue { background: linear-gradient(180deg, #22d3ee, #6366f1); }
.sec-accent-new      { background: linear-gradient(180deg, #34e8b6, #22d3ee); }
.sec-accent-dir      { background: var(--brand-grad); }
.sec-accent-cat      { background: linear-gradient(180deg, #5d6788, #3a4670); }

/* ── 라이브러리 구분선 ── */
.library-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 36px 0 22px;
    color: var(--text-3);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.library-divider::before,
.library-divider::after {
    content: "";
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-2), transparent);
    flex: 1;
}

/* ── 넷플릭스식 회차 목록 ── */
.episode-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.episode-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.episode-row:hover {
    border-color: var(--brand);
    background: var(--surface-2);
    color: var(--text);
    transform: translateX(3px);
    box-shadow: 0 0 0 1px rgba(34,211,238,0.25);
}
.episode-num {
    flex-shrink: 0;
    width: 30px;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-3);
}
.episode-row:hover .episode-num { color: var(--brand); }
.episode-thumb {
    flex-shrink: 0;
    width: 150px;
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    background-size: cover;
    background-position: center;
    background-color: var(--surface-2);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.episode-play {
    font-size: 22px;
    color: rgba(255,255,255,0);
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.4));
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    transition: color var(--t-fast);
}
.episode-row:hover .episode-play { color: rgba(255,255,255,0.95); }
.episode-progress {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 4px; background: rgba(255,255,255,0.2);
}
.episode-info { flex: 1; min-width: 0; }
.episode-title {
    font-size: 15px; font-weight: 700; color: #fff;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin-bottom: 4px;
}
.episode-meta { font-size: 12px; color: var(--text-3); }
.episode-meta .ep-watched { color: var(--success); font-weight: 600; }
.episode-meta .ep-progress { color: var(--brand); font-weight: 600; }
.episode-arrow {
    flex-shrink: 0;
    color: var(--text-3);
    font-size: 13px;
    transition: transform var(--t-fast), color var(--t-fast);
}
.episode-row:hover .episode-arrow { color: var(--brand); transform: translateX(3px); }

@media (max-width: 700px) {
    .episode-row { gap: 11px; padding: 9px 11px; }
    .episode-num { width: 20px; font-size: 15px; }
    .episode-thumb { width: 104px; }
    .episode-title { font-size: 13px; white-space: normal;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .episode-arrow { display: none; }
}

.browse-head { margin-bottom: 18px; }
.browse-head-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.browse-head-row h1 { margin: 0; }
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--t-fast);
    white-space: nowrap;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.btn-back:hover {
    border-color: var(--brand);
    color: var(--text);
    background: var(--surface-2);
}
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-3);
    margin-top: 6px;
}
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { color: var(--text-3); }

/* ──────────────────────────────────────────────
   Player
   ────────────────────────────────────────────── */
body.player-page { background: #000; }
body.player-page .page { padding: 0; }
/* 전체화면일 때만 페이지 스크롤 잠금.
   비전체화면에서는 일반 웹페이지처럼 세로 스크롤·당겨서 새로고침이 동작해야 함. */
body.player-fs {
    overflow: hidden;
    overscroll-behavior: none;
    height: 100vh;
    height: 100dvh;
}
.player-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #000;
}
.player-topbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px 28px;
    background: linear-gradient(180deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.35) 55%, transparent 100%);
    transition: opacity var(--t-base), transform var(--t-base);
}
.player-wrap.idle .player-topbar {
    opacity: 0;
    transform: translateY(-12px);
    pointer-events: none;
}
.player-wrap.idle .vc-bar {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
}
.player-wrap.idle { cursor: none; }

/* ── 커스텀 컨트롤 바 ── */
.vc-bar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 18px 14px;
    background: linear-gradient(0deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.35) 60%, transparent 100%);
    transition: opacity var(--t-base), transform var(--t-base);
}
.vc-btn {
    background: transparent; border: none; color: #fff;
    font-size: 20px; line-height: 1; cursor: pointer;
    padding: 6px; flex-shrink: 0; border-radius: 6px;
}
.vc-btn:hover { color: var(--brand); background: transparent; }
.vc-time {
    color: #fff; font-size: 12px; font-variant-numeric: tabular-nums;
    flex-shrink: 0; min-width: 42px; text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.vc-progress {
    position: relative; flex: 1; height: 18px; cursor: pointer;
    display: flex; align-items: center; touch-action: none;
}
.vc-progress::before {
    content: ""; position: absolute; left: 0; right: 0; height: 5px;
    background: rgba(255,255,255,0.22); border-radius: 999px;
}
.vc-buffered {
    position: absolute; left: 0; height: 5px; width: 0;
    background: rgba(255,255,255,0.35); border-radius: 999px;
}
.vc-played {
    position: absolute; left: 0; height: 5px; width: 0;
    background: var(--brand-grad); border-radius: 999px;
    box-shadow: 0 0 8px rgba(34,211,238,0.5);
}
.vc-thumb {
    position: absolute; left: 0; width: 0; height: 5px;  /* width=played 따라감(아래 JS는 played만 갱신) */
}
.vc-played::after {
    content: ""; position: absolute; right: -7px; top: 50%;
    width: 14px; height: 14px; border-radius: 50%;
    background: #fff; transform: translateY(-50%);
    box-shadow: 0 0 8px rgba(34,211,238,0.6);
}

/* 가운데 큰 재생 버튼 (일시정지 상태일 때만 강조) */
.center-toggle {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 76px; height: 76px; border-radius: 50%;
    background: rgba(8, 12, 24, 0.55);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff; font-size: 30px; cursor: pointer;
    z-index: 20; display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    transition: opacity var(--t-fast), transform var(--t-fast);
    opacity: 0; pointer-events: none;
}
/* 컨트롤이 보일 때(=idle 아님) 또는 일시정지 시 가운데 재생/정지 버튼 표시.
   데스크톱·모바일 공통 → 영상 클릭/탭은 컨트롤 표시, 정지/재생은 이 버튼으로. */
.player-wrap:not(.idle) .center-toggle,
.player-wrap.paused .center-toggle { opacity: 1; pointer-events: auto; }
.center-toggle:hover { background: rgba(34,211,238,0.25); }

@media (max-width: 700px) {
    .vc-bar { padding: 28px 12px 12px; gap: 8px; }
    .vc-btn { font-size: 22px; padding: 8px; }
    .center-toggle { width: 64px; height: 64px; font-size: 26px; }
}
.player-title {
    flex: 1;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.player-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.player-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 0;
    touch-action: auto;  /* 비전체화면: 일반 페이지처럼 전방향 스크롤/패닝 + 핀치 줌 모두 허용 (시크는 전체화면에서만) */
}
#player {
    width: 100%;
    max-height: calc(100vh - 50px);
    height: auto;
    background: #000;
    outline: none;
    display: block;
    touch-action: auto;
}
.btn-sm.is-active {
    background: rgba(229,9,20,0.18);
    border-color: var(--brand);
    color: #ff8a92;
}

/* 재생 에러 박스 */
/* 다음 화 카드 (영상 끝 무렵) */
.next-card {
    position: absolute;
    right: 28px;
    bottom: 90px;
    z-index: 40;
    width: 320px;
    max-width: calc(100% - 40px);
    background: rgba(10, 14, 26, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 16px 44px rgba(0,0,0,0.6), 0 0 28px rgba(34,211,238,0.12);
    animation: next-card-in 0.35s var(--t-base);
}
@keyframes next-card-in {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.next-card-label {
    font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--brand); margin-bottom: 6px;
}
.next-card-title {
    font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 14px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.next-card-actions { display: flex; gap: 8px; align-items: center; }
.next-card-play { flex: 1; justify-content: center; text-decoration: none; }

@media (max-width: 700px) {
    .next-card { right: 12px; bottom: 80px; width: 260px; }
}

.player-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 560px;
    width: calc(100% - 40px);
    background: rgba(8, 12, 24, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--danger);
    color: var(--text);
    padding: 22px 26px;
    border-radius: 14px;
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.55;
    z-index: 50;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
    word-break: keep-all;
}
.player-stage { position: relative; }

/* WebVTT 자막 — 기본값. 실제 스타일은 player.html이 동적 <style>로 덮어씀
   (배경 투명 + text-shadow 외곽선 + 사용자 크기). */
video::cue {
    background: transparent;
    color: #fff;
    font-size: 40px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
    text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000;
}

/* 커스텀 자막 오버레이 — 네이티브 ::cue 대신 직접 렌더.
   위치를 %로 잡아 0~100 밖(화면 밖)까지 상하좌우 이동 가능. 크기/외곽선은 JS가 인라인 지정. */
.sub-overlay {
    position: absolute;
    left: 50%;
    bottom: 8%;
    transform: translateX(-50%);
    max-width: 92%;
    text-align: center;
    color: #fff;
    font-weight: 600;
    line-height: 1.25;
    white-space: pre-wrap;
    word-break: break-word;
    pointer-events: none;
    z-index: 16;
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
}
.sub-overlay .sub-line { display: block; }

/* 자막 메뉴 (CC + 설정) */
.sub-menu { position: relative; display: inline-flex; gap: 4px; }
.sub-gear { padding: 6px 9px; }
.sub-settings-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    width: 230px;
    background: rgba(10, 14, 26, 0.96);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 75vh;
    overflow-y: auto;
}
/* hidden 속성이 flex display 에 안 가려지는 문제 → 명시적으로 숨김 강제 */
.sub-settings-panel[hidden] { display: none; }
.sub-settings-head { font-size: 13px; font-weight: 700; color: #fff; }
.sub-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.sub-toggle-row input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--brand);
    margin: 0;
}

/* 전체화면 시 컨테이너가 화면을 꽉 채우도록 */
.player-wrap:fullscreen { width: 100vw; height: 100vh; background: #000; }
.player-wrap:-webkit-full-screen { width: 100vw; height: 100vh; background: #000; }
.player-wrap:fullscreen .player-stage,
.player-wrap:-webkit-full-screen .player-stage { height: 100vh; }
.player-wrap:fullscreen #player,
.player-wrap:-webkit-full-screen #player { max-height: 100vh; }
/* 전체화면: 세로 스크롤 끄고 모든 스와이프를 시크로 (body.player-fs 는 JS 가 토글) */
body.player-fs .player-stage,
body.player-fs #player { touch-action: none; }
.sub-row {
    display: flex; flex-direction: column; gap: 6px;
    font-size: 12px; color: var(--text-2);
}
.sub-row span { color: var(--brand); font-weight: 700; }
.sub-row input[type="range"] { width: 100%; accent-color: var(--brand); }
.sub-settings-panel .btn-sm { align-self: flex-start; }
.sub-offset-btns { display: flex; gap: 6px; }
.sub-offset-btns .btn-sm { flex: 1; align-self: stretch; justify-content: center; padding: 6px 4px; }

/* 오디오 트랙 메뉴 */
.audio-menu { position: relative; display: inline-flex; }
.audio-menu[hidden] { display: none; }
.audio-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    min-width: 220px;
    background: rgba(10, 14, 26, 0.96);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.audio-panel[hidden] { display: none; }
.audio-opt {
    background: transparent;
    border: none;
    color: var(--text-2);
    text-align: left;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}
.audio-opt:hover { background: rgba(34, 211, 238, 0.10); color: var(--text); }
.audio-opt.is-active { color: var(--brand); font-weight: 700; }

/* 플레이어 OSD (볼륨/시크 표시) */
.player-osd {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    background: rgba(8, 12, 24, 0.88);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(34, 211, 238, 0.4);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6), 0 0 24px rgba(34, 211, 238, 0.2);
    color: #fff;
    padding: 14px 22px;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease, transform 0.12s ease;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 200px;
    white-space: nowrap;
}
.player-osd.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.player-osd .osd-ico { font-size: 22px; line-height: 1; }
.player-osd .osd-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    overflow: hidden;
}
.player-osd .osd-fill {
    height: 100%;
    background: var(--brand-grad);
    transition: width 0.18s ease;
}
.player-osd .osd-num {
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
    min-width: 36px;
    text-align: right;
}

.topbar-nav .nick { display: inline-block; }

@media (max-width: 700px) {
    .grid-card { grid-template-columns: 1fr 1fr; gap: 10px; }
    .library-card { min-height: 92px; padding: 14px; gap: 10px; }
    .library-card-title { font-size: 13px; }
    .library-card-icon { font-size: 22px; }
    .card { flex: 0 0 160px; }
    .section-title { font-size: 16px; }
    .player-topbar { padding: 9px 12px; gap: 8px; }
    .player-title { font-size: 13px; }
    .player-topbar .btn-sm { padding: 6px 10px; font-size: 12px; }
    video::cue { font-size: 17px; }
    .topbar-nav .nick { display: none; }
}


