/* Shared site chrome — all pages */
:root {
  --ink: #13262F;
  --muted: #5A717C;
  --line: #D5E2E6;
  --paper: #F4F8F7;
  --surface: #FFFFFF;
  --teal: #0B6E7A;
  --teal-deep: #0B3D4A;
  --teal-soft: #D8EEF0;
  --high: #C23B22;
  --high-bg: #FCEDEA;
  --low: #1F6F8B;
  --low-bg: #E8F3F7;
  --warn: #B45309;
  --warn-bg: #FEF3C7;
  --ok: #2F7D4A;
  --ok-bg: #E8F5EC;
  --shadow: 0 10px 28px rgba(11, 61, 74, 0.08);
  --radius: 16px;
  --font: "Outfit", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --app-max: 1100px;
  --pad-x: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1000px 420px at 0% -10%, #C9E8E6 0%, transparent 55%),
    radial-gradient(800px 380px at 100% 0%, #D7E6F0 0%, transparent 50%),
    linear-gradient(180deg, #EAF3F2 0%, var(--paper) 42%, #EEF3F2 100%);
  min-height: 100vh;
  min-height: 100dvh;
}

.app {
  max-width: var(--app-max);
  margin: 0 auto;
  padding: calc(14px + var(--safe-top)) var(--pad-x) calc(28px + var(--safe-bottom));
}

/* Nav */
.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.topnav a {
  text-decoration: none;
  padding: 8px 12px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
}
.topnav a.active {
  background: var(--teal-deep);
  border-color: var(--teal-deep);
  color: #fff;
}

/* Header */
.brand {
  font-size: clamp(1.55rem, 4.2vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--teal-deep);
  line-height: 1.15;
}
.brand span { color: var(--teal); }
.sub,
.hero-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 6px 0 14px;
  line-height: 1.5;
  max-width: 42em;
}
.meta,
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
  color: var(--muted);
}
.chip strong { color: var(--ink); font-weight: 600; }
.chip.allergy { background: #FEE2E2; border-color: #FECACA; color: #991B1B; }
.chip.allergy strong { color: #7F1D1D; }

/* Cards / panels (same chrome) */
.card,
.panel {
  background: var(--surface);
  border: 1px solid rgba(213, 226, 230, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}
.layout .panel { margin-bottom: 0; }
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}
@media (min-width: 900px) {
  .layout { grid-template-columns: 250px 1fr; gap: 18px; }
}
.card-h,
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #FBFEFE, #F5FAFA);
}
.card-h h2,
.panel-head h2 {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--teal-deep);
}
.card-b { padding: 14px 16px; }
.muted { color: var(--muted); font-size: 0.82rem; }

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill {
  display: inline-block;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-weight: 600;
  margin: 2px;
}
.pill.warn { background: #FEE2E2; color: #991B1B; }

.kv {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 6px 10px;
  font-size: 0.88rem;
}
.kv .k { color: var(--muted); }
.kv .v { font-weight: 550; }

.val { font-weight: 700; font-variant-numeric: tabular-nums; }
.val.high { color: var(--high); }
.val.low { color: var(--low); }
.flag {
  display: inline-flex;
  min-width: 26px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}
.flag.high { background: var(--high-bg); color: var(--high); }
.flag.low { background: var(--low-bg); color: var(--low); }
.flag.ok { background: #F0F4F5; color: #8A9AA1; }

.allergy-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #FEE2E2;
  border: 1px solid #FECACA;
  color: #991B1B;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(153, 27, 27, 0.08);
}
.allergy-banner .tag {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #991B1B;
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
}
.allergy-banner .txt { font-size: 0.92rem; line-height: 1.45; font-weight: 650; }
.allergy-banner .txt small {
  display: block;
  margin-top: 2px;
  font-weight: 500;
  opacity: 0.9;
  font-size: 0.78rem;
}
.allergy {
  background: #FEE2E2;
  border-left: 4px solid #991B1B;
  color: #7F1D1D;
  padding: 10px 12px;
  border-radius: 0 10px 10px 0;
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 12px;
  font-weight: 650;
}
.alert,
.note {
  border-left: 4px solid var(--warn);
  background: var(--warn-bg);
  border-radius: 0 12px 12px 0;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
}
.alert.critical {
  border-left-color: #991B1B;
  background: #FEE2E2;
  color: #7F1D1D;
  font-weight: 600;
}
.med {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #EEF3F4;
  font-size: 0.9rem;
}
.med:last-child { border-bottom: 0; }
.footnote {
  text-align: center;
  color: #8A9AA1;
  font-size: 0.75rem;
  margin-top: 14px;
  line-height: 1.5;
}

table.mini,
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
table.mini th,
table.data th {
  text-align: left;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
table.mini td,
table.data td {
  padding: 8px;
  border-bottom: 1px solid #EEF3F4;
  vertical-align: top;
}

.grid2 { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
}
.box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #FBFEFE;
}
.box h3 {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.box ul { padding-left: 1.1em; font-size: 0.88rem; line-height: 1.55; }

.diag {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--teal-deep);
  line-height: 1.45;
  margin-bottom: 8px;
}
.summary-text,
.card .summary {
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--teal-deep);
}
.rep {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  background: #FBFEFE;
}
.rep h3 { font-size: 0.9rem; color: var(--teal-deep); margin-bottom: 4px; }
.rep ul { padding-left: 1.1em; font-size: 0.86rem; line-height: 1.5; margin-top: 6px; }
.phase { padding: 10px 0; border-bottom: 1px solid #EEF3F4; }
.phase:last-child { border-bottom: 0; }
.phase strong { color: var(--teal-deep); }
.day { padding: 10px 0; border-bottom: 1px solid #EEF3F4; }
.day:last-child { border-bottom: 0; }
.day-h {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.day-h strong { font-size: 0.92rem; }

.shortcut {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (min-width: 700px) {
  .shortcut { grid-template-columns: repeat(4, 1fr); }
}
.shortcut a {
  display: block;
  text-decoration: none;
  color: var(--teal-deep);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 12px;
  background: #FBFEFE;
  font-weight: 650;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.shortcut a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.shortcut a small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.72rem;
}

/* Mobile polish */
@media (max-width: 480px) {
  :root { --pad-x: 12px; }
  .topnav { gap: 5px; margin-bottom: 12px; }
  .topnav a {
    padding: 7px 10px;
    font-size: 0.78rem;
    min-height: 34px;
  }
  .brand { font-size: clamp(1.4rem, 7vw, 1.75rem); }
  .sub, .hero-sub { font-size: 0.86rem; margin-bottom: 12px; }
  .card-h, .panel-head, .card-b { padding-left: 12px; padding-right: 12px; }
  .kv { grid-template-columns: 76px 1fr; font-size: 0.84rem; }
}

@media print {
  body { background: #fff; }
  .topnav, .shortcut { display: none; }
  .card, .panel { box-shadow: none; break-inside: avoid; }
}
