/* ============================================================================
   陪跑交付平台 · 设计系统
   ----------------------------------------------------------------------------
   颜色分两类，互不混用：
     · 界面色（品牌青绿 + 中性灰阶）——外壳、按钮、边框
     · 数据色（青绿序数阶 + 固定状态色）——图表里的编码
   数据色阶经 dataviz 校验器验证：
     浅色 #6dbeb4/#3d9e94/#14756e 对 #ffffff  ——序数四项检查全过
     深色 #8fd2c9/#4fb3a8/#2a8d84 对 #151d1c  ——同上
   最浅一阶对白底只有 2.17:1（低于 3:1），因此按「relief 规则」必须
   配可见的直接标签与表格视图 —— 见 .viz-stack 与 .viz-table。
   状态色为固定四档，永不主题化，且一律图标 + 文字，不靠颜色单独表意。
   ========================================================================= */

:root {
  color-scheme: light;

  /* --- 中性与品牌 --- */
  --plane: #f4f6f5;            /* 页面底 */
  --surface: #ffffff;          /* 卡片面 */
  --surface-2: #f8faf9;        /* 卡片内的次级面 */
  --surface-sunken: #eef2f1;
  --ink: #101a19;
  --ink-2: #545f5c;
  --ink-3: #8a948f;            /* 轴、次要标签 */
  --line: #e6ebe9;
  --line-strong: #d3dcd9;
  --accent: #0f6f68;
  --accent-hover: #0b5852;
  --accent-ink: #ffffff;
  --accent-wash: #e8f3f1;
  --accent-wash-2: #d5e9e5;
  --gold: #a9762f;
  --gold-wash: #fbf1e2;

  /* --- 数据编码：青绿序数阶（浅色） --- */
  --seq-1: #6dbeb4;
  --seq-2: #3d9e94;
  --seq-3: #14756e;
  --seq-track: #e4efed;

  /* --- 状态色（固定，不随主题变化） --- */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --good-wash: #e7f6e7;
  --warning-wash: #fdf3dd;
  --critical-wash: #faeaea;

  /* --- 图表铅笔 --- */
  --grid: #e8edeb;
  --axis: #ccd6d3;

  /* --- 形状与投影 --- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(16, 26, 25, .05), 0 1px 3px rgba(16, 26, 25, .04);
  --shadow-2: 0 2px 4px rgba(16, 26, 25, .05), 0 8px 20px -6px rgba(16, 26, 25, .10);
  --shadow-3: 0 12px 28px -8px rgba(16, 26, 25, .18), 0 32px 64px -24px rgba(16, 26, 25, .22);
  --ring: 0 0 0 3px rgba(15, 111, 104, .22);

  --sidebar-w: 236px;
  --header-h: 60px;
  --gutter: 28px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* 深色模式：同一套色阶为深底重新取步，不是简单反色 */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --plane: #0c1211;
    --surface: #151d1c;
    --surface-2: #1b2423;
    --surface-sunken: #111817;
    --ink: #f1f5f4;
    --ink-2: #a7b3af;
    --ink-3: #8a948f;
    --line: #253130;
    --line-strong: #32403e;
    --accent: #45b3a8;
    --accent-hover: #5cc4b9;
    --accent-ink: #06201e;
    --accent-wash: #16302d;
    --accent-wash-2: #1d403c;
    --gold: #d6a458;
    --gold-wash: #2e2517;
    --seq-1: #8fd2c9;
    --seq-2: #4fb3a8;
    --seq-3: #2a8d84;
    --seq-track: #1e2c2a;
    --good-wash: #102a12;
    --warning-wash: #2d2410;
    --critical-wash: #2e1616;
    --grid: #253130;
    --axis: #35433f;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .4), 0 10px 24px -8px rgba(0, 0, 0, .5);
    --shadow-3: 0 16px 40px -10px rgba(0, 0, 0, .7);
    --ring: 0 0 0 3px rgba(69, 179, 168, .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --plane: #0c1211;
  --surface: #151d1c;
  --surface-2: #1b2423;
  --surface-sunken: #111817;
  --ink: #f1f5f4;
  --ink-2: #a7b3af;
  --ink-3: #8a948f;
  --line: #253130;
  --line-strong: #32403e;
  --accent: #45b3a8;
  --accent-hover: #5cc4b9;
  --accent-ink: #06201e;
  --accent-wash: #16302d;
  --accent-wash-2: #1d403c;
  --gold: #d6a458;
  --gold-wash: #2e2517;
  --seq-1: #8fd2c9;
  --seq-2: #4fb3a8;
  --seq-3: #2a8d84;
  --seq-track: #1e2c2a;
  --good-wash: #102a12;
  --warning-wash: #2d2410;
  --critical-wash: #2e1616;
  --grid: #253130;
  --axis: #35433f;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .4), 0 10px 24px -8px rgba(0, 0, 0, .5);
  --shadow-3: 0 16px 40px -10px rgba(0, 0, 0, .7);
  --ring: 0 0 0 3px rgba(69, 179, 168, .3);
}

/* ---------------------------------------------------------------- 基础 */
*, *::before, *::after { box-sizing: border-box; }
/* 组件类里的 display 会盖掉 [hidden]，这里统一兜住 */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font: 400 14px/1.6 system-ui, -apple-system, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: var(--accent); text-underline-offset: 2px; }
/* 内联图标的默认尺寸。没有这条，SVG 会被 flex 容器拉满，把标题挤成竖排 */
svg[aria-hidden] { width: 16px; height: 16px; flex: 0 0 auto; display: inline-block; vertical-align: -.16em; }
code { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.011em; }
h1 { font-size: 21px; line-height: 1.3; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
p { margin: 6px 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
::selection { background: var(--accent-wash-2); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- 布局 */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }

aside {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 0 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px 18px; margin-bottom: 4px;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(145deg, var(--accent), var(--accent-hover));
  color: var(--accent-ink);
  display: grid; place-items: center; font-size: 15px; font-weight: 600;
  box-shadow: var(--shadow-1);
}
.brand-text { min-width: 0; }
.brand-text b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.brand-text span { display: block; font-size: 11px; color: var(--ink-3); margin-top: 1px; }

.nav-label {
  padding: 14px 18px 6px; font-size: 10.5px; font-weight: 600;
  letter-spacing: .09em; color: var(--ink-3); text-transform: uppercase;
}
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; }
aside > .brand, aside > .side-foot { flex-shrink: 0; }
nav { display: flex; flex-direction: column; gap: 1px; padding: 0 8px; flex-shrink: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: var(--r-sm);
  font-size: 13.5px; color: var(--ink-2); text-align: left;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .8; }
.nav-item:hover { background: var(--surface-sunken); color: var(--ink); }
.nav-item[aria-current="page"] {
  background: var(--accent-wash); color: var(--accent); font-weight: 600;
}
.nav-item[aria-current="page"] svg { opacity: 1; }
.side-foot {
  margin-top: auto; padding: 14px 18px 0; font-size: 11px; line-height: 1.55;
  color: var(--ink-3); border-top: 1px solid var(--line);
}
.theme-toggle {
  display: flex; align-items: center; gap: 7px; margin-top: 10px;
  padding: 6px 8px; border-radius: var(--r-sm); font-size: 12px; color: var(--ink-2);
}
.theme-toggle:hover { background: var(--surface-sunken); color: var(--ink); }
.theme-toggle svg { width: 15px; height: 15px; }

main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
header {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
header .drawer-btn { display: none; }
.crumb {
  min-width: 0; flex: 1; font-size: 13px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crumb b { color: var(--ink); font-weight: 600; }
.crumb .sep { padding: 0 7px; opacity: .5; }
.who { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.who-name { font-size: 12.5px; color: var(--ink-2); }
.who-name b { color: var(--ink); font-weight: 600; }
.avatar {
  width: 30px; height: 30px; border-radius: var(--r-pill); flex-shrink: 0;
  background: var(--accent-wash); color: var(--accent);
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  border: 1px solid var(--accent-wash-2);
}
.content {
  padding: 24px var(--gutter) 64px;
  width: 100%; max-width: 1260px;
  transition: opacity .18s var(--ease);
}
.content[data-loading="1"] { opacity: .45; }

/* 抽屉遮罩（小屏） */
.scrim {
  display: none; position: fixed; inset: 0; z-index: 35;
  background: rgba(12, 18, 17, .45);
  backdrop-filter: blur(2px);
}

/* ---------------------------------------------------------------- 组件 */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}
.panel.flush { padding: 0; overflow: hidden; }
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 14px; flex-wrap: wrap;
}
.panel.flush .panel-head { padding: 16px 20px 0; margin-bottom: 12px; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.panel-head h2 svg { width: 17px; height: 17px; color: var(--ink-3); }
.title-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.title-row .sub { color: var(--ink-2); font-size: 13px; margin-top: 3px; max-width: 62ch; }
.muted { color: var(--ink-2); }
.small { font-size: 12px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* 详情弹窗顶部的标签行 / 操作按钮行，统一节奏，不再各写各的内联 margin */
.meta-row { margin: 14px 0 6px; }
.actions-row { margin-top: 14px; }
.stats.stats-inline { margin: 16px 0 0; }
.panel-head.tight { margin-bottom: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 13px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease),
              color .15s var(--ease), transform .08s var(--ease);
}
.btn svg { width: 15px; height: 15px; }
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--accent); color: var(--accent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: var(--shadow-1);
}
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--surface-sunken); }
.btn.danger { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 32%, var(--line)); }
.btn.danger:hover:not(:disabled) { background: var(--critical-wash); color: var(--critical); border-color: var(--critical); }
.btn.tiny { min-height: 28px; padding: 0 9px; font-size: 12px; }
.btn.icon { min-height: 34px; width: 34px; padding: 0; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  background: var(--accent-wash); color: var(--accent);
}
.tag svg { width: 12px; height: 12px; }
.tag.gray { background: var(--surface-sunken); color: var(--ink-2); }
.tag.gold { background: var(--warning-wash); color: var(--gold); }
.tag.red { background: var(--critical-wash); color: var(--critical); }
.tag.green { background: var(--good-wash); color: color-mix(in srgb, var(--good) 88%, var(--ink)); }
.level-badge {
  display: inline-grid; place-items: center; min-width: 26px; height: 19px;
  padding: 0 5px; border-radius: 5px; background: var(--surface-sunken);
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* KPI 卡片 */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow-1);
}
.stat .k { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.stat .v {
  display: block; font-size: 26px; font-weight: 600; line-height: 1.15;
  letter-spacing: -.02em;      /* 大号数字用比例字形，不用 tabular */
}
.stat .n { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.stat .n.alert { color: var(--critical); font-weight: 500; }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; vertical-align: top; }
thead th {
  font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  letter-spacing: .02em; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
tbody td { border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s var(--ease); }
tbody tr:hover { background: var(--surface-2); }
td .cell-title { font-size: 13.5px; font-weight: 600; }
td .cell-sub { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* 分段控件 */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-sunken); border-radius: var(--r-sm);
}
.segmented button {
  padding: 6px 12px; border-radius: 6px; font-size: 12.5px; color: var(--ink-2);
  transition: background .15s var(--ease), color .15s var(--ease);
  white-space: nowrap;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] {
  background: var(--surface); color: var(--ink); font-weight: 600;
  box-shadow: var(--shadow-1);
}
.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px;
}
.toolbar .spacer { flex: 1; }

/* 提示条 */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 15px; margin-bottom: 16px;
  border: 1px solid var(--line); border-left: 3px solid var(--ink-3);
  border-radius: var(--r-sm); font-size: 13px; background: var(--surface);
}
.notice svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.notice .grow { min-width: 0; }
.notice.teal { background: var(--accent-wash); border-color: var(--accent-wash-2); border-left-color: var(--accent); }
.notice.teal svg { color: var(--accent); }
.notice.gold { background: var(--gold-wash); border-color: color-mix(in srgb, var(--gold) 26%, var(--line)); border-left-color: var(--gold); }
.notice.gold svg { color: var(--gold); }
.notice.red { background: var(--critical-wash); border-color: color-mix(in srgb, var(--critical) 26%, var(--line)); border-left-color: var(--critical); }
.notice.red svg { color: var(--critical); }
.notice.spaced { margin-top: 14px; }

.empty {
  display: grid; place-items: center; gap: 8px;
  padding: 44px 24px; color: var(--ink-3); font-size: 13px; text-align: center;
}
.empty svg { width: 26px; height: 26px; opacity: .6; }

/* 表单 */
/* 表单字段块：垂直节奏统一由 .fld 提供，label 自身不再带 margin-top，
   这样字段、提示文字、两列网格的上下间距才对得齐。 */
.fld { margin-top: 15px; min-width: 0; }
.fld > label { margin: 0 0 6px; }
.two > .fld, .fld .fld { margin-top: 0; }
.modal-body > .fld:first-child { margin-top: 12px; }

/* 裸 label 当作分组小标题用（详情弹窗里的「版本」「期间读数」等） */
label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin: 20px 0 6px; }
input[type=text], input[type=date], input[type=number], input[type=email],
input[type=password], input[type=url], input[type=search], input[type=tel], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: 9px 11px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { min-height: 80px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
input[type=file] { padding: 7px 10px; font-size: 13px; color: var(--ink-2); }
/* 原生日期/时间控件的内建高度与 text input 不一致，这里拉齐 */
input[type=date], input[type=time], input[type=datetime-local] {
  min-height: 38px; appearance: none; -webkit-appearance: none;
}
input[type=date]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
input[type=date]:hover::-webkit-calendar-picker-indicator,
input[type=time]:hover::-webkit-calendar-picker-indicator { opacity: .9; }
input[type=number] { appearance: textfield; -moz-appearance: textfield; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px; }
.hint { font-size: 12px; color: var(--ink-3); margin: 7px 0 0; line-height: 1.55; }
.fld + .hint, .two + .hint { margin-top: 7px; }
.err {
  display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0;
  padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--critical-wash); color: var(--critical); font-size: 13px;
}

/* 弹窗 —— 桌面居中卡片，手机变底部抽屉 */
dialog {
  border: 0; padding: 0; margin: auto;
  width: min(640px, calc(100% - 32px)); max-height: min(86vh, 86dvh);
  background: var(--surface); color: var(--ink);
  border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  overflow: hidden;
}
dialog::backdrop { background: rgba(12, 18, 17, .5); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .2s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
#modal > form { display: flex; flex-direction: column; max-height: inherit; }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 22px 14px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 4px 22px 20px; overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.modal-body > label:first-child, .modal-body > .two:first-child { margin-top: 12px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0;
  padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2);
}

/* 文件拖放区 —— 三处上传点共用 */
.dropzone {
  position: relative; display: block; width: 100%;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-md);
  background: var(--surface-2); padding: 20px 16px; cursor: pointer;
  text-align: center; color: var(--ink-2);
  transition: border-color .15s var(--ease), background .15s var(--ease),
              color .15s var(--ease);
}
.dropzone:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }
.dropzone:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
.dropzone.is-over {
  border-color: var(--accent); border-style: solid;
  background: var(--accent-wash-2); color: var(--accent);
}
.dropzone.has-file {
  border-style: solid; border-color: var(--accent-wash-2);
  background: var(--surface); text-align: left; padding: 12px 14px;
}
.dz-idle { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dz-idle svg { width: 22px; height: 22px; opacity: .75; margin-bottom: 2px; }
.dz-idle b { font-size: 13.5px; font-weight: 600; color: inherit; }
.dz-idle span { font-size: 12px; color: var(--ink-3); }
.dropzone.is-over .dz-idle span, .dropzone:hover .dz-idle span { color: inherit; }
.dz-file { display: flex; align-items: center; gap: 11px; text-align: left; }
.dz-file .ico {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--accent-wash); color: var(--accent);
  display: grid; place-items: center; font-size: 10px; font-weight: 600;
}
.dz-file .grow { min-width: 0; flex: 1; }
.dz-file .nm {
  display: block; font-size: 13px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dz-file .sz { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.dropzone.has-file .dz-idle { display: none; }
.dropzone:not(.has-file) .dz-file { display: none; }
/* 拖拽经过页面任何地方时，给所有拖放区一点提示 */
body.dragging .dropzone:not(.has-file) { border-color: var(--accent); color: var(--accent); }

/* 文件阅读器 */
dialog.wide { width: min(1080px, calc(100% - 32px)); }
.viewer-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 2px 0 10px; }
.viewer-tabs button {
  padding: 6px 12px; border-radius: var(--r-sm); font-size: 12.5px; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--surface); white-space: nowrap;
}
.viewer-tabs button[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.viewer-tabs button .hid { opacity: .7; font-size: 11px; }
.sheet-wrap {
  overflow: auto; max-height: 56vh; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface);
}
table.sheet { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
table.sheet th, table.sheet td {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 5px 9px; font-size: 12.5px; white-space: pre; vertical-align: top;
  max-width: 320px; overflow: hidden; text-overflow: ellipsis;
}
table.sheet thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2);
  color: var(--ink-3); font-weight: 500; text-align: center; font-size: 11px;
}
table.sheet tbody th {
  position: sticky; left: 0; z-index: 1; background: var(--surface-2);
  color: var(--ink-3); font-weight: 400; text-align: right; font-size: 11px;
  font-variant-numeric: tabular-nums;
}
table.sheet thead th:first-child { left: 0; z-index: 3; }
table.sheet tbody tr:first-child td { font-weight: 600; background: var(--surface-2); }
.doc-blocks { max-height: 58vh; overflow: auto; padding-right: 6px; }
.doc-blocks h3 { margin: 18px 0 6px; color: var(--accent); }
.doc-blocks p { margin: 6px 0; }
.doc-blocks table { margin: 10px 0; border: 1px solid var(--line); border-radius: var(--r-sm); }
.doc-blocks table td { border-bottom: 1px solid var(--line); padding: 7px 10px; font-size: 12.5px; }
.viewer-text {
  max-height: 58vh; overflow: auto; white-space: pre-wrap; word-break: break-word;
  font: 12.5px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 14px 16px;
}
.viewer-frame { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: var(--r-sm); }
.viewer-img { max-width: 100%; border-radius: var(--r-sm); border: 1px solid var(--line); }

/* 吐司 */
.toast-host {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
  width: min(520px, calc(100% - 32px)); pointer-events: none;
}
.toast-host .notice {
  margin: 0; box-shadow: var(--shadow-2); animation: rise .24s var(--ease);
  pointer-events: auto;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* 时间线与轮次 */
.timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 16px; border-left: 2px solid var(--line); }
.timeline li:last-child { padding-bottom: 4px; }
.timeline li::before {
  content: ""; position: absolute; left: -5px; top: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--surface);
}
.timeline li.internal::before { background: var(--gold); }
.timeline .who-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12px; }
.round {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; margin-bottom: 10px; background: var(--surface);
}
.round.done { background: var(--surface-2); }
.criteria {
  padding: 9px 12px; margin: 9px 0; font-size: 12.5px; line-height: 1.6;
  background: var(--accent-wash); border-left: 3px solid var(--accent-wash-2);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.doc-row {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.doc-row:last-child { border-bottom: 0; }
.doc-row .grow { min-width: 0; flex: 1; }

/* Markdown（阶段总结） */
.md { font-size: 13.5px; line-height: 1.75; }
.md h1 { font-size: 18px; margin: 0 0 12px; }
.md h2 {
  font-size: 15px; margin: 24px 0 8px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.md h3 { font-size: 13px; margin: 16px 0 6px; color: var(--accent); }
.md ul { margin: 6px 0; padding-left: 20px; }
.md li { margin: 3px 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.md b { font-weight: 600; }

/* ================================================================ 图表
   细marks、hairline 实线网格、2px 表面间隙、直接标签 + 表格孪生。  */
.viz { margin: 4px 0 2px; }
.viz-title { font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }

/* 计量条：单一比率对上限。轨道是同色阶的更浅一阶 */
.meter { margin: 10px 0 4px; }
.meter-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 7px;
}
.meter-val { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.meter-of { font-size: 12px; color: var(--ink-3); }
.meter-track {
  height: 10px; border-radius: var(--r-pill); background: var(--seq-track);
  overflow: hidden; position: relative;
}
.meter-fill {
  height: 100%; border-radius: var(--r-pill);
  transition: width .5s var(--ease);
  background: var(--seq-3);
}
.meter-fill.is-good { background: var(--good); }
.meter-fill.is-warning { background: var(--warning); }
.meter-fill.is-critical { background: var(--critical); }
.meter-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; font-size: 11.5px; color: var(--ink-3); }

/* 水平堆叠条：部分对整体。段间 2px 表面间隙由 border-right 实现 */
.viz-stack { display: flex; width: 100%; height: 30px; background: var(--surface-sunken); border-radius: 6px; }
.viz-stack .seg:first-child { border-radius: 6px 0 0 6px; }
.viz-stack .seg:last-child { border-radius: 0 6px 6px 0; }
.viz-stack .seg:only-child { border-radius: 6px; }
.viz-stack .seg {
  display: flex; align-items: center; justify-content: center;
  min-width: 2px; border-right: 2px solid var(--surface);
  font-size: 11.5px; font-weight: 600; overflow: visible;
  transition: flex-basis .5s var(--ease);
}
.viz-stack .seg:last-child { border-right: 0; }
.viz-stack .seg.s1 { background: var(--seq-1); }
.viz-stack .seg.s2 { background: var(--seq-2); }
.viz-stack .seg.s3 { background: var(--seq-3); }
.viz-stack .seg.s-critical { background: var(--critical); }
/* 段内标签按填色明度取墨色或白字，保证对比 */
.viz-stack .seg.on-dark { color: #fff; }
.viz-stack .seg.on-light { color: #0b1a18; }
.viz-legend {
  display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px;
  font-size: 12px; color: var(--ink-2);
}
.viz-legend .item { display: flex; align-items: center; gap: 6px; }
.viz-legend .swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.viz-legend .swatch.s1 { background: var(--seq-1); }
.viz-legend .swatch.s2 { background: var(--seq-2); }
.viz-legend .swatch.s3 { background: var(--seq-3); }
.viz-legend .swatch.s-critical { background: var(--critical); }
.viz-legend .n { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 折线图（指标趋势）。轴文字用文本色，不穿数据色 */
.viz-line { width: 100%; display: block; overflow: visible; }
.viz-line .grid-line { stroke: var(--grid); stroke-width: 1; }
.viz-line .axis-line { stroke: var(--axis); stroke-width: 1; }
.viz-line .baseline-ref { stroke: var(--ink-3); stroke-width: 1; }
.viz-line .series { fill: none; stroke: var(--seq-3); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-line .area { fill: var(--seq-3); opacity: .1; }
.viz-line .dot { fill: var(--seq-3); stroke: var(--surface); stroke-width: 2; }
.viz-line .tick { fill: var(--ink-3); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.viz-line .end-label { fill: var(--ink); font-size: 11.5px; font-weight: 600; }
.viz-line .ref-label { fill: var(--ink-3); font-size: 10.5px; }
.viz-line .hit { fill: transparent; cursor: pointer; }
.viz-line .hit:hover + .dot, .viz-line .hit:focus-visible + .dot { r: 6; }

/* 表格孪生：每个图都有等价的表格视图（最浅色阶低于 3:1 时这是强制项） */
.viz-table { margin-top: 12px; }
.viz-table summary {
  cursor: pointer; font-size: 12px; color: var(--ink-2);
  padding: 5px 0; list-style: none; display: flex; align-items: center; gap: 6px;
}
.viz-table summary::-webkit-details-marker { display: none; }
.viz-table summary::marker { content: ""; }
.viz-table summary::before { content: "▸"; font-size: 10px; transition: transform .15s var(--ease); }
.viz-table[open] summary::before { transform: rotate(90deg); }
.viz-table summary:hover { color: var(--ink); }
.viz-table table { margin-top: 6px; font-size: 12.5px; }
.viz-table th, .viz-table td { padding: 7px 10px; }

/* 登录 */
.login {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: 1.05fr .95fr;
}
.login-aside {
  padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(900px 600px at 12% 8%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 62%),
    linear-gradient(160deg, #0f2a28, #0a1a19 70%);
  color: #e8f2f0;
}
.login-aside h1 { font-size: 30px; line-height: 1.3; color: #fff; max-width: 20ch; }
.login-aside .lede { color: #a9c8c3; font-size: 14px; margin-top: 14px; max-width: 42ch; line-height: 1.7; }
.login-points { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 14px; }
.login-points li { display: flex; gap: 10px; font-size: 13px; color: #c8ded9; line-height: 1.6; }
.login-points svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; color: var(--seq-1); }
.login-aside .foot { font-size: 11.5px; color: #7fa5a0; }
.login-main {
  display: grid; place-items: center; padding: 40px 32px; background: var(--plane);
}
.login-card { width: min(392px, 100%); }
.login-card > h2 { font-size: 22px; margin-bottom: 4px; }
.demo-users {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line);
}
.demo-users > .small { margin-bottom: 8px; }
.demo-users button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 9px 12px; margin-bottom: 6px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); font-size: 12.5px; color: var(--ink-2);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.demo-users button:hover { border-color: var(--accent); background: var(--accent-wash); color: var(--accent); }
.demo-users .who { display: block; min-width: 0; }
.demo-users b { display: block; color: var(--ink); font-weight: 600; font-size: 13px; }
.demo-users i { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.demo-users button:hover b { color: var(--accent); }

/* ================================================================ 响应式
   ≥1100 侧栏常驻 / 768–1099 平板：侧栏收为抽屉、双列压成单列
   <768 手机：表格转卡片、弹窗变底部抽屉、KPI 两列                        */

@media (max-width: 1099px) {
  :root { --gutter: 22px; }
  /* 登录页从左右两栏改为上下堆叠 */
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 100dvh; }
  .login-aside { padding: 34px 26px 30px; justify-content: flex-start; gap: 22px; }
  .login-aside h1 { font-size: 25px; max-width: 26ch; }
  .login-aside .lede { margin-top: 10px; }
  .login-points { margin-top: 22px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); display: grid; }
  .login-aside .foot { margin-top: 4px; }
  .login-main { padding: 32px 26px 52px; place-items: start center; }
  .login-card { width: min(420px, 100%); }
  aside {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100dvh;
    transform: translateX(-100%);
    transition: transform .26s var(--ease);
    box-shadow: var(--shadow-3); border-right: 1px solid var(--line);
  }
  body[data-drawer="open"] aside { transform: none; }
  body[data-drawer="open"] .scrim { display: block; }
  header .drawer-btn { display: inline-flex; }
  main { width: 100%; }
  .grid2 { grid-template-columns: 1fr; }
  .content { max-width: none; }
}

@media (max-width: 767px) {
  :root { --gutter: 16px; --header-h: 56px; }
  /* 手机上只留品牌条与一句主张，价值点折起来不抢表单的位置 */
  .login-aside { padding: 22px 16px 20px; gap: 14px; }
  .login-aside h1 { font-size: 20px; line-height: 1.45; max-width: none; }
  .login-aside .lede { font-size: 13px; margin-top: 8px; }
  .login-points, .login-aside .foot { display: none; }
  .login-main { padding: 24px 16px 40px; }
  body { font-size: 13.5px; }
  h1 { font-size: 19px; }
  .content { padding: 18px var(--gutter) 56px; }
  .who-name { display: none; }
  .title-row { margin-bottom: 16px; }
  .title-row .inline { width: 100%; }
  .title-row .inline .btn { flex: 1; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px 13px; }
  .stat .v { font-size: 22px; }
  .two { grid-template-columns: 1fr; }
  .panel { padding: 16px; border-radius: var(--r-md); }
  .panel.flush .panel-head { padding: 14px 16px 0; }

  /* 表格转卡片：每行一张卡，单元格前缀用表头文字 */
  table.as-cards, table.as-cards tbody { display: block; width: 100%; }
  table.as-cards thead { display: none; }
  table.as-cards tr {
    display: block; padding: 14px 16px; border-bottom: 1px solid var(--line);
  }
  table.as-cards tr:last-child { border-bottom: 0; }
  table.as-cards td {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 3px 0; border: 0;
  }
  table.as-cards td::before {
    content: attr(data-label); flex: 0 0 74px;
    font-size: 11.5px; color: var(--ink-3); padding-top: 2px;
  }
  table.as-cards td[data-label=""]::before,
  table.as-cards td.stack::before { display: none; }
  table.as-cards td.stack { display: block; padding-bottom: 8px; }
  table.as-cards td.actions { padding-top: 10px; }
  table.as-cards td.actions::before { display: none; }
  table.as-cards td.actions .inline { width: 100%; }
  table.as-cards td.actions .btn { flex: 1; }
  .table-wrap { overflow: visible; }

  /* 弹窗变底部抽屉 */
  dialog {
    width: 100%; max-width: none; max-height: 92dvh;
    margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
  dialog[open] { animation: sheet .26s var(--ease); }
  @keyframes sheet { from { transform: translateY(100%); } }
  .modal-head { padding: 16px 18px 12px; }
  .modal-body { padding: 4px 18px 18px; }
  .modal-foot { padding: 12px 18px; }
  .modal-foot .btn { flex: 1; }
  .toast-host { bottom: 16px; }
  .segmented { width: 100%; overflow-x: auto; }
  .segmented button { flex: 1; }
  .meter-val { font-size: 24px; }
  .viz-stack { height: 26px; }
}

@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr; }
  table.as-cards td { display: block; }
  table.as-cards td::before { display: block; flex: none; margin-bottom: 1px; }
}

/* 打印：去掉外壳，展开全部表格孪生 */
@media print {
  aside, header, .toast-host, .btn { display: none !important; }
  .content { max-width: none; padding: 0; }
  .panel { break-inside: avoid; box-shadow: none; border-color: #ccc; }
  .viz-table[open] summary { display: none; }
}

/* Shared filter fields align labels, controls and actions across management pages. */
.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(220px, 320px) auto;
  align-items: end;
  justify-content: start;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.filter-bar > .fld { margin: 0; }
.filter-bar .fld > label { margin: 0 0 8px; }
.filter-bar input, .filter-bar select, .filter-actions .btn {
  height: 40px;
  min-height: 40px;
}
.filter-actions { display: flex; align-items: center; gap: 8px; }
.filter-actions .btn { padding: 0 16px; white-space: nowrap; }
.store-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; }
.store-list-heading h2 { display: flex; align-items: baseline; gap: 10px; font-size: 14px; margin: 0; }
.store-list-heading h2 span { font-weight: 400; }
@media (min-width: 768px) and (max-width: 1099px) {
  .filter-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 767px) {
  .filter-bar { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 14px; }
  .filter-actions .btn { flex: 1; }
  .store-list-heading { padding: 16px; }
}

.account-filters { grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) 140px auto; }
@media (min-width: 768px) and (max-width: 1399px) {
  .account-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .account-filters .filter-actions { grid-column: auto; justify-content: flex-end; }
}
@media (max-width: 767px) { .account-filters { grid-template-columns: minmax(0, 1fr); } }

@media (min-width: 768px) {
  .account-table td:first-child { min-width: 120px; }
  .account-table td:nth-child(2) { min-width: 115px; }
  .account-table td:nth-child(3) { min-width: 180px; }
  .account-table td:nth-child(4) { min-width: 190px; }
  .account-table td:nth-child(5), .account-table td:nth-child(6) { white-space: nowrap; }
}

.search-filters { grid-template-columns: minmax(240px, 1fr) minmax(140px, 200px) auto; }
.search-results { padding: 0 20px; }
@media (min-width: 768px) {
  .dashboard-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .as-cards td[data-label="截止"], .as-cards td[data-label="应交日期"],
  .as-cards td[data-label="时间"] { white-space: nowrap; }
  .as-cards td[data-label="负责人"] { min-width: 105px; }
}
@media (max-width: 767px) {
  .search-filters { grid-template-columns: minmax(0, 1fr); }
  .search-results { padding: 0 16px; }
}

@media (max-width: 767px) {
  .dashboard-stats > .stat:last-child { grid-column: 1 / -1; }
}

.form-section-title { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; }
.modal-body > .form-section-title:first-child { margin-top: 16px; padding-top: 0; border-top: 0; }
.account-login-hint { align-self: end; margin: 0; }

.task-filters { grid-template-columns: minmax(180px, 320px) auto; }
@media (max-width: 767px) { .task-filters { grid-template-columns: minmax(0, 1fr); } }

.personnel-back { margin: -8px 0 12px; }
.personnel-summary { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 24px; padding: 22px 24px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 12px; }
.personnel-summary span, .personnel-affiliation span { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.personnel-summary strong { font-size: 22px; font-weight: 600; }
.personnel-summary small { font-size: 13px; font-weight: 400; }
.personnel-summary p { margin: 0; font-size: 14px; }
.personnel-tabs { display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.personnel-tabs > button, .personnel-tabs > span { border: 0; border-radius: 0; background: transparent; padding: 12px 2px; font: inherit; color: var(--ink-2); cursor: pointer; }
.personnel-tabs > .active { color: var(--ink); border-bottom: 2px solid currentColor; font-weight: 600; }
.personnel-affiliation { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; align-self: end; }
.personnel-affiliation span { margin-bottom: 5px; }
.personnel-affiliation strong { font-size: 14px; }
.personnel-filters { grid-template-columns: minmax(200px, 1fr) minmax(140px, 180px) auto; }
@media (max-width: 767px) {
  .personnel-summary { grid-template-columns: 1fr 1fr; gap: 20px; padding: 18px; }
  .personnel-summary > div:last-child { grid-column: 1 / -1; }
  .personnel-summary strong { font-size: 19px; }
  .personnel-filters { grid-template-columns: minmax(0, 1fr); }
}

/* 培训考试：管理端与独立手机答题页 */
.exam-question { padding: 0; }
.exam-question-body { padding: 0 20px 20px; }
.exam-question-tools { padding-left: 0; padding-right: 0; }
.exam-save-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; z-index: 2; }
.exam-review { padding: 16px 0; border-bottom: 1px solid var(--line); }
.exam-review h3 { font-size: 14px; white-space: pre-wrap; }
.exam-review li { padding: 5px 0; }
.exam-share { text-align: center; }
.exam-share img { background: white; border-radius: 12px; padding: 12px; max-width: 100%; height: auto; }
.public-exam-wrap { max-width: 800px; margin: 0 auto; padding: 28px 24px 64px; }
.exam-brand { font-size: 13px; font-weight: 600; letter-spacing: .08em; margin: 0 0 28px; }
.public-exam h1 { font-size: clamp(23px, 4vw, 30px); line-height: 1.45; margin: 12px 0; overflow-wrap: anywhere; }
.public-exam h2 { font-size: 17px; line-height: 1.7; }
.exam-eyebrow { font-size: 12px; color: var(--ink-2); }
.exam-description { white-space: pre-wrap; line-height: 1.8; }
.exam-facts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.exam-facts span { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.exam-consent { display: flex; align-items: flex-start; gap: 10px; line-height: 1.7; margin: 24px 0 12px; font-size: 13px; }
.exam-consent input, .exam-option input { width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; margin: 3px 0 0; accent-color: #276d66; }
.exam-start { width: 100%; justify-content: center; margin-top: 12px; }
.exam-taking-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.exam-clock { flex: 0 0 auto; text-align: right; padding-top: 8px; }
.exam-clock span { display: block; font-size: 12px; color: var(--ink-2); }
.exam-clock strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.exam-public-question { margin-top: 22px; min-width: 0; }
.exam-public-question legend { padding: 0 8px; font-size: 12px; }
.exam-question-number { font-weight: 700; margin-right: 6px; }
.exam-public-question h2 { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 20px; }
.exam-options { display: grid; gap: 10px; }
.exam-option { margin: 0; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 14px; line-height: 1.7; }
.exam-option:has(input:checked) { border-color: #397d75; background: rgba(57,125,117,.08); }
.exam-option span { overflow-wrap: anywhere; white-space: pre-wrap; }
.exam-submit { margin-top: 24px; }
.exam-submit .btn { width: 100%; justify-content: center; }
.exam-result { text-align: center; padding: 40px 24px; }
.exam-result-mark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 18px; background: #e5f1ed; color: #276d66; border-radius: 50%; font-size: 28px; }
.exam-score { font-size: 56px; font-weight: 650; line-height: 1.4; margin: 24px 0 10px; font-variant-numeric: tabular-nums; }
.exam-score small { font-size: 16px; font-weight: 400; }
@media (max-width: 767px) {
 .public-exam-wrap { padding: 22px 16px 40px; }
 .exam-brand { margin-bottom: 22px; }
 .exam-question-tools { flex-wrap: wrap; }
 .exam-save-bar { flex-wrap: wrap; padding: 14px 16px; }
 .exam-save-bar .btn { margin-left: auto; }
 .exam-question-body { padding: 0 16px 16px; }
 .exam-clock strong { font-size: 20px; }
}

.public-exam .err:empty { display: none; }

/* 分享弹框采用独立的预览、链接、操作与提示分区。 */
.exam-share-dialog { display: grid; gap: 20px; padding-top: 20px; }
.exam-share img { display: block; margin: 0 auto; }
.exam-share h3 { margin: 16px 0 8px; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.exam-share .hint { margin: 0; line-height: 1.7; }
.exam-share-link { border-top: 1px solid var(--line); padding-top: 20px; }
.exam-share-link > .fld { margin: 0; }
.exam-share-link input { min-height: 42px; font-size: 13px; }
.exam-share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.exam-share-actions .btn { min-height: 40px; justify-content: center; padding: 0 16px; }
.exam-share-note { margin: 0; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink-2); font-size: 12px; line-height: 1.7; }
.modal-body > .fld + .inline { margin-top: 16px; }
.modal-body > .inline + .hint { margin-top: 12px; }
.exam-question-body > .fld:first-child { margin-top: 0; }
.exam-question-body { padding-top: 4px; }
.exam-review p { margin: 10px 0 0; line-height: 1.7; overflow-wrap: anywhere; }
@media (max-width: 767px) {
 .exam-share-dialog { gap: 18px; padding-top: 18px; }
 .exam-share img { width: 200px; }
 .exam-share-actions .btn { flex: 1 1 130px; }
 .exam-taking-header h1 { margin-top: 10px; }
}
@media (min-width: 768px) {
 .exam-share { display: grid; grid-template-columns: 180px minmax(0, 1fr); column-gap: 24px; text-align: left; }
 .exam-share img { grid-row: 1 / 3; width: 180px; margin: 0; padding: 0; }
 .exam-share h3 { align-self: end; margin: 0 0 10px; font-size: 16px; }
 .exam-share .hint { align-self: start; }
}
/* 带按钮样式的链接保持与原生按钮一致，包含考试导出与分享操作。 */
a.btn, a.btn:hover { text-decoration: none; }

.demo-role-group { margin-top: 20px; }
.demo-role-group h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 0 0 8px; }
.demo-role-group h3 span { font-size: 11px; font-weight: 400; color: var(--ink-3); }
.demo-role-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.demo-role-tabs button { margin: 0; padding: 10px 12px; font-size: 12px; }
.demo-role-tabs button span { color: var(--ink-3); font-size: 11px; }
.demo-role-tabs button[aria-pressed=true] { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); font-weight: 600; }
.demo-users small { display: block; margin-top: 4px; color: var(--ink-2); font-size: 11px; overflow-wrap: anywhere; }

/* 全局搜索 */
.header-search { gap: 9px; height: 34px; color: var(--ink-2); background: var(--surface); }
.header-search kbd { padding-left: 12px; color: var(--ink-3); font: inherit; font-size: 10px; }
.search-filters { grid-template-columns: minmax(220px,1fr) 150px minmax(180px,240px) auto; }
.search-result { display: flex; align-items: center; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.search-result:last-child { border-bottom: 0; }
.search-result .grow { min-width: 0; flex: 1; }
.search-result-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--ink-2); }
.search-result-meta > span:last-child { overflow-wrap: anywhere; }
.search-result h2 { font-size: 15px; font-weight: 600; line-height: 1.6; margin: 10px 0 0; overflow-wrap: anywhere; }
.search-result p { font-size: 13px; color: var(--ink-2); margin: 7px 0 0; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.search-result mark { background: var(--gold-wash); color: var(--ink); border-radius: 2px; }
.person-search-detail { padding-top: 16px; }
.person-search-detail h3 { font-size: 18px; margin-bottom: 20px; }
.person-search-detail dl { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 14px; margin: 0; font-size: 13px; }
.person-search-detail dt { color: var(--ink-2); }
.person-search-detail dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width:768px) and (max-width:1250px) {
 .search-filters { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
 .search-filters .filter-actions { grid-column: auto; justify-content: flex-end; }
 .header-search kbd { display: none; }
}
@media (max-width:767px) {
 .header-search { width: 34px; padding: 0; flex: 0 0 34px; justify-content: center; }
 .header-search span, .header-search kbd { display: none; }
 .search-filters { grid-template-columns: minmax(0,1fr); }
 .search-result { align-items: flex-start; gap: 12px; padding: 18px 0; }
 .search-result > .btn { margin-top: 4px; flex-shrink: 0; }
 .person-search-detail dl { grid-template-columns: 100px minmax(0,1fr); }
}

/* 新环境与未选择项目：先引导建档，项目功能不发送空 ID 请求。 */
.project-nav-context { margin: 0 14px 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.project-nav-context > span { display: block; font-size: 12px; color: var(--ink-2); line-height: 1.6; overflow-wrap: anywhere; }
.project-nav-context > .btn { margin-top: 8px; }
.project-nav-context > small { display: block; margin-top: 5px; font-size: 11px; color: var(--ink-3); line-height: 1.6; }
.project-empty { padding: 32px; }
.project-empty-icon { width: 44px; height: 44px; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); border-radius: 12px; margin-bottom: 18px; }
.project-empty-icon svg { width: 22px; height: 22px; }
.project-empty > h2 { font-size: 20px; margin-bottom: 10px; }
.project-empty > p { color: var(--ink-2); font-size: 14px; line-height: 1.8; margin: 0 0 24px; }
.workspace-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin-top: 26px; }
.workspace-step { display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; }
.workspace-step-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-sunken); color: var(--ink-2); font-size: 12px; font-weight: 600; margin-bottom: 18px; }
.workspace-step h3 { font-size: 15px; margin-bottom: 10px; }
.workspace-step p { font-size: 13px; color: var(--ink-2); line-height: 1.8; margin: 0 0 22px; flex: 1; }
.workspace-independent { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.workspace-independent h2 { font-size: 15px; }
.workspace-independent .hint { margin-bottom: 0; }
@media(max-width:900px) { .workspace-steps { grid-template-columns: 1fr; } }
@media(max-width:767px) { .project-empty { padding: 22px 18px; } .workspace-step { padding: 18px; } .workspace-independent > .inline { width: 100%; } }

/* 录音核对与已发布纪要共用播放器。 */
.recording-player { display: block; width: 100%; margin: 12px 0 18px; }

/* 资料原表与人工正文分别展示，原表保留列宽并完整换行。 */
.material-meta { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding-top:14px; }
.material-meta a { overflow-wrap:anywhere; }
.material-actions { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; }
.material-tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin:18px 0 14px; }
.material-tabs button { border:0; background:transparent; padding:10px 14px; cursor:pointer; color:var(--ink-2); border-bottom:2px solid transparent; }
.material-tabs button[aria-selected="true"] { color:var(--accent); border-bottom-color:var(--accent); font-weight:600; }
.material-original table.material-sheet { table-layout:fixed; min-width:100%; }
.material-original table.material-sheet td { white-space:pre-wrap; overflow-wrap:anywhere; max-width:none; overflow:visible; text-overflow:clip; line-height:1.65; }
.material-original .sheet-wrap { max-height:max(180px, calc(86dvh - 360px)); }
#materialContent { padding-bottom:4px; }

/* 资料原件阅读：长段落与表格不截断，预览区域适配弹框。 */
#materialContent .doc-blocks table td { white-space:pre-wrap; overflow-wrap:anywhere; text-overflow:clip; max-width:none; }
#materialContent .doc-blocks, #materialContent .viewer-text { max-height:max(180px, calc(86dvh - 360px)); }
#materialContent .viewer-frame { height:max(220px, calc(86dvh - 360px)); }
#materialContent .viewer-img { display:block; max-width:100%; height:auto; }

.material-review-notice { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:12px 0; }

#modal.material-editor textarea { min-height: min(280px, 38dvh); line-height:1.7; }
