/* ============ 主题变量 ============ */
:root {
    --bg: #0f1420;
    --bg-2: #161d2e;
    --panel: #1a2234;
    --panel-2: #202a40;
    --border: #2a3550;
    --text: #e6ecf7;
    --text-2: #9aa8c4;
    --text-3: #6b7a99;
    --primary: #4f8cff;
    --primary-hover: #3d7aef;
    --green: #35d0a5;
    --red: #ff6b6b;
    --orange: #ffb84d;
    --purple: #a78bfa;
    --shadow: 0 8px 30px rgba(0,0,0,.35);
}
html[data-theme="light"] {
    --bg: #f4f6fb;
    --bg-2: #ffffff;
    --panel: #ffffff;
    --panel-2: #f7f9fd;
    --border: #e3e8f2;
    --text: #1c2740;
    --text-2: #5c6a85;
    --text-3: #94a0b8;
    --primary: #3b73e8;
    --primary-hover: #2f62cc;
    --shadow: 0 8px 30px rgba(30,50,90,.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    transition: background .2s, color .2s;
}
.app { display: flex; min-height: 100vh; }

/* ============ 侧边栏 ============ */
.sidebar {
    width: 240px; flex-shrink: 0;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 24px 16px;
    position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-icon {
    width: 40px; height: 40px; border-radius: 11px;
    background: linear-gradient(135deg, #4f8cff, #7c5cff);
    display: grid; place-items: center; font-size: 20px; color: #fff;
}
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border: 0; border-radius: 9px;
    background: transparent; color: var(--text-2);
    font-size: 14px; cursor: pointer; text-align: left;
    transition: all .15s;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: rgba(79,140,255,.14); color: var(--primary); font-weight: 600; }
.nav-ico { font-size: 17px; width: 20px; text-align: center; }
.sidebar-foot { margin-top: auto; }
.sync-info {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 14px; margin-bottom: 12px;
}
.sync-label { font-size: 11px; color: var(--text-3); }
.sync-value { font-size: 12px; color: var(--green); margin-top: 4px; font-weight: 600; }
.theme-toggle {
    width: 100%; padding: 9px; border: 1px solid var(--border);
    background: transparent; color: var(--text-2); border-radius: 9px;
    cursor: pointer; font-size: 12px;
}
.theme-toggle:hover { color: var(--text); border-color: var(--primary); }

/* ============ 主区域 ============ */
.main { flex: 1; min-width: 0; padding: 28px 34px 40px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.topbar-title h1 { font-size: 24px; font-weight: 700; }
.topbar-title p { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.topbar-actions { display: flex; gap: 10px; }

.view { display: none; }
.view.active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============ 按钮 ============ */
.btn {
    padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
    font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s;
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); }
.btn-subtle { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-subtle:hover { color: var(--text); }
.btn-danger { background: transparent; color: var(--red); border-color: rgba(255,107,107,.35); }
.btn-danger:hover { background: rgba(255,107,107,.12); }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; font-size: 12px; }

/* ============ 统计卡片 ============ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 14px; padding: 20px 22px; position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.accent-blue::before { background: var(--primary); }
.accent-green::before { background: var(--green); }
.accent-purple::before { background: var(--purple); }
.accent-orange::before { background: var(--orange); }
.stat-label { font-size: 12px; color: var(--text-2); }
.stat-value { font-size: 32px; font-weight: 700; margin: 8px 0 4px; letter-spacing: -.5px; }
.stat-foot { font-size: 11px; color: var(--text-3); }

/* ============ 面板 ============ */
.panel-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
.panel {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 14px; padding: 20px 22px; margin-bottom: 16px;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.panel-head h3 { font-size: 15px; font-weight: 600; }
.panel-tag { font-size: 11px; color: var(--text-3); background: var(--panel-2); padding: 3px 9px; border-radius: 6px; }

/* 条形图 */
.bar-chart { display: flex; flex-direction: column; gap: 13px; }
.bar-item { display: grid; grid-template-columns: 60px 1fr 70px; align-items: center; gap: 12px; }
.bar-label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.bar-track { height: 9px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #4f8cff, #7c5cff); transition: width .6s ease; }
.bar-num { font-size: 12px; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.bar-num small { color: var(--text-3); }

/* 环形图 */
.health-wrap { display: flex; align-items: center; gap: 28px; }
.donut {
    width: 130px; height: 130px; border-radius: 50%; flex-shrink: 0;
    display: grid; place-items: center; position: relative;
}
.donut-center { text-align: center; }
.donut-value { font-size: 26px; font-weight: 700; }
.donut-label { font-size: 11px; color: var(--text-3); }
.legend { display: flex; flex-direction: column; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; }
.legend-item b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* TOP 列表 */
.top-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.top-item {
    background: var(--panel-2); border-radius: 10px; padding: 12px 14px;
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.top-item { min-width: 0; }
.top-item .name { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.top-item .num { font-size: 15px; font-weight: 700; color: var(--primary); flex-shrink: 0; }

/* ============ 工具栏 / 表格 ============ */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search-box {
    flex: 1; min-width: 220px; position: relative;
}
.search-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 18px; }
.search-box input, .filter-group select, .per-page {
    background: var(--panel); border: 1px solid var(--border); color: var(--text);
    border-radius: 9px; padding: 9px 12px; font-size: 13px; outline: none;
}
.search-box input { width: 100%; padding-left: 38px; }
.search-box input:focus, .filter-group select:focus { border-color: var(--primary); }
.filter-group { display: flex; gap: 8px; }
.filter-group select { cursor: pointer; }
.result-bar { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 12px; color: var(--text-2); }
.result-bar .hint { color: var(--text-3); }

.table-wrap {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 12px; overflow: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    background: var(--panel-2); color: var(--text-2); font-weight: 600;
    text-align: left; padding: 12px 14px; white-space: nowrap;
    position: sticky; top: 0; cursor: pointer; user-select: none;
}
.data-table th:hover { color: var(--primary); }
.data-table th.num { text-align: right; }
.sort-mark { font-size: 10px; color: var(--text-3); margin-left: 3px; }
.data-table td { padding: 11px 14px; border-top: 1px solid var(--border); }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody tr { cursor: pointer; transition: background .12s; }
.data-table tbody tr:hover { background: var(--panel-2); }
.model-cell { font-weight: 600; color: var(--text); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remark-cell { color: var(--text-2); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.badge-brand { background: rgba(79,140,255,.14); color: var(--primary); }
.stock-ok { color: var(--green); font-weight: 700; }
.stock-low { color: var(--orange); font-weight: 700; }
.stock-out { color: var(--red); font-weight: 700; }
.row-actions { display: flex; gap: 6px; }
.icon-btn {
    border: 1px solid var(--border); background: transparent; color: var(--text-2);
    width: 28px; height: 28px; border-radius: 7px; cursor: pointer; font-size: 13px;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty-ico { font-size: 48px; opacity: .4; }
.empty-state p { font-size: 15px; color: var(--text-2); margin: 12px 0 4px; }

.pagination { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.page-btn {
    background: var(--panel); border: 1px solid var(--border); color: var(--text);
    padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 12px;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-info { color: var(--text-2); font-size: 12px; }
.per-page { margin-left: auto; padding: 7px 10px; cursor: pointer; }

/* ============ 弹窗 ============ */
.modal {
    display: none; position: fixed; inset: 0; z-index: 100;
    background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
    align-items: center; justify-content: center; padding: 20px;
}
.modal.open { display: flex; }
.modal-box {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 16px; width: 100%; max-width: 620px;
    box-shadow: var(--shadow); max-height: 90vh; display: flex; flex-direction: column;
    animation: pop .2s ease;
}
.modal-box.small { max-width: 480px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; }
.modal-close { background: none; border: 0; color: var(--text-3); font-size: 24px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; align-items: center; padding: 16px 24px; border-top: 1px solid var(--border); }
.spacer { flex: 1; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.form-field input {
    width: 100%; background: var(--bg-2); border: 1px solid var(--border);
    color: var(--text); border-radius: 8px; padding: 9px 11px; font-size: 13px; outline: none;
}
.form-field input:focus { border-color: var(--primary); }
.req { color: var(--red); }
.person-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.person-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.person-title span { font-size: 11px; color: var(--text-3); font-weight: 400; }
.person-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
.calc-preview {
    margin-top: 18px; padding: 12px 16px; border-radius: 9px;
    background: rgba(79,140,255,.08); border: 1px solid rgba(79,140,255,.2);
    font-size: 12px; display: flex; gap: 24px; flex-wrap: wrap;
}
.calc-preview b { color: var(--primary); font-size: 15px; }

/* 导入 */
.dropzone {
    border: 2px dashed var(--border); border-radius: 12px; padding: 30px 20px;
    text-align: center; cursor: pointer; transition: all .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: rgba(79,140,255,.05); }
.drop-ico { font-size: 30px; color: var(--primary); }
.dropzone p { margin: 10px 0 4px; font-weight: 600; }
.dropzone span { font-size: 11px; color: var(--text-3); }
.file-info {
    margin-top: 12px; padding: 10px 14px; border-radius: 8px;
    background: var(--panel-2); font-size: 12px; color: var(--green);
}
.import-options { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.radio-label { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; font-size: 12px; color: var(--text-2); }
.radio-label input { margin-top: 2px; accent-color: var(--primary); }
.radio-label b { color: var(--text); }
.import-tip { margin-top: 16px; font-size: 11px; color: var(--text-3); line-height: 1.6; background: var(--panel-2); padding: 10px 12px; border-radius: 8px; }

/* Toast */
.toast {
    position: fixed; bottom: 28px; right: 28px; z-index: 200;
    background: var(--panel-2); border: 1px solid var(--border);
    border-left: 3px solid var(--green);
    padding: 13px 18px; border-radius: 10px; box-shadow: var(--shadow);
    font-size: 13px; transform: translateY(100px); opacity: 0;
    transition: all .3s ease; pointer-events: none; max-width: 360px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-left-color: var(--red); }

/* ============ 响应式适配 ============ */
.mobile-theme-btn { display: none; }   /* 桌面端隐藏，仅手机端显示 */

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .panel-row { grid-template-columns: 1fr; }
    .top-list { grid-template-columns: repeat(2, 1fr); }
    .match-banner { flex-wrap: wrap; }
    .match-metrics { gap: 16px; }
}

/* 平板：侧边栏收为图标栏 */
@media (min-width: 761px) and (max-width: 1000px) {
    .sidebar { width: 68px; padding: 20px 10px; }
    .brand { justify-content: center; padding: 0 0 24px; }
    .brand > div:last-child, .nav-label, .sync-info, .theme-toggle { display: none; }
    .nav-item { justify-content: center; padding: 12px; }
}

/* 手机：底部标签栏布局 */
@media (max-width: 760px) {
    .app { flex-direction: column; }
    .main { padding: 16px 14px 88px; }   /* 底部留出标签栏空间 */

    /* 侧边栏 -> 底部标签栏 */
    .sidebar {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto;
        width: 100%; height: 62px; z-index: 50;
        flex-direction: row; align-items: stretch;
        padding: 0; border-right: 0; border-top: 1px solid var(--border);
        background: var(--bg-2); box-shadow: 0 -4px 20px rgba(0,0,0,.2);
    }
    .brand, .sidebar-foot { display: none; }
    .nav { flex-direction: row; width: 100%; gap: 0; }
    .nav-item {
        flex: 1; flex-direction: column; justify-content: center; gap: 3px;
        padding: 6px 2px; border-radius: 0; font-size: 11px;
    }
    .nav-item.active { background: transparent; border-top: 2px solid var(--primary); }
    .nav-ico { font-size: 19px; width: auto; }

    /* 顶栏 */
    .topbar { flex-direction: column; gap: 14px; align-items: stretch; }
    .topbar-title h1 { font-size: 20px; }
    .topbar-title p { font-size: 12px; }
    .topbar-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
    .topbar-actions .btn { padding: 9px 4px; font-size: 11px; justify-content: center; }
    .mobile-theme-btn { display: inline-flex; }

    /* 统计卡片 */
    .stats-grid { gap: 10px; }
    .stat-card { padding: 14px 15px; }
    .stat-value { font-size: 24px; }
    .stat-label, .stat-foot { font-size: 11px; }

    /* 面板 */
    .panel { padding: 16px; }
    .panel-row { gap: 12px; }
    .top-list { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .health-wrap { gap: 16px; flex-wrap: wrap; justify-content: center; }
    .bar-item { grid-template-columns: 52px 1fr 62px; gap: 8px; }

    /* 目录关联条 */
    .match-banner { padding: 14px; gap: 12px; }
    .match-text { flex-basis: calc(100% - 56px); }
    .match-metrics { width: 100%; justify-content: space-around; gap: 8px; order: 3; }
    .match-banner > .btn { width: 100%; order: 4; }
    .mm span { font-size: 17px; }

    /* 工具栏与筛选 */
    .toolbar { gap: 8px; }
    .search-box { flex-basis: 100%; }
    .filter-group { flex: 1; }
    .filter-group select { flex: 1; min-width: 0; }
    .result-bar { font-size: 11px; }
    .result-bar .hint { display: none; }

    /* 表格：横向滚动 + 首列固定 */
    .table-wrap { border-radius: 10px; }
    .data-table { font-size: 12px; min-width: 720px; }
    .data-table th, .data-table td { padding: 9px 10px; }
    .data-table th:first-child, .data-table td:first-child {
        position: sticky; left: 0; z-index: 2;
        background: var(--panel); box-shadow: 2px 0 6px rgba(0,0,0,.15);
    }
    .data-table th:first-child { background: var(--panel-2); z-index: 3; }
    .data-table tbody tr:hover td:first-child { background: var(--panel-2); }
    .model-cell { max-width: 200px; }
    .table-wrap::after {
        content: '← 左右滑动查看更多 →';
        display: block; text-align: center; font-size: 10px;
        color: var(--text-3); padding: 6px; background: var(--panel-2);
    }
    .catalog-table { min-width: 860px; }

    /* 分页 */
    .pagination { flex-wrap: wrap; gap: 8px; justify-content: center; }
    .page-info { order: -1; width: 100%; text-align: center; }
    .per-page { margin-left: 0; }

    /* 弹窗 */
    .modal { padding: 10px; align-items: flex-end; }
    .modal-box { max-height: 94vh; border-radius: 16px 16px 10px 10px; }
    .modal-head, .modal-body, .modal-foot { padding: 16px; }
    .form-grid, .person-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .calc-preview { flex-direction: column; gap: 6px; }
    .modal-foot .btn { flex: 1; justify-content: center; }

    /* 目录介绍 / Toast */
    .catalog-intro { padding: 14px; }
    .toast { left: 16px; right: 16px; bottom: 74px; max-width: none; }
}

/* 超窄屏（iPhone SE 等） */
@media (max-width: 380px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 21px; }
    .topbar-actions { grid-template-columns: repeat(2, 1fr); }
    .nav-label { font-size: 10px; }
    .form-grid, .person-grid { grid-template-columns: 1fr; }
}

/* ============ 目录关联功能 ============ */
.match-banner {
    display: flex; align-items: center; gap: 16px;
    background: linear-gradient(100deg, rgba(79,140,255,.12), rgba(167,139,250,.08));
    border: 1px solid rgba(79,140,255,.25); border-radius: 14px;
    padding: 16px 20px; margin-bottom: 20px;
}
.match-icon {
    width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
    background: linear-gradient(135deg, #4f8cff, #7c5cff);
    display: grid; place-items: center; color: #fff; font-size: 20px; font-weight: 700;
}
.match-text { flex: 1; min-width: 0; }
.match-title { font-size: 14px; font-weight: 600; }
.match-desc { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.match-metrics { display: flex; gap: 24px; }
.mm { text-align: center; }
.mm span { display: block; font-size: 20px; font-weight: 700; color: var(--primary); }
.mm small { font-size: 11px; color: var(--text-3); }

.catalog-intro {
    display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
    padding: 16px 20px; background: var(--panel);
    border: 1px solid var(--border); border-radius: 12px;
}
.ci-icon {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    background: rgba(167,139,250,.16); color: var(--purple);
    display: grid; place-items: center; font-size: 20px; font-weight: 700;
}
.ci-title { font-size: 15px; font-weight: 600; }
.ci-desc { font-size: 12px; color: var(--text-2); margin-top: 3px; }

.catalog-table th:nth-child(5), .catalog-table th:nth-child(6) { white-space: nowrap; }
.cat-price { color: var(--green); font-weight: 600; }
.cat-chan { color: var(--text-2); font-size: 12px; }
.cat-stock { color: var(--primary); font-weight: 600; }
.cat-cat { font-size: 11px; color: var(--text-3); display: block; }
.badge-match {
    display: inline-block; padding: 1px 7px; border-radius: 5px;
    font-size: 10px; margin-left: 6px; font-weight: 600;
}
.badge-exact { background: rgba(53,208,165,.15); color: var(--green); }
.badge-fuzzy { background: rgba(255,184,77,.15); color: var(--orange); }
.catalog-hint { font-size: 11px; color: var(--text-3); margin-top: 8px; }
.match-tag { color: var(--green); font-size: 11px; }

/* ============ 管理员登录页 ============ */
.login-page {
    min-height: 100vh; min-height: 100dvh;
    display: grid; place-items: center;
    padding: 24px; position: relative; overflow: hidden;
    background: radial-gradient(circle at 12% 8%, rgba(79,140,255,.14), transparent 50%), var(--bg);
}
.login-glow-wrap {
    position: absolute; inset: 0; overflow: hidden;
    pointer-events: none; z-index: 0;
}
.login-glow {
    position: absolute; border-radius: 50%; filter: blur(90px);
    pointer-events: none; opacity: .55;
}
.login-glow-a { width: 340px; height: 340px; top: -140px; left: -110px; background: rgba(79,140,255,.22); }
.login-glow-b { width: 300px; height: 300px; bottom: -130px; right: -100px; background: rgba(167,139,250,.18); }
.login-shell { position: relative; z-index: 1; width: 100%; max-width: 420px; }
.login-card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 20px; padding: 36px 34px 26px; box-shadow: var(--shadow);
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo {
    width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 15px;
    background: linear-gradient(135deg, #4f8cff, #7c5cff);
    display: grid; place-items: center; color: #fff; font-size: 28px;
    box-shadow: 0 8px 24px rgba(79,140,255,.35);
}
.login-brand h1 { font-size: 21px; font-weight: 700; letter-spacing: .5px; }
.login-brand p { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.login-badge {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    font-size: 11px; color: var(--text-2); margin-bottom: 22px;
}
.login-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(53,208,165,.12); }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 7px; }
.login-input {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 0 12px; transition: border-color .2s;
}
.login-input:focus-within { border-color: var(--primary); }
.login-input-ico { color: var(--text-3); font-size: 14px; }
.login-input input {
    flex: 1; min-width: 0; height: 46px; border: 0; outline: 0;
    background: transparent; color: var(--text); font-size: 14px;
}
.login-input input::placeholder { color: var(--text-3); }
.login-eye {
    border: 0; background: transparent; color: var(--text-3);
    font-size: 17px; cursor: pointer; padding: 4px;
}
.login-error {
    display: none; font-size: 12px; color: var(--red);
    background: rgba(255,107,107,.09); border: 1px solid rgba(255,107,107,.25);
    border-radius: 8px; padding: 9px 11px; margin-bottom: 14px;
}
.login-error.show { display: block; }
.login-submit {
    width: 100%; height: 48px; border: 0; border-radius: 10px; cursor: pointer;
    background: linear-gradient(135deg, #4f8cff, #6c63ff); color: #fff;
    font-size: 15px; font-weight: 700; letter-spacing: 3px;
    transition: filter .2s, transform .1s;
}
.login-submit:hover { filter: brightness(1.1); }
.login-submit:active { transform: scale(.99); }
.login-submit:disabled { opacity: .65; cursor: wait; }
.login-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--border); font-size: 11px; color: var(--text-3);
}
.login-theme { border: 0; background: transparent; color: var(--text-2); font-size: 11px; cursor: pointer; padding: 4px 0; }
.login-copy { text-align: center; color: var(--text-3); font-size: 11px; margin-top: 20px; }

/* ============ 管理员区块 ============ */
.admin-block {
    margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.admin-name { font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.admin-name b { color: var(--text); font-weight: 600; }
.admin-actions { display: flex; gap: 8px; }
.admin-actions .btn { flex: 1; font-size: 11px; padding: 8px 6px; justify-content: center; }
.nav-item[data-view="account"] { display: none; }

/* ============ 价格目录编辑 ============ */
.cat-toolbar-btn { white-space: nowrap; }
.cat-edit-box { max-width: 620px; }
.cat-form-section {
    margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.cat-form-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.cat-form-title {
    font-size: 12px; font-weight: 700; color: var(--primary);
    margin-bottom: 12px; display: flex; align-items: center; gap: 7px;
}
.cat-form-title::before {
    content: ''; width: 3px; height: 13px; border-radius: 2px; background: var(--primary);
}
.cat-form-note { font-size: 11px; color: var(--text-3); margin-top: 10px; line-height: 1.6; }
.cat-price-preview {
    margin-top: 12px; padding: 10px 12px; border-radius: 9px;
    background: rgba(53,208,165,.08); border: 1px solid rgba(53,208,165,.2);
    font-size: 12px; color: var(--text-2);
}
.cat-price-preview b { color: var(--green); }
.cat-row-actions { display: flex; gap: 5px; }
.cat-row-actions .icon-btn { font-size: 14px; }
.badge-manual {
    background: rgba(167,139,250,.15); color: var(--purple);
}

/* 手机端补充说明 */
@media (max-width: 760px) {
    .login-page { padding: 18px 16px; }
    .login-card { padding: 28px 20px 20px; border-radius: 18px; }
    .login-brand h1 { font-size: 19px; }
    .login-logo { width: 50px; height: 50px; font-size: 25px; }
    .login-foot { flex-direction: column; gap: 8px; text-align: center; }
    .nav-item[data-view="account"] { display: flex; }
    .catalog-table { min-width: 940px; }
    .cat-form-section { margin-bottom: 14px; padding-bottom: 12px; }
}
@media (max-height: 640px) {
    .login-card { padding-top: 20px; padding-bottom: 16px; }
    .login-brand { margin-bottom: 14px; }
    .login-logo { width: 44px; height: 44px; margin-bottom: 10px; font-size: 22px; }
    .login-field { margin-bottom: 11px; }
    .login-input input { height: 40px; }
}
@media (max-width: 380px) {
    .cat-toolbar-btn { font-size: 11px; }
}

/* ============ 库存明细：精简三列 ============ */
.inventory-table th:first-child { width: 40%; }
.inventory-table th:nth-child(2) { width: 18%; }
.inventory-table th:nth-child(3) { width: 42%; }
.inventory-table .model-cell, .inventory-table .remark-cell { max-width: none; }

@media (max-width: 760px) {
    .inventory-table { min-width: 0; table-layout: fixed; }
    .inventory-wrap::after { display: none; }
    .inventory-table th:first-child, .inventory-table td:first-child {
        position: static; box-shadow: none;
    }
    .inventory-table th:nth-child(1) { width: 46%; }
    .inventory-table th:nth-child(2) { width: 22%; }
    .inventory-table th:nth-child(3) { width: 32%; }
    .inventory-table th, .inventory-table td { padding: 10px 8px; }
}
