/* SuperPlay 文件库 —— 主样式表 */

:root {
    --bg: #f4f6fa;
    --panel: #ffffff;
    --border: #e3e8f0;
    --border-strong: #cfd8e6;
    --text: #1f2733;
    --text-soft: #64748b;
    --text-faint: #94a3b8;
    --primary: #2b6cff;
    --primary-dark: #1d54d8;
    --primary-soft: #eaf1ff;
    --danger: #e5484d;
    --danger-soft: #fdecec;
    --ok: #16a34a;
    --ok-soft: #e9f8ef;
    --warn: #d97706;
    --warn-soft: #fef4e6;
    --topbar: #1b2432;
    --topbar-soft: #2a3648;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .06);
    --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c9d3e2; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aab8cd; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 布局 ---------------- */

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.layout {
    flex: 1;
    display: flex;
    min-height: 0;
}

.sidebar {
    width: 236px;
    flex: 0 0 236px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.rightpanel {
    width: 42%;
    min-width: 340px;
    max-width: 50%;
    flex: 0 0 42%;
    border-left: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ---------------- 顶栏 ---------------- */

.topbar {
    flex: 0 0 auto;
    height: 56px;
    background: var(--topbar);
    color: #e8eef8;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .2);
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: .2px;
}

.brand .logo {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #7c3aed);
    display: grid; place-items: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.brand .badge {
    font-size: 11px;
    font-weight: 500;
    color: #9fb3d1;
    background: var(--topbar-soft);
    border: 1px solid #3a4759;
    padding: 1px 7px;
    border-radius: 20px;
}

.searchbox {
    flex: 1 1 auto;
    max-width: 460px;
    display: flex;
    align-items: center;
    background: var(--topbar-soft);
    border: 1px solid #3a4759;
    border-radius: 8px;
    padding: 0 4px 0 10px;
    transition: border-color .15s, box-shadow .15s;
}

.searchbox:focus-within {
    border-color: #4d7cff;
    box-shadow: 0 0 0 3px rgba(77, 124, 255, .2);
}

.searchbox svg { flex: 0 0 auto; opacity: .6; }

.searchbox input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: #e8eef8;
    padding: 8px 6px;
    min-width: 0;
}

.searchbox input::placeholder { color: #8b9cb5; }

.searchbox .clear {
    background: transparent; border: 0; color: #8b9cb5;
    cursor: pointer; padding: 4px 8px; border-radius: 6px; display: none;
}
.searchbox.has-value .clear { display: block; }
.searchbox .clear:hover { color: #fff; background: rgba(255, 255, 255, .1); }

.topbar .spacer { flex: 1 1 auto; }

.topbar .actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

/* ---------------- 按钮 ---------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.35;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    user-select: none;
}

.btn:hover { background: #f1f5fb; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-ghost {
    background: transparent;
    border-color: #3a4759;
    color: #cfdbec;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .09); color: #fff; }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #cf3b40; border-color: #cf3b40; }

.btn-outline { background: #fff; border-color: var(--border-strong); }
.btn-outline:hover { background: #f1f5fb; border-color: #b8c5d8; }

.btn-sm { padding: 4px 9px; font-size: 12.5px; border-radius: 5px; }
.btn-block { width: 100%; }

.btn-icon { padding: 5px 7px; background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-icon:hover { background: #eef2f8; color: var(--text); }

/* ---------------- 侧栏目录树 ---------------- */

.side-head {
    flex: 0 0 auto;
    padding: 12px 14px 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .6px;
    color: var(--text-faint);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tree {
    flex: 1 1 auto;
    overflow: auto;
    padding: 0 8px 16px;
    font-size: 13px;
}

.tree-node { margin: 1px 0; }

.tree-row {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text);
    position: relative;
    white-space: nowrap;
}

.tree-row:hover { background: #eff4fc; }
.tree-row.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }

.tree-row .caret {
    width: 16px; height: 16px;
    flex: 0 0 16px;
    display: grid; place-items: center;
    color: var(--text-faint);
    transition: transform .15s;
    border-radius: 4px;
}

.tree-row .caret:hover { background: rgba(0, 0, 0, .06); }
.tree-row .caret.open { transform: rotate(90deg); }
.tree-row .caret.leaf { visibility: hidden; }

.tree-row .ico { flex: 0 0 auto; opacity: .85; }
.tree-row .label { overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }

.tree-children { margin-left: 14px; border-left: 1px dashed var(--border); padding-left: 3px; }

.tree-empty { color: var(--text-faint); padding: 4px 10px; font-size: 12.5px; }

/* ---------------- 路径栏 / 工具栏 ---------------- */

.crumbs {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 11px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    min-height: 45px;
}

.crumbs .crumb {
    padding: 3px 8px;
    border-radius: 5px;
    color: var(--text-soft);
    cursor: pointer;
    background: transparent;
    border: 0;
    font-size: 13.5px;
}

.crumbs .crumb:hover { background: #eef2f8; color: var(--text); }
.crumbs .crumb.last { color: var(--text); font-weight: 600; }
.crumbs .sep { color: var(--text-faint); font-size: 12px; }

.crumbs .meta {
    margin-left: auto;
    font-size: 12.5px;
    color: var(--text-faint);
    white-space: nowrap;
}

.toolbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: #fafbfd;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.toolbar .tool {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: #fff;
    cursor: pointer;
    color: var(--text-soft);
}

.toolbar .tool:hover { background: #f1f5fb; color: var(--text); border-color: #b8c5d8; }
.toolbar .tool.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.toolbar .tool.primary:hover { background: var(--primary-dark); }
.toolbar .tool.danger:hover { background: var(--danger-soft); color: var(--danger); border-color: #f3c2c3; }
.toolbar .grow { flex: 1 1 auto; }
.toolbar .selinfo { font-size: 12.5px; color: var(--text-soft); }

/* ---------------- 文件列表 ---------------- */

.listwrap {
    flex: 1 1 auto;
    overflow: auto;
    min-height: 0;
}

table.files {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--panel);
}

table.files thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-faint);
    letter-spacing: .4px;
    padding: 9px 12px;
    background: #f7f9fc;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    user-select: none;
}

table.files thead th.sortable { cursor: pointer; }
table.files thead th.sortable:hover { color: var(--text); }
table.files thead th .arrow { font-size: 10px; opacity: .8; }

table.files tbody tr { cursor: default; }
table.files tbody tr:hover { background: #f7faff; }
table.files tbody tr.selected { background: var(--primary-soft); }
table.files tbody tr.dragover { background: #dbeafe; outline: 1px dashed var(--primary); outline-offset: -2px; }

table.files td {
    padding: 7px 12px;
    border-bottom: 1px solid #f0f3f8;
    vertical-align: middle;
    font-size: 13.5px;
}

table.files td.name { display: flex; align-items: center; gap: 8px; min-width: 0; }
table.files td.name .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
table.files td.name .fname:hover { color: var(--primary); text-decoration: underline; }
table.files td.size, table.files td.time { color: var(--text-soft); font-size: 12.5px; white-space: nowrap; }
table.files td.ops { text-align: right; white-space: nowrap; width: 1%; }

table.files td.ops .op { opacity: 0; transition: opacity .12s; }
table.files tbody tr:hover td.ops .op,
table.files tbody tr.selected td.ops .op { opacity: 1; }

.fileicon {
    width: 20px; height: 20px;
    flex: 0 0 20px;
    display: grid; place-items: center;
    font-size: 15px;
    line-height: 1;
}

.empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-faint);
}
.empty .big { font-size: 40px; margin-bottom: 10px; opacity: .5; }

/* ---------------- 右侧面板卡片 ---------------- */

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card:first-child { margin-top: 12px; }

.card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border-bottom: 1px solid var(--border);
    background: #fbfcfe;
    min-height: 43px;
}

.card-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 7px;
}

.card-head .sub { font-size: 12px; color: var(--text-faint); font-weight: 400; }

.card-body { padding: 13px; }
.card-body.tight { padding: 9px 13px; }

.meta-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    font-size: 13px;
}

.meta-grid dt { color: var(--text-faint); white-space: nowrap; }
.meta-grid dd { margin: 0; word-break: break-all; }

.stat-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.stat {
    flex: 1 1 90px;
    background: #f7f9fc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}

.stat .v { font-size: 16px; font-weight: 600; }
.stat .k { font-size: 11.5px; color: var(--text-faint); margin-top: 1px; }

.note-render {
    font-size: 13.5px;
    line-height: 1.7;
    word-break: break-word;
    color: #2b3543;
    white-space: pre-wrap;
    max-height: 320px;
    overflow: auto;
}

.note-render h1, .note-render h2, .note-render h3 { margin: .6em 0 .35em; line-height: 1.35; }
.note-render h1 { font-size: 17px; }
.note-render h2 { font-size: 15.5px; }
.note-render h3 { font-size: 14px; }
.note-render p { margin: .5em 0; }
.note-render ul, .note-render ol { margin: .5em 0; padding-left: 1.4em; }
.note-render code {
    background: #f1f4f9;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .92em;
}
.note-render pre {
    background: #f7f9fc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    overflow: auto;
}
.note-render pre code { background: none; border: 0; padding: 0; }
.note-render a { word-break: break-all; }
.note-render blockquote {
    margin: .5em 0;
    padding: .1em 0 .1em 10px;
    border-left: 3px solid var(--border-strong);
    color: var(--text-soft);
}
.note-render hr { border: 0; border-top: 1px solid var(--border); margin: .8em 0; }
.note-render table { border-collapse: collapse; margin: .5em 0; }
.note-render th, .note-render td { border: 1px solid var(--border); padding: 4px 8px; }

.note-empty { color: var(--text-faint); font-size: 13px; }
.note-stamp { font-size: 11.5px; color: var(--text-faint); margin-top: 8px; }

.recent-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.recent-list li {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 2px;
    border-bottom: 1px dashed #eef1f6;
}
.recent-list li:last-child { border-bottom: 0; }
.recent-list .r-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.recent-list .r-name:hover { color: var(--primary); }
.recent-list .r-size { color: var(--text-faint); font-size: 12px; white-space: nowrap; }

.preview-box {
    background: #f7f9fc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    min-height: 120px;
    overflow: auto;
    padding: 8px;
}

.preview-box img, .preview-box video {
    max-width: 100%;
    max-height: 380px;
    border-radius: 6px;
    display: block;
}

.preview-box audio { width: 100%; }
.preview-box iframe { width: 100%; height: 460px; border: 0; background: #fff; border-radius: 6px; }
.preview-box pre {
    margin: 0;
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 420px;
    overflow: auto;
}

.btnrow { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; }

/* ---------------- 编辑器 ---------------- */

.editor-wrap { display: flex; flex-direction: column; }

.editor-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    background: #fbfcfe;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.editor-bar .fname { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-bar .grow { flex: 1 1 auto; }
.editor-bar .hint { font-size: 11.5px; color: var(--text-faint); }

.CodeMirror {
    height: auto;
    min-height: 320px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.6;
}

#app.editor-fullscreen .editor-card {
    position: fixed;
    inset: 0;
    margin: 0;
    border-radius: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}
#app.editor-fullscreen .editor-card .card-body { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; padding: 0; }
#app.editor-fullscreen .editor-card .editor-wrap { flex: 1 1 auto; min-height: 0; }
#app.editor-fullscreen .editor-card .CodeMirror { flex: 1 1 auto; min-height: 0; height: 100%; }
#app.editor-fullscreen .editor-card .CodeMirror-scroll { height: 100%; }

/* ---------------- 备份列表 ---------------- */

.backup-list { list-style: none; margin: 0; padding: 0; font-size: 13px; max-height: 260px; overflow: auto; }
.backup-list li {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 2px;
    border-bottom: 1px dashed #eef1f6;
}
.backup-list li:last-child { border-bottom: 0; }
.backup-list .b-main { flex: 1 1 auto; min-width: 0; }
.backup-list .b-file {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.backup-list .b-time { font-size: 11.5px; color: var(--text-faint); }
.backup-list .b-ops { display: flex; gap: 5px; white-space: nowrap; }

/* ---------------- 弹窗 ---------------- */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 22, 36, .48);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 500;
    animation: fadein .13s ease;
}

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: pop .15s ease;
}

.modal.wide { max-width: 720px; }

@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: .6; } to { transform: none; opacity: 1; } }

.modal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 17px;
    border-bottom: 1px solid var(--border);
}

.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 600; flex: 1 1 auto; }
.modal-head .x {
    border: 0; background: transparent; cursor: pointer; color: var(--text-faint);
    font-size: 19px; line-height: 1; padding: 3px 6px; border-radius: 6px;
}
.modal-head .x:hover { background: #eef2f8; color: var(--text); }

.modal-body { padding: 17px; overflow: auto; }
.modal-foot {
    display: flex; align-items: center; gap: 8px; justify-content: flex-end;
    padding: 12px 17px;
    border-top: 1px solid var(--border);
    background: #fbfcfe;
}
.modal-foot .grow { flex: 1 1 auto; }

.field { margin-bottom: 13px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; color: #3d4a5c; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; }
.field input[type=text], .field input[type=password], .field input[type=number], .field select, .field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    outline: 0;
    transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 130px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43, 108, 255, .15);
}
.field .row { display: flex; gap: 8px; align-items: center; }
.field .row > * { min-width: 0; }
.field .row input { flex: 1 1 auto; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 17px; background: #fbfcfe; flex-wrap: wrap; }
.tabs button {
    border: 0; background: transparent; padding: 10px 12px; cursor: pointer;
    font-size: 13.5px; color: var(--text-soft);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.driver-note {
    font-size: 12.5px;
    background: var(--warn-soft);
    border: 1px solid #f5dcae;
    color: #8a5a00;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    margin-bottom: 13px;
}
.driver-note.ok { background: var(--ok-soft); border-color: #b7e4c9; color: #14663a; }

.code-box {
    background: #1b2432;
    color: #d7e2f2;
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 320px;
    overflow: auto;
}

/* ---------------- 提示 ---------------- */

#toasts {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    pointer-events: none;
}

.toast {
    background: #22303f;
    color: #eaf2ff;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    max-width: 400px;
    animation: slidein .18s ease;
    pointer-events: auto;
    word-break: break-word;
}

@keyframes slidein { from { transform: translateX(14px); opacity: 0; } to { transform: none; opacity: 1; } }

.toast.ok { background: #14532d; color: #dcfce7; }
.toast.err { background: #7f1d1d; color: #fee2e2; }
.toast.warn { background: #78350f; color: #fef3c7; }

/* ---------------- 上传进度 ---------------- */

.upload-panel {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 350px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 800;
    overflow: hidden;
}

.upload-panel .up-head {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 13px;
    background: #fbfcfe;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px; font-weight: 600;
}
.upload-panel .up-head .grow { flex: 1 1 auto; }
.upload-panel .up-list { max-height: 210px; overflow: auto; padding: 9px 13px; font-size: 12.5px; }
.upload-panel .up-item { padding: 5px 0; border-bottom: 1px dashed #eef1f6; }
.upload-panel .up-item:last-child { border-bottom: 0; }
.upload-panel .up-name { display: flex; gap: 8px; }
.upload-panel .up-name .n { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-panel .up-name .p { color: var(--text-faint); white-space: nowrap; }
.upload-panel .up-name .p.ok { color: var(--ok); }
.upload-panel .up-name .p.err { color: var(--danger); }
.upload-panel .up-bar { height: 4px; background: #eef2f8; border-radius: 3px; margin-top: 5px; overflow: hidden; }
.upload-panel .up-bar > i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .15s; }

/* ---------------- 拖拽上传遮罩 ---------------- */

#dropmask {
    position: fixed;
    inset: 0;
    background: rgba(43, 108, 255, .12);
    border: 3px dashed var(--primary);
    z-index: 700;
    display: none;
    place-items: center;
    pointer-events: none;
}
#dropmask.show { display: grid; }
#dropmask .msg {
    background: #fff;
    padding: 20px 34px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-dark);
}

/* ---------------- 登录墙 ---------------- */

.gate {
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    padding: 30px;
}
.gate .box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 28px 30px;
    text-align: center;
    max-width: 380px;
}
.gate .box .big { font-size: 36px; margin-bottom: 8px; }
.gate .box h2 { margin: 0 0 6px; font-size: 17px; }
.gate .box p { margin: 0 0 16px; color: var(--text-soft); font-size: 13.5px; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 1180px) {
    .rightpanel { width: 38%; flex-basis: 38%; min-width: 300px; }
    .sidebar { width: 200px; flex-basis: 200px; }
}

@media (max-width: 900px) {
    .layout { flex-direction: column; height: auto; overflow: visible; }
    #app { height: auto; min-height: 100vh; overflow: visible; }
    .sidebar { width: 100%; flex: 0 0 auto; max-height: 210px; border-right: 0; border-bottom: 1px solid var(--border); }
    .content { flex: 0 0 auto; min-height: 300px; }
    .rightpanel { width: 100%; flex: 0 0 auto; max-width: none; min-width: 0; border-left: 0; border-top: 1px solid var(--border); }
    .topbar { height: auto; padding: 9px 12px; flex-wrap: wrap; }
    .searchbox { max-width: none; flex-basis: 100%; order: 3; }
    .brand .badge { display: none; }
}
