/* ==========================================================
   京海电子签批系统 · 前端样式 v2
   零依赖：原生 CSS（无框架、无 CDN、无外部字体）
   移动优先：375px 竖屏完全可用；PC 居中，最大内容宽 1080px

   v2 设计要点：
   · 色彩：深墨蓝主色 + 青金点缀，语义色（成功/警示/危险）柔和化
   · 层次：卡片多级阴影 + 细边框，替代"纯白贴纸"感
   · 质感：顶栏毛玻璃、导航吸顶、按压反馈、渐变强调
   · 可读性：正文对比度提升，弱化次要信息但保持可扫读
   ========================================================== */

:root {
  /* 主色：深墨蓝（稳重、政务、可信） */
  --navy: #1d4ed8;
  --navy-deep: #14275a;
  --navy-ink: #0f1e42;
  --navy-soft: #eef3ff;
  --navy-line: #c7d7fb;

  /* 强调色：青金（用于高亮数字、焦点） */
  --gold: #b8860b;
  --gold-soft: #fdf6e3;

  /* 语义色 */
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --ok-line: #a7f3d0;
  --bad: #b91c1c;
  --bad-soft: #fef2f2;
  --bad-line: #fecaca;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --warn-line: #fde68a;
  --info: #0369a1;
  --info-soft: #f0f9ff;
  --info-line: #bae6fd;

  /* 中性 */
  --line: #e6eaf0;
  --line-2: #cfd6e0;
  --bg: #f4f6fa;
  --bg-grad: radial-gradient(1200px 400px at 50% -8%, #e8eefb 0%, rgba(244, 246, 250, 0) 62%);
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 12px rgba(15, 23, 42, .05);
  --shadow-lg: 0 2px 6px rgba(15, 23, 42, .05), 0 12px 32px rgba(15, 23, 42, .08);
  --ring: 0 0 0 3px rgba(29, 78, 216, .16);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 0 72px;                 /* 给底部固定合规条留位 */
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0 0 .6em; }
a { color: var(--navy); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--navy-deep); text-decoration: none; }
code, .mono, .hash { font-family: var(--mono); }

::selection { background: var(--navy-soft); color: var(--navy-ink); }

/* 滚动条（桌面） */
@media (pointer: fine) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; border: 2px solid var(--bg); }
  ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
}

/* ------------------------------------------------ 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy-ink) 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 4px 20px rgba(15, 30, 66, .18);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 11px 18px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand {
  font-size: 16.5px; font-weight: 700; color: #fff; letter-spacing: .2px;
  display: flex; align-items: center; gap: 10px; margin-right: auto;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(140deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .08));
  border: 1px solid rgba(255, 255, 255, .18);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}
.brand-sub { font-size: 11px; font-weight: 400; opacity: .68; }
.topbar-user {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px;
}
.topbar-user .who { font-weight: 600; }
.chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .12);
  font-size: 11.5px; white-space: nowrap; line-height: 1.6;
}
.topbar .btn {
  background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff;
}
.topbar .btn:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .32); }

/* ------------------------------------------------ 主导航 */
.nav {
  position: sticky; top: 52px; z-index: 39;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 12px;
  display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; padding: 11px 15px; color: var(--text-2); font-size: 14px; white-space: nowrap;
  border-bottom: 2px solid transparent; font-weight: 500;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.nav a:hover { color: var(--navy); background: rgba(29, 78, 216, .05); }
.nav a.active { color: var(--navy); border-bottom-color: var(--navy); font-weight: 650; }

/* ------------------------------------------------ 容器与卡片 */
.wrap { max-width: 1080px; margin: 0 auto; padding: 18px 16px; }
.wrap-narrow { max-width: 520px; margin: 0 auto; padding: 18px 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
  transition: box-shadow .2s ease;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-title { font-size: 16px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head .card-title { margin: 0; padding: 0; border: 0; margin-right: auto; }
.card-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

/* 页面头部：标题 + 副标题 + 右侧操作 */
.page-head {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  margin: 2px 0 16px;
}
.page-head h1 { font-size: 21px; margin-right: auto; letter-spacing: -.02em; }
.page-head .sub { font-size: 13px; color: var(--muted); width: 100%; margin-top: -4px; }

.section { margin-bottom: 18px; }

/* ------------------------------------------------ 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 15px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: #fff; color: var(--text-2); font-size: 13.5px; font-family: inherit;
  cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1.45;
  font-weight: 500;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .08s ease, box-shadow .15s ease;
  box-shadow: var(--shadow-xs);
}
.btn:hover { background: #f8fafc; border-color: var(--faint); color: var(--text); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary {
  background: linear-gradient(135deg, var(--navy) 0%, #1e40af 100%);
  border-color: transparent; color: #fff; box-shadow: 0 1px 2px rgba(29, 78, 216, .3);
}
.btn-primary:hover { background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%); border-color: transparent; color: #fff; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #036c4d; border-color: #036c4d; color: #fff; }
.btn-bad { background: #fff; border-color: var(--bad-line); color: var(--bad); }
.btn-bad:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--navy); box-shadow: none; }
.btn-ghost:hover { background: var(--navy-soft); box-shadow: none; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 6px; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ------------------------------------------------ 统计卡 */
.stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.stat {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 16px 14px;
  border-left: 3px solid var(--navy);
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat::after {
  content: ""; position: absolute; right: -18px; top: -18px;
  width: 68px; height: 68px; border-radius: 50%;
  background: radial-gradient(circle, rgba(29, 78, 216, .07), transparent 70%);
  pointer-events: none;
}
.stat.warn { border-left-color: var(--warn); }
.stat.warn::after { background: radial-gradient(circle, rgba(180, 83, 9, .09), transparent 70%); }
.stat.bad { border-left-color: var(--bad); }
.stat.bad::after { background: radial-gradient(circle, rgba(185, 28, 28, .09), transparent 70%); }
.stat.ok { border-left-color: var(--ok); }
.stat.ok::after { background: radial-gradient(circle, rgba(4, 120, 87, .09), transparent 70%); }
.stat-value {
  font-size: 28px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; color: var(--text);
}
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ------------------------------------------------ 表格 */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  box-shadow: var(--shadow-xs);
}
table.tb { width: 100%; border-collapse: collapse; min-width: 720px; font-size: 13.5px; }
table.tb th, table.tb td {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  text-align: left; vertical-align: top; white-space: nowrap;
}
table.tb th {
  background: linear-gradient(180deg, #f8fafc, #f4f7fb); font-weight: 650; color: var(--text-2);
  font-size: 12.5px; position: sticky; top: 0; z-index: 1;
  border-bottom: 1px solid var(--line-2);
}
table.tb tbody tr:last-child td { border-bottom: 0; }
table.tb tbody tr { transition: background .12s ease; }
table.tb tbody tr:hover { background: var(--navy-soft); }
table.tb td.wrap-cell { white-space: normal; min-width: 180px; }
table.tb td.num { font-variant-numeric: tabular-nums; }
.tb-hash { font-family: var(--mono); font-size: 11.5px; color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }
.empty { padding: 30px 12px; text-align: center; color: var(--faint); font-size: 13.5px; }

/* ------------------------------------------------ 待办列表 */
.todo-list { display: flex; flex-direction: column; gap: 10px; }
.todo-row {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.todo-row:hover {
  border-color: var(--navy-line); background: var(--navy-soft);
  box-shadow: var(--shadow); transform: translateX(2px);
}
.todo-kind {
  flex: none; font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  background: #eef1f5; color: var(--text-2); font-weight: 650; line-height: 1.7;
}
.todo-kind.sign { background: var(--navy-soft); color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy-line); }
.todo-main { flex: 1 1 auto; min-width: 0; }
.todo-title { font-weight: 600; font-size: 14px; }
.todo-meta { font-size: 12px; color: var(--muted); margin-top: 3px; word-break: break-all; }
.todo-due { flex: none; text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ------------------------------------------------ 徽标 */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; white-space: nowrap;
  border: 1px solid transparent; line-height: 1.7;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge.info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.badge.muted { background: #f1f5f9; color: var(--muted); border-color: var(--line); }
.badge.navy { background: var(--navy-soft); color: var(--navy); border-color: var(--navy-line); }

/* ------------------------------------------------ 信息网格 */
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.info-item { min-width: 0; }
.info-item .k { font-size: 11.5px; color: var(--muted); display: block; margin-bottom: 1px; }
.info-item .v { font-size: 13.5px; word-break: break-word; font-weight: 500; }
.info-item.span2 { grid-column: 1 / -1; }

/* ------------------------------------------------ 表单 */
.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.req::after { content: " *"; color: var(--bad); }

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=email], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; font-size: 14px; font-family: inherit;
  color: var(--text); background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; line-height: 1.65; min-height: 88px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: var(--ring);
}
input:disabled, select:disabled, textarea:disabled { background: #f8fafc; color: var(--muted); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.check input { width: auto; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

/* ------------------------------------------------ 筛选栏 */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin-bottom: 0; flex: 1 1 140px; min-width: 120px; }
.filters .field.grow { flex: 2 1 200px; }

/* ------------------------------------------------ 动态行 */
.row-list { display: flex; flex-direction: column; gap: 12px; }
.dyn-row {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px;
  background: #f8fafc;
  display: grid; grid-template-columns: 1fr; gap: 10px;
  border-left: 3px solid var(--navy-line);
}
.dyn-row .dyn-head { display: flex; align-items: center; gap: 8px; }
.dyn-row .dyn-head .n { font-size: 12px; color: var(--muted); font-weight: 650; }
.dyn-row .dyn-head .sp { margin-left: auto; }
.dyn-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.dyn-grid.two { grid-template-columns: 1fr 1fr; }

/* ------------------------------------------------ 时间线 */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative; padding: 0 0 18px 28px; border-left: 2px solid var(--line);
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -8px; top: 4px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line-2);
  box-shadow: 0 0 0 3px #fff;
}
.timeline li.done::before { background: var(--ok); border-color: var(--ok); }
.timeline li.current::before { background: var(--navy); border-color: var(--navy); box-shadow: 0 0 0 4px rgba(29, 78, 216, .18); }
.timeline li.current {
  background: linear-gradient(90deg, var(--navy-soft), rgba(238, 243, 255, 0));
  border-radius: var(--radius-sm); padding: 10px 12px; margin-left: -14px;
}
.timeline li.rejected::before { background: var(--bad); border-color: var(--bad); }
.tl-title { font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.tl-comment {
  font-size: 13px; margin-top: 6px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 11px; color: var(--text-2);
}
.tl-actions { margin-top: 10px; }
.tl-actions textarea { margin-bottom: 8px; }

/* ------------------------------------------------ 提示块 */
.alert { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; margin: 10px 0; border: 1px solid; line-height: 1.7; }
.alert.bad { background: var(--bad-soft); border-color: var(--bad-line); color: #7f1d1d; }
.alert.warn { background: var(--warn-soft); border-color: var(--warn-line); color: #78350f; }
.alert.ok { background: var(--ok-soft); border-color: var(--ok-line); color: #065f46; }
.alert.info { background: var(--info-soft); border-color: var(--info-line); color: #075985; }
.alert strong { font-weight: 700; }
.alert ul { margin: 7px 0 0; padding-left: 19px; }
.alert li { margin-bottom: 4px; }

.summary-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.summary-chip {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 13px;
  font-size: 12.5px; background: #fff; min-width: 88px; box-shadow: var(--shadow-xs);
}
.summary-chip b { display: block; font-size: 19px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.summary-chip.ok b { color: var(--ok); }
.summary-chip.bad b { color: var(--bad); }
.summary-chip.warn b { color: var(--warn); }

/* ------------------------------------------------ 折叠面板 */
details.fold {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; margin-bottom: 10px;
  overflow: hidden;
}
details.fold > summary {
  cursor: pointer; padding: 11px 14px; font-size: 13.5px; font-weight: 600;
  color: var(--text-2); list-style: none; display: flex; align-items: center; gap: 8px;
  transition: background .15s ease;
}
details.fold > summary:hover { background: #f8fafc; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; color: var(--faint); font-size: 11px; transition: transform .18s ease; }
details.fold[open] > summary { border-bottom: 1px solid var(--line); background: #f8fafc; }
details.fold[open] > summary::before { content: "▾"; }
details.fold > summary .sp { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--muted); }
.fold-body { padding: 14px; font-size: 13.5px; }
.fold-body > *:first-child { margin-top: 0; }
.fold-body > *:last-child { margin-bottom: 0; }

/* 法律定位声明：完整显示，不截断 */
.legal-notice {
  background: var(--warn-soft); border: 1px solid var(--warn-line); border-left: 3px solid var(--warn);
  border-radius: var(--radius-sm); padding: 14px; font-size: 13.5px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-word; color: #451a03;
}
.legal-notice strong { color: #7f1d1d; }
.pre { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 13.5px; line-height: 1.85; margin: 0; }
.pre-mono { white-space: pre-wrap; word-break: break-all; font-family: var(--mono); font-size: 12px; }

/* ------------------------------------------------ 签署页 */
.challenge-code {
  font-family: var(--mono); font-size: 42px; font-weight: 700; letter-spacing: 10px;
  color: var(--navy); background: linear-gradient(135deg, #f8fafc, var(--navy-soft));
  border: 2px dashed var(--navy-line); border-radius: var(--radius);
  padding: 16px 10px; text-align: center; word-break: break-all;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, .04);
}
.qr-box {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; display: inline-block; box-shadow: var(--shadow);
}
.qr-box svg { width: 172px; height: 172px; display: block; }
.step { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.step-no {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), #1e40af); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(29, 78, 216, .28);
}
.step-body { flex: 1 1 auto; min-width: 0; }
.kv-list { font-size: 13.5px; }
.kv-list .kv { display: flex; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.kv-list .kv:last-child { border-bottom: 0; }
.kv-list .kv .k { flex: none; width: 100px; color: var(--muted); font-size: 12.5px; }
.kv-list .kv .v { flex: 1 1 auto; min-width: 0; word-break: break-all; }

/* ------------------------------------------------ 标签页 */
.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tabs button {
  flex: none; padding: 10px 16px; font-size: 14px; font-family: inherit; cursor: pointer;
  background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted);
  font-weight: 500; transition: color .15s ease, border-color .15s ease;
}
.tabs button:hover { color: var(--navy); }
.tabs button.active { color: var(--navy); border-bottom-color: var(--navy); font-weight: 650; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade-in .2s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------ JSON 友好展示 */
.kv-tree { font-size: 13.5px; }
.kv-tree .node { padding: 3px 0; }
.kv-tree .node > .k { color: var(--muted); font-size: 12.5px; }
.kv-tree .node > .v { margin-left: 8px; word-break: break-word; }
.kv-tree .children { margin-left: 12px; padding-left: 11px; border-left: 1px solid var(--line); }
.pending-mark {
  background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line);
  border-radius: 4px; padding: 0 6px; font-size: 11px; font-weight: 650; margin-left: 5px;
}

/* ------------------------------------------------ 提示浮层 */
.toast-wrap {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 999; display: flex; flex-direction: column; gap: 8px;
  width: min(92vw, 460px); pointer-events: none;
}
.toast {
  pointer-events: auto; padding: 11px 15px; border-radius: var(--radius-sm); font-size: 13.5px;
  background: #1e293b; color: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .28);
  animation: toast-in .22s cubic-bezier(.2, .9, .3, 1); word-break: break-word;
  border-left: 3px solid #38bdf8;
}
.toast.error { background: var(--bad); border-left-color: #fca5a5; }
.toast.success { background: var(--ok); border-left-color: #6ee7b7; }
.toast.warn { background: var(--warn); border-left-color: #fcd34d; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------ 底部合规条（固定） */
.compliance-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(248, 250, 252, .93);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line);
  padding: 8px 14px; font-size: 11.5px; line-height: 1.55; color: var(--text-2);
  text-align: center;
}
.compliance-bar b { color: var(--navy); font-weight: 650; }

/* ------------------------------------------------ 登录页 */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 22px 16px;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(59, 130, 246, .18), transparent 60%),
    radial-gradient(800px 460px at 85% 90%, rgba(184, 134, 11, .12), transparent 60%),
    linear-gradient(160deg, #14275a 0%, #0f1e42 55%, #0a1730 100%);
}
.login-card {
  width: 100%; max-width: 392px; background: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(2, 12, 24, .45); padding: 32px 26px;
  border: 1px solid rgba(255, 255, 255, .3);
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand .logo {
  width: 52px; height: 52px; border-radius: 15px;
  background: linear-gradient(140deg, var(--navy) 0%, #1e40af 100%); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 700; margin-bottom: 12px;
  box-shadow: 0 8px 20px rgba(29, 78, 216, .3);
}
.login-brand h1 { font-size: 19px; color: var(--navy-ink); }
.login-brand p { font-size: 12.5px; color: var(--muted); margin: 5px 0 0; }
.login-error {
  display: none; background: var(--bad-soft); border: 1px solid var(--bad-line); color: #7f1d1d;
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; margin-bottom: 14px;
}
.login-error.show { display: block; animation: shake .3s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.login-foot { margin-top: 18px; font-size: 11px; color: var(--muted); line-height: 1.65; text-align: center; }

/* ------------------------------------------------ 加载态 */
.loading { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
.spinner {
  display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line-2);
  border-top-color: var(--navy); border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: -2px; margin-right: 7px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #eef1f5 25%, #f6f8fb 37%, #eef1f5 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%; } }

/* ------------------------------------------------ 分区标题（sec-head）
   用法：<div class="sec-head"><span class="sec-ico">📄</span>
        <div><h2 class="sec-title">基本信息</h2><div class="sec-sub">…</div></div>
        <div class="sec-extra">…</div></div>                                   */
.sec-head {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  margin: -2px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.sec-head > div { min-width: 0; }
.sec-ico {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
  background: linear-gradient(140deg, var(--navy-soft), #e2ebff);
  box-shadow: inset 0 0 0 1px var(--navy-line), 0 1px 2px rgba(15, 23, 42, .04);
}
.sec-title { font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; }
.sec-sub { font-size: 12px; color: var(--muted); margin-top: 1px; line-height: 1.5; }
.sec-extra { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 计数徽标（配合表格标题） */
.count-chip {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 2px 10px; border-radius: 999px;
  background: var(--navy-soft); border: 1px solid var(--navy-line);
  color: var(--navy); font-size: 11.5px; font-weight: 650; line-height: 1.7;
}
.count-chip b { font-size: 13px; font-variant-numeric: tabular-nums; }
.count-chip.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.count-chip.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.count-chip.muted { background: #f1f5f9; border-color: var(--line); color: var(--muted); }

/* 空态：图标 + 文案 */
.empty-state {
  padding: 34px 16px 30px; text-align: center; color: var(--faint);
}
.empty-state .ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 16px; font-size: 25px;
  background: #f5f7fa; border: 1px solid var(--line); margin-bottom: 12px;
}
.empty-state .txt { font-size: 13.5px; color: var(--muted); }
.empty-state .sub { font-size: 12px; margin-top: 4px; }

/* 表格内链接 */
table.tb td a { font-weight: 550; }
table.tb td a:hover { text-decoration: underline; }

/* 键值对：双列（宽屏） */
.kv-2col { display: grid; grid-template-columns: 1fr; gap: 0 22px; }
@media (min-width: 800px) { .kv-2col { grid-template-columns: 1fr 1fr; } }

/* 流程概览条 */
.flow-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; margin-bottom: 14px;
  background: linear-gradient(120deg, var(--navy-soft), rgba(238, 243, 255, 0));
  border: 1px solid var(--navy-line); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-2);
}
.flow-head .k { color: var(--muted); font-size: 12px; }
.flow-head .v { font-weight: 650; }
.flow-head .sep { width: 1px; height: 14px; background: var(--navy-line); }

/* 顶部提示条（页面级） */
.notice-strip {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: var(--radius); padding: 12px 15px; font-size: 13px; line-height: 1.7;
  border: 1px solid var(--info-line); background: var(--info-soft); color: #075985;
  margin-bottom: 16px;
}
.notice-strip.warn { border-color: var(--warn-line); background: var(--warn-soft); color: #78350f; }
.notice-strip .ico { flex: none; font-size: 15px; line-height: 1.5; }

/* ------------------------------------------------ 响应式增强 */
@media (min-width: 560px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dyn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dyn-grid .full { grid-column: 1 / -1; }
}

@media (min-width: 800px) {
  body { font-size: 14.5px; }
  .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .card { padding: 20px 22px; }
  .dyn-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wrap { padding: 22px 20px; }
  .challenge-code { font-size: 52px; }
  .page-head h1 { font-size: 23px; }
}

@media (min-width: 1200px) {
  .wrap { padding: 26px 24px; }
}

@media print {
  .topbar, .nav, .compliance-bar, .actions, .toast-wrap { display: none !important; }
  body { padding: 0; background: #fff; }
  .card { box-shadow: none; break-inside: avoid; border-color: #ddd; }
  .card:hover { box-shadow: none; }
}
