/* ============ 基础 ============ */
:root {
    --ink: #1c2026;
    --ink-2: #2a2f37;
    --paper: #f4f2ec;
    --surface: #ffffff;
    --surface-2: #faf9f5;
    --line: #e6e1d6;
    --line-strong: #d6cfc0;
    --muted: #7c766a;
    --muted-2: #9b9488;
    --accent: #8f4b34;
    --accent-2: #a85c3f;
    --accent-soft: #f3e6df;
    --gold: #b08a4f;
    --danger: #b0443b;
    --danger-soft: #fbeceb;
    --ok: #3f7a5c;
    --ok-soft: #e8f2ec;
    --warn: #9a741f;
    --warn-soft: #faf1dc;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 10px 32px rgba(28, 32, 38, .07);
    --shadow-sm: 0 2px 10px rgba(28, 32, 38, .05);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
ul { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; fill: currentColor; }
.svg-sprite symbol path[fill="none"] { fill: none; }

/* ============ 布局 ============ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 248px;
    flex: none;
    background: linear-gradient(180deg, #1b1f25 0%, #20262d 100%);
    color: #e8e4da;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--accent-2), var(--accent));
    color: #fff;
    font-family: "Songti SC", "Noto Serif SC", serif;
    font-size: 22px;
    box-shadow: 0 6px 16px rgba(143, 75, 52, .35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong {
    font-family: "Songti SC", "Noto Serif SC", serif;
    font-size: 19px;
    letter-spacing: .14em;
    color: #f5f0e6;
}
.brand-text span { font-size: 11px; color: #9aa0a8; letter-spacing: .12em; margin-top: 3px; }

.nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 13px;
    border-radius: 9px;
    color: #b7bcc3;
    font-size: 14px;
    transition: background .16s, color .16s;
    position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #f2ede3; }
.nav-item.active { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-item.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    border-radius: 0 3px 3px 0;
    background: var(--accent-2);
}
.nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-style: normal;
    font-size: 11px;
    line-height: 18px;
    min-width: 20px;
    text-align: center;
    border-radius: 20px;
    padding: 0 6px;
}

.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .07); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 9px; }
.user-card:hover { background: rgba(255, 255, 255, .06); }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, .12);
    color: #f2ede3;
    font-size: 15px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.user-meta strong { font-size: 13px; font-weight: 500; color: #eee9df; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { font-size: 11px; color: #8f959d; }
.logout-form { margin-top: 8px; padding-left: 8px; }
.link-btn {
    background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--accent-2); font-size: 13px;
}
.sidebar .link-btn { color: #9aa0a8; }
.sidebar .link-btn:hover { color: #e8e4da; }
.logout-form .link-btn { font-size: 12px; }

.main { flex: 1; margin-left: 248px; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 62px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 28px;
    background: rgba(250, 249, 245, .88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 30;
}
.topbar-title { font-size: 14px; color: var(--muted); letter-spacing: .04em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; }
.topbar-user { color: var(--ink-2); }
.topbar-role { color: var(--muted); border-left: 1px solid var(--line-strong); padding-left: 10px; }
.icon-btn {
    width: 36px; height: 36px; border-radius: 9px;
    display: grid; place-items: center;
    background: transparent; border: 1px solid transparent; cursor: pointer;
    color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); }
.menu-btn { display: none; }

.content { padding: 26px 30px 56px; max-width: 1560px; width: 100%; }

/* ============ 页头 ============ */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-head h1 {
    font-family: "Songti SC", "Noto Serif SC", serif;
    font-size: 28px;
    letter-spacing: .03em;
    line-height: 1.25;
    margin-top: 2px;
}
.page-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.back-link {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--muted); font-size: 12px; margin-bottom: 6px;
}
.back-link:hover { color: var(--accent); }
.back-link .icon { width: 14px; height: 14px; }

/* ============ 按钮 ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 38px; padding: 0 16px;
    border-radius: 9px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-2);
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--muted-2); }
.btn-primary {
    background: var(--ink);
    border-color: var(--ink);
    color: #f6f2e9;
}
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #9c3a32; border-color: #9c3a32; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn-block { width: 100%; height: 44px; font-size: 14px; }

/* ============ 卡片 / 面板 ============ */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 16px;
}
.panel-head h2 {
    font-size: 15px; letter-spacing: .04em;
    font-family: "Songti SC", "Noto Serif SC", serif;
}
.panel-link { font-size: 12px; color: var(--accent); }
.panel-link:hover { text-decoration: underline; }

/* ============ 统计 ============ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: "";
    position: absolute; right: -18px; top: -18px;
    width: 74px; height: 74px; border-radius: 50%;
    background: var(--accent-soft);
    opacity: .55;
}
.stat-label { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.stat-value {
    font-family: "Songti SC", "Noto Serif SC", serif;
    font-size: 34px; line-height: 1.2; margin-top: 6px; color: var(--ink);
}
.stat-foot { font-size: 11px; color: var(--muted-2); margin-top: 6px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.bar-list { display: flex; flex-direction: column; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 100px 1fr 60px; align-items: center; gap: 12px; }
.bar-name { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 9px; border-radius: 20px; background: #f0ede5; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); min-width: 2px; }
.bar-fill.alt { background: linear-gradient(90deg, #5d6b73, #83919a); }
.bar-fill.warm { background: linear-gradient(90deg, var(--gold), #c9a874); }
.bar-value { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.log-list { display: flex; flex-direction: column; }
.log-list li {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
}
.log-list li:last-child { border-bottom: 0; }
.log-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); margin-top: 7px; flex: none; }
.log-main { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.log-main strong { font-size: 13px; font-weight: 500; }
.log-main span { font-size: 12px; color: var(--ink-2); }
.log-main small { font-size: 11px; color: var(--muted-2); }
.log-list time { margin-left: auto; font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.empty-line { color: var(--muted-2); font-size: 13px; padding: 8px 0; }

.artwork-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}
.artwork-card {
    border: 1px solid var(--line);
    border-radius: 11px;
    overflow: hidden;
    background: var(--surface-2);
    transition: transform .16s, box-shadow .16s, border-color .16s;
}
.artwork-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.artwork-cover { aspect-ratio: 4 / 3; background: #eeebe3; overflow: hidden; }
.artwork-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-empty { display: grid; place-items: center; height: 100%; font-size: 11px; color: var(--muted-2); }
.artwork-info { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 2px; }
.artwork-info strong { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artwork-info span { font-size: 12px; color: var(--muted); }
.artwork-info small { font-size: 11px; color: var(--muted-2); }

/* ============ 筛选 ============ */
.filter-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-row + .filter-row { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.filter-field { display: flex; flex-direction: column; gap: 5px; min-width: 150px; flex: 1 1 150px; }
.filter-field > span { font-size: 11px; color: var(--muted); letter-spacing: .05em; }
.filter-field input, .filter-field select {
    height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 0 11px;
    font-size: 13px;
    width: 100%;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.filter-field input:focus, .filter-field select:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(168, 92, 63, .12);
}
.filter-field:first-child { flex: 2 1 260px; }
.input-with-icon { position: relative; }
.input-with-icon .icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--muted-2);
}
.input-with-icon input { padding-left: 34px; }
.filter-actions { display: flex; gap: 8px; padding-bottom: 1px; }

.bulk-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    background: var(--accent-soft);
    border: 1px solid #e7d1c6;
    color: #6f3a28;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
}
.bulk-actions { display: flex; gap: 8px; }

/* ============ 表格 ============ */
.table-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.data-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .07em;
    color: var(--muted);
    background: var(--surface-2);
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.data-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    font-size: 13px;
}
.data-table tbody tr:hover { background: #fbfaf6; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .col-check { width: 36px; }
.data-table .col-cover { width: 72px; }
.data-table .col-actions { white-space: nowrap; text-align: right; }
.data-table .col-name { min-width: 170px; }
.data-table .nowrap { white-space: nowrap; }

.thumb {
    width: 52px; height: 52px; border-radius: 8px;
    border: 1px solid var(--line); background: #f0ede6;
    display: block; overflow: hidden; position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-empty { display: grid; place-items: center; height: 100%; font-size: 10px; color: var(--muted-2); }
.thumb-count {
    position: absolute; right: 2px; bottom: 2px;
    background: rgba(28, 32, 38, .72); color: #fff;
    font-size: 10px; font-style: normal; line-height: 14px;
    padding: 0 4px; border-radius: 4px;
}
.cell-title { font-weight: 500; color: var(--ink); display: block; }
.cell-title:hover { color: var(--accent); }
.col-name small { font-size: 11px; color: var(--muted-2); }
.stack { display: flex; flex-direction: column; line-height: 1.35; }
.stack small { font-size: 11px; color: var(--muted-2); }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; }
.muted { color: var(--muted-2); }
.tag {
    display: inline-block;
    background: #f1eee7;
    color: #5c564b;
    border-radius: 5px;
    padding: 2px 7px;
    font-size: 11px;
    white-space: nowrap;
}
.tag-warm { background: var(--accent-soft); color: #7c3f2c; }
.status-pill {
    display: inline-block; border-radius: 20px; padding: 2px 9px; font-size: 11px;
}
.status-on { background: var(--ok-soft); color: var(--ok); }
.status-off { background: #efeeea; color: var(--muted); }
.icon-link {
    background: none; border: 0; padding: 2px 6px; cursor: pointer;
    color: var(--accent); font-size: 12px;
    border-radius: 5px;
}
.icon-link:hover { background: var(--accent-soft); }
.icon-link.danger { color: var(--danger); }
.icon-link.danger:hover { background: var(--danger-soft); }
.inline-form { display: inline; }

.empty-cell { padding: 46px 20px !important; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); }
.empty-state strong { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.empty-state span { font-size: 12px; color: var(--muted-2); }

/* ============ 分页 ============ */
.pagination {
    display: flex; align-items: center; gap: 6px;
    margin-top: 18px; flex-wrap: wrap;
}
.page-btn {
    min-width: 34px; height: 34px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    font-size: 12px; color: var(--ink-2);
}
.page-btn:hover { border-color: var(--muted-2); }
.page-btn.active { background: var(--ink); border-color: var(--ink); color: #f6f2e9; }
.page-btn.disabled { color: var(--muted-2); background: var(--surface-2); }
.page-ellipsis { color: var(--muted-2); padding: 0 2px; }
.page-total { margin-left: auto; font-size: 12px; color: var(--muted-2); }

/* ============ 表单 ============ */
.form-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 6px 24px 22px;
}
.form-section { padding: 18px 0; border-bottom: 1px dashed var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section h2 {
    font-size: 14px; letter-spacing: .05em; margin-bottom: 14px;
    font-family: "Songti SC", "Noto Serif SC", serif;
}
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin-bottom: 0; }
.section-tools { display: flex; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; color: var(--muted); letter-spacing: .03em; }
.field > span em { color: var(--danger); font-style: normal; }
.field input, .field select, .field textarea {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 9px 11px;
    font-size: 13px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(168, 92, 63, .12);
}
.field-wide { grid-column: span 2; }
.field-full { margin-top: 14px; }
.field-hint { font-size: 11px; color: var(--muted-2); margin-top: 8px; }
.form-actions { display: flex; gap: 10px; padding-top: 18px; }

.existing-images { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.image-tile {
    width: 118px; border: 1px solid var(--line); border-radius: 9px;
    overflow: hidden; background: var(--surface-2);
}
.image-tile img { width: 100%; height: 92px; object-fit: cover; }
.image-tile-meta { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 11px; color: var(--muted); }
.image-tile-meta input { width: 14px; height: 14px; }

.upload-zone {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    border: 1.5px dashed var(--line-strong);
    border-radius: 11px;
    padding: 26px 18px;
    text-align: center;
    cursor: pointer;
    background: var(--surface-2);
    transition: border-color .15s, background .15s;
    position: relative;
}
.upload-zone:hover { border-color: var(--accent-2); background: #fdfbf7; }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-icon { color: var(--muted-2); }
.upload-icon .icon { width: 26px; height: 26px; }
.upload-zone strong { font-size: 13px; font-weight: 500; }
.upload-zone small { font-size: 11px; color: var(--muted-2); }

/* ============ 详情 ============ */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 18px; }
.gallery-panel { padding: 14px; }
.gallery-main {
    background: #171a1f;
    border-radius: 10px;
    overflow: hidden;
    min-height: 340px;
    display: grid;
    place-items: center;
}
.gallery-main img { max-height: 560px; width: auto; margin: 0 auto; object-fit: contain; }
.gallery-empty { color: #8b9098; font-size: 13px; padding: 90px 0; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumb {
    width: 64px; height: 64px; padding: 0; border: 2px solid transparent;
    border-radius: 7px; overflow: hidden; cursor: pointer; background: none;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--accent-2); }
.info-panel { align-self: start; }
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.info-list > div { display: flex; flex-direction: column; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.info-list dt { font-size: 11px; color: var(--muted-2); }
.info-list dd { margin: 2px 0 0; font-size: 13px; color: var(--ink); word-break: break-all; }
.remark-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.remark-block h3 { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.remark-block p { font-size: 13px; color: var(--ink-2); line-height: 1.75; white-space: pre-wrap; }

/* ============ 导出 ============ */
.export-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.field-group { margin-bottom: 16px; }
.field-group h3 { font-size: 12px; color: var(--muted); margin-bottom: 8px; letter-spacing: .06em; font-weight: 500; }
.check-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.check-item {
    display: flex; align-items: center; gap: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
    background: var(--surface-2);
}
.check-item:hover { border-color: var(--line-strong); }
.check-item input { width: 14px; height: 14px; accent-color: var(--accent); }
.export-summary .panel { position: sticky; top: 82px; }
.summary-count { display: flex; align-items: baseline; gap: 5px; margin-bottom: 12px; }
.summary-count strong { font-family: "Songti SC", "Noto Serif SC", serif; font-size: 34px; }
.summary-count span { font-size: 12px; color: var(--muted); }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    font-size: 11px; background: #f1eee7; color: #5c564b;
    border-radius: 20px; padding: 3px 9px;
}
.chip-accent { background: var(--accent-soft); color: #7c3f2c; }

/* ============ 标签页 ============ */
.tab-bar { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab-btn {
    background: none; border: 0; cursor: pointer;
    padding: 9px 4px; margin-right: 18px;
    font-size: 13px; color: var(--muted);
    border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.inline-create {
    display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 12px;
}
.inline-create input, .inline-create select {
    height: 36px; border: 1px solid var(--line-strong); border-radius: 8px;
    padding: 0 10px; font-size: 13px; background: var(--surface);
}
.inline-create input[type="text"] { min-width: 200px; }
.inline-create input[type="number"] { width: 90px; }

/* ============ 个人设置 ============ */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.password-form .field { margin-bottom: 13px; }

/* ============ 提示 ============ */
.alert {
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert ul { padding-left: 18px; list-style: disc; }
.alert-error { background: var(--danger-soft); border-color: #f0cfcb; color: #8b352e; }
.alert-warning { background: var(--warn-soft); border-color: #ecd9ae; color: #7d5c14; }
.alert-success { background: var(--ok-soft); border-color: #cfe4d7; color: #2f6047; }

.toast-stack {
    position: fixed; top: 18px; right: 20px; z-index: 100;
    display: flex; flex-direction: column; gap: 8px;
    max-width: 420px;
}
.toast {
    display: flex; align-items: flex-start; gap: 10px;
    background: var(--ink);
    color: #f3efe6;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
    animation: toast-in .25s ease-out;
}
.toast-success { background: #2f6047; }
.toast-error { background: #8b352e; }
.toast-warning { background: #7d5c14; }
.toast-close { background: none; border: 0; color: inherit; cursor: pointer; font-size: 16px; line-height: 1; margin-left: auto; opacity: .7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ============ 弹窗 ============ */
.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(24, 27, 32, .46); backdrop-filter: blur(2px); }
.modal-dialog {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    width: 440px;
    max-width: 100%;
    max-height: 88vh;
    overflow: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .24);
    animation: modal-in .2s ease-out;
}
.modal-sm { width: 380px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { padding: 17px 20px 0; }
.modal-head h3 { font-size: 16px; font-family: "Songti SC", "Noto Serif SC", serif; }
.modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-text { font-size: 13px; color: var(--ink-2); }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 9px;
    padding: 0 20px 18px;
}

/* ============ 登录 ============ */
.login-body { background: var(--paper); }
.login-shell { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }
.login-visual { position: relative; overflow: hidden; background: #1a1d22; }
.login-mosaic { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 3px; }
.mosaic-cell { overflow: hidden; }
.mosaic-cell img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) contrast(.96); }
.mosaic-fallback { grid-column: span 3; grid-row: span 2; background: radial-gradient(circle at 30% 20%, #4a3a30, #1a1d22 65%); }
.mosaic-shade {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(12, 13, 16, .62) 0%, rgba(12, 13, 16, .1) 42%, rgba(12, 13, 16, .9) 100%);
}
.login-brand {
    position: absolute; left: 52px; bottom: 84px; color: #f4efe5;
    text-shadow: 0 2px 20px rgba(0, 0, 0, .55);
}
.login-seal {
    display: inline-grid; place-items: center;
    width: 46px; height: 46px; border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .38);
    background: rgba(143, 75, 52, .5);
    font-family: "Songti SC", "Noto Serif SC", serif; font-size: 23px;
    margin-bottom: 16px;
}
.login-brand h1 {
    font-family: "Songti SC", "Noto Serif SC", serif;
    font-size: 52px; letter-spacing: .22em; line-height: 1; margin-bottom: 14px;
}
.login-brand p { font-size: 14px; color: rgba(244, 239, 229, .82); line-height: 1.8; letter-spacing: .04em; }
.login-caption {
    position: absolute; left: 40px; top: 28px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(12, 13, 16, .34);
    backdrop-filter: blur(8px);
    font-size: 11px; letter-spacing: .22em; color: rgba(244, 239, 229, .82);
}
.login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-form-wrap { width: 100%; max-width: 360px; }
.eyebrow { font-size: 10px; letter-spacing: .28em; color: var(--muted-2); }
.login-heading h2 { font-family: "Songti SC", "Noto Serif SC", serif; font-size: 30px; margin: 8px 0 6px; }
.login-heading p { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .field input { height: 44px; }
.login-footnote { margin-top: 18px; font-size: 11px; color: var(--muted-2); text-align: center; }

/* ============ 错误页 ============ */
.error-body { display: grid; place-items: center; min-height: 100vh; background: var(--paper); }
.error-wrap { text-align: center; padding: 40px; }
.error-code { font-family: "Songti SC", "Noto Serif SC", serif; font-size: 86px; color: var(--line-strong); line-height: 1; }
.error-wrap h1 { font-family: "Songti SC", "Noto Serif SC", serif; font-size: 24px; margin: 14px 0 8px; }
.error-wrap p { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

/* ============ 响应式 ============ */
.sidebar-mask { display: none; }

@media (max-width: 1280px) {
    .artwork-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .check-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .sidebar.open { transform: none; }
    .main { margin-left: 0; }
    .menu-btn { display: grid; }
    .sidebar-mask { display: block; position: fixed; inset: 0; background: rgba(20, 22, 26, .42); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .22s; }
    .sidebar-mask.show { opacity: 1; pointer-events: auto; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .export-layout { grid-template-columns: minmax(0, 1fr); }
    .export-summary .panel { position: static; }
    .profile-grid { grid-template-columns: minmax(0, 1fr); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-shell { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .login-panel { min-height: 100vh; }
}

@media (max-width: 720px) {
    .content { padding: 18px 16px 46px; }
    .topbar { padding: 0 16px; }
    .page-head h1 { font-size: 23px; }
    .stat-grid { grid-template-columns: minmax(0, 1fr); }
    .artwork-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .field-wide { grid-column: span 1; }
    .info-list { grid-template-columns: minmax(0, 1fr); }
    .bar-row { grid-template-columns: 78px 1fr 48px; }
    .toast-stack { left: 14px; right: 14px; max-width: none; }
    .form-card { padding: 4px 16px 18px; }
    .topbar-right { display: none; }
}

@media print {
    .sidebar, .topbar, .filter-card, .page-actions, .pagination, .bulk-bar, .col-check, .col-actions { display: none !important; }
    .main { margin-left: 0; }
    .content { padding: 0; }
    .table-card { box-shadow: none; border: 0; }
    body { background: #fff; }
}

/* ============ VR 展厅 ============ */
.vr-hall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 18px;
}
.vr-hall-card {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.vr-hall-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: 0 20px 42px -26px rgba(30, 25, 20, .5);
}
.vr-hall-cover {
    position: relative; display: block; aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #24252a, #3b332b);
    overflow: hidden;
}
.vr-hall-cover img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .7s cubic-bezier(.2, .7, .3, 1);
}
.vr-hall-card:hover .vr-hall-cover img { transform: scale(1.05); }
.vr-hall-shade {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(10, 11, 13, .28) 0%, rgba(10, 11, 13, 0) 42%, rgba(10, 11, 13, .68) 100%);
}
.vr-cover-empty {
    position: absolute; inset: 0; display: grid; place-items: center;
    color: rgba(246, 242, 233, .5); font-size: 13px; letter-spacing: .12em;
}
.vr-hall-theme, .vr-hall-count, .vr-hall-draft {
    position: absolute; top: 12px; z-index: 1;
    height: 24px; padding: 0 10px; border-radius: 20px;
    display: inline-flex; align-items: center;
    font-size: 11px; letter-spacing: .04em;
    background: rgba(14, 15, 18, .6); color: #f2ede2;
    border: 1px solid rgba(255, 255, 255, .18);
    backdrop-filter: blur(8px);
}
.vr-hall-theme { left: 12px; }
.vr-hall-count { right: 12px; }
.vr-hall-draft {
    top: auto; bottom: 12px; left: 12px;
    background: rgba(176, 138, 79, .82); border-color: transparent; color: #221a10;
}
.vr-enter {
    position: absolute; right: 12px; bottom: 12px; z-index: 1;
    height: 30px; padding: 0 14px; border-radius: 20px;
    display: inline-flex; align-items: center;
    font-size: 12px; color: #211a10;
    background: #e7cfa4;
    opacity: .94;
    transition: background .2s, transform .2s;
}
.vr-hall-card:hover .vr-enter { background: #f3dfb9; transform: translateX(2px); }
.vr-hall-body { padding: 15px 18px 17px; display: flex; flex-direction: column; flex: 1; }
.vr-hall-body h3 {
    margin: 0; font: 600 18px/1.4 "Songti SC", "Noto Serif SC", serif;
    letter-spacing: .02em;
}
.vr-hall-body h3 a:hover { color: var(--accent); }
.vr-hall-body p {
    margin: 7px 0 0; font-size: 12px; line-height: 1.7; color: var(--muted-2);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    flex: 1;
}
.vr-hall-admin {
    display: flex; gap: 16px; margin-top: 12px; padding-top: 11px;
    border-top: 1px dashed var(--line);
}
.vr-hall-admin a { font-size: 12px; color: var(--accent); }
.vr-hall-admin a:hover { text-decoration: underline; }

/* 主题选择 */
.layout-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.layout-option {
    display: flex; align-items: flex-start; gap: 10px;
    border: 1px solid var(--line-strong); border-radius: 10px;
    padding: 12px 14px; cursor: pointer; background: var(--surface-2);
    transition: border-color .15s, box-shadow .15s;
}
.layout-option:hover { border-color: var(--muted-2); }
.layout-option input { margin: 3px 0 0; flex: 0 0 auto; }
.layout-option input:checked { accent-color: var(--accent-2); }
.layout-option strong { display: block; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.layout-option small { display: block; margin-top: 4px; font-size: 11px; line-height: 1.5; color: var(--muted); }

.theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.theme-option {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    background: var(--surface-2);
    transition: border-color .15s, box-shadow .15s;
}
.theme-option:hover { border-color: var(--muted-2); }
.theme-option input { display: none; }
.theme-option input:checked + .theme-swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent-2); }
.theme-swatch {
    width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%;
    border: 2px solid transparent;
}
.theme-name { font-size: 12px; color: var(--ink-2); }

/* 展厅作品管理 */
.vr-items-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}
.vr-items-table .col-check { width: 52px; }
.vr-items-table .col-actions { min-width: 210px; }
.vr-add-panel { position: sticky; top: 82px; }
.vr-add-panel .panel { padding: 18px; }
.vr-search { display: flex; gap: 8px; align-items: center; }
.vr-search .input-with-icon { flex: 1; }
.vr-search input { width: 100%; }
.vr-candidate-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.vr-candidate-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 0; border-bottom: 1px dashed var(--line);
}
.vr-candidate-list li:last-child { border-bottom: 0; }
.vr-candidate-list li.empty-line { display: block; }
.candidate-thumb {
    width: 44px; height: 44px; flex: 0 0 auto; border-radius: 7px;
    border: 1px solid var(--line); background: #f0ede6; overflow: hidden;
}
.candidate-thumb img { width: 100%; height: 100%; object-fit: cover; }
.candidate-info { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.4; }
.candidate-info strong {
    font-size: 12px; font-weight: 500; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.candidate-info small { font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check-item-inline { display: inline-flex; margin-top: 14px; }
.icon-link[disabled] { color: var(--muted-2); opacity: .45; cursor: not-allowed; }
.icon-link[disabled]:hover { background: none; }

@media (max-width: 1100px) {
    .vr-items-layout { grid-template-columns: minmax(0, 1fr); }
    .vr-add-panel { position: static; }
}
@media (max-width: 900px) {
    .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .layout-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
    .vr-hall-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1360px) {
    .vr-items-table .col-meta { display: none; }
}

/* ============ 分页数量 / 登录验证码 ============ */
.pagination-wrap {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    margin-top: 18px;
}
.pagination-wrap .pagination { margin-top: 0; flex: 1 1 auto; }
.page-size-form { display: flex; align-items: center; gap: 12px; margin-left: auto; font-size: 12px; color: var(--muted); }
.page-size-form label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.page-size-form select {
    height: 34px; padding: 0 8px;
    border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface); color: var(--ink-2); font-size: 12px;
}
.page-size-form .page-total { margin-left: 0; }

.captcha-row { display: flex; align-items: center; gap: 8px; }
.captcha-row input { flex: 1; min-width: 0; }
.public-link-row { display: flex; align-items: center; gap: 8px; }
.public-link-row input { flex: 1; min-width: 0; }
.captcha-row img {
    width: 136px; height: 44px; flex: 0 0 auto;
    border: 1px solid var(--line); border-radius: 8px;
    background: #f3eee4; cursor: pointer;
}
.captcha-refresh {
    flex: 0 0 auto; height: 44px; padding: 0 10px;
    border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface-2); color: var(--muted);
    font-size: 12px; cursor: pointer;
}
.captcha-refresh:hover { border-color: var(--line-strong); color: var(--ink-2); }

.login-brand h1 { font-size: 46px; letter-spacing: .16em; }

@media (max-width: 720px) {
    .pagination-wrap { flex-direction: column; align-items: stretch; }
    .page-size-form { margin-left: 0; justify-content: space-between; }
}
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* 中等宽度笔记本仍展示登录页作品拼图 */
@media (min-width: 901px) and (max-width: 1080px) {
    .login-shell { grid-template-columns: 1.15fr 1fr; }
    .login-visual { display: block; }
    .login-brand { left: 36px; bottom: 60px; }
    .login-brand h1 { font-size: 38px; letter-spacing: .12em; }
    .login-brand p { font-size: 12px; }
    .login-caption { left: 36px; top: 24px; }
}
