/* =========================================================
   抗白日记 · 诊疗记录管理
   设计基调：暖米白底 + 青绿主色 + 珊瑚点缀，温和、干净、可长时间阅读
   ========================================================= */

:root {
  --bg: #f5f1ea;
  --bg-soft: #fbf8f3;
  --surface: #ffffff;
  --ink: #1e2a32;
  --ink-2: #3d4c57;
  --muted: #7c8a95;
  --line: #ebe3d7;
  --line-strong: #ded3c2;

  --brand: #0e7c6b;
  --brand-2: #12a08a;
  --brand-ink: #0a5f53;
  --brand-tint: #e7f4f0;

  --coral: #dd6139;
  --coral-tint: #fceee6;
  --amber: #c1841b;
  --amber-tint: #fbf1da;
  --violet: #7060aa;
  --violet-tint: #efecf9;
  --blue: #35719b;
  --blue-tint: #e8f1f8;

  --shadow-sm: 0 1px 2px rgba(30, 42, 50, .04), 0 2px 8px rgba(30, 42, 50, .04);
  --shadow-md: 0 2px 6px rgba(30, 42, 50, .05), 0 14px 34px rgba(30, 42, 50, .07);
  --shadow-lg: 0 24px 60px rgba(20, 32, 40, .16);

  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;

  --wrap: 1180px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(18, 160, 138, .10), transparent 62%),
    radial-gradient(760px 380px at 92% 2%, rgba(221, 97, 57, .08), transparent 60%);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; line-height: 1.35; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 26px; }

/* ============================ 顶部导航 ============================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 247, 242, .86);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(222, 211, 194, .55);
}

.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 13px 26px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand { display: flex; align-items: center; gap: 11px; flex: none; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 6px 16px rgba(14, 124, 107, .28);
  display: grid;
  place-items: center;
}
.brand-mark svg { width: 21px; height: 21px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { font-size: 16.5px; letter-spacing: .02em; }
.brand-text span { font-size: 10.5px; color: var(--muted); letter-spacing: .16em; text-transform: uppercase; }

.topbar-inner { position: relative; }

.nav { display: flex; align-items: center; gap: 3px; margin-left: 6px; }

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-2);
  transition: background .18s, color .18s, box-shadow .18s;
  white-space: nowrap;
}
.nav-item .nav-ic { width: 16px; height: 16px; display: inline-flex; opacity: .7; }
.nav-item .nav-ic svg { width: 16px; height: 16px; }
.nav-tb { display: inline-flex; flex-direction: column; min-width: 0; }
.nav-item .nav-desc { display: none; }
.nav-item:hover { background: rgba(14, 124, 107, .07); color: var(--brand-ink); }
.nav-item:hover .nav-ic { opacity: 1; }
.nav-item.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(14, 124, 107, .22); }
.nav-item.active .nav-ic { opacity: 1; }

.nav-logout { display: none; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  cursor: pointer;
  place-items: center;
  gap: 0;
}
.nav-toggle span {
  display: block;
  width: 17px;
  height: 2px;
  margin: 2.5px auto;
  border-radius: 2px;
  background: var(--ink-2);
  transition: transform .22s ease, opacity .18s ease;
}
.nav-toggle[aria-expanded="true"] { background: var(--brand-tint); border-color: rgba(14, 124, 107, .3); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.day-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--brand-tint);
  border: 1px solid rgba(14, 124, 107, .16);
  color: var(--brand-ink);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.day-pill b { font-size: 15px; font-variant-numeric: tabular-nums; }

.btn-ghost {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: .18s;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-tint); }

/* ============================ 首页 HERO ============================ */
.page { padding: 30px 0 72px; }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 34px 38px;
  color: #fff;
  background:
    radial-gradient(680px 320px at 88% -30%, rgba(255, 255, 255, .22), transparent 62%),
    radial-gradient(420px 260px at 6% 118%, rgba(255, 255, 255, .12), transparent 60%),
    linear-gradient(122deg, #0b6b5d 0%, #0e7c6b 46%, #13907c 100%);
  box-shadow: 0 18px 44px -18px rgba(10, 95, 83, .55);
  display: grid;
  grid-template-columns: minmax(250px, .9fr) 1.35fr;
  gap: 34px;
  align-items: center;
}

.hero::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -110px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 0 0 42px rgba(255, 255, 255, .045), 0 0 0 92px rgba(255, 255, 255, .03);
  pointer-events: none;
}

.hero-kicker {
  font-size: 12.5px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
  margin-bottom: 2px;
}

.hero-day { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 8px; }

.hero-day .num {
  font-size: 82px;
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 8px 26px rgba(0, 0, 0, .18);
}

.hero-day .unit { font-size: 20px; font-weight: 600; color: rgba(255, 255, 255, .85); }

.hero-sub { font-size: 13.5px; color: rgba(255, 255, 255, .82); }
.hero-sub b { color: #fff; font-weight: 600; }

.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 26px;
  padding: 18px 22px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(6px);
}

.hero-meta .item { min-width: 0; }
.hero-meta .item span {
  display: block;
  font-size: 11.5px;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .62);
  margin-bottom: 3px;
}
.hero-meta .item b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================ 概览数字 ============================ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 13px;
}

.stat-ic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--brand-tint);
  color: var(--brand);
}
.stat-ic svg { width: 20px; height: 20px; }

.stat .lbl { font-size: 12px; color: var(--muted); letter-spacing: .02em; display: block; }
.stat .val {
  display: block;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.stat > span:last-child { min-width: 0; }
.stat .val small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }

/* ============================ 模块入口 ============================ */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 38px 0 15px;
}
.section-head h2 { font-size: 19px; display: flex; align-items: center; gap: 9px; }
.section-head h2::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(var(--brand), var(--brand-2));
}
.section-head .hint { font-size: 12.5px; color: var(--muted); }
.section-head .link { font-size: 13px; color: var(--brand-ink); font-weight: 600; }
.section-head .link:hover { text-decoration: underline; }

.mod-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mod-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px 17px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  overflow: hidden;
}
.mod-card::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand);
  opacity: 0;
  transition: opacity .2s;
}
.mod-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.mod-card:hover::after { opacity: 1; }

.mod-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }

.mod-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--brand-tint);
  color: var(--brand);
}
.mod-icon svg { width: 21px; height: 21px; }

.mod-arrow { color: var(--muted); font-size: 16px; transition: transform .2s, color .2s; }
.mod-card:hover .mod-arrow { transform: translateX(3px); color: var(--brand); }

.mod-card h3 { font-size: 15.5px; margin-bottom: 3px; }
.mod-count { font-size: 12.5px; color: var(--muted); }
.mod-count b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mod-latest {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.mod-latest .ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-latest .k { color: var(--muted); flex: none; }

/* 模块主题色 */
.mod-card.t-brand  .mod-icon { background: var(--brand-tint);  color: var(--brand); }
.mod-card.t-brand::after  { background: var(--brand); }
.mod-card.t-coral  .mod-icon { background: var(--coral-tint);  color: var(--coral); }
.mod-card.t-coral::after  { background: var(--coral); }
.mod-card.t-blue   .mod-icon { background: var(--blue-tint);   color: var(--blue); }
.mod-card.t-blue::after   { background: var(--blue); }
.mod-card.t-violet .mod-icon { background: var(--violet-tint); color: var(--violet); }
.mod-card.t-violet::after { background: var(--violet); }
.mod-card.t-amber  .mod-icon { background: var(--amber-tint);  color: var(--amber); }
.mod-card.t-amber::after  { background: var(--amber); }

/* ============================ 指标看板（趋势 + 关键值） ============================ */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.dash-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(251, 248, 243, .9), rgba(255, 255, 255, .55));
}
.dash-head h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.dash-head h3 svg { width: 17px; height: 17px; color: var(--brand); flex: none; }
.dash-head .dash-link { font-size: 12.5px; font-weight: 600; color: var(--brand-ink); white-space: nowrap; }
.dash-head .dash-link:hover { text-decoration: underline; }

.dash-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }

.key-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; flex: 1; }

.km {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 10px 12px 11px;
  min-width: 0;
}
.km.abn { background: #fdf2ec; border-color: #f4dccd; }
.km-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.km-name { font-size: 11.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.km-abbr { font-size: 10px; letter-spacing: .1em; color: var(--muted); flex: none; }
.km-val {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  line-height: 1.3;
}
.km-val small { font-size: 10.5px; font-weight: 500; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.km.abn .km-val { color: #a8451f; }
.km-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.km-delta { font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* ============================ 时间线 ============================ */
.timeline-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px 26px 10px;
  box-shadow: var(--shadow-sm);
}

.tl-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }

.tl-filter {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: .18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tl-filter:hover { border-color: var(--line-strong); background: #fff; }
.tl-filter.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.tl-filter .cnt { font-size: 11px; opacity: .62; font-variant-numeric: tabular-nums; }

.tl { position: relative; padding-bottom: 8px; }
.tl::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 18px;
  left: 88px;
  width: 2px;
  background: linear-gradient(var(--line) 0%, var(--line) 90%, rgba(235, 227, 215, 0) 100%);
  border-radius: 2px;
}

.tl-month {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 4px;
  padding-left: 2px;
}
.tl-month span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
}

.tl-item {
  display: grid;
  grid-template-columns: 74px 30px minmax(0, 1fr);
  padding: 11px 0;
}

.tl-date { text-align: right; padding-top: 12px; padding-right: 2px; }
.tl-date b {
  display: block;
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.tl-date span { font-size: 11px; color: var(--muted); }

.tl-rail { position: relative; display: flex; justify-content: center; }

.tl-dot {
  position: relative;
  z-index: 1;
  margin-top: 17px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--bg);
  border: 2px solid #fff;
}
.tl-dot.dot-lab    { background: var(--blue); }
.tl-dot.dot-chemo  { background: var(--coral); }
.tl-dot.dot-med    { background: var(--amber); }
.tl-dot.dot-visit  { background: var(--violet); }

.tl-body {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 17px 14px;
  transition: border-color .18s, box-shadow .18s, background .18s;
  min-width: 0;
}
.tl-body:hover { border-color: var(--line-strong); background: #fff; box-shadow: var(--shadow-sm); }

/* 时间线分类配色：每类一个柔和底色 */
.tl-item[data-type="chemo"] .tl-body { background: #fdf2ec; border-color: #f4dccd; }
.tl-item[data-type="lab"]   .tl-body { background: #eef5fa; border-color: #d6e5f1; }
.tl-item[data-type="med"]   .tl-body { background: #fbf5e4; border-color: #eee0bd; }
.tl-item[data-type="visit"] .tl-body { background: #f3f0fb; border-color: #e0d9f2; }
.tl-item[data-type="chemo"] .tl-body:hover { background: #fceade; }
.tl-item[data-type="lab"]   .tl-body:hover { background: #e6f0f8; }
.tl-item[data-type="med"]   .tl-body:hover { background: #f9f1d8; }
.tl-item[data-type="visit"] .tl-body:hover { background: #ede8f8; }
.tl-item[data-type="chemo"] .tl-head h4 a { color: #a8451f; }
.tl-item[data-type="lab"]   .tl-head h4 a { color: #265b7d; }
.tl-item[data-type="med"]   .tl-head h4 a { color: #8a5c10; }
.tl-item[data-type="visit"] .tl-head h4 a { color: #54458a; }
.tl-item .tl-head h4 a:hover { text-decoration: underline; }

.tl-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.tl-head h4 { font-size: 14.5px; font-weight: 650; }

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2.5px 8px;
  border-radius: 6px;
  letter-spacing: .04em;
  flex: none;
}
.tag-lab   { background: var(--blue-tint);   color: var(--blue); }
.tag-chemo { background: var(--coral-tint);  color: var(--coral); }
.tag-med   { background: var(--amber-tint);  color: var(--amber); }
.tag-visit { background: var(--violet-tint); color: var(--violet); }
.tag-brand { background: var(--brand-tint);  color: var(--brand-ink); }

.tl-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }

.tl-desc {
  margin-top: 7px;
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.tl-desc.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }

.chip {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.chip b { font-weight: 650; color: var(--ink); }
.chip.warn { background: var(--coral-tint); border-color: rgba(221, 97, 57, .2); color: #a8451f; }
.chip.ok { background: var(--brand-tint); border-color: rgba(14, 124, 107, .18); color: var(--brand-ink); }

.file-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-ink);
  background: var(--brand-tint);
  border: 1px solid rgba(14, 124, 107, .18);
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.file-link:hover { background: #d9efe9; }
.file-link svg { width: 13px; height: 13px; }

.empty {
  text-align: center;
  padding: 54px 20px;
  color: var(--muted);
}
.empty svg { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--line-strong); }
.empty p { font-size: 13.5px; }

/* ============================ 内页 ============================ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 6px 0 22px;
  flex-wrap: wrap;
}
.page-head .eyebrow {
  font-size: 11.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 5px;
}
.page-head h1 { font-size: 27px; letter-spacing: -.02em; }
.page-head .sub { font-size: 13.5px; color: var(--muted); margin-top: 5px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 17px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: .18s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px rgba(14, 124, 107, .6); }
.btn-primary:hover { background: var(--brand-ink); transform: translateY(-1px); }
.btn-plain { background: #fff; border-color: var(--line-strong); color: var(--ink-2); }
.btn-plain:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn-danger { background: #fff; border-color: rgba(221, 97, 57, .35); color: var(--coral); }
.btn-danger:hover { background: var(--coral-tint); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-ico { padding: 5px 8px; font-size: 12px; border-radius: 7px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.btn-ico:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn-ico.del:hover { border-color: rgba(221, 97, 57, .5); color: var(--coral); background: var(--coral-tint); }
.btn-ico svg { width: 13px; height: 13px; }
.chip svg, .pill svg, .count svg { width: 12px; height: 12px; vertical-align: -2px; }

/* 检验项目行 */
.item-head, .item-row { display: grid; grid-template-columns: 1.5fr .85fr .75fr 1.1fr 34px; gap: 8px; align-items: center; }
.item-head { font-size: 11px; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.item-row { margin-bottom: 8px; }
.item-row .input { padding: 7px 10px; font-size: 13px; }
.item-row .btn-ico { justify-content: center; }
@media (max-width: 640px) {
  .item-head { display: none; }
  .item-row { grid-template-columns: 1fr 1fr; }
  .item-row .ir-name { grid-column: 1 / -1; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-pad { padding: 22px 24px; }
.panel-head {
  padding: 17px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: linear-gradient(#fff, #fdfbf8);
}
.panel-head h2 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.panel-head .count { font-size: 12px; color: var(--muted); font-weight: 500; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  padding: 11px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tbl td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #fdfaf6; }
table.tbl .nowrap { white-space: nowrap; }
table.tbl .muted { color: var(--muted); font-size: 12.5px; }
.tbl-title { font-weight: 600; }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; }

/* 档案页 */
.profile-card { display: grid; grid-template-columns: 250px 1fr; gap: 0; }
.profile-side {
  padding: 30px 26px;
  background: linear-gradient(170deg, #0b6b5d, #128b78);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.avatar {
  width: 78px; height: 78px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  display: grid; place-items: center;
  font-size: 30px; font-weight: 700;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-side .pname { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.profile-side .pday { font-size: 12.5px; color: rgba(255, 255, 255, .78); }
.profile-side .pday b { color: #fff; font-size: 15px; font-variant-numeric: tabular-nums; }
.profile-side .pkv { display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; border-top: 1px solid rgba(255,255,255,.18); padding-top: 15px; }
.profile-side .pkv div { display: flex; justify-content: space-between; gap: 10px; }
.profile-side .pkv span { color: rgba(255, 255, 255, .62); }
.profile-side .pkv b { font-weight: 600; text-align: right; }

.profile-main { padding: 26px 30px; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px 26px; }
.kv .k { font-size: 11.5px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; margin-bottom: 3px; }
.kv .v { font-size: 14.5px; font-weight: 550; word-break: break-word; }

/* 图表 */
.lab-top { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; margin-bottom: 18px; }
.chart-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.select {
  appearance: none;
  padding: 8px 32px 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c8a95' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center;
  font-size: 13.5px;
  cursor: pointer;
  max-width: 240px;
}
.select:focus { outline: 2px solid rgba(14, 124, 107, .22); border-color: var(--brand); }

.chart-box { position: relative; width: 100%; padding: 6px 2px 0; overflow-x: auto; }
.chart-box svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field label .req { color: var(--coral); margin-left: 2px; }
.field .tip { font-size: 11.5px; color: var(--muted); }
.input, textarea.input, select.input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 14px;
  transition: border-color .16s, box-shadow .16s;
}
.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 124, 107, .13);
}
textarea.input { resize: vertical; min-height: 84px; line-height: 1.6; }
select.input { appearance: none; background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c8a95' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; padding-right: 32px; }

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.file-drop {
  border: 1.5px dashed var(--line-strong);
  border-radius: 11px;
  padding: 16px;
  background: var(--bg-soft);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: .18s;
}
.file-drop:hover { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-ink); }
.file-drop input { display: none; }
.file-drop b { color: var(--ink-2); }
.file-drop .picked { color: var(--brand-ink); font-weight: 600; }

.alert {
  padding: 11px 15px;
  border-radius: 10px;
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.alert-ok { background: var(--brand-tint); border-color: rgba(14, 124, 107, .2); color: var(--brand-ink); }
.alert-err { background: var(--coral-tint); border-color: rgba(221, 97, 57, .24); color: #a8451f; }
.alert-info { background: var(--blue-tint); border-color: rgba(53, 113, 155, .2); color: #265b7d; }

/* 登录页 */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px 20px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: 34px 32px 28px;
}
.login-logo {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--brand), var(--brand-2));
  display: grid; place-items: center;
  box-shadow: 0 10px 24px -8px rgba(14, 124, 107, .65);
  margin-bottom: 18px;
}
.login-logo svg { width: 28px; height: 28px; }
.login-card h1 { font-size: 22px; }
.login-card .sub { font-size: 13px; color: var(--muted); margin: 6px 0 24px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }
.login-foot { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 18px; line-height: 1.7; }

/* 模态预览 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(22, 30, 36, .55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 26px;
}
.modal.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 880px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head b { font-size: 14px; }
.modal-body { overflow: auto; background: #f3f1ec; display: grid; place-items: center; min-height: 200px; }
.modal-body img { max-width: 100%; max-height: 75vh; }
.modal-body iframe { width: 100%; height: 74vh; border: 0; background: #fff; }
.modal-close {
  border: 0; background: transparent; font-size: 22px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 0 4px;
}
.modal-close:hover { color: var(--ink); }

/* 页脚 */
.foot {
  border-top: 1px solid rgba(222, 211, 194, .6);
  padding: 22px 0 30px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* 杂项 */
.hstack { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.text-right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.txt-coral { color: var(--coral); }
.txt-brand { color: var(--brand-ink); }
.txt-muted { color: var(--muted); }

.pill-row { display: flex; gap: 7px; flex-wrap: wrap; }
.pill {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink-2);
  cursor: pointer;
}
.pill.active { background: var(--brand-tint); border-color: rgba(14,124,107,.3); color: var(--brand-ink); font-weight: 600; }

/* 中等屏幕：切换到抽屉式导航 */
@media (max-width: 1040px) {
  .nav-toggle { display: grid; }
  .topbar-logout { display: none; }
  .nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 10px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    max-height: 74vh;
    overflow-y: auto;
  }
  .nav.open { display: flex; }
  .nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 11px; border-radius: 13px; white-space: normal; }
  .nav-item .nav-ic {
    width: 36px; height: 36px;
    border-radius: 11px;
    background: var(--brand-tint);
    color: var(--brand);
    display: grid;
    place-items: center;
    opacity: 1;
    flex: none;
  }
  .nav-item .nav-ic svg { width: 18px; height: 18px; }
  .nav-tb { display: flex; flex-direction: column; min-width: 0; }
  .nav-tx { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
  .nav-item .nav-desc { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; }
  .nav-item.active { background: var(--brand-tint); color: var(--brand-ink); box-shadow: none; }
  .nav-item.active .nav-ic { background: var(--brand); color: #fff; }
  .nav-logout { display: block; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding: 28px; gap: 22px; }
  .hero-day .num { font-size: 68px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-card { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .lab-top { grid-template-columns: 1fr; }
  .chart-box svg { min-width: 520px; }
}

@media (max-width: 760px) {
  .mod-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topbar-inner { padding: 9px 14px; gap: 10px; }
  .topbar-right { margin-left: auto; gap: 8px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .brand-text b { font-size: 15px; }
  .brand-text span { display: none; }
  .day-pill { padding: 5px 10px; font-size: 11.5px; }
  .day-pill b { font-size: 14px; }
  .nav { left: 10px; right: 10px; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 13px 14px; gap: 10px; }
  .stat .val { font-size: 18px; }
  .hero-day .num { font-size: 58px; }
  .hero-meta { grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 15px; }
  .timeline-card { padding: 16px 14px 4px; }
  .tl-item { grid-template-columns: 52px 22px minmax(0, 1fr); padding: 9px 0; }
  .tl::before { left: 62px; }
  .tl-date b { font-size: 12.5px; }
  .tl-body { padding: 11px 13px 12px; }
  .form-grid, .kv-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 22px; }
  .panel-pad { padding: 16px; }
  .panel-head { padding: 13px 16px; }
  .dash-head { padding: 12px 14px; }
  .dash-body { padding: 12px; }
  .km-val { font-size: 17px; }
}
