/* ==========================================================================
   体检中心抖音运营系统 · 设计系统 v2
   --------------------------------------------------------------------------
   方针：
   1. 零第三方依赖，断网可跑（不引 CDN / 字体 / 图标库）
   2. 手机优先（员工用微信打开），桌面端自适应成后台
   3. 信息密度高但呼吸感要在：靠层次、留白、极细边框区分，不靠色块堆叠
   4. 所有颜色走变量，改主题只改 :root
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  /* 品牌 */
  --brand-50:  #EEF4FF;
  --brand-100: #DCE7FE;
  --brand-200: #BFD4FD;
  --brand-500: #3B7BF6;
  --brand-600: #2563EB;
  --brand-700: #1D4ED8;
  --brand-800: #1E3FA8;

  /* 中性 */
  --ink-1: #0D1526;
  --ink-2: #313E58;
  --ink-3: #64748B;
  --ink-4: #94A3B8;
  --line:   #E4E9F2;
  --line-2: #EEF2F8;
  --bg:      #F5F7FB;
  --surface: #FFFFFF;
  --surface-2: #FAFBFE;

  /* 语义 */
  --ok: #0E9F6E;    --ok-bg: #E7F7F0;   --ok-line: #B6E6D2;
  --warn: #B86E00;  --warn-bg: #FFF5E3; --warn-line: #F7DDA8;
  --bad: #D83A34;   --bad-bg: #FDECEA;  --bad-line: #F6C6C2;
  --info: #2563EB;  --info-bg: #EEF4FF;

  /* 圆角 / 阴影 */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 15px;
  --r-xl: 22px;
  --sh-1: 0 1px 2px rgba(13, 21, 38, .045);
  --sh-2: 0 1px 2px rgba(13, 21, 38, .05), 0 2px 8px -2px rgba(13, 21, 38, .06);
  --sh-3: 0 4px 10px -4px rgba(13, 21, 38, .10), 0 12px 32px -8px rgba(13, 21, 38, .10);
  --sh-pop: 0 32px 80px -16px rgba(13, 21, 38, .34), 0 8px 20px -8px rgba(13, 21, 38, .14);

  /* 侧边栏 */
  --nav-bg: #0B1524;
  --nav-bg-2: #101F35;
  --nav-ink: #AEBBD0;
  --nav-ink-on: #FFFFFF;

  /* 尺寸 */
  --nav-w: 224px;
  --head-h: 68px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink-1);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body { min-height: 100vh; }

/* 手机浏览器（尤其微信/企业微信内置）不要自动放大字号，点击也不要闪一块灰 */
html { -webkit-text-size-adjust: 100%; -moz-text-size-adjust: 100%; text-size-adjust: 100%; }
* { -webkit-tap-highlight-color: transparent; }

h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -.015em; color: var(--ink-1); line-height: 1.35; }
h1 { font-size: 21px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p  { margin: 0 0 .6em; }
a  { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
svg { flex: none; }

::selection { background: var(--brand-100); color: var(--brand-800); }

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

/* ---------- 3. 工具类 ---------- */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num  { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.dim   { color: var(--ink-4); }
.small { font-size: 13px; }
.tiny  { font-size: 12px; }
.micro { font-size: 11px; }
.b     { font-weight: 700; }
.center { text-align: center; }
.right  { text-align: right; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.grow { flex: 1 1 auto; min-width: 0; }
.sp   { flex: 1 1 auto; }
.row  { display: flex; align-items: center; gap: 10px; }
.row.top { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.col  { display: flex; flex-direction: column; gap: 10px; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; }
.gap12 { gap: 12px; } .gap16 { gap: 16px; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; }
.mb0 { margin-bottom: 0 !important; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tabnums { font-variant-numeric: tabular-nums; }

/* 网格 */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grid6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.auto-fit { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

/* ---------- 4. 按钮 ---------- */
.btn {
  --btn-bg: var(--brand-600);
  --btn-ink: #fff;
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.005em;
  padding: 0 16px;
  height: 40px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background .16s ease, box-shadow .16s ease, transform .08s ease, border-color .16s ease;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .18);
  user-select: none;
}
.btn:hover { --btn-bg: var(--brand-700); }
.btn:active { transform: translateY(.5px) scale(.995); }
.btn:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }

.btn.ghost {
  --btn-bg: var(--surface);
  --btn-ink: var(--ink-2);
  border-color: var(--line);
  box-shadow: var(--sh-1);
}
.btn.ghost:hover { --btn-bg: var(--surface-2); border-color: #D5DDEA; --btn-ink: var(--ink-1); }

.btn.soft { --btn-bg: var(--brand-50); --btn-ink: var(--brand-700); box-shadow: none; }
.btn.soft:hover { --btn-bg: var(--brand-100); }

.btn.dark { --btn-bg: var(--ink-1); --btn-ink: #fff; box-shadow: 0 1px 2px rgba(13,21,38,.2); }
.btn.dark:hover { --btn-bg: #1B2438; }

.btn.ok { --btn-bg: var(--ok); box-shadow: 0 1px 2px rgba(14,159,110,.22); }
.btn.ok:hover { --btn-bg: #0B8A5F; }

.btn.danger { --btn-bg: var(--surface); --btn-ink: var(--bad); border-color: var(--bad-line); box-shadow: none; }
.btn.danger:hover { --btn-bg: var(--bad-bg); }

.btn.solid-danger { --btn-bg: var(--bad); --btn-ink: #fff; }
.btn.solid-danger:hover { --btn-bg: #BF2E29; }

.btn.xs { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-xs); gap: 5px; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); gap: 6px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: var(--r-md); }
.btn.block { width: 100%; display: flex; }
.btn.pill { border-radius: 99px; }

/* 纯图标按钮 */
.iconbtn {
  appearance: none; border: 1px solid transparent; background: transparent;
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-3); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.iconbtn:hover { background: var(--line-2); color: var(--ink-1); }
.iconbtn.line { border-color: var(--line); background: var(--surface); box-shadow: var(--sh-1); }
.iconbtn.line:hover { background: var(--surface-2); }
.iconbtn.on { background: var(--brand-50); color: var(--brand-700); }

/* ---------- 5. 表单 ---------- */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label, .lbl {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: .01em;
}
.field > label.req::after { content: ' *'; color: var(--bad); }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.6; }
.hint.warn { color: var(--warn); }

input[type=text], input[type=number], input[type=date], input[type=time],
input[type=password], input[type=tel], input[type=search], input[type=url],
select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14.5px;
  color: var(--ink-1);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input:hover, select:hover, textarea:hover { border-color: #CBD5E3; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, .12);
}
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
textarea { min-height: 96px; resize: vertical; line-height: 1.7; padding: 10px 12px; }
textarea.code { font-family: var(--mono); font-size: 12.8px; line-height: 1.75; }

select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'><path d='M1 1l4.5 4.5L10 1' fill='none' stroke='%2364748B' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

input[type=checkbox].ck, input[type=radio].rd {
  width: 17px; height: 17px; min-height: 0; margin: 0;
  accent-color: var(--brand-600); cursor: pointer; flex: none;
  vertical-align: -3px;
}
.checkline {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13.5px; color: var(--ink-2); cursor: pointer; line-height: 1.55;
}
.checkline input { margin-top: 2px; }

/* 输入框 + 按钮 的组合 */
.inputgroup { display: flex; gap: 8px; }
.inputgroup > input { flex: 1; }
.inputgroup > .btn { flex: none; }

/* 搜索框 */
.searchbox { position: relative; }
.searchbox > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-4); pointer-events: none; }
.searchbox > input { padding-left: 34px; }

/* ---------- 6. 卡片 / 面板 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 18px;
  margin-bottom: 14px;
}
.card:last-child { margin-bottom: 0; }
.card.pad0 { padding: 0; overflow: hidden; }
.card.flat { box-shadow: none; }
.card.tint { background: var(--surface-2); }
.card.hl { border-color: var(--brand-200); box-shadow: 0 0 0 3px var(--brand-50); }

/* 面板：带标题栏 */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
  margin-bottom: 16px;
}
.panel:last-child { margin-bottom: 0; }
.panel-h {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
  min-height: 52px;
}
.panel-h h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.panel-h h3 .ic { color: var(--ink-3); }
.panel-h .sub { font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.panel-b { padding: 18px; }
.panel-b.pad0 { padding: 0; }
.panel-f {
  padding: 12px 18px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
  display: flex; align-items: center; gap: 10px;
}

/* 区块标题（无边框版） */
.sechead { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; }
.sechead:first-child { margin-top: 0; }
.sechead h3 { font-size: 14px; letter-spacing: -.005em; }
.sechead .sub { font-size: 12px; color: var(--ink-4); }

/* ---------- 7. 统计卡 ---------- */
.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 15px 16px 14px;
  box-shadow: var(--sh-1);
  overflow: hidden;
  transition: box-shadow .18s, border-color .18s, transform .18s;
}
.stat:hover { box-shadow: var(--sh-2); border-color: #D9E1EE; }
.stat .hd { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.stat .ic {
  width: 27px; height: 27px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-50); color: var(--brand-700);
}
.stat .ic.g { background: var(--ok-bg); color: var(--ok); }
.stat .ic.y { background: var(--warn-bg); color: var(--warn); }
.stat .ic.r { background: var(--bad-bg); color: var(--bad); }
.stat .ic.n { background: var(--line-2); color: var(--ink-3); }
.stat .lab { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.stat .val {
  font-size: 27px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15;
  font-variant-numeric: tabular-nums; color: var(--ink-1);
  display: flex; align-items: baseline; gap: 5px;
}
.stat .val .unit { font-size: 13px; font-weight: 600; color: var(--ink-4); letter-spacing: 0; }
.stat .foot { font-size: 12px; color: var(--ink-3); margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.stat.accent { background: linear-gradient(140deg, #1D4ED8 0%, #3B7BF6 55%, #5B95FF 100%); border-color: transparent; }
.stat.accent .lab, .stat.accent .foot { color: rgba(255,255,255,.80); }
.stat.accent .val { color: #fff; }
.stat.accent .val .unit { color: rgba(255,255,255,.7); }
.stat.accent .ic { background: rgba(255,255,255,.18); color: #fff; }
.stat.alarm { background: linear-gradient(140deg, #C4302B 0%, #E14B42 100%); border-color: transparent; }
.stat.alarm .lab, .stat.alarm .foot { color: rgba(255,255,255,.85); }
.stat.alarm .val { color: #fff; }
.stat.alarm .ic { background: rgba(255,255,255,.2); color: #fff; }

.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--ink-4); }

/* ---------- 8. 徽章 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .01em;
  border-radius: var(--r-xs);
  background: var(--line-2); color: var(--ink-3);
  white-space: nowrap;
  border: 1px solid transparent;
}
.tag.b { background: var(--brand-50); color: var(--brand-700); border-color: #DCE7FE; }
.tag.g { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.tag.y { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.tag.r { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.tag.n { background: var(--surface-2); color: var(--ink-3); border-color: var(--line); }
.tag.solid { border-color: transparent; }
.tag.lg { height: 26px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); }

/* 圆点 */
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; background: var(--ink-4); }
.dot.g { background: var(--ok); } .dot.y { background: var(--warn); }
.dot.r { background: var(--bad); } .dot.b { background: var(--brand-600); }

/* 头像 */
.av {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  background: var(--brand-50); color: var(--brand-700);
}
.av.round { border-radius: 50%; }
.av.lg { width: 42px; height: 42px; border-radius: 14px; font-size: 15px; }
.av.sm { width: 26px; height: 26px; border-radius: 9px; font-size: 11px; }
.av.g { background: var(--ok-bg); color: var(--ok); }
.av.gray { background: var(--line-2); color: var(--ink-3); }

/* ---------- 9. 表格 ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
table.tbl th, table.tbl td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
table.tbl th {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-4);
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--surface-2);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
  border-bottom: 1px solid var(--line);
}
table.tbl td { color: var(--ink-2); }
table.tbl td b, table.tbl td strong { color: var(--ink-1); font-weight: 650; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: #F8FAFF; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.center, table.tbl th.center { text-align: center; }
table.tbl .wide { white-space: normal; min-width: 190px; }
table.tbl .nowrap { white-space: nowrap; }
.tbl-wrap.compact table.tbl th, .tbl-wrap.compact table.tbl td { padding: 8px 12px; }

/* 排名色 */
.rk1 { color: #B07C10 !important; font-weight: 800; }
.rk2 { color: #77839A !important; font-weight: 800; }
.rk3 { color: #A0673A !important; font-weight: 800; }

/* 表格空态 */
.tbl-empty { padding: 46px 20px; text-align: center; }

/* 手机上表格降级成卡片（加 class="resp" 并给 td 写 data-l） */
@media (max-width: 820px) {
  table.tbl.resp { font-size: 13px; }
  table.tbl.resp thead { display: none; }
  table.tbl.resp tbody, table.tbl.resp tr, table.tbl.resp td { display: block; width: auto; }
  table.tbl.resp tr {
    padding: 13px 15px;
    border-bottom: 1px solid var(--line-2);
    position: relative;
  }
  table.tbl.resp tr:last-child { border-bottom: 0; }
  table.tbl.resp td {
    border: 0; padding: 2px 0; display: flex; gap: 10px;
    align-items: baseline; white-space: normal; text-align: left !important;
  }
  table.tbl.resp td::before {
    content: attr(data-l);
    flex: none; width: 64px;
    font-size: 12px; color: var(--ink-4); font-weight: 600;
  }
  table.tbl.resp td[data-l=""]::before { display: none; }
  table.tbl.resp td.hide-sm { display: none; }
  table.tbl.resp td.act-cell { justify-content: flex-end; margin-top: 8px; }
  table.tbl.resp td.act-cell::before { display: none; }
  table.tbl.resp td.primary {
    display: block; font-size: 14.5px; margin-bottom: 7px;
    padding-bottom: 7px; border-bottom: 1px dashed var(--line-2);
  }
  table.tbl.resp td.primary::before { display: none; }
  table.tbl.resp td.primary b { font-size: 14.5px; }
  table.tbl.resp td .bar { min-width: 90px; }
}

/* ---------- 10. 进度 ---------- */
.bar {
  height: 6px; background: #EDF1F7; border-radius: 99px;
  overflow: hidden; position: relative;
}
.bar > i {
  display: block; height: 100%; width: 0;
  background: var(--brand-600); border-radius: 99px;
  transition: width .5s cubic-bezier(.2,.7,.3,1);
}
.bar.g > i { background: var(--ok); }
.bar.y > i { background: var(--warn); }
.bar.r > i { background: var(--bad); }
.bar.lg { height: 9px; }
.bar.xs { height: 4px; }

/* 进度环（纯 CSS conic-gradient） */
.ring {
  --v: 0; --sz: 74px; --th: 7px;
  width: var(--sz); height: var(--sz); border-radius: 50%;
  background: conic-gradient(var(--brand-600) calc(var(--v) * 1%), #EDF1F7 0);
  display: flex; align-items: center; justify-content: center;
  position: relative; flex: none;
}
.ring::after {
  content: ''; position: absolute; inset: var(--th);
  background: var(--surface); border-radius: 50%;
}
.ring > span {
  position: relative; z-index: 1;
  font-size: 15px; font-weight: 800; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.ring > span em { font-size: 10px; font-weight: 600; color: var(--ink-4); font-style: normal; }
.ring.g { background: conic-gradient(var(--ok) calc(var(--v) * 1%), #EDF1F7 0); }
.ring.y { background: conic-gradient(var(--warn) calc(var(--v) * 1%), #EDF1F7 0); }
.ring.r { background: conic-gradient(var(--bad) calc(var(--v) * 1%), #EDF1F7 0); }

/* ---------- 11. 提示条 ---------- */
.note {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: var(--r-md);
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.68;
  background: var(--info-bg); color: #1A3A82;
  border: 1px solid #DCE7FE;
  margin-bottom: 12px;
}
.note:last-child { margin-bottom: 0; }
.note .ni { flex: none; margin-top: 1px; color: var(--brand-600); }
.note b { font-weight: 700; }
.note.y { background: var(--warn-bg); color: #7A4A00; border-color: var(--warn-line); }
.note.y .ni { color: var(--warn); }
.note.r { background: var(--bad-bg); color: #8E211D; border-color: var(--bad-line); }
.note.r .ni { color: var(--bad); }
.note.g { background: var(--ok-bg); color: #0A6045; border-color: var(--ok-line); }
.note.g .ni { color: var(--ok); }
.note.plain { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.note.plain .ni { color: var(--ink-3); }

/* ---------- 12. 列表项 ---------- */
.li {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-2);
  transition: background .12s;
}
.li:last-child { border-bottom: 0; }
.li.click { cursor: pointer; }
.li.click:hover { background: var(--surface-2); }
.li .t { font-weight: 600; color: var(--ink-1); font-size: 14px; }
.li .d { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.li-h {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px; font-weight: 650; color: var(--ink-3);
}

/* ---------- 13. 空状态 / 骨架屏 ---------- */
.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--ink-4);
  font-size: 13.5px;
  line-height: 1.7;
}
.empty .ei {
  width: 54px; height: 54px; margin: 0 auto 12px;
  border-radius: 18px; background: var(--line-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-4);
}
.empty .et { font-weight: 650; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }
.empty .eb { font-size: 12.5px; color: var(--ink-4); max-width: 300px; margin: 0 auto; }
.empty .ea { margin-top: 14px; }

@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk {
  background: #EAEFF6;
  border-radius: var(--r-xs);
  position: relative;
  overflow: hidden;
}
.sk::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.35s infinite;
}
.sk.t { height: 12px; }
.sk.h { height: 20px; }
.sk.b { height: 40px; border-radius: var(--r-sm); }
.sk.card { height: 96px; border-radius: var(--r-lg); }
.sk.av { width: 34px; height: 34px; border-radius: 11px; }

/* ---------- 14. 弹层 ---------- */
.mask {
  position: fixed; inset: 0;
  background: rgba(10, 17, 32, .5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 90;
  animation: fadein .18s ease;
}
.mask.mid { align-items: center; padding: 20px; }
.mask.right { justify-content: flex-end; align-items: stretch; padding: 0; }
@keyframes fadein { from { opacity: 0; } }

.sheet {
  background: var(--surface);
  width: 100%;
  max-width: 580px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: var(--sh-pop);
  animation: sheetup .26s cubic-bezier(.2,.8,.3,1);
  overflow: hidden;
}
@keyframes sheetup { from { transform: translateY(26px); opacity: .5; } }
.mask.mid .sheet { border-radius: var(--r-xl); max-height: 88vh; }
.mask.right .sheet {
  border-radius: 0; max-width: 460px; height: 100%; max-height: 100%;
  animation: sheetright .26s cubic-bezier(.2,.8,.3,1);
}
@keyframes sheetright { from { transform: translateX(40px); opacity: .6; } }

.sheet-h {
  display: flex; align-items: center; gap: 10px;
  padding: 17px 20px 15px;
  border-bottom: 1px solid var(--line-2);
  flex: none;
}
.sheet-h h3 { font-size: 16px; letter-spacing: -.01em; }
.sheet-h .sub { font-size: 12.5px; color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.sheet-h .x {
  margin-left: auto; width: 30px; height: 30px; flex: none;
  border: 0; background: var(--line-2); border-radius: 50%;
  color: var(--ink-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.sheet-h .x:hover { background: #DFE5EF; color: var(--ink-1); }
.sheet-b { padding: 18px 20px; overflow: auto; flex: 1; }
.sheet-f {
  display: flex; gap: 10px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-2); background: var(--surface-2); flex: none;
}
.sheet-f .btn { flex: 1; }
.sheet-f .btn.auto { flex: none; }

/* ---------- 15. Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 92px;
  transform: translateX(-50%) translateY(14px);
  background: rgba(13, 21, 38, .94);
  color: #fff;
  font-size: 13.5px; font-weight: 500;
  padding: 11px 18px;
  border-radius: var(--r-md);
  max-width: 84vw;
  text-align: center;
  line-height: 1.5;
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 300;
  white-space: pre-wrap;
  box-shadow: var(--sh-3);
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 16. 分段控件 / Tab ---------- */
.seg {
  display: inline-flex; align-items: center;
  background: #EDF1F7;
  border-radius: var(--r-sm);
  padding: 3px; gap: 2px;
}
.seg button {
  appearance: none; border: 0; background: none;
  font-size: 12.5px; font-weight: 650;
  color: var(--ink-3);
  padding: 6px 13px; border-radius: 6px;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg button:hover { color: var(--ink-1); }
.seg button.on {
  background: var(--surface); color: var(--ink-1);
  box-shadow: 0 1px 2px rgba(13,21,38,.10), 0 0 0 .5px rgba(13,21,38,.04);
}

/* 下划线 tab */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  appearance: none; border: 0; background: none;
  font-size: 13.5px; font-weight: 650; color: var(--ink-3);
  padding: 11px 13px; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  display: flex; align-items: center; gap: 6px;
}
.tabs button:hover { color: var(--ink-1); }
.tabs button.on { color: var(--brand-700); border-bottom-color: var(--brand-600); }

/* ---------- 17. 后台骨架：侧边栏 + 主区 ---------- */
.shell { display: flex; min-height: 100vh; }

.sidenav {
  width: var(--nav-w);
  flex: none;
  background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%);
  color: var(--nav-ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 70;
}
.sidenav-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  flex: none;
}
.sidenav-brand .logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(140deg, #3B7BF6, #1D4ED8);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 12px -2px rgba(59,123,246,.5);
}
.sidenav-brand .nm { font-size: 14px; font-weight: 700; color: #fff; letter-spacing: -.01em; line-height: 1.3; }
.sidenav-brand .sn { font-size: 11px; color: #6C7F99; margin-top: 1px; }

.sidenav-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.sidenav-nav::-webkit-scrollbar { width: 0; }
.navlab {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em;
  color: #55677F; text-transform: uppercase;
  padding: 16px 10px 7px;
}
.navitem {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; margin-bottom: 2px;
  border-radius: var(--r-sm);
  color: var(--nav-ink);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: 0; background: none;
  width: 100%; text-align: left;
  transition: background .15s, color .15s;
  position: relative;
}
.navitem svg { color: #6F86A3; transition: color .15s; }
.navitem:hover { background: rgba(255,255,255,.06); color: #E6ECF5; }
.navitem:hover svg { color: #9FB2CC; }
.navitem.on { background: rgba(59,123,246,.18); color: #fff; }
.navitem.on svg { color: #7BABFF; }
.navitem.on::before {
  content: ''; position: absolute; left: -12px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 17px; border-radius: 0 3px 3px 0;
  background: #4C86F7;
}
.navitem .badge {
  margin-left: auto; min-width: 19px; height: 19px; padding: 0 6px;
  border-radius: 99px; background: var(--bad);
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.sidenav-foot {
  flex: none;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.navuser {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--r-sm);
  cursor: pointer; transition: background .15s;
  border: 0; background: none; width: 100%; text-align: left;
}
.navuser:hover { background: rgba(255,255,255,.06); }
.navuser .av { background: rgba(255,255,255,.12); color: #DCE6F5; }
.navuser .nm { font-size: 13px; font-weight: 650; color: #fff; line-height: 1.3; }
.navuser .rl { font-size: 11px; color: #6C7F99; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.pagehead {
  position: sticky; top: 0; z-index: 50;
  min-height: var(--head-h);
  background: rgba(245, 247, 251, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 12px 26px;
  flex-wrap: wrap;
}
.pagehead h1 { font-size: 19px; letter-spacing: -.02em; line-height: 1.2; }
.pagehead .desc { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.pagehead .acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.content { padding: 22px 26px 64px; max-width: 1420px; width: 100%; }

/* 侧边栏遮罩（手机端） */
.navmask {
  display: none;
  position: fixed; inset: 0; z-index: 65;
  background: rgba(10,17,32,.5);
  backdrop-filter: blur(2px);
}

/* ---------- 18. 员工端 ---------- */
.appbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 11px 16px;
  padding-top: calc(11px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 12px;
}
.appbar .logo {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, #3B7BF6, #1D4ED8);
  color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.appbar .ttl { font-size: 15px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.appbar .sub { font-size: 11.5px; color: var(--ink-4); margin-top: 1px; }

.appwrap { max-width: 660px; margin: 0 auto; padding: 16px 14px 108px; }

/* 员工端主卡（渐变） */
.hero {
  position: relative;
  border-radius: var(--r-xl);
  padding: 20px;
  color: #fff;
  background: linear-gradient(135deg, #1D4ED8 0%, #3B7BF6 52%, #5E9BFF 100%);
  box-shadow: 0 10px 30px -10px rgba(37, 99, 235, .55);
  overflow: hidden;
  margin-bottom: 16px;
}
.hero::after {
  content: '';
  position: absolute; right: -46px; top: -56px;
  width: 168px; height: 168px; border-radius: 50%;
  background: rgba(255,255,255,.10);
  pointer-events: none;
}
.hero::before {
  content: '';
  position: absolute; right: 26px; bottom: -74px;
  width: 122px; height: 122px; border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;
}
.hero .hlab { font-size: 12.5px; font-weight: 650; color: rgba(255,255,255,.82); letter-spacing: .02em; }
.hero .hnum {
  font-size: 34px; font-weight: 800; letter-spacing: -.035em; line-height: 1.12;
  font-variant-numeric: tabular-nums; margin-top: 2px;
}
.hero .hnum small { font-size: 15px; font-weight: 600; color: rgba(255,255,255,.78); margin-left: 3px; letter-spacing: 0; }
.hero .htip { font-size: 12.5px; color: rgba(255,255,255,.9); margin-top: 10px; }
.hero .hbar {
  height: 7px; border-radius: 99px;
  background: rgba(255,255,255,.26);
  margin-top: 13px; overflow: hidden;
}
.hero .hbar > i { display: block; height: 100%; background: #fff; border-radius: 99px; transition: width .5s ease; }
.hero .hside { text-align: right; position: relative; z-index: 1; }
.hero .hside .n { font-size: 21px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.hero.green { background: linear-gradient(135deg, #07735A 0%, #0E9F6E 55%, #22BF8A 100%); box-shadow: 0 10px 30px -10px rgba(14,159,110,.5); }

/* 底部 tab */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  max-width: 100%;
}
.tabbar button {
  flex: 1; border: 0; background: none;
  padding: 8px 0 7px;
  color: var(--ink-4);
  font-size: 10.5px; font-weight: 650;
  letter-spacing: .01em;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; position: relative;
  transition: color .16s;
  min-height: 52px;
}
.tabbar button svg { transition: transform .18s; }
.tabbar button.on { color: var(--brand-600); }
.tabbar button.on svg { transform: translateY(-1px); }
.tabbar button.on::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 22px; height: 2.5px; border-radius: 0 0 3px 3px;
  background: var(--brand-600);
}
.tabbar button .nub {
  position: absolute; top: 5px; left: calc(50% + 7px);
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 99px; background: var(--bad); color: #fff;
  font-size: 9.5px; font-weight: 700; line-height: 15px;
}

/* 脚本台词块 */
.script-body {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 14px;
  font-size: 13.5px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 12px;
  max-height: 320px;
  overflow: auto;
  color: var(--ink-2);
}

/* ---------- 19. 时间线 ---------- */
.tl { position: relative; padding-left: 20px; }
.tl::before {
  content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 1.5px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 15px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -19px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--brand-600);
  box-sizing: border-box;
}
.tl-item.done::before { background: var(--ok); border-color: var(--ok); }
.tl-item.bad::before { background: var(--bad); border-color: var(--bad); }

/* ---------- 20. 图表容器 ---------- */
.chart-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-wrap > svg { display: block; width: 100%; height: auto; }
.legend { display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: var(--ink-3); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* 迷你柱图 */
.spark { display: flex; align-items: flex-end; gap: 4px; height: 58px; }
.spark > div {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; height: 100%;
}
.spark i {
  display: block; width: 100%; max-width: 26px;
  background: var(--brand-200); border-radius: 3px 3px 0 0;
  transition: height .4s ease, background .2s;
}
.spark > div:hover i { background: var(--brand-600); }
.spark i.hot { background: var(--brand-600); }
.spark .lb { font-size: 9.5px; color: var(--ink-4); margin-top: 4px; white-space: nowrap; }

/* 响应式工具：小于 620 时隐藏次要操作，避免工具栏挤成三行 */
@media (max-width: 620px) {
  .hide-sm { display: none !important; }
  .pane-tools { gap: 8px; margin-bottom: 13px; flex-wrap: wrap; }
  .pane-tools .btn.sm { height: 32px; padding: 0 10px; font-size: 12.5px; }
  /* 分段控件独占一行，放不下时横向滑动，不再把整页撑宽 */
  .pane-tools > .seg {
    flex: 1 1 100%; min-width: 0;
    display: flex; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .pane-tools > .seg::-webkit-scrollbar { display: none; }
  .pane-tools > .seg button { flex: none; }
  .pane-tools > .sp { display: none; }
}

/* ---------- 21. 响应式 ---------- */
.only-sm { display: none !important; }

@media (max-width: 1080px) {
  .grid6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content { padding: 18px 18px 56px; }
  .pagehead { padding: 12px 18px; }
}

@media (max-width: 900px) {
  .sidenav {
    position: fixed; left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.2,.8,.3,1);
    width: 254px;
    box-shadow: var(--sh-pop);
  }
  .sidenav.open { transform: none; }
  .navmask.on { display: block; }
  .only-sm { display: inline-flex !important; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  html, body { font-size: 14px; }
  .grid2, .grid3, .grid4, .grid6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2.sm1, .grid3.sm1 { grid-template-columns: 1fr; }
  .grid2.sm1 { gap: 15px; }
  .content { padding: 14px 12px 52px; }
  .pagehead { padding: 10px 12px; min-height: 58px; }
  .pagehead h1 { font-size: 17px; }
  .pagehead .desc { display: none; }
  .card { padding: 15px; border-radius: var(--r-md); }
  .panel-h { padding: 12px 15px; }
  .panel-b { padding: 15px; }
  /* 手机上统计卡压成两列，但数字仍要一眼看清 */
  .stat { padding: 12px 12px 11px; border-radius: var(--r-md); }
  .stat .hd { gap: 6px; margin-bottom: 7px; }
  .stat .ic { width: 22px; height: 22px; border-radius: 7px; }
  .stat .ic svg { width: 14px; height: 14px; }
  .stat .lab { font-size: 11.5px; }
  .stat .val { font-size: 21px; gap: 3px; }
  .stat .val .unit { font-size: 11.5px; }
  .stat .foot { font-size: 11px; margin-top: 4px; line-height: 1.4; }
  .sheet-h { padding: 15px 16px 13px; }
  .sheet-b { padding: 15px 16px; }
  .sheet-f { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .navitem.on::before { display: none; }
  h1 { font-size: 19px; }
  /* iOS 上输入框字号不足 16px，聚焦时会自动放大整个页面，这里统一到 16 */
  input[type=text], input[type=number], input[type=date], input[type=time],
  input[type=password], input[type=tel], input[type=search], input[type=url],
  select, textarea { font-size: 16px; min-height: 44px; }
  .field label { font-size: 12.5px; }
}

@media (max-width: 400px) {
  .grid2, .grid3, .grid4, .grid6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid4.half, .grid2.half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 真·小屏（iPhone SE 一代、老安卓）才退成一列 */
@media (max-width: 340px) {
  .grid2, .grid3, .grid4, .grid6 { grid-template-columns: 1fr; }
  .grid4.half, .grid2.half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 手机端底栏占位：内容区留出 tab 高度，最后一行不会被压住 */
@media (max-width: 900px) {
  .content { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .appwrap { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
}

/* 管理端手机底栏：五格平分 */
.mtabs button { min-height: 50px; }
.mtabs button .nub { top: 4px; left: calc(50% + 9px); }

/* 打印 */
@media print {
  .sidenav, .pagehead .acts, .tabbar, .appbar { display: none !important; }
  .content { padding: 0; }
  .card, .panel { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}
