/* ============================================================
   结构化病理诊断报告管理系统 · 界面样式
   布局：左侧固定导航 + 顶部信息栏 + 右侧内容区
   主色：靛蓝 / 紫罗兰（报告签发与质控）
   ============================================================ */
:root {
  --brand: #4338ca;
  --brand-2: #4f46e5;
  --brand-3: #818cf8;
  --brand-soft: #eceafd;
  --ink: #2e2a72;
  --line: #dcdcf0;
  --line-2: #e8e8f6;
  --bg: #f0f0f8;
  --surface: #ffffff;
  --text: #23233a;
  --muted: #6b6b8a;
  --green: #15803d;
  --green-soft: #e7f4ec;
  --orange: #c2740f;
  --orange-soft: #fdf1e0;
  --red: #c0392b;
  --red-soft: #fbeae7;
  --blue: #2563a8;
  --blue-soft: #e8f1fb;
  --purple: #7c3aed;
  --purple-soft: #f1eafd;
  --teal: #0d9488;
  --teal-soft: #e0f2f1;
  --pink: #db2777;
  --pink-soft: #fce7f3;
  --sidebar-w: 232px;
  --header-h: 60px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(46, 42, 114, 0.05), 0 4px 16px rgba(46, 42, 114, 0.06);
  --shadow-lg: 0 12px 40px rgba(24, 20, 70, 0.24);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

/* 自定义滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c6c4e2; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #aba8d4; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border: 2px solid transparent; }
.side-nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 15% 10%, #4f46e5 0%, #2e2a72 45%, #17143f 100%);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  position: relative; overflow: hidden;
}
.login-page::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 26px 26px; opacity: 0.5;
}
.login-card {
  width: 940px; max-width: 96vw; min-height: 540px; background: #fff;
  border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; overflow: hidden;
  position: relative; z-index: 1;
}
.login-side {
  width: 400px; background: linear-gradient(160deg, #4f46e5, #2e2a72);
  color: #fff; padding: 46px 40px; display: flex; flex-direction: column; justify-content: space-between; position: relative;
}
.login-side::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, 0.05); }
.login-side .mark { font-size: 12px; letter-spacing: 2px; color: rgba(255, 255, 255, 0.7); }
.login-side .rule { width: 44px; height: 3px; background: var(--brand-3); margin: 18px 0; border-radius: 2px; }
.login-side h1 { font-size: 22px; line-height: 1.5; margin: 0 0 18px; font-weight: 600; }
.login-side p { color: rgba(255, 255, 255, 0.82); line-height: 1.95; font-size: 12.5px; margin: 0; }
.login-side .feat { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.login-side .feat span { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: rgba(255, 255, 255, 0.9); }
.login-side .feat i { width: 20px; height: 20px; border-radius: 6px; background: rgba(255, 255, 255, 0.16); display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px; }
.login-form { flex: 1; padding: 56px 58px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { font-size: 21px; margin: 0 0 6px; color: var(--ink); }
.login-form .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 30px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.field input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; font-size: 14px; color: var(--text); outline: none; transition: all 0.15s; }
.field input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14); }
.login-btn { height: 46px; border: none; border-radius: 8px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; font-size: 15px; letter-spacing: 3px; cursor: pointer; transition: filter 0.15s; }
.login-btn:hover { filter: brightness(1.06); }
.login-btn:disabled { background: #a9a6cf; cursor: not-allowed; }
.login-msg { min-height: 20px; color: var(--red); font-size: 12.5px; margin-top: 12px; }
.login-foot { margin-top: 26px; color: #9393ad; font-size: 12px; }

/* ---------- 应用框架 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: linear-gradient(180deg, #241f5c 0%, #312a7a 100%);
  color: #d6d3f0; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 30;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.side-brand .logo { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-2), var(--brand-3)); display: flex; align-items: center; justify-content: center; flex: 0 0 40px; box-shadow: 0 4px 12px rgba(129, 140, 248, 0.35); }
.side-brand .logo svg { width: 24px; height: 24px; }
.side-brand .tt { line-height: 1.3; }
.side-brand .tt b { display: block; font-size: 14px; color: #fff; font-weight: 600; letter-spacing: 0.5px; }
.side-brand .tt span { font-size: 10.5px; color: #a5a1e0; letter-spacing: 0.5px; }
.side-nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; }
.nav-group { margin-bottom: 6px; }
.nav-group .gt { font-size: 10.5px; letter-spacing: 1.5px; color: #8b87c8; padding: 12px 12px 6px; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 8px; color: #d6d3f0; cursor: pointer; font-size: 13px; margin-bottom: 2px; transition: background 0.14s, color 0.14s; position: relative; user-select: none; }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: 0.85; }
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, var(--brand-2), var(--brand)); color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35); }
.nav-item.active svg { opacity: 1; }
.nav-item .n-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10.5px; padding: 1px 7px; border-radius: 10px; font-weight: 600; }
.nav-item.active .n-badge { background: rgba(255, 255, 255, 0.25); }
.side-foot { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 11px; color: #9b97d6; line-height: 1.6; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.header { height: var(--header-h); background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 3px rgba(46, 42, 114, 0.04); }
.header .crumb { display: flex; align-items: center; gap: 10px; }
.header .crumb .mod-icon { width: 34px; height: 34px; border-radius: 8px; background: var(--brand-soft); display: flex; align-items: center; justify-content: center; }
.header .crumb .mod-icon svg { width: 19px; height: 19px; }
.header .crumb h1 { font-size: 16px; margin: 0; color: var(--ink); font-weight: 600; }
.header .crumb p { margin: 1px 0 0; font-size: 11.5px; color: var(--muted); }
.header .h-right { display: flex; align-items: center; gap: 14px; }
.header .clock { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.user-chip { display: flex; align-items: center; gap: 9px; background: var(--brand-soft); padding: 5px 12px 5px 6px; border-radius: 20px; }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.user-chip .u-meta { line-height: 1.25; }
.user-chip .u-meta b { display: block; font-size: 12.5px; color: var(--ink); }
.user-chip .u-meta span { font-size: 10.5px; color: var(--muted); }
.link-btn { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 6px 13px; border-radius: 7px; cursor: pointer; font-size: 12.5px; transition: all 0.14s; }
.link-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }

.content { padding: 20px 22px 34px; flex: 1; }
.view { display: none; animation: fade 0.25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 卡片与统计 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title h2 { font-size: 14.5px; margin: 0; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.card-title h2::before { content: ""; width: 4px; height: 15px; background: var(--brand-2); border-radius: 2px; }
.card-title .hint { color: var(--muted); font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2-uneven { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }

.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 13px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand-2); }
.stat .label { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 27px; font-weight: 700; margin-top: 8px; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }
.stat .extra { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.stat.ok::before { background: var(--green); } .stat.ok .value { color: var(--green); }
.stat.warn::before { background: var(--orange); } .stat.warn .value { color: var(--orange); }
.stat.danger::before { background: var(--red); } .stat.danger .value { color: var(--red); }
.stat.info::before { background: var(--blue); } .stat.info .value { color: var(--blue); }
.stat.purple::before { background: var(--purple); } .stat.purple .value { color: var(--purple); }
.stat.teal::before { background: var(--teal); } .stat.teal .value { color: var(--teal); }

/* ---------- 工具条 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar input[type="text"], .toolbar input[type="date"], .toolbar select { height: 34px; border: 1px solid var(--line); border-radius: 7px; padding: 0 11px; font-size: 12.5px; color: var(--text); background: #fff; outline: none; transition: border 0.14s; }
.toolbar input[type="text"] { width: 230px; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--brand-2); }
.toolbar select { min-width: 120px; }
.toolbar .spacer { flex: 1; }
.btn { height: 34px; padding: 0 15px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; font-size: 12.5px; transition: all 0.14s; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--brand-2); color: var(--brand-2); }
.btn.primary { background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.06); color: #fff; }
.btn.ghost { background: #f5f4fb; }
.btn.small { height: 27px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn.danger { color: var(--red); border-color: #e6b8b1; }
.btn.danger:hover { background: var(--red-soft); }
.btn.teal { color: var(--teal); border-color: #b5ded9; }
.btn.teal:hover { background: var(--teal-soft); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { background: #f1f0fa; color: #3a3670; font-weight: 600; text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
td { padding: 10px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:hover td { background: #f7f6fc; }
tbody tr:last-child td { border-bottom: none; }
.nowrap { white-space: nowrap; }
.mono { font-family: Consolas, "Courier New", monospace; }
.actions { display: flex; gap: 5px; flex-wrap: nowrap; align-items: center; }
td.actions { min-width: 150px; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 4px 0; color: var(--muted); font-size: 12.5px; }

/* ---------- 状态标签 ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 11px; font-size: 11.5px; border: 1px solid transparent; white-space: nowrap; }
.badge.gray { background: #eef0f4; color: #62627f; border-color: #dfdfe9; }
.badge.blue { background: var(--blue-soft); color: #1f5f9e; border-color: #cfe0f3; }
.badge.indigo { background: var(--brand-soft); color: #4338ca; border-color: #cfcbf2; }
.badge.green { background: var(--green-soft); color: #1a7a4f; border-color: #cde8d9; }
.badge.orange { background: var(--orange-soft); color: #a9641b; border-color: #f4ddc2; }
.badge.red { background: var(--red-soft); color: #a93226; border-color: #f0cdc7; }
.badge.purple { background: var(--purple-soft); color: #6d28d9; border-color: #e0d4f7; }
.badge.teal { background: var(--teal-soft); color: #0f766e; border-color: #b5ded9; }
.badge.pink { background: var(--pink-soft); color: #be185d; border-color: #f7c8dd; }

/* ---------- 图表 ---------- */
.bars .bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.bar-row .name { width: 110px; color: var(--muted); font-size: 12.5px; text-align: right; }
.bar-track { flex: 1; height: 18px; background: #eeedf6; border-radius: 9px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-3)); border-radius: 9px; transition: width 0.4s; }
.bar-row .num { width: 44px; font-size: 12.5px; color: #3a3670; font-weight: 600; }
.chart-box { width: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.legend .li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend .dot { width: 11px; height: 11px; border-radius: 3px; }
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut-legend { flex: 1; }
.donut-legend .row { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 12.5px; border-bottom: 1px dashed var(--line-2); }
.donut-legend .row .dot { width: 11px; height: 11px; border-radius: 3px; }
.donut-legend .row .nm { flex: 1; color: var(--text); }
.donut-legend .row .vl { font-weight: 600; color: var(--ink); }

/* ---------- 质控指标 ---------- */
.qc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.qc-tile { border: 1px solid var(--line); border-radius: 10px; padding: 15px 16px; background: linear-gradient(160deg, #fbfbff, #f4f3fc); position: relative; overflow: hidden; }
.qc-tile .ql { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.qc-tile .qv { font-size: 26px; font-weight: 700; color: var(--ink); margin: 8px 0 6px; font-variant-numeric: tabular-nums; }
.qc-tile .qv small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.qc-tile .qtrack { height: 6px; background: #e6e4f4; border-radius: 3px; overflow: hidden; }
.qc-tile .qfill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--brand-2), var(--brand-3)); }
.qc-tile.good .qfill { background: linear-gradient(90deg, #16a34a, #4ade80); }
.qc-tile.warn .qfill { background: linear-gradient(90deg, #d97706, #fbbf24); }
.qc-tile.bad .qfill { background: linear-gradient(90deg, #dc2626, #f87171); }
.qc-tile .qnote { font-size: 11px; color: var(--muted); margin-top: 7px; }

/* ---------- 危急值 ---------- */
.critical-banner { display: flex; align-items: center; gap: 12px; background: linear-gradient(90deg, #fdecea, #fbe3e0); border: 1px solid #f0cdc7; border-left: 4px solid var(--red); border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
.critical-banner .ic { width: 34px; height: 34px; border-radius: 8px; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; flex: 0 0 34px; }
.critical-banner b { color: #a93226; font-size: 13px; }
.critical-banner p { margin: 2px 0 0; color: #8c4a41; font-size: 12px; }

/* ---------- 模板库 ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tpl-card { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow 0.15s, transform 0.15s; }
.tpl-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.tpl-card.disabled { opacity: 0.62; }
.tpl-card .th { padding: 12px 14px; background: linear-gradient(90deg, var(--brand-soft), #f6f5fd); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tpl-card .th b { font-size: 13px; color: var(--ink); }
.tpl-card .tb { padding: 12px 14px; flex: 1; }
.tpl-card .tb .concl { font-size: 12.5px; color: var(--text); line-height: 1.7; background: #f8f7fc; border-left: 3px solid var(--brand-3); padding: 8px 10px; border-radius: 0 6px 6px 0; }
.tpl-card .tb .meta { font-size: 11.5px; color: var(--muted); margin-top: 9px; display: flex; gap: 10px; flex-wrap: wrap; }
.tpl-card .tf { padding: 10px 14px; border-top: 1px solid var(--line-2); display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- 报告 A4 打印预览 ---------- */
.print-stage { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.print-side { width: 280px; flex: 0 0 280px; }
.report-a4 {
  width: 794px; max-width: 100%; background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 46px 52px; color: #1c1c28; font-size: 12.5px; line-height: 1.8;
}
.report-a4 .ra-head { text-align: center; border-bottom: 2px solid #2e2a72; padding-bottom: 12px; margin-bottom: 16px; }
.report-a4 .ra-head .hosp { font-size: 17px; font-weight: 700; letter-spacing: 2px; color: #2e2a72; }
.report-a4 .ra-head .title { font-size: 15px; font-weight: 600; margin-top: 6px; letter-spacing: 4px; }
.report-a4 .ra-head .no { font-size: 11.5px; color: #6b6b8a; margin-top: 6px; font-family: Consolas, monospace; }
.report-a4 .ra-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 18px; border: 1px solid #dcdcf0; border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; font-size: 12px; }
.report-a4 .ra-info .k { color: #6b6b8a; }
.report-a4 .ra-sec { margin-bottom: 14px; }
.report-a4 .ra-sec h4 { margin: 0 0 6px; font-size: 13px; color: #2e2a72; border-left: 3px solid #4f46e5; padding-left: 8px; }
.report-a4 .ra-sec .body { text-align: justify; white-space: pre-wrap; }
.report-a4 .ra-concl { background: #f4f3fc; border: 1px solid #cfcbf2; border-radius: 6px; padding: 10px 14px; font-weight: 600; color: #2e2a72; }
.report-a4 .ra-foot { display: flex; justify-content: space-between; margin-top: 26px; padding-top: 12px; border-top: 1px dashed #dcdcf0; font-size: 12px; }
.report-a4 .ra-foot .sig { text-align: center; }
.report-a4 .ra-foot .sig .line { display: inline-block; min-width: 90px; border-bottom: 1px solid #9a97c8; margin-left: 6px; }
.report-a4 .ra-barcode { margin-top: 18px; text-align: center; }
.report-a4 .ra-barcode svg { width: 240px; height: 44px; }
.report-a4 .ra-barcode .t { font-family: Consolas, monospace; letter-spacing: 3px; font-size: 12px; }
.report-a4 .ra-note { margin-top: 14px; font-size: 11px; color: #6b6b8a; border-top: 1px solid #e8e8f6; padding-top: 8px; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20, 16, 60, 0.5); display: none; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(2px); }
.modal-mask.active { display: flex; animation: fade 0.18s ease; }
.modal { width: 680px; max-width: 94vw; max-height: 88vh; overflow: auto; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); }
.modal.wide { width: 880px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #f8f7fc; border-radius: 12px 12px 0 0; position: sticky; top: 0; z-index: 2; }
.modal-head h3 { margin: 0; font-size: 15px; color: var(--ink); }
.modal-head .close { border: none; background: transparent; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #fbfbfe; border-radius: 0 0 12px 12px; position: sticky; bottom: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.form-item label i { color: var(--red); font-style: normal; margin-left: 2px; }
.form-item input, .form-item select, .form-item textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font-size: 12.5px; font-family: inherit; color: var(--text); outline: none; transition: border 0.14s; }
.form-item textarea { min-height: 74px; resize: vertical; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
.form-tip { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.err-box { background: var(--red-soft); color: #a93226; border: 1px solid #f0cdc7; padding: 9px 12px; border-radius: 7px; font-size: 12.5px; margin-bottom: 13px; display: none; }
.err-box.show { display: block; }
.char-count { font-size: 11px; color: var(--muted); text-align: right; margin-top: 3px; }
.char-count.over { color: var(--red); font-weight: 600; }

/* ---------- 详情 / 时间线 ---------- */
.detail-section { margin-bottom: 18px; }
.detail-section h4 { margin: 0 0 10px; font-size: 13px; color: var(--ink); border-left: 3px solid var(--brand-2); padding-left: 9px; }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px 18px; }
.kv .item { display: flex; gap: 8px; font-size: 12.5px; }
.kv .k { color: var(--muted); min-width: 86px; }
.kv .v { color: var(--text); word-break: break-all; }
.timeline { border-left: 2px solid #dddbf0; margin-left: 6px; padding-left: 18px; }
.timeline .node { position: relative; padding-bottom: 16px; }
.timeline .node::before { content: ""; position: absolute; left: -25px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #a9a6d8; }
.timeline .node:last-child::before { border-color: var(--green); background: var(--green); }
.timeline .node.reject::before { border-color: var(--red); background: var(--red); }
.timeline .node .title { font-size: 12.5px; color: #3a3670; font-weight: 600; }
.timeline .node .meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.timeline .node .note { color: #4a4a68; font-size: 12px; margin-top: 2px; }

/* ---------- 字典 / 标签 ---------- */
.dict-panel { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.dict-panel h3 { margin: 0 0 12px; font-size: 13px; color: var(--ink); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 7px; background: var(--brand-soft); color: var(--brand); border: 1px solid #cfcbf2; padding: 5px 11px; border-radius: 16px; font-size: 12px; }
.tag .x { cursor: pointer; color: #9a97c8; font-weight: 700; }
.tag .x:hover { color: var(--red); }
.dict-add { display: flex; gap: 8px; margin-top: 12px; }
.dict-add input { flex: 1; height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; font-size: 12.5px; outline: none; }

/* ---------- Toast ---------- */
.toast { position: fixed; right: 24px; bottom: 32px; background: #241f5c; color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 12.5px; opacity: 0; transform: translateY(12px); transition: all 0.24s; z-index: 60; max-width: 440px; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #8f2b20; }

/* ---------- 响应式 ---------- */
@media (max-width: 1400px) { .stats { grid-template-columns: repeat(3, 1fr); } .qc-grid { grid-template-columns: repeat(2, 1fr); } .tpl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1100px) {
  :root { --sidebar-w: 64px; }
  .side-brand .tt, .nav-group .gt, .nav-item span, .side-foot { display: none; }
  .nav-item { justify-content: center; }
  .nav-item .n-badge { position: absolute; top: 4px; right: 4px; margin: 0; }
  .grid-2, .grid-2-uneven { grid-template-columns: 1fr; }
  .print-side { width: 100%; flex: 1; }
}
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } .qc-grid { grid-template-columns: 1fr; } .tpl-grid { grid-template-columns: 1fr; } }

/* ---------- 打印 ---------- */
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .report-a4 { box-shadow: none; border: none; width: 100%; padding: 20px 30px; }
}
#print-area { display: none; }
@media print { #print-area { display: block; } }