:root {
  --ink: #16302e;
  --ink-soft: #42625c;
  --muted: #778b86;
  --muted-light: #a5b7b1;
  --line: #dbe9e4;
  --paper: #fff;
  --mist: #f2f7f5;
  --brand: #0e7a70;
  --brand-dark: #07544e;
  --brand-soft: #dff2eb;
  --amber: #b77825;
  --amber-soft: #fff5e4;
  --rose: #b65458;
  --rose-soft: #fff0ef;
  --shadow: 0 18px 45px rgba(27, 73, 65, .08);
  --shadow-small: 0 7px 22px rgba(27, 73, 65, .07);
  font-family: "Inter", "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #eef5f2;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 100% -10%, rgba(133, 205, 181, .23), transparent 34rem),
    radial-gradient(circle at -12% 74%, rgba(216, 235, 224, .38), transparent 30rem),
    #f3f8f5;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, rgba(255,255,255,.62), transparent 31rem);
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 0 max(20px, calc((100vw - 1220px) / 2));
  background: rgba(255, 255, 255, .86);
  border-bottom: 1px solid rgba(210, 229, 221, .88);
  box-shadow: 0 8px 24px rgba(43, 81, 72, .04);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  background: linear-gradient(145deg, #159487, #07554e);
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(8, 103, 91, .22);
}
.brand h1 { margin: 0; font-size: 18px; line-height: 1.2; letter-spacing: -.02em; }
.brand p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.status-pill { padding: 6px 10px; color: var(--brand-dark); font-size: 11px; font-weight: 700; background: var(--brand-soft); border-radius: 99px; }
.status-pill.pending { color: var(--amber); background: var(--amber-soft); }
.status-pill.error { color: var(--rose); background: var(--rose-soft); }
.icon-button { display: inline-grid; width: 35px; height: 35px; place-items: center; color: var(--brand-dark); font-size: 11px; font-weight: 800; background: #fff; border: 1px solid var(--line); border-radius: 11px; transition: .18s; }
.icon-button:hover { border-color: var(--brand); box-shadow: var(--shadow-small); transform: translateY(-2px); }

.shell { max-width: 1220px; margin: auto; padding: 24px 22px 72px; }
.privacy-banner { display: flex; gap: 13px; align-items: center; margin-bottom: 26px; padding: 13px 16px; color: #275d54; background: linear-gradient(100deg, #e5f6ef, #f3fbf7); border: 1px solid #cde8dc; border-radius: 15px; box-shadow: 0 4px 14px rgba(42,111,94,.04); }
.privacy-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; background: #d2eee4; border-radius: 11px; }
.privacy-banner strong { font-size: 12px; letter-spacing: .03em; }
.privacy-banner p { margin: 4px 0 0; color: #5e8076; font-size: 11px; line-height: 1.6; }
.privacy-banner a { margin-left: auto; color: var(--brand); font-size: 12px; font-weight: 750; white-space: nowrap; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 25px; padding: 9px 2px 3px; }
.eyebrow { margin: 0 0 8px; color: var(--brand); font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.hero h2, .section-heading h2 { margin: 0 0 9px; color: var(--ink); font-size: clamp(28px, 4vw, 40px); font-weight: 780; letter-spacing: -.05em; }
.hero-copy { max-width: 680px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.hero-actions { display: flex; gap: 9px; flex: 0 0 auto; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; color: var(--brand-dark); font-size: 12px; font-weight: 750; border: 1px solid transparent; border-radius: 11px; transition: .18s; }
.button:hover { transform: translateY(-2px); box-shadow: var(--shadow-small); }
.button.primary { color: #fff; background: linear-gradient(145deg, #13867a, #075850); }
.button.secondary { color: var(--brand-dark); background: #fff; border-color: var(--line); }
.button.secondary:hover { border-color: var(--brand); background: #f2faf7; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { position: relative; min-height: 115px; padding: 17px 18px; overflow: hidden; background: rgba(255,255,255,.93); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); }
.stat-card::after { position: absolute; right: -20px; bottom: -27px; width: 92px; height: 92px; content: ""; background: var(--brand-soft); border-radius: 50%; opacity: .78; }
.stat-card:nth-child(2)::after { background: #e7eefb; }
.stat-card:nth-child(3)::after { background: #fff0d8; }
.stat-card:nth-child(4)::after { background: #f2eafa; }
.stat-label { position: relative; z-index: 1; color: var(--muted); font-size: 11px; font-weight: 750; }
.stat-value { position: relative; z-index: 1; margin-top: 10px; color: var(--ink); font-size: 25px; font-weight: 820; letter-spacing: -.04em; }
.stat-sub { position: relative; z-index: 1; margin-top: 5px; color: var(--muted-light); font-size: 10px; }

.content-grid { display: grid; gap: 17px; margin-bottom: 17px; }
.two-col { grid-template-columns: minmax(0, 1.3fr) minmax(310px, 1fr); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { padding: 21px; background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.card-heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.card-heading { margin-bottom: 16px; }
.card h3 { margin: 0 0 5px; font-size: 16px; font-weight: 780; letter-spacing: -.025em; }
.badge { padding: 5px 9px; color: var(--brand-dark); font-size: 10px; font-weight: 800; white-space: nowrap; background: var(--brand-soft); border-radius: 99px; }
.badge.success { color: #28714e; background: #e5f7ec; }
.hint-mark { display: grid; width: 24px; height: 24px; place-items: center; color: var(--brand); font-size: 12px; font-weight: 850; border: 1px solid #c6ded7; border-radius: 50%; }
.muted { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.table-wrap { overflow-x: auto; }
.simple-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.simple-table th { color: var(--muted); font-size: 10px; font-weight: 780; text-align: left; white-space: nowrap; background: #f5f9f7; }
.simple-table th:first-child { border-radius: 8px 0 0 8px; }
.simple-table th:last-child { border-radius: 0 8px 8px 0; }
.simple-table td, .simple-table th { padding: 11px 10px; border-bottom: 1px solid #edf2f0; }
.simple-table tbody tr:hover td { background: #f7fbf9; }
.simple-table tr:last-child td { border-bottom: 0; }
.flag-abnormal { color: var(--rose); font-weight: 800; background: var(--rose-soft); }
.flag-normal { color: #378064; }
.hint-list { display: grid; gap: 9px; }
.hint { padding: 10px 12px; color: var(--ink-soft); font-size: 12px; line-height: 1.65; background: #f3faf7; border-left: 3px solid var(--brand); border-radius: 0 9px 9px 0; }
.hint.watch { background: #fffaf0; border-left-color: var(--amber); }
.hint.good { background: #eff9f3; border-left-color: #4d9b70; }
.disclaimer { margin: 15px 0 0; padding: 10px 11px; color: #8d7041; font-size: 10px; line-height: 1.6; background: #fffaf0; border: 1px solid #f5e6c7; border-radius: 9px; }
.empty-state { padding: 34px 18px; color: var(--muted); font-size: 12px; line-height: 1.7; text-align: center; background: #fbfdfc; border: 1px dashed #c7dcd5; border-radius: 12px; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink-soft); font-size: 14px; }

.section-block { margin-top: 42px; scroll-margin-top: 96px; }
.section-heading { align-items: flex-end; margin-bottom: 18px; }
.section-heading h2 { margin-bottom: 5px; font-size: 26px; letter-spacing: -.04em; }
.trend-heading { align-items: flex-end; }
.segmented { display: flex; gap: 2px; padding: 3px; background: #f2f7f5; border: 1px solid var(--line); border-radius: 10px; }
.segmented button { padding: 7px 10px; color: var(--muted); font-size: 11px; font-weight: 700; background: transparent; border: 0; border-radius: 7px; }
.segmented button.active { color: var(--brand-dark); background: #fff; box-shadow: 0 2px 7px rgba(42,85,73,.1); }
.report-list { display: grid; gap: 9px; }
.report-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 80px 90px; gap: 14px; align-items: center; padding: 13px 14px; background: #fbfdfc; border: 1px solid #e5efeb; border-radius: 12px; transition: .16s; }
.report-row:hover { border-color: #afd8c9; background: #f6fcf9; transform: translateY(-1px); }
.report-date { color: var(--ink); font-weight: 780; }
.report-hospital { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.report-items { color: var(--ink-soft); font-size: 11px; }
.report-action { justify-self: end; padding: 6px 9px; color: var(--brand); font-size: 11px; font-weight: 780; background: transparent; border: 1px solid #c9e3d9; border-radius: 8px; }
.report-action:hover { background: var(--brand-soft); }

.trend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.trend-card { min-height: 284px; }
.trend-card .card-heading { align-items: center; }
.trend-card h3 { font-size: 14px; }
.trend-card small { color: var(--muted-light); font-size: 10px; }
.chart { height: 205px; padding: 6px 3px; overflow: hidden; background: linear-gradient(180deg, #fbfdfc, #f7fbf9); border: 1px solid #edf3f0; border-radius: 11px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: #e3eee9; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--brand); stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: #fff; stroke: var(--brand); stroke-width: 2; }
.chart-label { fill: #84938f; font-size: 9px; }
.chart-value { fill: #3f6d66; font-size: 9px; font-weight: 700; }
.no-trend { display: grid; height: 100%; place-items: center; color: var(--muted); font-size: 11px; }

.flow-card { min-height: 145px; position: relative; overflow: hidden; }
.flow-number { display: inline-block; margin-bottom: 16px; color: var(--brand); font-size: 11px; font-weight: 850; letter-spacing: .12em; }
.flow-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
code { padding: 2px 5px; color: var(--brand-dark); font-size: 10px; background: var(--brand-soft); border-radius: 5px; }
.config-card { border-top: 4px solid var(--brand); }
.config-grid { display: grid; grid-template-columns: 150px 1fr 180px 180px; gap: 10px; }
.config-grid > div { min-width: 0; padding: 12px 13px; background: #f7fbf9; border: 1px solid #e4efeb; border-radius: 10px; }
.config-grid .wide { min-width: 0; }
.config-grid span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.config-grid strong { display: block; overflow: hidden; color: var(--ink-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.small-note { margin: 13px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }

.report-dialog { width: min(760px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 23px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 25px 80px rgba(15,64,55,.22); }
.report-dialog::backdrop { background: rgba(14, 45, 40, .42); backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.dialog-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
.close-button { width: 31px; height: 31px; color: var(--muted); font-size: 22px; line-height: 1; background: #f4f8f6; border: 0; border-radius: 9px; }
.close-button:hover { color: var(--brand-dark); background: var(--brand-soft); }
.dialog-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.meta-chip { padding: 6px 8px; color: var(--ink-soft); font-size: 10px; background: var(--mist); border-radius: 7px; }
.toast { position: fixed; bottom: 25px; left: 50%; z-index: 30; max-width: calc(100vw - 30px); padding: 11px 16px; color: #fff; font-size: 12px; font-weight: 650; pointer-events: none; opacity: 0; background: #1d3d39; border-radius: 10px; box-shadow: 0 12px 25px rgba(20,60,54,.22); transform: translate(-50%, 18px); transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 920px) {
  .topbar { padding: 0 16px; }
  .shell { padding: 18px 15px 55px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col, .three-col, .trend-grid { grid-template-columns: 1fr; }
  .config-grid { grid-template-columns: repeat(2, 1fr); }
  .config-grid .wide { grid-column: 1 / -1; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero-actions { width: 100%; }
  .hero-actions .button { flex: 1; }
}
@media (max-width: 620px) {
  .brand p, .status-pill { display: none; }
  .privacy-banner { align-items: flex-start; }
  .privacy-banner a { align-self: center; }
  .section-heading, .trend-heading { align-items: flex-start; flex-direction: column; }
  .report-row { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .report-hospital { grid-column: 1 / 2; }
  .report-items { grid-column: 1 / 2; }
  .report-action { grid-column: 2; grid-row: 1 / span 3; }
  .config-grid { grid-template-columns: 1fr; }
  .config-grid .wide { grid-column: auto; }
  .top-actions { gap: 6px; }
}
