:root {
  --ink: #1c2b33;
  --muted: #5e6f78;
  --line: #e3eaee;
  --bg: #eef2f4;
  --card: #fff;
  --navy: #0c3142;
  --navy-2: #16485c;
  --sea: #0f6e6b;
  --sea-soft: #e7f4f2;
  --gold: #8a5a00;
  --bad: #b42318;
  --ok: #067647;
  --mid: #b54708;
  --bad-bg: #fef3f2;
  --ok-bg: #ecfdf3;
  --mid-bg: #fff6ed;
  --shadow: 0 1px 2px rgba(12, 49, 66, .05), 0 0 0 1px rgba(12, 49, 66, .04);
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html.is-drawer-open,
html.is-drawer-open body { overflow: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sea); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }
[hidden] { display: none !important; }

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(320px, 480px);
  background: var(--navy);
}
.login-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  background:
    radial-gradient(720px 360px at 18% 78%, rgba(15, 110, 107, .34), transparent 62%),
    linear-gradient(165deg, #071e2a 0%, #0c3142 46%, #0e3f45 100%);
}
.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 900' preserveAspectRatio='xMidYMid slice'><g fill='none' stroke='rgba(255,255,255,0.09)' stroke-width='1'><path d='M0 80H1200'/><path d='M0 820H1200'/><path d='M80 0V900'/><path d='M1120 0V900'/></g><g fill='none' stroke='rgba(255,255,255,0.2)' stroke-width='1.15'><path d='M-40 560C220 500 420 640 680 560S1020 470 1260 560'/><path d='M-40 660C240 590 460 760 740 650S1060 560 1260 670'/><path d='M-40 760C260 690 500 860 800 750S1100 680 1260 780'/></g><path fill='rgba(15,110,107,0.28)' d='M0 700C240 650 460 790 700 720S980 640 1200 750V900H0Z'/><path fill='rgba(6,28,36,0.5)' d='M0 800C300 740 540 870 820 800S1080 760 1200 840V900H0Z'/><g fill='rgba(255,255,255,0.55)'><circle cx='240' cy='612' r='2.4'/><circle cx='620' cy='692' r='2.4'/><circle cx='960' cy='648' r='2.4'/></g></svg>");
  background-size: cover;
  background-position: center bottom;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.7) 0%, rgba(0,0,0,.18) 24%, transparent 40%, transparent 54%, #000 72%, #000 100%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,.7) 0%, rgba(0,0,0,.18) 24%, transparent 40%, transparent 54%, #000 72%, #000 100%);
}
.login-hero > * { position: relative; z-index: 1; }
.login-hero .org { letter-spacing: .18em; font-size: 13px; opacity: .8; }
.login-hero h1 { font-size: 34px; font-weight: 600; line-height: 1.35; }
.login-hero p { max-width: 460px; color: rgba(255,255,255,.82); font-size: 15px; }
.chain-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chain-steps span {
  border: 1px solid rgba(255,255,255,.28);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 13px;
}
.login-panel {
  background:
    radial-gradient(480px 320px at 100% 0%, rgba(15, 110, 107, .09), transparent 70%),
    linear-gradient(180deg, #f7f5f1 0%, #eef2f4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}
.login-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 28px 28px 22px;
  display: grid;
  gap: 14px;
}
.login-card h2 { font-size: 20px; }
.login-card label, .field { display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.login-card .hint, .hint { color: var(--muted); font-size: 12px; line-height: 1.6; }

.app {
  --sider-w: 178px;
  --sider-w-collapsed: 52px;
  --sider-current: var(--sider-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app.is-sider-collapsed { --sider-current: var(--sider-w-collapsed); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  flex: 0 0 auto;
  height: 56px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 16px;
  gap: 16px;
}
.brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.brand strong { font-size: 16px; font-weight: 600; white-space: nowrap; }
.brand span { color: rgba(255,255,255,.72); font-size: 12px; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions .who { color: rgba(255,255,255,.92); }
.role-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.86);
  font-size: 13px;
  white-space: nowrap;
}
.role-switch select {
  width: auto;
  min-width: 112px;
  min-height: 32px;
  padding-right: 28px;
  color: var(--ink);
  background-color: #fff;
}
.user-menu { position: relative; }
.user-menu > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  color: #fff;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 6px;
}
.user-menu > button:hover { background: rgba(255,255,255,.08); }
.user-caret {
  width: 0;
  height: 0;
  border: 4px solid transparent;
  border-top-color: rgba(255,255,255,.75);
  margin-top: 4px;
}
.user-menu .menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 132px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(12, 49, 66, .14);
  padding: 4px;
  z-index: 30;
}
.user-menu .menu a,
.user-menu .menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  min-height: 34px;
  padding: 6px 10px;
  text-decoration: none;
}
.user-menu .menu a:hover,
.user-menu .menu button:hover { background: var(--sea-soft); color: var(--sea); }
.topbar .btn.ghost, .topbar .btn.text {
  color: #fff;
  border-color: rgba(255,255,255,.35);
  background: transparent;
}
.topbar .btn.ghost:hover, .topbar .btn.text:hover { background: rgba(255,255,255,.08); }

.workspace { flex: 1; display: flex; align-items: stretch; }
.sider {
  width: var(--sider-current);
  flex: 0 0 var(--sider-current);
  align-self: stretch;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 10px 0 18px;
  display: flex;
  flex-direction: column;
  transition: width .18s ease, flex-basis .18s ease;
}
.sider-scroll {
  flex: 0 0 auto;
  overflow: visible;
  padding-bottom: 8px;
}
.menu-group { padding: 14px 16px 4px; color: #8aa0a8; font-size: 12px; }
.sider.is-collapsed .menu-group { display: none; }
.sider a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 14px;
  color: var(--ink);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.sider.is-collapsed a {
  justify-content: center;
  gap: 0;
  padding: 9px 0;
  border-left-width: 3px;
}
.sider.is-collapsed .nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.nav-label { min-width: 0; }
.nav-ico { width: 16px; height: 16px; flex: 0 0 16px; display: inline-flex; color: #5d7782; }
.nav-ico svg {
  width: 16px; height: 16px; display: block;
  stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.sider a:hover .nav-ico, .sider a.is-on .nav-ico { color: var(--sea); }
.sider a:hover { background: #f6f8f9; }
.sider a.is-on { background: var(--sea-soft); color: var(--sea); border-left-color: var(--sea); font-weight: 600; }
.sider-toggle {
  position: fixed;
  top: 50%;
  left: var(--sider-current);
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #fff;
  color: #5d7782;
  box-shadow: 2px 0 8px rgba(12, 49, 66, .1);
  transform: translateY(-50%);
  cursor: pointer;
  transition: left .18s ease;
}
.sider-toggle:hover { background: var(--sea-soft); color: var(--sea); border-color: #b7d8d4; }
.sider-toggle-ico {
  display: inline-flex;
  width: 16px;
  height: 16px;
}
.sider-toggle-ico svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.content { flex: 1; min-width: 0; overflow: visible; padding: 16px 18px 32px; }
.sheet {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 28px;
  min-height: 0;
}

.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.page-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.page-head > .btn-row { flex: none; flex-wrap: nowrap; }
.page-head h1 { font-size: 20px; font-weight: 650; letter-spacing: .01em; }
.page-head .hint { margin-top: 4px; max-width: 760px; }
.crumbs { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.crumbs .btn-back { margin: 0 0 8px; }
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 11px;
  font-size: 13px;
  font-weight: 500;
}
.btn-back .btn-ico {
  display: inline-flex;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--sea);
}
.btn-back .btn-ico svg {
  display: block;
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-back:hover .btn-ico { color: var(--sea); }

.btn {
  background: var(--sea);
  color: #fff;
  border: 1px solid var(--sea);
  border-radius: 6px;
  min-height: 32px;
  padding: 4px 12px;
}
.btn:hover { background: #0c5e5b; }
.btn.ghost { background: #fff; color: var(--ink); border-color: #cfd8dc; }
.btn.ghost:hover { border-color: var(--sea); color: var(--sea); background: #fff; }
.btn.danger { background: #fff; color: var(--bad); border-color: #f0c2be; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.text { background: transparent; border-color: transparent; color: var(--sea); padding-left: 6px; padding-right: 6px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.role-list { display: flex; flex-direction: column; gap: 8px; }
.role-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.role-card:hover { border-color: var(--sea); }
.role-note strong { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.role-note p { margin: 4px 0 0; color: #243833; font-size: 14px; line-height: 1.7; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

input, select, textarea {
  border: 1px solid #cfd8dc;
  background: #fff;
  border-radius: 6px;
  min-height: 32px;
  padding: 4px 10px;
  width: 100%;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--sea); outline: none; box-shadow: 0 0 0 3px rgba(15,110,107,.12); }
.combo { position: relative; }
.combo-input { padding-right: 28px; }
.combo::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 14px;
  border: 4px solid transparent;
  border-top-color: #7b8c95;
  pointer-events: none;
}
.combo-menu {
  position: fixed;
  z-index: 40;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(12, 49, 66, .12);
  padding: 4px;
}
.combo-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  border-radius: 4px;
  min-height: 32px;
  padding: 6px 8px;
  color: var(--ink);
}
.combo-menu button:hover, .combo-menu button.is-active, .combo-menu button.is-on { background: var(--sea-soft); color: var(--sea); }
.combo-menu button[hidden] { display: none; }
.combo-empty { margin: 0; padding: 8px; color: var(--muted); font-size: 12px; }

.multi { position: relative; }
.multi-btn {
  width: 100%;
  text-align: left;
  background: #fff;
  color: var(--ink);
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  min-height: 32px;
  padding: 4px 28px 4px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.multi-btn:hover { border-color: var(--sea); }
.multi::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 14px;
  border: 4px solid transparent;
  border-top-color: #7b8c95;
  pointer-events: none;
}
.multi-menu {
  position: absolute;
  z-index: 25;
  left: 0;
  top: calc(100% + 4px);
  width: max(100%, 360px);
  background: #fff;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(12, 49, 66, .12);
  padding: 8px;
}
.multi-actions { display: flex; gap: 4px; margin-top: 6px; }
.multi-list { max-height: 240px; overflow: auto; margin-top: 4px; }
.multi-opt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 2px;
  color: var(--ink);
  cursor: pointer;
}
.multi-opt input { width: auto; min-height: 16px; flex: 0 0 auto; margin-top: 3px; }
.multi-opt span { line-height: 1.45; }

.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: 8px 0 14px; }
.filters .field { min-width: 160px; flex: 1 1 160px; }
.filters .field.grow { flex: 1.4 1 200px; }
.field span, .field .lab { font-size: 12px; color: var(--muted); }
.field .err { color: var(--bad); font-size: 12px; }
.form-grid { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.form-grid .field {
  display: grid;
  grid-template-columns: 9.2em minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 6px;
  align-items: center;
}
.form-grid .field > span:first-child { grid-column: 1; grid-row: 1; text-align: right; font-size: 14px; color: var(--ink); }
.form-grid .field > :not(span:first-child) { grid-column: 2; min-width: 0; }
.form-grid .field:has(textarea),
.form-grid .field:has([data-pick-for]) { align-items: start; }
.form-grid .field:has(textarea) > span:first-child,
.form-grid .field:has([data-pick-for]) > span:first-child { padding-top: 6px; }
.form-grid > .btn-row,
form:has(> .form-grid) > .btn-row,
.form-grid > .hint,
.form-grid > .span-3:not(.field) { margin-left: calc(9.2em + 12px); }
.form-grid .form-break {
  display: grid;
  grid-template-columns: 9.2em minmax(0, 1fr);
  column-gap: 12px;
  align-items: baseline;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.form-grid .form-break > span { text-align: right; font-size: 14px; font-weight: 650; color: var(--ink); }
.form-grid .form-break .hint { margin: 0; }
.cascade { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cascade-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cascade-item > span { font-size: 12px; color: var(--muted); }
.with-unit { display: flex; align-items: center; gap: 8px; }
.with-unit input { flex: 1 1 auto; min-width: 0; width: auto; }
.with-unit > span { flex: 0 0 auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.req::after { content: " *"; color: var(--bad); }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.cards.cards-5 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.card .k { color: var(--muted); font-size: 12px; }
.card .v { font-size: 26px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.card .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.nobr { white-space: nowrap; }
.card.click { cursor: pointer; }
.card.click:hover { border-color: var(--sea); }
.card .v .unit { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.overview .card.metric { position: relative; overflow: visible; }
.overview .card.metric:has(.tip:hover),
.overview .card.metric:has(.tip:focus-within) { z-index: 4; }
.metric-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.metric-bg {
  position: absolute;
  right: -28px;
  top: -24px;
  width: 210px;
  height: 210px;
  pointer-events: none;
  opacity: .32;
}
.metric-bg svg { width: 100%; height: 100%; display: block; }
.metric-body { position: relative; z-index: 1; }
.overview .card.metric.samples { background: linear-gradient(105deg, #fff 70%, #f3faf9 100%); color: var(--sea); }
.overview .card.metric.progress { background: linear-gradient(105deg, #fff 70%, #f3f7fb 100%); color: #1d4e89; }
.overview .card.metric.drug { background: linear-gradient(105deg, #fff 70%, #f7f5fb 100%); color: #6d28d9; }
.overview .card.metric.exceed { background: linear-gradient(105deg, #fff 70%, #fdf6f6 100%); color: var(--bad); }
.overview .card.metric.pass { background: linear-gradient(105deg, #fff 70%, #f4faf6 100%); color: var(--ok); }
.overview .card.metric .k,
.overview .card.metric .v,
.overview .card.metric .s,
.overview .card.metric .stat-block .lab,
.overview .card.metric .stat-chips em,
.overview .card.metric .stat-chips i { color: var(--muted); }
.overview .card.metric .v,
.overview .card.metric .stat-chips,
.overview .card.metric .stat-chips b,
.overview .card.metric .stat-chips a { color: var(--ink); }
.overview .card.metric .stat-chips > a:hover { color: var(--sea); }
.k-row { display: inline-flex; align-items: center; gap: 4px; }
.tip { position: relative; display: inline-flex; }
.tip-btn {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: help;
}
.tip-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tip-btn:hover,
.tip-btn:focus-visible { color: var(--sea); outline: none; }
.tip-pop {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  width: 280px;
  z-index: 5;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(12, 49, 66, .12);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  text-align: left;
  white-space: normal;
}
.tip:hover .tip-pop,
.tip:focus-within .tip-pop { display: block; }
.overview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.overview .card.metric.wide { grid-column: 1 / -1; }
.stat-block { margin-top: 10px; }
.stat-block .lab { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.stat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.stat-chips > span,
.stat-chips > a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  max-width: 100%;
  background: #f4f8f8;
  border-radius: 6px;
  padding: 4px 8px;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
}
.stat-chips > a:hover { color: var(--sea); }
.stat-chips em { font-style: normal; color: var(--muted); }
.stat-chips b { font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-chips i { font-style: normal; color: var(--muted); font-size: 12px; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
th, td { padding: 9px 12px; text-align: left; vertical-align: middle; white-space: nowrap; }
th { font-weight: 600; font-size: 13px; background: #f7fafb; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
td { border-bottom: 1px solid #f0f4f6; }
td.fail-cell { white-space: normal; min-width: 280px; }
.fail-rec + .fail-rec { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.fail-rec .muted { display: block; margin: 2px 0; font-size: 12px; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f6fbfa; }
tr.pick.is-on td { background: var(--sea-soft); }
tr.pick:hover td,
tr.pick.is-on:hover td { background: #d7eeeb; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.bad { color: var(--bad); }
.ok { color: var(--ok); }

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 99px;
  font-size: 12px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag.ok { color: var(--ok); background: var(--ok-bg); }
.tag.bad { color: var(--bad); background: var(--bad-bg); }
.tag.mid { color: var(--mid); background: var(--mid-bg); }
.tag.muted { color: var(--muted); background: #f4f6f7; }
.tag.sea { color: var(--sea); background: var(--sea-soft); }

.bar { height: 8px; background: #e7eef0; border-radius: 99px; overflow: hidden; min-width: 72px; display: inline-block; vertical-align: middle; }
.bar i { display: block; height: 100%; background: var(--sea); border-radius: 99px; }
.bar.bad i { background: var(--bad); }
.bar.mid i { background: #e08a2c; }

.banner {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  background: #f4faf9; border: 1px solid #c9e6e2; color: var(--navy);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
}
.empty {
  padding: 36px 12px;
  text-align: center;
  color: var(--muted);
}
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }

.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 12px; color: var(--muted); }
.pager button { min-width: 32px; }

.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; }
.kv { display: grid; grid-template-columns: 9.2em 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.section { margin-top: 22px; }
.section h2 { font-size: 16px; margin-bottom: 8px; }
.section-head { display: flex; align-items: center; justify-content: flex-start; gap: 12px; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.checkline { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.checkline label { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; }
.checkline input { width: auto; min-height: 16px; padding: 0; }
td.wrap { white-space: normal; min-width: 240px; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs a, .tabs button {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 14px; color: var(--ink); border-radius: 0; text-decoration: none;
}
.tabs a.is-on, .tabs button.is-on { color: var(--sea); border-bottom-color: var(--sea); font-weight: 600; }

.entries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
a.entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 168px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
a.entry:hover { border-color: var(--sea); box-shadow: 0 0 0 2px rgba(15, 110, 107, .16); text-decoration: none; }
a.entry .entry-ico {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--sea-soft);
  color: var(--sea);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
a.entry .entry-ico svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
a.entry .entry-ico svg .knob { fill: var(--sea-soft); }
a.entry:hover .entry-ico svg .knob { fill: var(--sea); }
a.entry:hover .entry-ico { background: var(--sea); color: #fff; }
a.entry strong { font-size: 16px; font-weight: 650; }
a.entry p { margin: 0; color: var(--muted); flex: 1; }
a.entry .meta { color: var(--sea); font-size: 13px; }
.chain-board { display: flex; align-items: stretch; gap: 8px; overflow-x: auto; margin: 4px 0 18px; }
.chain-slot { flex: 1 1 0; min-width: 132px; display: flex; flex-direction: column; gap: 4px; }
.chain-node {
  width: 100%;
  text-align: left;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 104px;
  padding: 10px 12px;
}
button.chain-node { cursor: pointer; }
button.chain-node:hover { border-color: var(--sea); }
.chain-node.is-on { border-color: var(--sea); box-shadow: 0 0 0 2px rgba(15, 110, 107, .16); }
.chain-node.is-gap { background: #f7fafb; border-style: dashed; }
.chain-node .stage { display: block; font-weight: 650; margin-bottom: 6px; }
.chain-node .sub { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 14px; margin-bottom: 12px; background: #fff; }
.suggest-card.click { cursor: pointer; }
.suggest-card.click:hover { border-color: var(--sea); box-shadow: 0 0 0 2px rgba(15, 110, 107, .12); }
.suggest-card .chain-board { margin-bottom: 8px; }
.chain-join { align-self: center; color: var(--muted); flex: 0 0 auto; }
td input[type="radio"] { width: auto; min-height: 16px; padding: 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 22px; border-left: 2px solid #d5e0e3; margin-left: 8px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--sea); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--sea);
}
.timeline li.gap { border-left-style: dashed; }
.timeline li.gap::before { background: #fff; }
.timeline .stage { font-weight: 650; }

.chart { width: 100%; height: auto; display: block; }
.chart.chart-fixed { width: 200px; max-width: 100%; height: auto; }
.chart-slot { width: 100%; }
.dash-map { display: flex; justify-content: center; }
.map-tools button[data-map-zoom="reset"] { width: auto; padding: 0 8px; }
.link-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.link-pair a.card { display: block; color: inherit; text-decoration: none; }
.link-pair a.card:hover { border-color: var(--sea); }
.share { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: #e7eef0; margin-top: 12px; }
.share i { display: block; height: 100%; }
.share i.linked { background: #0f6e6b; }
.share i.loose { background: #c5d0d6; }
.risk-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.risk-list a {
  display: grid;
  grid-template-columns: minmax(4.5em, 1.4fr) 2.2em 4.2em minmax(7.5em, 1fr);
  gap: 8px;
  align-items: baseline;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
}
.risk-list a:hover { color: var(--sea); }
.map-stage { position: relative; width: min(100%, 1000px); height: 600px; }
.map-stage .fjmap { width: 100%; height: 100%; }
.map-tools {
  position: absolute; z-index: 2; top: 8px; right: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.map-tools button {
  width: 36px; min-height: 32px; padding: 0;
  background: #fff; color: var(--ink); border: 1px solid #cfd8dc; border-radius: 6px;
}
.map-tools button:hover { border-color: var(--sea); color: var(--sea); }
.fjmap { width: 100%; height: auto; background: #f4f8fb; border: 1px solid var(--line); border-radius: 8px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.fjmap text { user-select: none; -webkit-user-select: none; }
.fjmap.is-drag { cursor: grabbing; }
.fjmap .town-layer { display: none; }
.fjmap.is-town .town-layer { display: block; }
.fjmap path { stroke: #fff; stroke-width: .8px; vector-effect: non-scaling-stroke; }
.fjmap path.county { stroke: none; }
.fjmap path.high { fill: #e89b94; }
.fjmap path.mid { fill: #f0c48a; }
.fjmap path.low { fill: #9dceaf; }
.fjmap path.none { fill: #e7edf0; }
.fjmap path.rest { fill: #d5e2ea; }
.fjmap path[data-county] { cursor: pointer; }
.fjmap .bare-labels { display: none; }
.fjmap.is-town .bare-labels { display: block; }
.fjmap .county-lines path { fill: none; stroke: #93aab4; stroke-width: 1.15px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.fjmap .city-lines path { fill: none; stroke: #0c3142; stroke-width: 1.35px; stroke-linecap: butt; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.fjmap .county-pick path { fill: none; stroke: #175cd3; stroke-width: 2px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.map-note { position: absolute; left: 10px; bottom: 10px; margin: 0; font-size: 12px; color: #3d4f5a; background: rgba(255,255,255,.9); padding: 2px 8px; border-radius: 4px; }
.map-note:empty { display: none; }
.fjmap .town-pt { stroke: #fff; stroke-width: 1.4px; vector-effect: non-scaling-stroke; cursor: pointer; }
.fjmap .town-pt.high { fill: #b42318; }
.fjmap .town-pt.mid { fill: #e08a2c; }
.fjmap .town-pt.low { fill: #3d9a62; }
.fjmap .town-pt.none { fill: #5f7784; }
.fjmap .county-edge { fill: none; stroke: #0c3142; stroke-width: 1.6px; vector-effect: non-scaling-stroke; pointer-events: none; }
.fjmap.is-zoom text { font-family: "Microsoft YaHei", sans-serif; fill: #1c2b33; }
.fjmap text { font-size: 11px; fill: #1c2b33; font-family: "Microsoft YaHei", sans-serif; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 14px; color: var(--muted); font-size: 12px; margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; background: #d5e2ea; }
.legend .line-key::before { content: ""; display: inline-block; width: 18px; height: 2px; margin-right: 4px; vertical-align: middle; background: #0c3142; }
.legend .line-key.county::before { height: 2px; background: #93aab4; }
.legend i.high { background: #b42318; }
.legend i.mid { background: #e08a2c; }
.legend i.low { background: #3d9a62; }
.legend i.area.high { background: #e89b94; }
.legend i.area.mid { background: #f0c48a; }
.legend i.area.low { background: #9dceaf; }
.legend i.none { background: #e7edf0; border: 1px solid #c5d0d6; }

.net { display: flex; flex-direction: column; gap: 18px; }
.net-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.net-one { align-items: flex-start; }
.net-col { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.net-label { font-size: 12px; color: var(--muted); }
.net-node {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  min-height: 72px;
}
.net-node strong { display: block; font-size: 13px; }
.net-node em { font-style: normal; color: var(--muted); font-size: 12px; }
.net-link { width: 28px; height: 2px; background: #b7c6cc; }
.net-graph { position: relative; max-width: 100%; }
.net-graph .net-lines { position: absolute; left: 0; top: 0; pointer-events: none; }
.net-graph .net-lines path { fill: none; stroke-width: 2; }
.net-graph .net-label { position: absolute; }
.net-graph .net-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 78px;
  box-sizing: border-box;
  text-decoration: none;
  color: inherit;
  white-space: normal;
}
.net-graph .net-node.is-empty { color: var(--muted); border-style: dashed; }

.modal-back {
  position: fixed; inset: 0; background: rgba(12, 32, 40, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 30;
}
.modal {
  width: min(720px, 100%);
  max-height: min(86vh, 860px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 18px 18px 16px;
  box-shadow: 0 16px 50px rgba(0,0,0,.18);
}
.modal h2 { font-size: 18px; margin-bottom: 10px; }

.drawer-back {
  position: fixed; inset: 0; background: rgba(12, 32, 40, .35);
  z-index: 32; display: flex; justify-content: flex-end;
}
.drawer {
  width: min(720px, 100%);
  max-width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: -8px 0 40px rgba(0, 0, 0, .12);
  display: flex;
  flex-direction: column;
  animation: drawer-in .22s ease-out;
}
@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.drawer-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 17px; line-height: 1.35; margin: 0; }
.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 20px;
}
.drawer-foot {
  flex: 0 0 auto;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}
.chain-timeline .timeline-node {
  display: block;
  width: 100%;
  max-width: 640px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0 0;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  line-height: 1.5;
}
.chain-timeline .timeline-node:hover { border-color: var(--sea); background: var(--sea-soft); }
.chain-timeline .timeline-node .tag { vertical-align: middle; }

.stage-block + .stage-block { margin-top: 8px; }
.stage-drug { line-height: 1.45; }
.cell-no {
  display: block;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.cell-no:hover { color: var(--sea); text-decoration: underline; }

.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  background: var(--navy); color: #fff; border-radius: 8px;
  padding: 10px 14px; max-width: min(420px, calc(100vw - 36px));
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.toast:empty { display: none; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; border-radius: 0; color: var(--ink); }
.seg button.is-on { background: var(--sea); color: #fff; }
.period-bar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin: -4px 0 16px; }
.period-bar .seg { flex: none; }
.period-dates { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.period-dates label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.period-dates input[type="date"] { width: 148px; }
.period-dates input:disabled { background: #f4f7f8; color: var(--muted); }
.period-bar .hint { margin: 0; flex: 1 1 100%; }

@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { padding: 28px 22px; }
  .login-hero h1 { font-size: 26px; }
}
@media (max-width: 800px) {
  .overview { grid-template-columns: 1fr; }
  .form-grid .field { grid-template-columns: 1fr; }
  .form-grid .field > span:first-child { text-align: left; }
  .form-grid .field > :not(span:first-child) { grid-column: 1; }
  .form-grid > .btn-row,
  form:has(> .form-grid) > .btn-row,
  .form-grid > .hint,
  .form-grid > .span-3:not(.field) { margin-left: 0; }
  .form-grid .form-break { grid-template-columns: 1fr; }
  .form-grid .form-break > span { text-align: left; }
  .workspace { flex-direction: column; }
  .app { --sider-current: 100%; }
  .sider {
    width: 100%;
    flex-basis: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    display: flex;
    overflow: visible;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sider.is-collapsed { width: 100%; flex-basis: auto; }
  .sider-scroll {
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
    padding: 0;
    flex: 1;
    gap: 0;
  }
  .sider-toggle { display: none; }
  .sider.is-collapsed .nav-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    clip: auto;
    overflow: visible;
  }
  .sider.is-collapsed a { justify-content: flex-start; padding: 7px 12px; gap: 8px; }
  .menu-group { display: none; }
  .sider a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .sider a.is-on { border-bottom-color: var(--sea); }
  .cards, .entries { grid-template-columns: 1fr; }
  .brand span { display: none; }
  .link-pair { grid-template-columns: 1fr; }
}
@media print {
  .topbar, .sider, .btn, .filters, .pager, .toast, .modal-back, .drawer-back { display: none !important; }
  .content { padding: 0; }
  .sheet { box-shadow: none; }
}
