/* ============================================================
   全局变量与基础设置
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #080a10;
    --bg2: #0e1118;
    --surface: #151821;
    --card: #1a1e2b;
    --card-h: #212637;
    --border: #2a2f42;
    --border-l: #353b52;
    --accent: #d4a853;
    --accent-l: #e8c578;
    --accent-d: #b08a3a;
    --accent-bg: rgba(212, 168, 83, .1);
    --text: #e8e6e1;
    --text2: #8b8fa3;
    --text3: #5a5f73;
    --ok: #34d399;
    --ok-bg: rgba(52, 211, 153, .1);
    --warn: #fbbf24;
    --warn-bg: rgba(251, 191, 36, .1);
    --err: #f87171;
    --err-bg: rgba(248, 113, 113, .1);
    --info: #60a5fa;
    --info-bg: rgba(96, 165, 250, .1);
    --r: 12px;
    --r-sm: 8px;
    --r-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, .3);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, .4);
    --side-w: 260px;
    --ease: cubic-bezier(.4, 0, .2, 1);
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 噪点质感背景 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");
    opacity: .5;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ============================================================
   侧边栏 (Sidebar)
   ============================================================ */
.sidebar {
    width: var(--side-w);
    height: 100vh;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all .3s var(--ease);
    z-index: 100;
    overflow-y: auto;
}

body.sidebar-collapsed .sidebar {
    width: 0;
    opacity: 0;
    border-right: none;
    overflow: hidden;
}

.logo {
    padding: 28px 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-d));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: .5px;
}

.logo-sub {
    font-size: 11px;
    color: var(--text3);
    margin-top: 2px;
}

.sidebar nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--r-sm);
    color: var(--text2);
    cursor: pointer;
    transition: all .2s var(--ease);
    font-size: 14px;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
}

.nav-item:hover {
    background: var(--card);
    color: var(--text);
}

.nav-item.active {
    background: var(--accent-bg);
    color: var(--accent);
    border-color: rgba(212, 168, 83, .15);
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: .7;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text3);
    white-space: nowrap;
}

/* ============================================================
   主容器与页眉 (Main Wrapper & Header)
   ============================================================ */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    background: var(--bg);
}

.top-header {
    display: flex;
    align-items: center;
    padding: 16px 32px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 90;
}

.toggle-btn {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all .2s var(--ease);
    margin-right: 16px;
}

.toggle-btn:hover {
    background: var(--card-h);
    border-color: var(--accent);
}

.header-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text2);
}

.header-title span {
    color: var(--text);
    font-weight: 600;
}

.main {
    padding: 32px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.section {
    display: none;
    animation: fadeUp .4s var(--ease);
}

.section.active {
    display: block;
}

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

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.5px;
}

.page-desc {
    color: var(--text2);
    margin-top: 6px;
    font-size: 14px;
}

/* ============================================================
   统计与图表卡片 (Stats & Charts)
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all .3s var(--ease);
}

.stat-card:hover {
    border-color: var(--border-l);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.stat-card:nth-child(1)::after { background: linear-gradient(90deg, var(--accent), transparent); }
.stat-card:nth-child(2)::after { background: linear-gradient(90deg, var(--ok), transparent); }
.stat-card:nth-child(3)::after { background: linear-gradient(90deg, var(--info), transparent); }
.stat-card:nth-child(4)::after { background: linear-gradient(90deg, var(--warn), transparent); }

.stat-label {
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.stat-card:nth-child(1) .stat-icon { background: var(--accent-bg); color: var(--accent); }
.stat-card:nth-child(2) .stat-icon { background: var(--ok-bg); color: var(--ok); }
.stat-card:nth-child(3) .stat-icon { background: var(--info-bg); color: var(--info); }
.stat-card:nth-child(4) .stat-icon { background: var(--warn-bg); color: var(--warn); }

.stat-value {
    font-family: 'DM Mono', monospace;
    font-size: 32px;
    font-weight: 500;
    line-height: 1;
}

.stat-unit {
    font-size: 14px;
    color: var(--text2);
    margin-left: 4px;
    font-family: 'Noto Sans SC', sans-serif;
}

.stat-change {
    font-size: 12px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text2);
}

.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 24px;
}

.chart-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-canvas {
    width: 100% !important;
    max-height: 280px;
}

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 24px;
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   上传与批量处理 (Upload & Batch)
   ============================================================ */
.upload-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--r-lg);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all .3s var(--ease);
    background: var(--surface);
    position: relative;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-bg);
}

.dropzone.dragover {
    transform: scale(1.01);
}

.dropzone-icon {
    font-size: 44px;
    opacity: .6;
}

.dropzone-text {
    color: var(--text2);
    font-size: 14px;
    line-height: 1.6;
}

.dropzone-text strong {
    color: var(--accent);
    font-weight: 500;
}

.dropzone-hint {
    font-size: 12px;
    color: var(--text3);
}

.dropzone input[type="file"] {
    display: none;
}

.format-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 4px;
}

.format-tag {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    color: var(--text2);
    font-family: 'DM Mono', monospace;
    font-weight: 500;
}

.format-tag.hot { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.format-tag.excel { border-color: #34d399; color: #34d399; background: rgba(52, 211, 153, .1); }

.preview-area {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    position: relative;
    overflow: auto;
}

.preview-area img {
    max-width: 100%;
    max-height: 260px;
    border-radius: var(--r-sm);
    object-fit: contain;
}

.preview-area canvas {
    max-width: 100%;
    max-height: 260px;
    border-radius: var(--r-sm);
}

.preview-empty {
    color: var(--text3);
    font-size: 14px;
    text-align: center;
}

.preview-empty span {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
    opacity: .3;
}

/* ============================================================
   文件标记与徽章 (Badges & File Badges)
   ============================================================ */
.file-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    font-family: 'DM Mono', monospace;
}

.file-badge.pdf { background: rgba(248, 113, 113, .15); color: #f87171; border: 1px solid rgba(248, 113, 113, .2); }
.file-badge.ofd { background: rgba(96, 165, 250, .15); color: #60a5fa; border: 1px solid rgba(96, 165, 250, .2); }
.file-badge.xml { background: rgba(52, 211, 153, .15); color: #34d399; border: 1px solid rgba(52, 211, 153, .2); }
.file-badge.img { background: var(--accent-bg); color: var(--accent); border: 1px solid rgba(212, 168, 83, .2); }
.file-badge.excel { background: rgba(52, 211, 153, .15); color: #34d399; border: 1px solid rgba(52, 211, 153, .2); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-err { background: var(--err-bg); color: var(--err); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-demo {
    background: rgba(139, 143, 163, .15);
    color: var(--text2);
    border: 1px solid rgba(139, 143, 163, .3);
    font-size: 10px;
    padding: 2px 6px;
    margin-left: 6px;
}

/* ============================================================
   批量解析控制台与列表 (Batch & Lists)
   ============================================================ */
.batch-queue {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 8px;
}

.batch-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 12px 16px;
    font-size: 13px;
}

.batch-item.success { border-left: 3px solid var(--ok); }
.batch-item.error { border-left: 3px solid var(--err); }
.batch-item.processing { border-left: 3px solid var(--accent); background: var(--accent-bg); }

.batch-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55%;
}

.batch-status {
    color: var(--text2);
    font-family: 'DM Mono', monospace;
    font-size: 12px;
}

/* ============================================================
   表单控件 (Form Controls)
   ============================================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full { grid-column: 1 / -1; }

.form-label {
    font-size: 12px;
    color: var(--text2);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.form-input {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 10px 14px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: all .2s var(--ease);
    outline: none;
    width: 100%;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.form-input::placeholder { color: var(--text3); }

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%238b8fa3' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* ============================================================
   按钮与工具栏 (Buttons & Toolbar)
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all .2s var(--ease);
    text-decoration: none;
}

.btn-primary { background: var(--accent); color: #0a0a0a; }
.btn-primary:hover { background: var(--accent-l); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(212, 168, 83, .3); }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-l); background: var(--card-h); }
.btn-danger { background: var(--err-bg); color: var(--err); border: 1px solid rgba(248, 113, 113, .2); }
.btn-danger:hover { background: var(--err); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-group { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; align-items: center; }

.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.toolbar-left { display: flex; gap: 12px; flex-wrap: wrap; flex: 1; }
.toolbar-right { display: flex; gap: 12px; align-items: center; }

.search-box { flex: 1; min-width: 200px; position: relative; }
.search-box input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 10px 14px 10px 40px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all .2s var(--ease);
}

.search-box input:focus { border-color: var(--accent); }
.search-box::before {
    content: '🔍';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: .5;
}

.filter-select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 10px 36px 10px 14px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%238b8fa3' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.batch-actions-bar {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--card-h);
    padding: 6px 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-l);
    animation: fadeUp .2s ease;
}

/* ============================================================
   表格样式 (Tables)
   ============================================================ */
.table-wrap {
    overflow-x: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead { background: var(--surface); }

th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s var(--ease); }
tbody tr:hover { background: var(--card-h); }

.td-mono { font-family: 'DM Mono', monospace; }
.td-amount { font-family: 'DM Mono', monospace; color: var(--accent); font-weight: 500; }

.action-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all .15s var(--ease);
    margin-right: 4px;
}

.action-btn:hover { background: var(--card-h); color: var(--text); border-color: var(--border-l); }
.action-btn.del:hover { background: var(--err-bg); color: var(--err); border-color: rgba(248, 113, 113, .3); }

/* 复选框样式 */
.custom-cb {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--text3);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.custom-cb:checked { background: var(--accent); border-color: var(--accent); }
.custom-cb:checked::after {
    content: '✓';
    color: #000;
    font-size: 12px;
    font-weight: bold;
    position: absolute;
}

/* ============================================================
   查验布局与导出 (Check & Export)
   ============================================================ */
.check-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.check-result {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.check-result-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.check-result-desc { color: var(--text2); font-size: 14px; }

.check-detail {
    margin-top: 20px;
    text-align: left;
    width: 100%;
    background: var(--surface);
    border-radius: var(--r-sm);
    padding: 16px;
    border: 1px solid var(--border);
}

.check-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.check-detail-row:last-child { border-bottom: none; }
.check-detail-label { color: var(--text2); }
.check-detail-value { font-family: 'DM Mono', monospace; }

.quick-check {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.quick-check input {
    flex: 1;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 12px 16px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.quick-check input:focus { border-color: var(--accent); }

.export-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.export-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all .3s var(--ease);
}

.export-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.export-icon { font-size: 40px; margin-bottom: 16px; opacity: .7; }
.export-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.export-desc { font-size: 13px; color: var(--text2); }

/* ============================================================
   模态框与通知 (Modals & Toasts)
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 32px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalIn .3s var(--ease);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-title { font-size: 20px; font-weight: 600; }

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text2);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s var(--ease);
}

.modal-close:hover { background: var(--err-bg); color: var(--err); border-color: rgba(248, 113, 113, .3); }

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    animation: toastIn .3s var(--ease);
    font-size: 14px;
    z-index: 2001;
}

.toast.out { animation: toastOut .3s var(--ease) forwards; }

@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast.success { border-left: 3px solid var(--ok); }
.toast.error { border-left: 3px solid var(--err); }
.toast.warning { border-left: 3px solid var(--warn); }
.toast.info { border-left: 3px solid var(--info); }

/* ============================================================
   辅助类与系统管理样式
   ============================================================ */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text3); }
.empty-state span { font-size: 48px; display: block; margin-bottom: 16px; opacity: .3; }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.loading { animation: pulse 1.5s infinite; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}
.shake { animation: shake .5s var(--ease); }

.highlight-num {
    background: linear-gradient(135deg, var(--accent-bg), transparent);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'DM Mono', monospace;
}

.sys-card-flex { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.sys-desc-block { flex: 1; }
.backup-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-top: 12px;
    border: 1px solid transparent;
    background: var(--bg2);
}

/* ============================================================
   欢迎弹窗样式 (可拖拽，左下角)
   ============================================================ */
#welcome-popup {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 250px;
    background: var(--card);
    border: 1px solid var(--accent);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    animation: fadeUp 0.4s var(--ease);
}

#welcome-popup-header {
    background: var(--bg2);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    border-radius: var(--r) var(--r) 0 0;
    user-select: none;
}

#welcome-popup-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

#welcome-popup-close {
    background: transparent;
    border: none;
    color: var(--text2);
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s;
    line-height: 1;
    padding: 0 4px;
}

#welcome-popup-close:hover { color: var(--err); }

#welcome-popup-content {
    padding: 16px 14px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
    text-align: center;
}

.popup-link {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 12px;
    background: var(--accent-bg);
    color: var(--accent);
    text-decoration: none;
    border-radius: var(--r-sm);
    border: 1px solid var(--accent);
    transition: all 0.2s var(--ease);
    font-size: 12px;
}

.popup-link:hover { background: var(--accent); color: #0a0a0a; }

/* ============================================================
   响应式设计 (Responsive)
   ============================================================ */
@media(max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-row, .upload-area, .check-layout { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .export-grid { grid-template-columns: 1fr; }
}

@media(max-width: 768px) {
    body.sidebar-collapsed .sidebar { transform: translateX(-100%); width: var(--side-w); position: absolute; }
    .sidebar { position: absolute; height: 100vh; }
    .main { padding: 20px; }
    .stats-grid, .form-grid { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: flex-start; }
    .sys-card-flex { flex-direction: column; }
}