/* ============================================================
   慧协商® SaaS —— 设计系统（Design Tokens + 组件 + 布局）
   零依赖、可主题切换、响应式、可访问性优先
   ============================================================ */

:root {
  /* 品牌色：深邃靛蓝（专业、可信、政务友好）*/
  --brand-50:  #eef4ff;
  --brand-100: #dbe7ff;
  --brand-200: #bcd1ff;
  --brand-300: #8fb2ff;
  --brand-400: #5c8bfa;
  --brand-500: #2f66ea;
  --brand-600: #1b4ed1;
  --brand-700: #163ea8;
  --brand-800: #163786;
  --brand-900: #142f6b;
  /* 辅助色 */
  --teal: #0e9f9f; --teal-soft: #e3f7f7;
  --amber: #d97706; --amber-soft: #fef3e2;
  --green: #14875b; --green-soft: #e3f7ee;
  --red: #cf2b3a;  --red-soft: #fdecee;
  --violet: #6d4bd8; --violet-soft: #efeafe;

  /* 中性色（浅色主题） */
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f4f9;
  --border: #e3e8f0;
  --border-strong: #cfd7e3;
  --text: #16202e;
  --text-2: #475467;
  --text-3: #8a94a6;
  --overlay: rgba(16, 24, 40, .45);

  --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
  --shadow-sm: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --shadow-md: 0 4px 12px rgba(16,24,40,.08), 0 2px 4px rgba(16,24,40,.04);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.12), 0 4px 8px rgba(16,24,40,.05);
  --shadow-xl: 0 24px 56px rgba(16,24,40,.18);

  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-full: 999px;

  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Consolas, "Liberation Mono", monospace;

  --side-w: 248px;
  --top-h: 60px;
  --content-max: 1280px;
}

[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #151b24;
  --surface-2: #1a222d;
  --surface-3: #212b38;
  --border: #253040;
  --border-strong: #33415a;
  --text: #e8eef7;
  --text-2: #a7b4c6;
  --text-3: #6f7d92;
  --overlay: rgba(0,0,0,.6);
  --brand-50: #14224a; --brand-100: #172a5c; --brand-200: #1e3a80;
  --brand-300: #3763cc; --brand-400: #5c8bfa; --brand-500: #6f9bff; --brand-600: #8fb2ff;
  --brand-700: #b1c9ff; --brand-800: #cfdeff; --brand-900: #e6efff;
  --teal-soft: #0f2f31; --amber-soft: #33260e; --green-soft: #10301f; --red-soft: #3a1419; --violet-soft: #241b45;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.5);
  --shadow-md: 0 4px 14px rgba(0,0,0,.5);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.6);
  --shadow-xl: 0 24px 56px rgba(0,0,0,.7);
}

/* ---------------- Reset ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1,h2,h3,h4,h5 { margin: 0; font-weight: 650; line-height: 1.35; color: var(--text); }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-200); color: var(--brand-900); }
.mono { font-family: var(--mono); font-size: .92em; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 通用工具类 ---------------- */
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }
.row.wrap { flex-wrap: wrap; }
.gap-4{gap:4px}.gap-6{gap:6px}.gap-8{gap:8px}.gap-12{gap:12px}.gap-16{gap:16px}.gap-24{gap:24px}
.col { display: flex; flex-direction: column; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-4{margin-top:4px}.mt-8{margin-top:8px}.mt-12{margin-top:12px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}.mt-32{margin-top:32px}
.mb-8{margin-bottom:8px}.mb-12{margin-bottom:12px}.mb-16{margin-bottom:16px}.mb-24{margin-bottom:24px}
.tc{text-align:center}.tr{text-align:right}
.fs-11{font-size:11px}.fs-12{font-size:12px}.fs-13{font-size:13px}.fs-16{font-size:16px}.fs-20{font-size:20px}.fs-24{font-size:24px}
.fw-500{font-weight:500}.fw-600{font-weight:600}.fw-700{font-weight:700}
.c-2{color:var(--text-2)}.c-3{color:var(--text-3)}
.c-brand{color:var(--brand-600)}.c-green{color:var(--green)}.c-red{color:var(--red)}.c-amber{color:var(--amber)}
.hide{display:none !important}
.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nowrap{white-space:nowrap}
.divider{height:1px;background:var(--border);margin:16px 0}

/* ---------------- 应用骨架 ---------------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--side-w); flex: 0 0 var(--side-w); background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 40; transition: width .18s ease;
}
.sidebar-brand {
  height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 18px;
  border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.sidebar-logo {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 32px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; letter-spacing: -.5px;
  box-shadow: 0 3px 10px rgba(47,102,234,.35);
}
.sidebar-title { font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.sidebar-sub { font-size: 11px; color: var(--text-3); letter-spacing: .3px; }
.sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: 12px 10px 20px; }
.nav-group-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--text-2); cursor: pointer; font-size: 13.5px; font-weight: 500; margin-bottom: 2px;
  border: 1px solid transparent; transition: background .13s, color .13s; user-select: none;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); font-weight: 600; }
[data-theme="dark"] .nav-item.active { color: var(--brand-600); }
.nav-item .ico { width: 18px; text-align: center; flex: 0 0 18px; font-size: 15px; }
.nav-item .nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: var(--r-full); font-weight: 700; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 12px; font-size: 11px; color: var(--text-3); }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--top-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 20px; position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-weight: 650; font-size: 16px; }
.topbar-sub { font-size: 12px; color: var(--text-3); }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--text-2);
  transition: background .13s, color .13s, border-color .13s; position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid var(--surface); }
.menu-toggle { display: none; }
.content { padding: 22px 24px 64px; max-width: var(--content-max); width: 100%; margin: 0 auto; flex: 1 1 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.page-desc { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.breadcrumb { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.breadcrumb a { color: var(--text-3); }

/* ---------------- 卡片 ---------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-xs); }
.card.pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; font-weight: 650; }
.card-body { padding: 18px; }
.card-hover { transition: box-shadow .16s, transform .16s, border-color .16s; }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--border-strong); }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); }

/* 统计卡 */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; position: relative; overflow: hidden; }
.stat::after { content:''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--brand-500); opacity:.9; }
.stat.s-green::after{background:var(--green)} .stat.s-amber::after{background:var(--amber)}
.stat.s-red::after{background:var(--red)} .stat.s-violet::after{background:var(--violet)} .stat.s-teal::after{background:var(--teal)}
.stat-label { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 750; letter-spacing: -.6px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px; border-radius: var(--r-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 550; cursor: pointer;
  transition: background .13s, border-color .13s, box-shadow .13s, transform .06s; white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--surface-3); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; box-shadow: 0 1px 2px rgba(27,78,209,.3); }
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(.93); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-lg { height: 44px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 15px; }
.label { display: block; font-size: 13px; font-weight: 550; color: var(--text-2); margin-bottom: 6px; }
.label .req { color: var(--red); margin-left: 2px; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font-size: 13.5px; transition: border-color .13s, box-shadow .13s; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
[data-theme="dark"] .input:focus, [data-theme="dark"] .select:focus, [data-theme="dark"] .textarea:focus { box-shadow: 0 0 0 3px rgba(111,155,255,.22); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-3); color: var(--text-3); cursor: not-allowed; }
.input.err, .select.err, .textarea.err { border-color: var(--red); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: linear-gradient(45deg,transparent 50%,var(--text-3) 50%),linear-gradient(135deg,var(--text-3) 50%,transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px,5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.err-msg { color: var(--red); font-size: 12px; margin-top: 4px; min-height: 0; }
.checkbox, .radio { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.checkbox input, .radio input { width: 16px; height: 16px; accent-color: var(--brand-600); cursor: pointer; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input { display: none; }
.switch .track { width: 38px; height: 22px; border-radius: var(--r-full); background: var(--border-strong); position: relative; transition: background .16s; flex: 0 0 38px; }
.switch .track::after { content:''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .16s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--brand-600); }
.switch input:checked + .track::after { transform: translateX(16px); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; font-weight: 600; color: var(--text-2); background: var(--surface-2);
  padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12.5px;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl td .actions { display: flex; gap: 6px; }
.empty { padding: 48px 20px; text-align: center; color: var(--text-3); }
.empty .i { font-size: 34px; opacity: .5; }

/* ---------------- 徽标 / 标签 ---------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--r-full); font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.blue { background: var(--brand-50); color: var(--brand-700); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.teal { background: var(--teal-soft); color: var(--teal); }
[data-theme="dark"] .badge.blue { color: var(--brand-600); }
.tag { display: inline-block; padding: 2px 8px; border-radius: var(--r-xs); background: var(--surface-3); color: var(--text-2); font-size: 11.5px; border: 1px solid var(--border); }

/* ---------------- 提示条 ---------------- */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); font-size: 13px; border: 1px solid; align-items: flex-start; }
.alert .ai { flex: 0 0 auto; font-size: 15px; line-height: 1.4; }
.alert.info { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); }
.alert.success { background: var(--green-soft); border-color: rgba(20,135,91,.3); color: var(--green); }
.alert.warn { background: var(--amber-soft); border-color: rgba(217,119,6,.3); color: var(--amber); }
.alert.danger { background: var(--red-soft); border-color: rgba(207,43,58,.3); color: var(--red); }
[data-theme="dark"] .alert.info { color: var(--brand-600); }

/* ---------------- 步骤条 ---------------- */
.stepper { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 4px 0; }
.step { display: flex; align-items: center; gap: 10px; flex: 1 1 0; min-width: 118px; position: relative; }
.step:not(:last-child)::after { content:''; position: absolute; right: 8px; left: 40px; top: 15px; height: 2px; background: var(--border); }
.step.done:not(:last-child)::after { background: var(--brand-500); }
.step .num {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 30px;
  background: var(--surface-3); color: var(--text-3); font-weight: 700; font-size: 13px; border: 2px solid var(--border); z-index: 1;
}
.step.done .num { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.step.active .num { background: var(--surface); border-color: var(--brand-600); color: var(--brand-600); box-shadow: 0 0 0 4px var(--brand-100); }
[data-theme="dark"] .step.active .num { box-shadow: 0 0 0 4px rgba(111,155,255,.18); }
.step .txt { font-size: 13px; font-weight: 550; color: var(--text-3); }
.step.done .txt, .step.active .txt { color: var(--text); }
.step .sub { font-size: 11px; color: var(--text-3); font-weight: 400; }

/* ---------------- 时间线 ---------------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content:''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before { content:''; position: absolute; left: -21px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-500); border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--brand-100); }
.tl-item.gray::before { background: var(--text-3); box-shadow: 0 0 0 2px var(--border); }
.tl-time { font-size: 11.5px; color: var(--text-3); }
.tl-title { font-size: 13.5px; font-weight: 550; }
.tl-desc { font-size: 12.5px; color: var(--text-2); }

/* ---------------- 进度条 ---------------- */
.progress { height: 8px; background: var(--surface-3); border-radius: var(--r-full); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-500), var(--brand-600)); border-radius: var(--r-full); transition: width .4s ease; }
.progress.green > i { background: linear-gradient(90deg,#16a06e,var(--green)); }

/* 环形进度 */
.ring { --p: 0; --sz: 96px; width: var(--sz); height: var(--sz); border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--brand-500) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring::after { content:''; position: absolute; inset: 8px; background: var(--surface); border-radius: 50%; }
.ring > span { position: relative; z-index: 1; font-weight: 750; font-size: 20px; font-variant-numeric: tabular-nums; }

/* ---------------- 模态 / 抽屉 ---------------- */
.modal-mask { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98) } to { opacity: 1; transform: none } }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-xl); width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; animation: rise .18s ease; border: 1px solid var(--border); }
.modal.wide { max-width: 860px; }
.modal.narrow { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ---------------- Toast ---------------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--brand-500);
  border-radius: var(--r-sm); padding: 12px 14px; box-shadow: var(--shadow-lg); animation: rise .2s ease; font-size: 13px; }
.toast.success { border-left-color: var(--green); } .toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); } .toast .ti { font-size: 15px; }
.toast .tt { font-weight: 600; } .toast .td { color: var(--text-2); font-size: 12.5px; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { padding: 9px 14px; font-size: 13.5px; font-weight: 550; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; user-select: none; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand-600); border-bottom-color: var(--brand-600); }

/* ---------------- 登录页 ---------------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-aside {
  background: linear-gradient(150deg, var(--brand-700) 0%, var(--brand-600) 45%, #0f3bb0 100%);
  color: #fff; padding: 52px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-aside::before { content:''; position: absolute; width: 460px; height: 460px; border-radius: 50%; background: rgba(255,255,255,.07); top: -160px; right: -140px; }
.auth-aside::after { content:''; position: absolute; width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.05); bottom: -120px; left: -80px; }
.auth-aside > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .logo { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.16); display: grid; place-items: center; font-weight: 800; font-size: 19px; backdrop-filter: blur(6px); }
.auth-h1 { font-size: 30px; font-weight: 750; color: #fff; line-height: 1.35; letter-spacing: -.4px; }
.auth-h1 small { display: block; font-size: 15px; font-weight: 400; opacity: .82; margin-top: 12px; line-height: 1.7; letter-spacing: 0; }
.auth-feats { display: grid; gap: 14px; margin-top: 28px; }
.auth-feat { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; opacity: .95; }
.auth-feat .fi { width: 26px; height: 26px; border-radius: 7px; background: rgba(255,255,255,.14); display: grid; place-items: center; flex: 0 0 26px; font-size: 13px; }
.auth-form-side { display: grid; place-items: center; padding: 40px 26px; background: var(--surface); overflow-y: auto; }
.auth-card { width: 100%; max-width: 400px; }
.auth-tabs { display: inline-flex; background: var(--surface-3); padding: 3px; border-radius: var(--r-sm); margin-bottom: 22px; }
.auth-tabs .t { padding: 7px 18px; border-radius: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; user-select: none; }
.auth-tabs .t.active { background: var(--surface); color: var(--brand-600); box-shadow: var(--shadow-xs); }

.foot { text-align: center; padding: 20px; color: var(--text-3); font-size: 12px; line-height: 1.9; }
.foot a { color: var(--text-3); }
.foot a:hover { color: var(--brand-600); }

/* ---------------- 签名板 ---------------- */
.sig-pad { border: 1.5px dashed var(--border-strong); border-radius: var(--r-md); background: var(--surface-2); position: relative; overflow: hidden; }
.sig-pad canvas { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; }
.sig-pad .sig-hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 13px; pointer-events: none; }
.sig-pad .sig-actions { position: absolute; right: 8px; top: 8px; }
.sig-preview { border: 1px solid var(--border); border-radius: var(--r-sm); background: #fff; padding: 6px; display: inline-block; }
.sig-preview img { height: 56px; }

/* ---------------- 哈希 / 存证 ---------------- */
.hash { font-family: var(--mono); font-size: 11.5px; background: var(--surface-3); padding: 2px 6px; border-radius: 4px; word-break: break-all; color: var(--text-2); border: 1px solid var(--border); }
.chain-node { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.chain-node.ok { border-color: rgba(20,135,91,.35); background: var(--green-soft); }
.chain-node.bad { border-color: rgba(207,43,58,.35); background: var(--red-soft); }

/* ---------------- 骨架屏 ---------------- */
.sk { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) { .grid.c4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 1024px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .grid.c3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-xl); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: grid; }
  .content { padding: 18px 14px 56px; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { max-width: 100%; }
  .sidebar-mask { position: fixed; inset: 0; background: var(--overlay); z-index: 39; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-sub { display: none; }
  .page-head { flex-direction: column; align-items: stretch; }
  .stat-value { font-size: 24px; }
  .toasts { left: 12px; right: 12px; max-width: none; }
  .auth-form-side { padding: 28px 16px; }
}

/* ---------------- 打印（合规存档用） ---------------- */
@media print {
  .sidebar, .topbar, .btn, .no-print, .toasts { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .table-wrap { box-shadow: none; border-color: #ccc; }
  .content { padding: 0; max-width: none; }
  a { color: #000; }
}
