/* ============================================================
   签证财务核对系统 — 「账本与墨」主题
   暖纸底色 · 墨色文字 · 朱砂点染 · 内嵌网格与账本细线
   ============================================================ */

:root {
    --paper: #F3EFE6;          /* 页面底纸 */
    --surface: #FDFBF5;        /* 卡片纸面 */
    --surface-2: #F6F1E7;      /* 内嵌/表头 */
    --ink: #27221A;            /* 主墨色 */
    --ink-2: #6E6655;          /* 次要灰墨 */
    --ink-3: #9C9280;          /* 弱化墨色 */
    --line: #E0D8C6;           /* 发丝线 */
    --line-2: #CFC5AE;         /* 强一丝 */
    --accent: #B23B26;         /* 朱砂 */
    --accent-deep: #8F2C1B;
    --accent-soft: rgba(178, 59, 38, 0.08);
    --green: #1F7A4D;
    --red: #C0392B;
    --amber: #AC731C;
    --ink-side: #211D16;       /* 侧栏墨底 */
    --ink-side-soft: #2E2820;
    --ink-side-text: #CFC5AD;
    --radius: 6px;
    --shadow: 0 1px 2px rgba(68, 56, 30, 0.04), 0 6px 18px rgba(68, 56, 30, 0.06);
    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    background: var(--paper); /* 页面淡出时不露白 */
}

body.dark-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--paper);
    background-image:
        radial-gradient(ellipse 120% 60% at 50% -10%, rgba(178, 59, 38, 0.045), transparent 55%),
        radial-gradient(ellipse at 0% 100%, rgba(120, 100, 60, 0.05), transparent 50%);
    background-attachment: fixed;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(178, 59, 38, 0.16); color: var(--accent-deep); }

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

/* ---------- 版式：衬线标题 ---------- */
h1, h2, h3, .page-title, .sidebar-title, .login-box h1 {
    font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", Georgia, serif;
    letter-spacing: .02em;
}

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

/* ---------- 侧栏：墨色书脊 ---------- */
.sidebar {
    width: 232px;
    min-width: 232px;
    background: var(--ink-side);
    background-image: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.12));
    color: var(--ink-side-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    border-right: 1px solid #000;
}

.sidebar-brand {
    padding: 22px 22px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    background: var(--accent);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Songti SC", "Noto Serif SC", serif;
    font-size: 18px;
    font-weight: 700;
    color: #F8F4EC;
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.sidebar-title {
    font-size: 17px;
    font-weight: 700;
    color: #EFE9DC;
    line-height: 1.3;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: 5px;
    color: #B7AC92;
    text-decoration: none;
    font-size: 13.5px;
    margin-bottom: 2px;
    border-left: 2px solid transparent;
    transition: background .18s var(--ease), color .18s var(--ease), border-color .18s;
}

.nav-item:hover { background: rgba(255,255,255,0.05); color: #EAE3D3; }

.nav-item.active {
    background: linear-gradient(90deg, rgba(178,59,38,0.22), rgba(178,59,38,0.06));
    border-left-color: var(--accent);
    color: #F4E3DA;
}

.nav-icon {
    width: 18px;
    height: 18px;
    font-size: 15px;
    flex-shrink: 0;
    text-align: center;
    filter: saturate(.9);
}

.nav-section-title {
    font-size: 11px;
    color: #7d7260;
    text-transform: uppercase;
    letter-spacing: .14em;
    padding: 16px 12px 7px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info { display: flex; align-items: center; gap: 10px; }

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ink-side-soft);
    border: 1px solid rgba(255,255,255,0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #EAE3D3;
    font-family: "Songti SC", serif;
    font-weight: 700;
}

.user-meta { display: flex; flex-direction: column; }

.user-name { font-size: 13px; color: #ECE6D8; font-weight: 500; }
.user-role { font-size: 11px; color: #8a7f6a; }

.logout-btn {
    color: #9a8f76;
    text-decoration: none;
    font-size: 12px;
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    transition: all .18s var(--ease);
}

.logout-btn:hover { color: #F0B6A3; border-color: var(--accent); }

/* ---------- 主区 ---------- */
.main-content { flex: 1; margin-left: 232px; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    padding: 18px 28px;
    background: rgba(253, 251, 245, 0.86);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--ink);
}

.topbar-right { display: flex; align-items: center; gap: 14px; }

.user-info { font-size: 13px; color: var(--ink-2); }

/* 渠道切换器 */
.channel-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 3px;
    margin-left: auto;
    margin-right: 12px;
}
.channel-btn {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--ink-2);
    text-decoration: none;
    transition: all .15s;
}
.channel-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--ink); }
.channel-btn.active {
    background: var(--primary, #3b82f6);
    color: #fff;
    font-weight: 600;
}
.channel-badge {
    margin-left: auto;
    margin-right: 12px;
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 13px;
    color: var(--ink-2);
}

.badge-admin, .badge-finance {
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 3px;
    margin-left: 6px;
    font-weight: 600;
    letter-spacing: .04em;
}

.badge-admin { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(178,59,38,.18); }
.badge-finance { background: rgba(31,122,77,.09); color: var(--green); border: 1px solid rgba(31,122,77,.2); }

.btn-logout {
    font-size: 13px;
    color: var(--ink-2);
    text-decoration: none;
    padding: 6px 13px;
    border-radius: 5px;
    border: 1px solid var(--line-2);
    background: var(--surface);
    transition: all .18s var(--ease);
}

.btn-logout:hover { color: var(--accent); border-color: var(--accent); }

.content-area { flex: 1; padding: 26px 28px; }

/* ---------- 入场动画（仅整页首次加载时生效；软切换另走进退场） ---------- */
html:not([data-softnav]) .topbar { animation: riseIn .35s var(--ease) both; }

html:not([data-softnav]) .content-area > * {
    animation: riseIn .45s var(--ease) both;
}

html:not([data-softnav]) .content-area > *:nth-child(1) { animation-delay: .02s; }
html:not([data-softnav]) .content-area > *:nth-child(2) { animation-delay: .07s; }
html:not([data-softnav]) .content-area > *:nth-child(3) { animation-delay: .12s; }
html:not([data-softnav]) .content-area > *:nth-child(4) { animation-delay: .17s; }
html:not([data-softnav]) .content-area > *:nth-child(5) { animation-delay: .22s; }
html:not([data-softnav]) .content-area > *:nth-child(6) { animation-delay: .27s; }
html:not([data-softnav]) .content-area > *:nth-child(7) { animation-delay: .32s; }
html:not([data-softnav]) .content-area > *:nth-child(8) { animation-delay: .37s; }
html:not([data-softnav]) .content-area > *:nth-child(9) { animation-delay: .42s; }
html:not([data-softnav]) .content-area > *:nth-child(10) { animation-delay: .47s; }

html:not([data-softnav]) .data-table tbody tr {
    animation: riseIn .4s var(--ease) both;
}

@keyframes riseIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 软切换：只过渡内容区，侧栏/顶栏始终可见（不会出现“只剩背景”） */
.content-area.content-enter,
.login-box.content-enter { animation: contentIn .16s var(--ease) both; }

@keyframes contentIn {
    from { opacity: .3; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* 加载中：顶部细进度条反馈，全程不隐藏任何按钮 */
body.top-loading::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    z-index: 2000;
    background: linear-gradient(90deg, var(--accent) 0%, var(--amber) 50%, var(--accent) 100%);
    background-size: 200% 100%;
    animation: loadSlip 1s linear infinite;
    box-shadow: 0 1px 4px rgba(143, 44, 27, 0.35);
}

@keyframes loadSlip {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* ---------- View Transitions（跨页平滑切换，不直接跳转） ---------- */
@keyframes vtOut {
    to { opacity: 0; transform: translateY(-8px) scale(.992); }
}
@keyframes vtIn {
    from { opacity: 0; transform: translateY(10px) scale(.996); }
}
::view-transition-old(root) { animation: vtOut .22s var(--ease) both; }
::view-transition-new(root) { animation: vtIn .32s var(--ease) both; }

/* ---------- 统计卡 ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}

.stat-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    opacity: .85;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(68,56,30,.05), 0 12px 26px rgba(68,56,30,.10); }

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    background: var(--accent-soft);
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    font-family: "Cascadia Mono", "SF Mono", Consolas, monospace;
}

.stat-label { font-size: 12px; color: var(--ink-2); margin-top: 2px; letter-spacing: .03em; }

/* ---------- 汇总行 ---------- */
.cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.summary-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    box-shadow: var(--shadow);
}

.summary-card h3 {
    font-size: 12.5px;
    color: var(--ink-2);
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.summary-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    font-family: "Cascadia Mono", "SF Mono", Consolas, monospace;
}

/* ---------- 图表行 ---------- */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}
.chart-title { font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }

/* ---------- 表格（账本细线） ---------- */
table { width: 100%; border-collapse: collapse; }

th {
    text-align: left;
    padding: 10px 14px;
    color: var(--ink-2);
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line-2);
    white-space: nowrap;
}

td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 13px;
}

tbody tr { transition: background .15s var(--ease); }
tbody tr:hover td { background: rgba(178, 59, 38, 0.035); }

tr.matched td { background: rgba(31, 122, 77, 0.05); }
tr.unmatched td { background: rgba(192, 57, 43, 0.06); }

.data-table-container {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow);
}

.data-table th { background: var(--surface-2); }
.data-table td { border-top: 1px solid var(--line); border-bottom: none; font-size: 13px; }
.data-table tr:hover td { background: rgba(178, 59, 38, 0.035); }

.table-mini th, .table-mini td { padding: 8px 10px; font-size: 12px; }
.table-mini code {
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: var(--accent);
}

.order-id, .order-no, .num {
    font-family: "Cascadia Mono", "SF Mono", Consolas, monospace;
    font-variant-numeric: tabular-nums;
}

.order-id { font-size: 12px; color: var(--ink-2); }
.order-no { font-size: 12px; color: var(--accent); }
.num { text-align: right; }

.text-right { text-align: right; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-success { color: var(--green); }
.text-danger { color: var(--red); }
.text-warning { color: var(--amber); }
.text-muted { color: var(--ink-3); }

/* ---------- 徽章 ---------- */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 3px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .02em;
    border: 1px solid transparent;
}

.badge.matched { background: rgba(31,122,77,.1); color: var(--green); border-color: rgba(31,122,77,.22); }
.badge.unmatched { background: rgba(192,57,43,.1); color: var(--red); border-color: rgba(192,57,43,.22); }

.badge-ctrip { background: var(--accent-soft); color: var(--accent); border-color: rgba(178,59,38,.18); }
.badge-fliggy { background: rgba(166,96,42,.1); color: #8A4E22; border-color: rgba(166,96,42,.22); }
.badge-tonghang { background: rgba(172,115,28,.1); color: var(--amber); border-color: rgba(172,115,28,.22); }
.badge-offline { background: rgba(110,102,85,.1); color: var(--ink-2); border-color: rgba(110,102,85,.22); }
.badge-store { background: rgba(31,122,77,.1); color: var(--green); border-color: rgba(31,122,77,.22); }

.channel-tag {
    font-size: 12px;
    padding: 2px 9px;
    border-radius: 3px;
    background: var(--accent-soft);
    color: var(--accent);
}

.status-tag { font-size: 11.5px; padding: 3px 10px; border-radius: 3px; font-weight: 600; }
.status-pending { background: rgba(172,115,28,.1); color: var(--amber); }
.status-done { background: rgba(31,122,77,.1); color: var(--green); }
.status-partial { background: var(--accent-soft); color: var(--accent); }

/* ---------- 提示条 ---------- */
.alert {
    margin: 0 28px;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid;
}

.alert-info { background: var(--accent-soft); border-color: rgba(178,59,38,.25); color: var(--accent-deep); }
.alert-success { background: rgba(31,122,77,.08); border-color: rgba(31,122,77,.22); color: var(--green); }
.alert-error { background: rgba(192,57,43,.08); border-color: rgba(192,57,43,.22); color: var(--red); }

.alert-close { background: none; border: none; color: inherit; font-size: 18px; cursor: pointer; opacity: .6; }
.alert-close:hover { opacity: 1; }

/* ---------- 空状态 ---------- */
.empty-state { text-align: center; padding: 44px; color: var(--ink-3); font-size: 13px; }
.empty-box { color: var(--ink-3); }
.empty-icon { font-size: 34px; margin-bottom: 8px; opacity: .75; }
.empty-box p { margin: 8px 0; }

/* ---------- 表单 ---------- */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea {
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 5px;
    color: var(--ink);
    padding: 9px 12px;
    font-size: 13.5px;
    outline: none;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(178, 59, 38, 0.12);
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    color: var(--ink-2);
    font-size: 12.5px;
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: .03em;
}
.form-group input, .form-group select { width: 100%; }
.form-group input:focus, .form-group select:focus { border-color: var(--accent); }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 5px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all .18s var(--ease);
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: #FBF6EE;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(143,44,27,.25);
}

.btn-primary:hover {
    background: var(--accent-deep);
    transform: translateY(-1px);
}

.btn-success { background: var(--green); color: #FBF6EE; }
.btn-success:hover { background: #1A6A42; transform: translateY(-1px); }

.btn-danger { background: var(--red); color: #FBF6EE; }
.btn-danger:hover { background: #A52E21; transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--line-2);
    color: var(--ink-2);
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line-2);
}

.btn-secondary:hover { background: var(--surface-2); border-color: var(--line-2); }

.btn-ghost { background: transparent; color: var(--ink-2); border: none; }
.btn-ghost:hover { color: var(--ink); }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 11px 32px; font-size: 15px; }

/* ---------- 分页 ---------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 18px 0; }
.page-link {
    padding: 7px 15px;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 5px;
    color: var(--ink-2);
    text-decoration: none;
    font-size: 13px;
    transition: all .18s var(--ease);
}
.page-link:hover { border-color: var(--accent); color: var(--accent); }
.page-info { font-size: 13px; color: var(--ink-3); }

/* ---------- 工具栏 / 筛选 ---------- */
.page-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.total-badge { font-size: 13px; color: var(--ink-2); }

.filter-bar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}
.filter-row { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 12px; flex-wrap: wrap; }
.filter-row:last-child { margin-bottom: 0; }
.filter-item { display: flex; flex-direction: column; gap: 4px; }
.filter-item label { font-size: 12px; color: var(--ink-2); }
.filter-item input, .filter-item select { min-width: 140px; }
.filter-actions { flex-direction: row !important; align-items: flex-end; gap: 8px; }

/* ---------- 文件上传 ---------- */
.file-upload {
    border: 1.5px dashed var(--line-2);
    border-radius: var(--radius);
    padding: 38px 24px;
    text-align: center;
    cursor: pointer;
    transition: all .18s var(--ease);
    background: var(--surface);
}
.file-upload:hover { border-color: var(--accent); background: var(--surface-2); }
.file-upload .icon { font-size: 46px; margin-bottom: 10px; opacity: .85; }
.file-upload .text { color: var(--ink-2); font-size: 13px; }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 13px;
    color: #FBF6EE;
    box-shadow: 0 8px 24px rgba(60,40,15,.2);
    animation: slideIn .3s var(--ease);
}
.toast-info { background: var(--accent); }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ---------- 模态框 ---------- */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(38, 34, 26, 0.55);
    backdrop-filter: blur(3px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal.show { display: flex; animation: modalFade .25s var(--ease) both; }

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

.modal-content {
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 10px;
    padding: 28px;
    max-width: 460px;
    width: 90%;
    box-shadow: 0 24px 60px rgba(38, 34, 26, 0.25);
    animation: modalPop .3s var(--ease) both;
}

@keyframes modalPop {
    from { opacity: 0; transform: translateY(12px) scale(.975); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-content h3 { font-size: 18px; margin-bottom: 18px; color: var(--ink); font-weight: 700; }
.modal-content input[readonly] { color: var(--ink-2); background: var(--surface-2); }

/* ---------- 登录页 ---------- */
.login-page {
    background: var(--paper);
    background-image:
        radial-gradient(ellipse 90% 55% at 50% -5%, rgba(178, 59, 38, 0.07), transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(120, 100, 60, 0.06), transparent 55%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-box {
    max-width: 400px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 42px 40px 36px;
    box-shadow: 0 2px 4px rgba(68,56,30,.04), 0 24px 60px rgba(68,56,30,.10);
    border-top: 3px solid var(--accent);
}

html:not([data-softnav]) .login-box { animation: riseIn .5s var(--ease) both; }

.login-box h1 {
    font-size: 25px;
    text-align: center;
    margin-bottom: 6px;
    color: var(--ink);
    font-weight: 700;
}

.login-box .subtitle {
    text-align: center;
    color: var(--ink-2);
    margin-bottom: 32px;
    font-size: 13.5px;
    letter-spacing: .12em;
}

.login-hint {
    text-align: center;
    margin-top: 18px;
    color: var(--ink-3);
    font-size: 12px;
}

/* ---------- 移动端抽屉与汉堡 ---------- */
.sidebar-toggle {
    display: none;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 5px;
    color: var(--ink);
    font-size: 17px;
    line-height: 1;
    padding: 8px 12px;
    cursor: pointer;
    flex-shrink: 0;
}
.sidebar-toggle:active { background: var(--surface-2); }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(38, 34, 26, 0.45);
    z-index: 99;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    /* 汉堡按钮 */
    .sidebar-toggle { display: inline-flex; }

    /* 侧栏 → 抽屉 */
    .sidebar {
        width: 250px;
        min-width: 250px;
        transform: translateX(-100%);
        transition: transform .28s var(--ease);
        box-shadow: 12px 0 34px rgba(0, 0, 0, 0.28);
        z-index: 100;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.show { display: block; }

    .main-content { margin-left: 0; }

    .topbar { padding: 12px 14px; gap: 10px; }
    .page-title { font-size: 17px; }
    .topbar-right { gap: 8px; }
    .topbar-right .user-info { display: none; }

    .content-area { padding: 16px 12px; }
    .alert { margin: 0 12px; margin-top: 12px; }

    /* 表格：横向滚动 */
    .data-table { min-width: 560px; }
    .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .card .data-table { min-width: 480px; }

    /* 图表 / 统计 */
    .charts-row { grid-template-columns: 1fr; }

    /* 筛选 / 工具栏纵向排布 */
    .page-toolbar { flex-direction: column; align-items: stretch; }
    .filter-row { gap: 10px; }
    .filter-item { width: 100%; }
    .filter-item input, .filter-item select { width: 100%; min-width: 0; }

    /* 触控目标 */
    .btn { min-height: 42px; }
    .page-link { min-height: 40px; display: inline-flex; align-items: center; }
    .btn-logout { padding: 9px 14px; }

    /* 登录 / 弹窗 */
    .login-box { padding: 30px 20px 26px; }
    .login-box h1 { font-size: 22px; }
    .modal-content { width: 94%; padding: 22px 16px; max-height: 92vh; overflow-y: auto; }
    .modal-content h3 { font-size: 16.5px; }

    /* 文件上传 */
    .file-upload { padding: 26px 16px; }
    .file-upload .icon { font-size: 38px; }
}

/* ---------- 无障碍：减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
    html { scroll-behavior: auto; }
}