html.pre-dark body { background: #0f1117 !important; }
/* ── 문서 뷰어 모달 ── */
#modal-viewer { padding: 0 !important; align-items: stretch !important; }
#modal-viewer > div { border-radius: 0 !important; max-height: 100vh; }
@media (min-width: 700px) {
    #modal-viewer > div { border-radius: 12px !important; margin: 20px auto !important; height: calc(100vh - 40px); }
    #modal-viewer { padding: 20px !important; }
}

/* ── SheetJS 엑셀 뷰어 ── */
#viewer-sheet-table th, #viewer-sheet-table td {
    border: 1px solid var(--border);
    padding: 4px 10px;
    min-width: 60px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}
#viewer-sheet-table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: center;
}
#viewer-sheet-table td { color: var(--text); }
#viewer-sheet-table tr:nth-child(even) td { background: rgba(0,0,0,0.02); }
body.dark-theme #viewer-sheet-table tr:nth-child(even) td { background: rgba(255,255,255,0.03); }
.sheet-tab-btn {
    padding: 5px 14px; border-radius: 6px 6px 0 0;
    border: 1px solid var(--border); border-bottom: none;
    background: var(--panel-bg); color: var(--text-muted);
    font-size: 12px; cursor: pointer; white-space: nowrap;
    transition: all 0.15s;
}
.sheet-tab-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.sheet-tab-btn:hover:not(.active) { background: var(--primary-light); color: var(--primary); }

:root {
    --primary: #1a6fc4;
    --primary-dark: #1558a0;
    --primary-light: #e8f0fb;
    --accent: #ff6b35;
    --bg: #f0f4f8;
    --sidebar-bg: #1a6fc4;
    --sidebar-text: rgba(255,255,255,0.75);
    --sidebar-active: #ffffff;
    --header-bg: #ffffff;
    --panel-bg: #ffffff;
    --border: #dde3ec;
    --text: #2d3748;
    --text-muted: #718096;
    --success: #38a169;
    --danger: #e53e3e;
    --warning: #d69e2e;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --font: 'Noto Sans KR', -apple-system, sans-serif;
}

/* ══ 다크 테마 ══ */
body.dark-theme {
    --primary: #4a9eff;
    --primary-dark: #2979d9;
    --primary-light: rgba(74,158,255,0.12);
    --accent: #ff8c5a;
    --bg: #0f1117;
    --sidebar-bg: #13151f;
    --sidebar-text: #8892a4;
    --sidebar-active: #ffffff;
    --header-bg: #13151f;
    --panel-bg: #1a1d27;
    --border: #2a2d3a;
    --text: #e8eaf0;
    --text-muted: #6b7280;
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}
body.dark-theme { background: var(--bg); color: var(--text); }
body.dark-theme #header { background: var(--header-bg); border-color: var(--border); }
body.dark-theme #header .logo { color: var(--primary); }
body.dark-theme #header .btn-logout { background: #1a1d27; border-color: var(--border); color: var(--text-muted); }
body.dark-theme #header .btn-logout:hover { border-color: var(--danger); color: var(--danger); background: rgba(229,62,62,0.1); }
body.dark-theme #theme-toggle-btn:hover { border-color: var(--warning); color: var(--warning); background: rgba(214,158,46,0.12); }
body.dark-theme #header .nav-tabs a { color: var(--text-muted); }
body.dark-theme #header .nav-tabs a.active { background: var(--primary); color: #fff; }
body.dark-theme #sidebar { background: var(--sidebar-bg); }
body.dark-theme #wh-left { background: var(--panel-bg); border-color: var(--border); }
body.dark-theme #wh-right { background: var(--panel-bg); }
body.dark-theme #wh-toolbar { background: var(--panel-bg); border-color: var(--border); }
body.dark-theme #wh-toolbar .btn { background: #22253a; border-color: var(--border); color: var(--text); }
body.dark-theme #wh-toolbar .btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
body.dark-theme .file-table th { background: #13151f; color: var(--text-muted); border-color: var(--border); }
body.dark-theme .file-table td { border-color: var(--border); }
body.dark-theme .file-table tr:hover td { background: var(--primary-light); }
body.dark-theme .file-table tr.selected td { background: rgba(74,158,255,0.15); }
body.dark-theme .dir-item { color: var(--text); }
body.dark-theme .dir-item:hover { background: var(--primary-light); }
body.dark-theme .dir-item.active { background: var(--primary-light); color: var(--primary); }
body.dark-theme #drop-zone { border-color: var(--border); color: var(--text-muted); }
body.dark-theme #drop-zone.dragover { border-color: var(--primary); background: var(--primary-light); }
body.dark-theme #wh-space { background: #13151f; border-color: var(--border); }
body.dark-theme .modal { background: #1a1d27; }
body.dark-theme .modal h3 { color: var(--text); }
body.dark-theme .modal input { background: #22253a; border-color: var(--border); color: var(--text); }
body.dark-theme .modal-bg { background: rgba(0,0,0,0.7); }
body.dark-theme .stat-card { background: var(--panel-bg); }
body.dark-theme #home-panel { background: var(--bg); }
body.dark-theme #login-box { background: #1a1d27; }
body.dark-theme #login-box .logo { color: var(--primary); }
body.dark-theme .form-group input { background: #22253a; border-color: var(--border); color: var(--text); }
body.dark-theme #mobile-nav { background: #13151f; border-color: var(--border); }
body.dark-theme #mobile-action-sheet { background: #1a1d27; }
body.dark-theme .sheet-handle { background: #3a3d50; }
body.dark-theme .sheet-cancel { background: #22253a; color: var(--text); }
body.dark-theme #mobile-drawer { background: #13151f; }
body.dark-theme #view-toggle-btn { background: #1a1d27; border-color: var(--border); color: var(--text-muted); }
body.dark-theme #view-toggle-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
body.dark-theme .upload-item { background: #22253a; }
body.dark-theme #music-bar { background: #13151f; color: #fff; border-top-color: var(--border); box-shadow: 0 -4px 20px rgba(0,0,0,0.3); }
body.dark-theme #music-bar .track-info::after { background: linear-gradient(to right, transparent, #13151f); }
body.dark-theme #music-bar .track-idx { color: #a8b2c8; }
body.dark-theme #music-bar .ctrl-btn { color: #fff; }
body.dark-theme #music-bar .progress-wrap .time { color: #a8b2c8; }
body.dark-theme #music-bar .progress-bar { background: rgba(255,255,255,0.2); }
body.dark-theme #music-bar .volume-wrap i { color: #a8b2c8; }
body.dark-theme #music-bar .playlist-btn { color: #a8b2c8; }
body.dark-theme #music-bar .playlist-btn:hover { color: #fff; }
body.dark-theme #playlist-panel { background: #1e2533; border-top-color: rgba(255,255,255,0.1); border-left-color: rgba(255,255,255,0.1); }
body.dark-theme #playlist-panel .pl-item { color: #a8b2c8; border-bottom-color: rgba(255,255,255,0.05); }
body.dark-theme #playlist-panel .pl-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* ── 헤더 ── */
#header {
    height: 56px; background: var(--header-bg); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; padding: 0 20px; gap: 16px;
    box-shadow: var(--shadow); z-index: 100; flex-shrink: 0;
}
#header .logo { font-size: 20px; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
#header .logo span { color: var(--accent); }
#header .nav-tabs { display: flex; gap: 4px; margin-left: 8px; }
#header .nav-tabs a {
    padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 500;
    color: var(--text-muted); text-decoration: none; cursor: pointer; transition: all 0.15s;
}
#header .nav-tabs a:hover { background: var(--primary-light); color: var(--primary); }
#header .nav-tabs a.active { background: var(--primary); color: #fff; }
#header .spacer { flex: 1; }
#header .user-info { display: flex; align-items: center; gap: 10px; font-size: 13px; }
#header .user-info .username { font-weight: 600; color: var(--text); }
#header .user-info .username:hover { color: var(--primary); text-decoration: underline; }
#header .btn-logout {
    padding: 5px 12px; border: 1px solid var(--border); border-radius: 6px;
    background: #fff; color: var(--text-muted); font-size: 12px; cursor: pointer;
    transition: all 0.15s;
}
#header .btn-logout:hover { border-color: var(--danger); color: var(--danger); background: rgba(229,62,62,0.08); }

/* ── 메인 레이아웃 ── */
#main { display: flex; flex: 1; overflow: hidden; }

/* ── 사이드바 ── */
#sidebar {
    width: 220px; background: var(--sidebar-bg); color: var(--sidebar-text);
    display: flex; flex-direction: column; overflow-y: auto; flex-shrink: 0;
}
#sidebar .user-card {
    padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
#sidebar .user-card .name { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 4px; }
#sidebar .user-card .space-bar-wrap { margin-top: 8px; }
#sidebar .user-card .space-text { font-size: 11px; color: var(--sidebar-text); margin-bottom: 4px; }
#sidebar .user-card .space-bar { height: 4px; background: rgba(255,255,255,0.15); border-radius: 2px; overflow: hidden; }
#sidebar .user-card .space-bar-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width 0.3s; }
#sidebar .menu { padding: 8px 0; }
#sidebar .menu-label { padding: 12px 16px 4px; font-size: 10px; font-weight: 700; letter-spacing: 1px; color: rgba(255,255,255,0.3); text-transform: uppercase; }
#sidebar .menu a {
    display: flex; align-items: center; gap: 10px; padding: 9px 16px;
    color: var(--sidebar-text); text-decoration: none; font-size: 13px;
    transition: all 0.15s; cursor: pointer; border-left: 3px solid transparent;
}
#sidebar .menu a:hover { background: rgba(255,255,255,0.15); color: #fff; }
#sidebar .menu a.active { background: rgba(255,255,255,0.25); color: #fff; border-left-color: #fff; }
#sidebar .menu a i { width: 16px; text-align: center; font-size: 13px; }

/* ── 콘텐츠 ── */
#content { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.tab-panel { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.tab-panel.active { display: flex; }

/* ── 웹하드 패널 ── */
#wh-container { display: flex; flex: 1; overflow: hidden; }
#wh-left { width: 240px; border-right: 1px solid var(--border); background: var(--panel-bg); overflow-y: auto; flex-shrink: 0; }
#wh-right { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--panel-bg); }

/* 웹하드 상단 툴바 */
#wh-toolbar {
    padding: 10px 16px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
    background: var(--panel-bg);
}
#wh-toolbar .btn {
    padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius);
    background: #fff; font-size: 12px; cursor: pointer; display: flex; align-items: center;
    gap: 5px; color: var(--text); transition: all 0.15s; white-space: nowrap;
}
#wh-toolbar .btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
#wh-toolbar .btn.danger:hover { background: #fff5f5; border-color: var(--danger); color: var(--danger); }
#wh-toolbar .btn i { font-size: 11px; }
#wh-toolbar .path-bar {
    flex: 1; font-size: 12px; color: var(--text-muted);
    padding: 4px 8px; background: var(--bg); border-radius: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 파일 목록 */
#wh-filelist { flex: 1; overflow-y: auto; }
.file-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.file-table th {
    padding: 8px 12px; text-align: left; font-size: 11px; font-weight: 600;
    color: var(--text-muted); border-bottom: 2px solid var(--border);
    background: var(--bg); position: sticky; top: 0; white-space: nowrap;
}
.file-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.file-table tr:hover td { background: var(--primary-light); }
.file-table tr.selected td { background: #dbeafe; }
.file-table .file-icon { width: 28px; text-align: center; color: var(--primary); }
/* 드래그 앤 드롭 스타일 */
.file-table tr[draggable="true"] { cursor: grab; }
.file-table tr[draggable="true"]:active { cursor: grabbing; }
.file-table tr.drag-over td { background: var(--primary-light) !important; outline: 2px dashed var(--primary); outline-offset: -2px; }
.file-table tr.dragging { opacity: 0.4; }
.file-table .file-name { cursor: pointer; }
.file-table .file-name:hover { color: var(--primary); text-decoration: underline; }
.file-table .file-size { color: var(--text-muted); white-space: nowrap; }
.file-table .file-date { color: var(--text-muted); white-space: nowrap; font-size: 12px; }
.file-table .file-actions { text-align: right; white-space: nowrap; }
.file-table .file-actions a { color: var(--text-muted); margin-left: 8px; cursor: pointer; font-size: 12px; }
.file-table .file-actions a:hover { color: var(--primary); }

/* 폴더 트리 */
.dir-tree { padding: 8px 0; }
/* 이전 폴더 행 */
.dir-back-row td { background: var(--hover) !important; }
.dir-back-row:hover td { background: var(--primary-bg) !important; }
/* 트리 토글 아이콘 */
.dir-toggle { transition: transform 0.15s; }
.dir-item {
    display: flex; align-items: center; gap: 6px; padding: 6px 12px;
    cursor: pointer; font-size: 13px; color: var(--text); transition: all 0.15s;
    border-left: 3px solid transparent;
}
.dir-item:hover { background: var(--primary-light); }
.dir-item.active { background: var(--primary-light); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.dir-item i { color: var(--warning); font-size: 14px; }
.dir-item .root { font-weight: 700; color: var(--primary); }

/* 업로드 드롭존 */
#drop-zone {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 24px; text-align: center; color: var(--text-muted);
    font-size: 13px; margin: 12px; transition: all 0.2s;
}
#drop-zone.dragover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
#drop-zone i { font-size: 24px; display: block; margin-bottom: 8px; }

/* 용량 표시 */
#wh-space { padding: 8px 16px; border-top: 1px solid var(--border); background: var(--bg); font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
#wh-space .bar { flex: 1; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
#wh-space .bar-fill { height: 100%; background: var(--primary); border-radius: 3px; }

/* 홈 패널 */
#home-panel { padding: 24px; overflow-y: auto; background: var(--panel-bg); }
#tab-board, #tab-msg, #tab-admin { background: var(--panel-bg); }
#board-content { background: var(--panel-bg); }
#tab-msg > div { background: var(--panel-bg); }
.home-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--panel-bg); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.stat-card .value { font-size: 22px; font-weight: 700; color: var(--primary); }
.stat-card .sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* 로그인 화면 */
#login-wrap {
    position: fixed; inset: 0; background: linear-gradient(135deg, #1e2533 0%, #1a6fc4 100%);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
}
#login-box {
    background: #fff; border-radius: 16px; padding: 40px 36px;
    width: 360px; box-shadow: var(--shadow-lg);
}
#login-box .logo { font-size: 26px; font-weight: 800; color: var(--primary); text-align: center; margin-bottom: 4px; }
#login-box .logo span { color: var(--accent); }
#login-box .subtitle { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }
.form-group input {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px;
    font-size: 14px; outline: none; transition: border-color 0.15s;
}
.form-group input:focus { border-color: var(--primary); }
.btn-primary {
    width: 100%; padding: 11px; background: var(--primary); color: #fff;
    border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background 0.15s; margin-top: 4px;
}
.btn-primary:hover { background: var(--primary-dark); }
.login-error { color: var(--danger); font-size: 13px; text-align: center; margin-top: 10px; min-height: 20px; }

/* 모달 */
.modal-bg {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1000;
    display: none; align-items: center; justify-content: center;
}
.modal-bg.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius); padding: 24px; min-width: 320px; max-width: 480px; box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.modal input {
    width: 100%; padding: 8px 10px; border: 1.5px solid var(--border);
    border-radius: 6px; font-size: 14px; outline: none;
}
.modal input:focus { border-color: var(--primary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn-sm { padding: 7px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid var(--border); background: #fff; transition: all 0.15s; }
.btn-sm.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-sm.primary:hover { background: var(--primary-dark); }
.btn-sm:hover { background: var(--bg); }

/* 토스트 */
#toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
}
.toast-item {
    padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 500;
    color: #fff; box-shadow: var(--shadow-lg); animation: slideIn 0.2s ease;
    display: flex; align-items: center; gap: 8px;
}
.toast-item.success { background: var(--success); }
.toast-item.error   { background: var(--danger); }
.toast-item.info    { background: var(--primary); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 업로드 진행 */
#upload-progress { padding: 0 16px 8px; }
.upload-item { background: var(--bg); border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; font-size: 12px; }
.upload-item .name { margin-bottom: 4px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .bar { height: 4px; background: #e2e8f0; border-radius: 2px; overflow: hidden; }
.upload-item .bar-fill { height: 100%; background: var(--primary); transition: width 0.2s; }

/* ══════════════════════════════════════════
   모바일 UI (768px 이하)
   ══════════════════════════════════════════ */

/* ── 하단 탭바 기본 숨김 (데스크톱) ── */
#mobile-nav { display: none; }

/* ── 모바일 FAB (업로드 버튼) ── */
#mobile-fab {
    display: none;
    position: fixed;
    bottom: 74px; right: 18px;
    width: 52px; height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #5b6ef5);
    color: #fff; font-size: 24px;
    border: none; cursor: pointer;
    box-shadow: 0 6px 20px rgba(26,111,196,0.45);
    align-items: center; justify-content: center;
    z-index: 400;
    transition: transform 0.15s, box-shadow 0.15s;
}
#mobile-fab:active { transform: scale(0.93); box-shadow: 0 3px 10px rgba(26,111,196,0.35); }

/* ── 모바일 액션시트 ── */
#mobile-action-sheet-bg {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 450;
    animation: fadeIn 0.2s ease;
}
#mobile-action-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--panel-bg);
    border-radius: 22px 22px 0 0;
    padding: 12px 20px 40px;
    z-index: 451;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
    animation: slideUp 0.25s ease;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
#mobile-action-sheet .sheet-handle {
    width: 36px; height: 4px;
    background: var(--border); border-radius: 2px;
    margin: 0 auto 18px;
}
#mobile-action-sheet .sheet-title {
    font-size: 11px; font-weight: 700;
    letter-spacing: 1.5px; color: var(--text-muted);
    text-transform: uppercase; margin-bottom: 16px;
}
.sheet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px; margin-bottom: 14px;
}
.sheet-item {
    display: flex; flex-direction: column;
    align-items: center; gap: 7px;
    cursor: pointer;
}
.sheet-icon {
    width: 54px; height: 54px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.sheet-icon.blue  { background: rgba(26,111,196,0.1);  color: var(--primary); }
.sheet-icon.green { background: rgba(56,161,105,0.1);  color: var(--success); }
.sheet-icon.yellow{ background: rgba(214,158,46,0.1);  color: var(--warning); }
.sheet-icon.red   { background: rgba(229,62,62,0.1);   color: var(--danger); }
.sheet-item span  { font-size: 11px; color: var(--text-muted); text-align: center; }
.sheet-cancel {
    width: 100%; padding: 14px;
    background: var(--bg); border-radius: 12px;
    border: none; font-size: 14px; font-weight: 500;
    color: var(--text); cursor: pointer; margin-top: 4px;
}

/* ── 모바일 드로어 ── */
#mobile-drawer-bg {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 600;
    animation: fadeIn 0.2s ease;
}
#mobile-drawer {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    background: var(--sidebar-bg);
    z-index: 601;
    display: flex; flex-direction: column;
    animation: slideRight 0.25s ease;
    overflow-y: auto;
}
@keyframes slideRight {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}
#mobile-drawer .drawer-user {
    padding: 50px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
#mobile-drawer .drawer-avatar {
    width: 46px; height: 46px; border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #5b6ef5);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff; margin-bottom: 10px;
}
#mobile-drawer .drawer-name {
    font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 2px;
}
#mobile-drawer .drawer-id {
    font-size: 11px; color: var(--sidebar-text);
}
#mobile-drawer .drawer-space {
    margin-top: 10px;
}
#mobile-drawer .drawer-space-text {
    font-size: 10px; color: var(--sidebar-text); margin-bottom: 4px;
}
#mobile-drawer .drawer-space-bar {
    height: 4px; background: rgba(255,255,255,0.15);
    border-radius: 2px; overflow: hidden;
}
#mobile-drawer .drawer-space-fill {
    height: 100%; background: var(--primary); border-radius: 2px;
}
#mobile-drawer .drawer-menu { padding: 10px 0; }
#mobile-drawer .drawer-menu-label {
    padding: 10px 18px 4px;
    font-size: 10px; font-weight: 700;
    letter-spacing: 1px; color: rgba(255,255,255,0.3);
    text-transform: uppercase;
}
#mobile-drawer .drawer-menu a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 18px;
    color: var(--sidebar-text); text-decoration: none;
    font-size: 13px; cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
#mobile-drawer .drawer-menu a:hover,
#mobile-drawer .drawer-menu a.active {
    background: rgba(255,255,255,0.2);
    color: #fff; border-left-color: #fff;
}
#mobile-drawer .drawer-menu a i { width: 18px; text-align: center; }
#mobile-drawer .drawer-footer {
    margin-top: auto; padding: 16px 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
#mobile-drawer .drawer-logout {
    width: 100%; padding: 10px;
    background: rgba(229,62,62,0.15);
    border: 1px solid rgba(229,62,62,0.3);
    border-radius: 10px; color: #fc8181;
    font-size: 13px; cursor: pointer;
}

@media (max-width: 768px) {

    /* ── 헤더 단순화 ── */
    #header {
        padding: 0 14px;
        height: 52px;
    }
    #header .nav-tabs { display: none; }
    #header .user-info .username { display: none; }
    #header .btn-logout { display: none; }
    #header .logo { font-size: 18px; }

    /* ── 사이드바 숨김 ── */
    #sidebar { display: none; }

    /* ── 하단 탭바 활성화 ── */
    #mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 62px;
        background: var(--panel-bg);
        border-top: 1px solid var(--border);
        align-items: center;
        justify-content: space-around;
        padding: 0 8px 6px;
        z-index: 300;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
    }
    #mobile-nav a {
        display: flex; flex-direction: column;
        align-items: center; gap: 3px;
        flex: 1; cursor: pointer;
        padding-top: 6px;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 9px; letter-spacing: 0.3px;
        border-radius: 10px;
        transition: color 0.15s;
    }
    #mobile-nav a i { font-size: 19px; line-height: 1; }
    #mobile-nav a.active { color: var(--primary); }
    #mobile-nav a.active i { color: var(--primary); }

    /* ── FAB 표시 ── */
    #mobile-fab { display: flex; }

    /* ── 본문 하단 여백 (탭바 높이 확보) ── */
    #main { padding-bottom: 62px; }
    #music-bar { bottom: 62px; }

    /* ── 웹하드: 폴더트리 숨김, 파일 목록 전체폭 ── */
    #wh-left { display: none; }
    #wh-container { flex-direction: column; }
    #wh-right { width: 100%; }

    /* ── 툴바 버튼 숨기고 경로바만 표시 ── */
    #wh-toolbar .btn { display: none; }
    #wh-toolbar { padding: 8px 12px; gap: 6px; }
    #wh-toolbar .path-bar {
        flex: 1; font-size: 12px;
        background: var(--bg); padding: 6px 10px;
        border-radius: 8px;
    }
    /* 뒤로가기 버튼 (모바일 전용) */
    #mobile-back-btn {
        display: flex !important;
        align-items: center; gap: 4px;
        font-size: 13px; color: var(--primary);
        cursor: pointer; padding: 4px 8px;
        border-radius: 8px; white-space: nowrap;
        background: var(--primary-light);
        border: none;
    }

    /* ── 드롭존 숨김 (모바일은 FAB으로 업로드) ── */
    #drop-zone { display: none; }

    /* ── 파일 테이블 → 카드형 리스트 ── */
    .file-table thead { display: none; }
    .file-table, .file-table tbody,
    .file-table tr, .file-table td { display: block; width: 100%; }

    .file-table tr {
        display: flex; align-items: center;
        padding: 10px 14px;
        border-bottom: 1px solid var(--border);
        gap: 10px;
        position: relative;
    }
    .file-table tr:hover td { background: transparent; }
    .file-table tr:active { background: var(--primary-light); }

    /* 체크박스 셀 */
    .file-table td:nth-child(1) {
        width: 20px; flex-shrink: 0; padding: 0;
    }
    /* 아이콘 셀 */
    .file-table td:nth-child(2) {
        width: 38px; height: 38px; flex-shrink: 0; padding: 0;
        background: var(--primary-light);
        border-radius: 10px;
        display: flex; align-items: center; justify-content: center;
        font-size: 18px;
    }
    /* 이름 셀 */
    .file-table td:nth-child(3) {
        flex: 1; padding: 0;
        min-width: 0;
    }
    .file-table td:nth-child(3) .file-name {
        font-size: 13px; font-weight: 500;
        display: block;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    /* 크기, 날짜를 이름 아래 소형 텍스트로 */
    .file-table .file-size,
    .file-table .file-date {
        display: inline; font-size: 11px; color: var(--text-muted);
    }
    .file-table .file-size::after { content: ' · '; }
    /* 크기/날짜 셀 숨김 (이름 셀 밑에 통합 표시) */
    .file-table td:nth-child(4),
    .file-table td:nth-child(5) { display: none; }
    /* 액션 셀 */
    .file-table td:nth-child(6) {
        width: 30px; flex-shrink: 0; padding: 0;
        text-align: right;
    }
    .file-table .file-actions a { font-size: 16px; margin: 0; }
    /* 액션 중 첫 번째(더보기 ⋯)만 표시, 나머지 숨김 */
    .file-table .file-actions a { display: none; }
    .file-table .file-actions a:first-child { display: inline; font-size: 18px; color: var(--text-muted); }

    /* 롱프레스 선택 모드 힌트 */
    .file-table tr { -webkit-user-select: none; user-select: none; }

    /* ── 홈 통계 그리드 ── */
    .home-stats { grid-template-columns: repeat(2, 1fr); }
    #home-panel { padding: 16px; }

    /* ── 모달 ── */
    .modal {
        width: calc(100% - 40px) !important;
        margin: 0 20px;
        border-radius: 18px !important;
    }

    /* ── 음악 플레이어 ── */
    #music-bar { padding: 0 14px; gap: 10px; }
    #music-bar .track-info { width: 140px; }
    #music-bar .vol-wrap { display: none; }

    /* ── 동영상 플레이어 오버레이 ── */
    #video-overlay { border-radius: 0 !important; }

    /* ── 메세지/게시판 패널 여백 ── */
    #msg-panel, #board-panel { padding: 12px; }
}

/* ══ body.mobile-view : 수동 모바일 모드 (PC에서도 적용) ══ */
body.mobile-view #header .nav-tabs { display: none; }
body.mobile-view #header .user-info .username { display: none; }
body.mobile-view #header .btn-logout { display: none; }
body.mobile-view #header .logo { font-size: 20px; }
body.mobile-view #header { height: 52px; padding: 0 14px; }
body.mobile-view #theme-toggle-btn { display: none; }
body.mobile-view #view-toggle-btn { display: none; }
/* PWA 설치 버튼 */
#pwa-install-btn {
    display: none; align-items: center; gap: 5px;
    padding: 5px 11px; border-radius: 8px;
    border: 1px solid var(--primary);
    background: var(--primary); color: #fff;
    font-size: 12px; cursor: pointer;
    transition: all 0.15s; white-space: nowrap;
}
#pwa-install-btn:hover { background: var(--primary-dark); }
body.mobile-view #mobile-menu-btn { display: inline-flex !important; }
body.mobile-view #sidebar { display: none; }
body.mobile-view #mobile-nav { display: flex !important; position: fixed; bottom: 0; left: 0; right: 0; height: 66px; background: var(--panel-bg); border-top: 1px solid var(--border); align-items: center; justify-content: space-around; padding: 0 8px 8px; z-index: 300; box-shadow: 0 -4px 20px rgba(0,0,0,0.1); }
body.mobile-view #mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; cursor: pointer; padding-top: 8px; text-decoration: none; color: var(--text-muted); font-size: 10px; letter-spacing: 0.3px; border-radius: 10px; transition: color 0.15s; }
body.mobile-view #mobile-nav a i { font-size: 22px; line-height: 1; }
body.mobile-view #mobile-nav a.active { color: var(--primary); }
body.mobile-view #mobile-fab { display: flex; bottom: 82px; width: 56px; height: 56px; font-size: 26px; }
body.mobile-view #main { padding-bottom: 66px; }
body.mobile-view #music-bar { bottom: 66px; }
body.mobile-view #wh-left { display: none; }
body.mobile-view #wh-container { flex-direction: column; }
body.mobile-view #wh-right { width: 100%; }
body.mobile-view #wh-toolbar .btn { display: none; }
body.mobile-view #wh-toolbar { padding: 8px 14px; gap: 6px; background: var(--panel-bg); border-bottom: 1px solid var(--border); }
body.mobile-view #mobile-back-btn { display: flex !important; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--primary); cursor: pointer; padding: 6px 12px; border-radius: 10px; white-space: nowrap; background: var(--primary-light); border: none; }
body.mobile-view #drop-zone { display: none; }
body.mobile-view .file-table thead { display: none; }
body.mobile-view .file-table, body.mobile-view .file-table tbody, body.mobile-view .file-table tr, body.mobile-view .file-table td { display: block; width: 100%; }
body.mobile-view .file-table tr { display: flex; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--border); gap: 14px; position: relative; min-height: 68px; }
body.mobile-view .file-table tr:active { background: var(--primary-light); }
body.mobile-view .file-table td:nth-child(1) { width: 22px; flex-shrink: 0; padding: 0; }
body.mobile-view .file-table td:nth-child(2) { width: 48px; height: 48px; flex-shrink: 0; padding: 0; background: var(--primary-light); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
body.mobile-view .file-table td:nth-child(3) { flex: 1; padding: 0; min-width: 0; }
body.mobile-view .file-table td:nth-child(3) .file-name { font-size: 15px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; color: var(--text); }
body.mobile-view .file-table .file-size, body.mobile-view .file-table .file-date { display: inline; font-size: 12px; color: var(--text-muted); }
body.mobile-view .file-table .file-size::after { content: ' · '; }
body.mobile-view .file-table td:nth-child(4), body.mobile-view .file-table td:nth-child(5) { display: none; }
body.mobile-view .file-table td:nth-child(6) { width: 36px; flex-shrink: 0; padding: 0; text-align: right; }
body.mobile-view .file-table .file-actions a { display: none; }
body.mobile-view .file-table .file-actions a:first-child { display: inline; font-size: 22px; color: var(--text-muted); padding: 4px; }
body.mobile-view .home-stats { grid-template-columns: repeat(2, 1fr); }
body.mobile-view #home-panel { padding: 16px; }
body.mobile-view .modal { width: calc(100% - 40px) !important; margin: 0 20px; border-radius: 18px !important; }
body.mobile-view #music-bar { padding: 0 14px; gap: 10px; }
body.mobile-view #music-bar .track-info { width: 140px; }
body.mobile-view #music-bar .vol-wrap { display: none; }

/* ══ body.pc-view : 수동 PC 모드 (모바일에서도 PC UI 강제) ══ */
body.pc-view #mobile-nav { display: none !important; }
body.pc-view #mobile-fab { display: none !important; }
body.pc-view #mobile-menu-btn { display: none !important; }
body.pc-view #sidebar { display: flex !important; }
body.pc-view #header .nav-tabs { display: flex !important; }
body.pc-view #header .user-info .username { display: inline !important; }
body.pc-view #header .btn-logout { display: inline-block !important; }
body.pc-view #wh-left { display: block !important; }
body.pc-view #drop-zone { display: block; }
body.pc-view #wh-toolbar .btn { display: flex !important; }
body.pc-view #mobile-back-btn { display: none !important; }
body.pc-view .file-table thead { display: table-header-group !important; }
body.pc-view .file-table { display: table !important; }
body.pc-view .file-table tbody { display: table-row-group !important; }
body.pc-view .file-table tr { display: table-row !important; }
body.pc-view .file-table td { display: table-cell !important; }
body.pc-view .mobile-meta { display: none !important; }
body.pc-view #music-bar { bottom: 0; }
body.pc-view #main { padding-bottom: 0; }

/* ── 뷰 전환 버튼 ── */
#view-toggle-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff; color: var(--text-muted);
    font-size: 12px; cursor: pointer;
    transition: all 0.15s; white-space: nowrap;
}
#view-toggle-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
#view-toggle-btn i { font-size: 13px; }

/* ── 테마 토글 버튼 hover ── */
#theme-toggle-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--panel-bg); color: var(--text-muted);
    font-size: 12px; cursor: pointer;
    transition: all 0.15s; white-space: nowrap;
}
#theme-toggle-btn:hover { border-color: var(--warning); color: var(--warning); background: rgba(214,158,46,0.1); }

/* ── 음악 플레이어 바 ── */
#music-bar {
    position: fixed; bottom: 0; left: 0; right: 0; height: 72px;
    background: var(--panel-bg); color: var(--text); display: none; align-items: center;
    padding: 0 20px; gap: 16px; z-index: 500; box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    flex-shrink: 0; border-top: 1px solid var(--border);
}
#music-bar.show { display: flex; }

/* ── min-width: 180px; max-width: 220px;  ── */
/* ──      효과 테스트 시작         ── */
#music-bar .track-info { width: 220px; overflow: hidden; position: relative; }
/* 우측 페이드 효과 */
#music-bar .track-info::after {
    content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 24px;
    background: linear-gradient(to right, transparent, var(--panel-bg));
    pointer-events: none; z-index: 1;
}
#music-bar .track-title {
    font-size: 13px; font-weight: 600; white-space: nowrap;
    display: inline-block;
    animation: mp-marquee 12s linear infinite;
    animation-play-state: paused;
}
#music-bar .track-title.marquee-on { animation-play-state: running; }
@keyframes mp-marquee {
    0%,20%  { transform: translateX(0); }
    80%,100% { transform: translateX(var(--marquee-dist, -60%)); }
}
/* ──          효과 테스트 끝       ── */

#music-bar .track-idx { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
#music-bar .controls { display: flex; align-items: center; gap: 10px; }
#music-bar .ctrl-btn {
    background: none; border: none; color: var(--text); cursor: pointer;
    font-size: 18px; padding: 4px 6px; opacity: 0.8; transition: opacity 0.15s;
}
#music-bar .ctrl-btn:hover { opacity: 1; }
#music-bar .ctrl-btn.play { font-size: 26px; }
#music-bar .ctrl-btn.active { color: var(--primary); opacity: 1; }
#music-bar .progress-wrap { flex: 1; display: flex; align-items: center; gap: 8px; }
#music-bar .progress-wrap .time { font-size: 11px; color: var(--text-muted); white-space: nowrap; min-width: 36px; }
#music-bar .progress-bar {
    flex: 1; height: 4px; background: var(--border); border-radius: 2px;
    cursor: pointer; position: relative;
}
#music-bar .progress-fill { height: 100%; background: var(--primary); border-radius: 2px; pointer-events: none; }
#music-bar .volume-wrap { display: flex; align-items: center; gap: 6px; }
#music-bar .volume-wrap i { font-size: 14px; color: var(--text-muted); }
#music-bar .volume-wrap input[type=range] { width: 70px; accent-color: var(--primary); cursor: pointer; }
#music-bar .playlist-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 4px 8px; }
#music-bar .playlist-btn:hover { color: var(--text); }
/* 플레이리스트 패널 */
#playlist-panel {
    position: fixed; bottom: 72px; right: 0; width: 300px; max-height: 400px;
    background: var(--panel-bg); border-top: 1px solid var(--border);
    border-left: 1px solid var(--border); overflow-y: auto;
    display: none; z-index: 499; box-shadow: -4px -4px 20px rgba(0,0,0,0.1);
}
#playlist-panel.show { display: block; }
#playlist-panel .pl-item {
    padding: 10px 14px; font-size: 13px; color: var(--text); cursor: pointer;
    border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#playlist-panel .pl-item:hover { background: var(--primary-light); color: var(--primary); }
#playlist-panel .pl-item.active { color: var(--primary); font-weight: 600; }
#playlist-panel .pl-item .pl-num { min-width: 20px; font-size: 11px; text-align: right; }
/* 동영상 플레이어 */
/* ── 동영상 플레이어 ── */
#video-player-wrap {
    position: fixed; inset: 0; background: #000; z-index: 800;
    display: none; flex-direction: row;
}
#video-player-wrap.show { display: flex; }
#video-main { flex: 1; display: flex; flex-direction: column; position: relative; overflow: hidden; }
/* 제목 */
#vp-title-bar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 10;
    padding: 12px 16px; background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    color: #fff; font-size: 14px; font-weight: 600;
    opacity: 0; transition: opacity 0.3s; pointer-events: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#video-main.show-controls #vp-title-bar { opacity: 1; }
/* 비디오 */
#vp-video { flex: 1; width: 100%; height: 100%; object-fit: contain; background: #000; cursor: pointer; }
/* 터치 제스처 레이어 — 비디오 위에 투명하게 덮어 브라우저 기본 터치 차단 */
#vp-touch-layer {
    position: absolute; inset: 0; z-index: 5;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
}
/* 밝기 오버레이 */
#vp-brightness-overlay {
    position: absolute; inset: 0; background: #000;
    opacity: 0; pointer-events: none; z-index: 2; transition: opacity 0.1s;
}
/* 중앙 HUD */
#vp-hud {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    font-size: 48px; opacity: 0; pointer-events: none; z-index: 10;
    transition: opacity 0.3s;
}
/* 좌/우 슬라이더 */
.vp-side-slider {
    position: absolute; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: rgba(0,0,0,0.6); border-radius: 20px; padding: 12px 8px;
    opacity: 0; pointer-events: none; z-index: 10; transition: opacity 0.2s;
    min-width: 36px;
}
.vp-side-slider.show { opacity: 1; }
#vp-brightness-slider { left: 16px; }
#vp-volume-slider { right: 16px; }
.vp-side-slider .sl-icon { font-size: 18px; }
.vp-side-slider .sl-bar-bg {
    width: 6px; height: 120px; background: rgba(255,255,255,0.2);
    border-radius: 3px; position: relative; overflow: hidden;
}
.vp-side-slider .sl-bar-fill {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: var(--primary); border-radius: 3px; transition: height 0.1s;
}
.vp-side-slider .sl-val { font-size: 11px; color: #fff; font-weight: 600; }
/* 화면 잠금 오버레이 */
#vp-lock-overlay {
    position: absolute; inset: 0;
    display: none; align-items: center; justify-content: center;
    z-index: 20; pointer-events: none;
}
#vp-lock-overlay.show { display: flex; pointer-events: auto; }
#vp-lock-overlay .lock-box {
    background: rgba(0,0,0,0.7); border-radius: 16px;
    padding: 20px 32px; display: flex; flex-direction: column;
    align-items: center; gap: 8px; color: #fff;
    pointer-events: auto;
    transition: opacity 0.5s;
}
#vp-lock-overlay .lock-box.fade { opacity: 0; }
#vp-lock-overlay .lock-icon { font-size: 48px; }
#vp-lock-overlay p { font-size: 16px; margin: 0; }
#vp-lock-overlay button {
    padding: 8px 20px; background: var(--primary); color: #fff;
    border: none; border-radius: 8px; font-size: 14px; cursor: pointer;
}
/* 컨트롤 바 */
#video-controls {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
    padding: 0 12px 10px; background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    opacity: 0; transition: opacity 0.3s;
}
#video-main.show-controls #video-controls { opacity: 1; }
/* 진행바 */
.vp-progress-wrap { padding: 8px 0 4px; cursor: pointer; }
.vp-progress-bg { height: 4px; background: rgba(255,255,255,0.25); border-radius: 2px; position: relative; transition: height 0.15s; }
.vp-progress-wrap:hover .vp-progress-bg { height: 6px; }
.vp-progress-fill { height: 100%; background: var(--primary); border-radius: 2px; pointer-events: none; }
/* 컨트롤 버튼 행 */
.vp-ctrl-row { display: flex; align-items: center; justify-content: space-between; }
.vp-ctrl-left, .vp-ctrl-right { display: flex; align-items: center; gap: 4px; }
.vp-btn { background: none; border: none; color: #fff; cursor: pointer; font-size: 18px; padding: 6px 8px; opacity: 0.9; transition: opacity 0.15s; }
.vp-btn:hover { opacity: 1; }
.vp-btn.active { color: var(--primary); }
.vp-time { font-size: 12px; color: #ccc; padding: 0 6px; white-space: nowrap; }
.vp-speed-btn { font-size: 13px; font-weight: 700; background: rgba(255,255,255,0.15); border: none; color: #fff; padding: 3px 8px; border-radius: 4px; cursor: pointer; }
/* 배속 팝업 */
#vp-speed-popup {
    position: absolute; bottom: 70px; right: 80px;
    background: rgba(20,20,20,0.95); border-radius: 8px; overflow: hidden;
    display: none; z-index: 20; min-width: 100px; box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
#vp-speed-popup.show { display: block; }
.vp-speed-opt {
    display: block; width: 100%; padding: 10px 16px; background: none; border: none;
    color: #ccc; cursor: pointer; font-size: 13px; text-align: left; transition: background 0.1s;
}
.vp-speed-opt:hover { background: rgba(255,255,255,0.1); color: #fff; }
.vp-speed-opt.active { color: var(--primary); font-weight: 700; }
/* 사이드바 */
#video-sidebar {
    width: 260px; background: #111; border-left: 1px solid #333;
    display: flex; flex-direction: column; overflow: hidden;
    transition: width 0.2s;
}
#video-sidebar.hidden { width: 0; }
#video-sidebar .vs-header {
    padding: 14px 16px; border-bottom: 1px solid #333;
    display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
#video-sidebar .vs-header span { font-size: 13px; font-weight: 700; color: #fff; }
#video-sidebar .vs-header button { background: none; border: none; color: #888; cursor: pointer; font-size: 16px; }
#video-sidebar .vs-header button:hover { color: #fff; }
#video-sidebar .ep-list { flex: 1; overflow-y: auto; }
#video-sidebar .ep-item {
    padding: 10px 14px; font-size: 13px; color: #888; cursor: pointer;
    border-bottom: 1px solid #1a1a1a; display: flex; align-items: center; gap: 8px;
}
#video-sidebar .ep-item:hover { background: #1a1a1a; color: #fff; }
#video-sidebar .ep-item.active { color: var(--primary); font-weight: 600; background: #0d1520; }
#video-sidebar .ep-item .ep-num { min-width: 24px; font-size: 11px; color: #555; }
#video-sidebar .ep-item .ep-resume { font-size: 10px; color: var(--primary); margin-top: 2px; }

/* ── 모바일: 비디오 컨트롤러 항상 표시 + 크기 확대 ── */
@media (max-width: 768px), (max-height: 500px) {
    #video-controls { opacity: 1 !important; padding: 0 10px 14px !important; }
    #vp-title-bar { opacity: 1 !important; font-size: 13px !important; padding: 10px 14px !important; }
    .vp-btn { font-size: 24px !important; padding: 10px 12px !important; min-width: 44px !important; min-height: 44px !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; }
    .vp-time { font-size: 14px !important; }
    .vp-speed-btn { font-size: 15px !important; padding: 6px 12px !important; min-height: 44px !important; }
    .vp-progress-bg { height: 6px !important; }
    .vp-progress-wrap { padding: 12px 0 6px !important; }
}

