/* ==========================================================================
   LIMS 实验室信息管理系统 —— 全站样式
   纯手写 CSS：无 CDN、无构建步骤，演示环境无外网也能完整呈现。
   ========================================================================== */

:root {
    --bg: #f4f6fb;
    --panel: #ffffff;
    --panel-2: #fafbfe;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #6b7a90;
    --line: #e6eaf2;
    --line-2: #f1f4fa;
    --brand: #4f46e5;
    --brand-ink: #3730a3;
    --brand-soft: #eef0ff;
    --ok: #16a34a;
    --warn: #d97706;
    --bad: #dc2626;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -18px rgba(15, 23, 42, .28);
    --radius: 12px;
    --side-w: 254px;
    --font: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

body.dark {
    --bg: #0b1220;
    --panel: #121b2d;
    --panel-2: #162034;
    --ink: #e8eefc;
    --ink-2: #c3cde0;
    --muted: #8c9ab4;
    --line: #22304a;
    --line-2: #1b2740;
    --brand: #7c83ff;
    --brand-ink: #b9bcff;
    --brand-soft: #1d2544;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -20px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.35; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.ta-right { text-align: right; }
.ta-center { text-align: center; }
.ic { vertical-align: -3px; }

/* ------------------------------------------------------------ 主框架 */

.shell { display: flex; min-height: 100vh; }

.side {
    width: var(--side-w);
    flex: 0 0 var(--side-w);
    background: var(--panel);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--line-2);
    position: sticky;
    top: 0;
    background: var(--panel);
    z-index: 3;
}

.brand-mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    color: #fff; display: grid; place-items: center;
    font-weight: 700; font-size: 15px; letter-spacing: .5px;
    box-shadow: 0 6px 16px -8px rgba(79, 70, 229, .9);
}

.brand-text b { display: block; font-size: 15px; letter-spacing: .2px; }
.brand-text span { display: block; font-size: 11.5px; color: var(--muted); }

.nav { padding: 10px 10px 90px; }
.nav-group { margin-bottom: 4px; }
.nav-title {
    display: flex; align-items: center; gap: 6px;
    padding: 12px 10px 6px;
    font-size: 11.5px; font-weight: 600; color: var(--muted);
    letter-spacing: .6px;
}
.nav a {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px; margin: 1px 0;
    border-radius: 9px; color: var(--ink-2); font-size: 13.5px;
}
.nav a:hover { background: var(--panel-2); text-decoration: none; color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.nav a.on .ic { color: var(--brand); }
.nav a .count { margin-left: auto; font-size: 11.5px; color: var(--muted); }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.top {
    height: 60px; flex: 0 0 60px;
    background: var(--panel); border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 14px;
    padding: 0 20px; position: sticky; top: 0; z-index: 5;
}

.top .search { flex: 1 1 420px; max-width: 520px; }
.top .search input {
    width: 100%; height: 36px; border-radius: 9px;
    border: 1px solid var(--line); background: var(--panel-2);
    padding: 0 12px 0 34px; font-family: var(--font); font-size: 13.5px; color: var(--ink);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7a90' stroke-width='2'><circle cx='11' cy='11' r='6'/><path d='M20 20l-4.5-4.5'/></svg>");
    background-repeat: no-repeat; background-position: 11px center;
}
.top .search input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.chip-role {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 11px; border-radius: 999px;
    background: var(--brand-soft); color: var(--brand-ink);
    font-size: 12.5px; font-weight: 600;
}

.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4, #4f46e5);
    color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
}

.icon-btn {
    width: 34px; height: 34px; border-radius: 9px;
    border: 1px solid var(--line); background: var(--panel);
    display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--panel-2); }
.icon-btn.on { background: var(--brand-soft); color: var(--brand-ink); }

.content { padding: 20px 22px 60px; max-width: 1560px; width: 100%; }
.side-toggle { display: none; }

/* ------------------------------------------------------------ 页头 */

.page-head {
    display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.page-head h1 { font-size: 21px; letter-spacing: .2px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }

/* ------------------------------------------------------------ 按钮 */

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 13px; border-radius: 9px;
    border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
    font-family: var(--font); font-size: 13px; font-weight: 550; cursor: pointer;
    white-space: nowrap;
}
.btn:hover { background: var(--panel-2); text-decoration: none; color: var(--ink); }
.btn-primary {
    background: var(--brand); border-color: var(--brand); color: #fff;
    box-shadow: 0 6px 16px -10px rgba(79, 70, 229, .9);
}
.btn-primary:hover { background: var(--brand-ink); color: #fff; }
.btn-danger { color: var(--bad); border-color: #f6d3d3; background: #fff5f5; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled], .btn.off { opacity: .5; pointer-events: none; }

/* ------------------------------------------------------------ 卡片 / 面板 */

.card, .panel {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
}

.panel { margin-bottom: 16px; overflow: hidden; }
.panel-hd {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 15px; border-bottom: 1px solid var(--line-2);
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
}
.panel-hd h3 { font-size: 14.5px; display: flex; align-items: center; gap: 7px; }
.panel-hd .ic { color: var(--brand); }
.panel-extra { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.panel-bd { padding: 14px 15px; }
.panel-bd.flush { padding: 0; }

.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); }
@media (max-width: 1400px) { .g-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1200px) {
    .g-5, .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .g-side, .g-3 { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------ 指标卡 */

.stat {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 13px 14px; display: flex; gap: 11px; align-items: flex-start;
    box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after {
    content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--brand);
}
.stat.t-cyan::after { background: #06b6d4; }
.stat.t-violet::after { background: #8b5cf6; }
.stat.t-amber::after { background: #f59e0b; }
.stat.t-red::after { background: #ef4444; }
.stat.t-green::after { background: #16a34a; }
.stat.t-orange::after { background: #f97316; }
.stat.t-rose::after { background: #e11d48; }
.stat.t-slate::after { background: #94a3b8; }
.stat-ic {
    width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px;
    display: grid; place-items: center; background: var(--brand-soft); color: var(--brand);
}
.stat.t-cyan .stat-ic { background: #e0f7fb; color: #0e7490; }
.stat.t-violet .stat-ic { background: #f1ebff; color: #7c3aed; }
.stat.t-amber .stat-ic { background: #fef4e2; color: #b45309; }
.stat.t-red .stat-ic { background: #fee7e7; color: #b91c1c; }
.stat.t-green .stat-ic { background: #e7f8ee; color: #15803d; }
.stat.t-orange .stat-ic { background: #ffefe3; color: #c2410c; }
.stat.t-rose .stat-ic { background: #ffe8ee; color: #be123c; }
.stat.t-slate .stat-ic { background: #eef2f7; color: #475569; }
body.dark .stat-ic { background: #1e2a44; color: #c7d2fe; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-value { font-size: 23px; font-weight: 700; letter-spacing: -.4px; margin-top: 1px; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ------------------------------------------------------------ 徽标 */

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 550;
    background: #eef2f7; color: #475569; white-space: nowrap;
}
.badge.dot::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.b-indigo { background: #eceffe; color: #4338ca; }
.b-blue { background: #e7f0ff; color: #1d4ed8; }
.b-cyan { background: #e2f7fa; color: #0e7490; }
.b-green { background: #e7f8ee; color: #15803d; }
.b-amber { background: #fdf3e0; color: #b45309; }
.b-orange { background: #ffefe3; color: #c2410c; }
.b-red { background: #fee7e7; color: #b91c1c; }
.b-rose { background: #ffe8ee; color: #be123c; }
.b-violet { background: #f2ebff; color: #6d28d9; }
.b-slate { background: #eef2f7; color: #475569; }
body.dark .badge { background: #1e2a44; color: #c7d2fe; }

/* ------------------------------------------------------------ 表格 */

.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tb th {
    text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted);
    padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2);
    white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.tb td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tb tbody tr:hover { background: var(--panel-2); }
table.tb td.strong { font-weight: 600; }
table.tb td.mono { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
table.tb .ellipsis { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.tb .row-act { display: flex; gap: 6px; justify-content: flex-end; }
table.tb tr.total-row td { background: var(--panel-2); font-weight: 600; }
table.mini { font-size: 12.8px; }
table.mini th, table.mini td { padding: 7px 10px; }

.pager {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 11px 14px; border-top: 1px solid var(--line-2); font-size: 12.5px;
}
.pg {
    min-width: 30px; height: 28px; padding: 0 8px; border-radius: 7px;
    display: inline-grid; place-items: center; border: 1px solid var(--line);
    color: var(--ink-2); background: var(--panel);
}
.pg:hover { background: var(--panel-2); text-decoration: none; }
.pg.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pg.off { opacity: .45; }
.pager .muted { margin-left: auto; }

/* ------------------------------------------------------------ 筛选条 */

.filter-bar {
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    padding: 12px 14px; border-bottom: 1px solid var(--line-2); background: var(--panel-2);
}
.filter-bar input[type=text], .filter-bar select {
    height: 34px; border-radius: 9px; border: 1px solid var(--line);
    background: var(--panel); color: var(--ink); padding: 0 10px; font-family: var(--font); font-size: 13px;
}
.filter-bar input[type=text] { min-width: 230px; }
.filter-bar .spacer { margin-left: auto; }
.filter-bar label { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }

.dist-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.dist-item {
    display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px;
    border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line);
    font-size: 12.5px; color: var(--ink-2);
}
.dist-item b { font-size: 13.5px; }

/* ------------------------------------------------------------ 详情 / 表单 */

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2px 18px; }
.kv .kv-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); }
.kv .kv-k { flex: 0 0 118px; color: var(--muted); font-size: 12.8px; }
.kv .kv-v { flex: 1 1 auto; min-width: 0; word-break: break-word; }
.kv .kv-wide { grid-column: 1 / -1; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 900px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.field label { display: block; font-size: 12.8px; color: var(--ink-2); font-weight: 600; margin-bottom: 5px; }
.field label .req { color: var(--bad); margin-left: 3px; }
.field input[type=text], .field input[type=number], .field input[type=password],
.field input[type=date], .field input[type=datetime-local], .field select, .field textarea {
    width: 100%; border-radius: 9px; border: 1px solid var(--line);
    background: var(--panel); color: var(--ink);
    padding: 8px 10px; font-family: var(--font); font-size: 13.5px; line-height: 1.5;
}
.field textarea { resize: vertical; min-height: 76px; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 3px solid var(--brand-soft); border-color: var(--brand);
}
.field .hint { font-size: 11.8px; color: var(--muted); margin-top: 4px; }
.field .ph { color: var(--muted); }
.form-actions {
    display: flex; gap: 9px; align-items: center;
    padding: 14px 15px; border-top: 1px solid var(--line-2); background: var(--panel-2);
}
.form-actions .spacer { margin-left: auto; }

/* ------------------------------------------------------------ 提示条 */

.flash {
    display: flex; gap: 9px; align-items: flex-start;
    padding: 10px 13px; border-radius: 10px; margin-bottom: 12px; font-size: 13.5px;
    border: 1px solid var(--line); background: var(--panel);
}
.flash.success { background: #eaf8f0; border-color: #c7ebd6; color: #14532d; }
.flash.error { background: #fdecec; border-color: #f7cccc; color: #7f1d1d; }
body.dark .flash.success { background: #10301f; border-color: #1d5433; color: #bbf7d0; }
body.dark .flash.error { background: #3a1414; border-color: #6b2020; color: #fecaca; }

.alert-list { display: flex; flex-direction: column; gap: 9px; }
.alert-item {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 9px 11px; border-radius: 10px; background: var(--panel-2);
    border: 1px solid var(--line); border-left: 3px solid var(--brand);
}
.alert-item.t-amber { border-left-color: #f59e0b; }
.alert-item.t-red { border-left-color: #ef4444; }
.alert-item.t-orange { border-left-color: #f97316; }
.alert-item.t-rose { border-left-color: #e11d48; }
.alert-item.t-slate { border-left-color: #94a3b8; }
.alert-item b { display: block; font-size: 13.2px; }
.alert-item span { font-size: 12.2px; color: var(--muted); }

.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 11px;
    border: 1px solid var(--line); border-radius: 10px; color: var(--ink);
    background: var(--panel-2);
}
.todo-item:hover { text-decoration: none; border-color: var(--brand); }
.todo-item .n {
    min-width: 30px; height: 26px; padding: 0 8px; border-radius: 8px;
    display: grid; place-items: center; font-weight: 700; font-size: 13px;
    background: var(--brand-soft); color: var(--brand-ink);
}
.todo-item.t-amber .n { background: #fef4e2; color: #b45309; }
.todo-item.t-blue .n { background: #e7f0ff; color: #1d4ed8; }
.todo-item.t-violet .n { background: #f2ebff; color: #6d28d9; }
.todo-item.t-red .n { background: #fee7e7; color: #b91c1c; }
.todo-item.t-orange .n { background: #ffefe3; color: #c2410c; }
.todo-item.t-green .n { background: #e7f8ee; color: #15803d; }
.todo-item .t { flex: 1 1 auto; font-size: 13.2px; }

/* ------------------------------------------------------------ 图表 */

.chart { width: 100%; height: auto; display: block; }
.cax { font-size: 10px; fill: var(--muted); font-family: var(--font); }
.cvl { font-size: 10.5px; fill: var(--ink-2); font-family: var(--font); font-weight: 600; }
.dnum { font-size: 22px; font-weight: 700; fill: var(--ink); font-family: var(--font); }
.dcap { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.donut { margin: 0 auto; }
.spark { display: block; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; }
.legend .lg-label { flex: 1 1 auto; color: var(--ink-2); }
.legend b { font-variant-numeric: tabular-nums; }

.donut-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-row .legend { flex: 1 1 180px; }

.prog { height: 7px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.prog > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.prog.p-green > span { background: #16a34a; }
.prog.p-amber > span { background: #f59e0b; }
.prog.p-red > span { background: #ef4444; }
.prog.p-cyan > span { background: #06b6d4; }

/* ------------------------------------------------------------ 看板 */

.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col {
    flex: 0 0 268px; background: var(--panel-2); border: 1px solid var(--line);
    border-radius: var(--radius); display: flex; flex-direction: column; max-height: 74vh;
}
.col-hd {
    display: flex; align-items: center; gap: 8px; padding: 11px 12px;
    border-bottom: 1px solid var(--line); background: var(--panel); border-radius: var(--radius) var(--radius) 0 0;
}
.col-hd b { font-size: 13.5px; }
.col-hd .n { margin-left: auto; font-size: 12px; color: var(--muted); }
.col-bd { padding: 10px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; }
.card-task {
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 11px; box-shadow: var(--shadow);
}
.card-task:hover { border-color: var(--brand); }
.card-task .ct { display: flex; gap: 7px; align-items: baseline; }
.card-task .ct b { font-size: 13.3px; flex: 1 1 auto; }
.card-task .cm { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.card-task .cb { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 12px; }
.overdue { color: #dc2626; font-weight: 600; }

/* ------------------------------------------------------------ 时间线 */

.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; }
.timeline li { position: relative; padding: 0 0 14px 18px; border-left: 1px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
    content: ''; position: absolute; left: -5px; top: 5px;
    width: 9px; height: 9px; border-radius: 50%; background: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.timeline .tt { font-size: 13.2px; }
.timeline .tm { font-size: 11.8px; color: var(--muted); }

/* ------------------------------------------------------------ 业务链路 / 下游 chips */

.chain { list-style: none; margin: 0; padding: 0; }
.chain li { position: relative; padding: 0 0 12px 20px; border-left: 2px solid var(--line); }
.chain li:last-child { border-left-color: transparent; padding-bottom: 0; }
.chain li::before {
    content: ''; position: absolute; left: -6px; top: 6px;
    width: 10px; height: 10px; border-radius: 50%;
    background: #fff; border: 2px solid var(--brand);
}
.chain li.chain-on::before { background: var(--brand); }
.chain-bd { display: block; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
a.chain-bd:hover { border-color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.chain-t { font-size: 13px; font-weight: 600; }
.chain-m { font-size: 11.8px; color: var(--muted); margin-top: 2px; }
.chain li.chain-on .chain-bd { background: var(--brand-soft); border-color: var(--brand); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
    border: 1px solid var(--line); border-radius: 999px; font-size: 12.6px;
    background: var(--card); color: var(--text); text-decoration: none;
}
.chip:hover { border-color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.chip-n {
    display: inline-block; min-width: 20px; text-align: center; padding: 0 5px;
    border-radius: 999px; background: var(--brand); color: #fff; font-size: 11.4px; font-weight: 600;
}

/* ------------------------------------------------------------ 登录页 */

.login-wrap {
    min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
    background: var(--bg);
}
.login-left {
    background:
        radial-gradient(1000px 500px at 8% 12%, rgba(79, 70, 229, .22), transparent 60%),
        radial-gradient(760px 420px at 88% 88%, rgba(6, 182, 212, .2), transparent 62%),
        linear-gradient(135deg, #0f172a, #16233f 55%, #0b1220);
    color: #eaf0ff; padding: 54px 56px; display: flex; flex-direction: column;
}
.login-left h1 { font-size: 32px; letter-spacing: .4px; line-height: 1.28; }
.login-left .slogan { color: #a9b6d6; margin-top: 12px; font-size: 14px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.login-brand .brand-mark { width: 44px; height: 44px; font-size: 16px; }
.login-brand b { font-size: 17px; }
.login-brand span { display: block; font-size: 12px; color: #9fb0d4; }

.dim { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: auto; }
.dim div {
    border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px;
    padding: 10px 11px; background: rgba(255, 255, 255, .04);
}
.dim b { display: block; font-size: 13px; }
.dim span { font-size: 11.5px; color: #9fb0d4; }

.login-right {
    display: flex; align-items: center; justify-content: center; padding: 34px;
}
.login-card { width: 100%; max-width: 430px; }
.login-card h2 { font-size: 20px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.login-form .field { margin-bottom: 13px; }
.login-form .btn { width: 100%; justify-content: center; height: 40px; font-size: 14px; }

.demo-accounts { margin-top: 18px; }
.demo-accounts .hd { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.demo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.demo-chip {
    border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px;
    cursor: pointer; background: var(--panel); text-align: left; font-family: var(--font);
}
.demo-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.demo-chip b { display: block; font-size: 12.8px; color: var(--ink); }
.demo-chip span { font-size: 11.4px; color: var(--muted); }

/* ------------------------------------------------------------ 打印版式 */

.print-body { background: #fff; color: #111827; }
.paper {
    width: 210mm; min-height: 297mm; margin: 0 auto; padding: 16mm 15mm;
    background: #fff; box-shadow: 0 10px 40px -20px rgba(0, 0, 0, .35);
    color: #111827; font-size: 12.5px;
}
.paper h1 { font-size: 20px; text-align: center; letter-spacing: 3px; }
.paper .doc-no { text-align: center; color: #4b5563; font-size: 12px; margin-bottom: 14px; }
.paper-head { display: flex; align-items: flex-start; gap: 14px; border-bottom: 2px solid #111827; padding-bottom: 10px; margin-bottom: 14px; }
.paper-head .lab b { font-size: 15.5px; }
.paper-head .lab span { display: block; font-size: 11px; color: #4b5563; }
.paper table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 12px; }
.paper table th, .paper table td { border: 1px solid #9ca3af; padding: 5px 7px; vertical-align: top; }
.paper table th { background: #f3f4f6; font-weight: 600; text-align: left; }
.paper .sec-title { font-weight: 700; margin: 14px 0 6px; font-size: 13px; }
.paper .sign { display: flex; gap: 30px; margin-top: 22px; flex-wrap: wrap; }
.paper .sign div { flex: 1 1 160px; border-top: 1px solid #9ca3af; padding-top: 6px; font-size: 12px; }
.paper .qr { text-align: right; }
.print-toolbar {
    position: sticky; top: 0; background: var(--panel); border-bottom: 1px solid var(--line);
    padding: 10px 18px; display: flex; gap: 10px; align-items: center; z-index: 9;
}
.labels { display: flex; flex-wrap: wrap; gap: 8px; }
.label-card {
    width: 260px; border: 1px solid #111827; border-radius: 6px; padding: 10px 11px;
    background: #fff; color: #111827;
}
.label-card b { font-size: 13px; }
.label-card .row { display: flex; justify-content: space-between; font-size: 11.6px; gap: 8px; }
.label-card .code { font-family: var(--mono); font-size: 12.4px; font-weight: 700; }
.label-card .label-foot {
    display: flex; align-items: center; gap: 8px; margin-top: 7px;
    padding-top: 6px; border-top: 1px dashed #9ca3af;
}
.label-qr { width: 54px; height: 54px; }

/* 编号图形标识（打印在标签与报告角落） */
.code-pattern { width: 74px; height: 74px; display: block; }
.label-card .label-foot .code-pattern { width: 40px; height: 40px; }
.paper .qr .code-pattern { width: 82px; height: 82px; }

@media print {
    .no-print, .side, .top { display: none !important; }
    .paper { width: auto; min-height: 0; box-shadow: none; padding: 0; margin: 0; }
    .content { padding: 0; max-width: none; }
    body { background: #fff; font-size: 12px; }
    @page { size: A4; margin: 14mm; }
}

/* ------------------------------------------------------------ 杂项 */

.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty p { margin-top: 6px; }
.split { display: flex; gap: 12px; flex-wrap: wrap; }
.split > * { min-width: 0; }
.tag {
    display: inline-block; padding: 1px 8px; border-radius: 6px;
    background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2);
}
.hr { height: 1px; background: var(--line-2); margin: 12px 0; }
.scroll-x { overflow-x: auto; }
.money { font-variant-numeric: tabular-nums; }
.link-strong { font-weight: 600; }
details.inline-add { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 11px; margin-top: 10px; }
details.inline-add summary { cursor: pointer; font-size: 12.8px; color: var(--brand); }
details.inline-add .form-grid { margin-top: 10px; }

@media (max-width: 1000px) {
    .side { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .18s ease; }
    body.side-open .side { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .35); }
    .side-toggle { display: grid; }
    .login-wrap { grid-template-columns: minmax(0, 1fr); }
    .login-left { display: none; }
    .g-6, .g-5, .g-4, .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
}
