:root {
  --bg: #f6f9f9;
  --surface: #ffffff;
  --surface-2: #eef5f4;
  --ink: #10201f;
  --muted: #5b6b6a;
  --line: #d9e4e3;
  --brand: #0f766e;
  --brand-strong: #0b5d56;
  --brand-soft: #d7efec;
  --accent: #b45309;
  --accent-soft: #fdf1df;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --warn: #9a6700;
  --warn-soft: #fdf7e3;
  --ok: #087443;
  --ok-soft: #e6f6ee;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 31, .04), 0 8px 24px rgba(16, 32, 31, .05);
  --max: 1120px;
}

[data-theme="dark"] {
  --bg: #0c1514;
  --surface: #12201f;
  --surface-2: #162625;
  --ink: #e8f1f0;
  --muted: #9db0ae;
  --line: #263a38;
  --brand: #4fd1c5;
  --brand-strong: #7ee0d6;
  --brand-soft: #10312e;
  --accent: #f0b267;
  --accent-soft: #2c2114;
  --danger: #f29f9a;
  --danger-soft: #331b19;
  --warn: #e8c46b;
  --warn-soft: #2b2413;
  --ok: #6fd6a4;
  --ok-soft: #122c20;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }

h1, h2, h3 { line-height: 1.28; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.85rem, 4vw, 3rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin: .35em 0; }

.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.narrow { max-width: 860px; }
.muted { color: var(--muted); font-weight: 400; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--surface); padding: .6rem 1rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; padding: .7rem 0; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: inherit; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #0b4f4a);
  color: #fff; font-weight: 800; letter-spacing: .04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text small { color: var(--muted); font-size: .75rem; }
.site-nav { display: flex; gap: .2rem; margin-left: auto; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink); text-decoration: none; font-size: .92rem;
  padding: .4rem .55rem; border-radius: 8px;
}
.site-nav a:hover { background: var(--surface-2); color: var(--brand-strong); }
.nav-toggle, .theme-toggle {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: .4rem .8rem; font: inherit; font-size: .85rem; cursor: pointer;
}
.nav-toggle { display: none; margin-left: auto; }
.theme-toggle { margin-left: .4rem; }

.notice {
  margin-top: 1rem; padding: .85rem 1rem; border: 1px solid var(--warn);
  background: var(--warn-soft); border-radius: var(--radius-sm); font-size: .95rem;
}

.hero { padding: clamp(2.2rem, 6vw, 4.5rem) 0 1rem; }
.hero-inner { display: grid; grid-template-columns: 1.35fr .85fr; gap: 2.2rem; align-items: center; }
.eyebrow { color: var(--brand-strong); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; margin-bottom: .6rem; }
.lead { font-size: 1.06rem; color: var(--muted); max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: .62rem 1rem; border-radius: 999px; text-decoration: none; font-weight: 600;
  font-size: .95rem; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { color: #fff; background: var(--brand-strong); }
.btn.ghost { background: transparent; }
.btn.small { padding: .45rem .8rem; font-size: .88rem; margin-top: .6rem; }

.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow);
}
.stat strong { display: block; font-size: 1.35rem; color: var(--brand-strong); }
.stat span { color: var(--muted); font-size: .86rem; line-height: 1.5; }

.section { padding: clamp(2.4rem, 6vw, 4rem) 0; }
.section.alt { background: var(--surface-2); border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.6rem; }
.section-sub { color: var(--muted); max-width: 70ch; margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.2rem; box-shadow: var(--shadow);
}
.card h3 { margin-top: .2rem; }
.card p:last-child { margin-bottom: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.drug-class { color: var(--muted); font-size: .85rem; margin: .1rem 0 .6rem; }
.kv { display: grid; grid-template-columns: 4.2rem 1fr; gap: .2rem .6rem; font-size: .92rem; margin: .6rem 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.card-links { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .9rem; margin-top: .8rem; }

.tag { display: inline-block; font-size: .75rem; padding: .18rem .55rem; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.tag.done { background: var(--ok-soft); color: var(--ok); }
.tag.watch { background: var(--accent-soft); color: var(--accent); }
.tag.pre { background: var(--danger-soft); color: var(--danger); }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; counter-reset: step; }
.timeline li {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.05rem 1.15rem 1.05rem 3.1rem; box-shadow: var(--shadow);
}
.timeline-dot {
  position: absolute; left: 1rem; top: 1.25rem; width: 1.05rem; height: 1.05rem;
  border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 5px var(--brand-soft);
}
.timeline h3 { margin-bottom: .3rem; }
.timeline p { margin: 0; color: var(--muted); }

.callout {
  margin-top: 1.2rem; padding: 1rem 1.1rem; border-left: 4px solid var(--brand);
  background: var(--brand-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.callout.subtle { border-left-color: var(--line); background: var(--surface); }

.toolbar { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.search input {
  width: min(100%, 420px); padding: .6rem .85rem; border: 1px solid var(--line);
  border-radius: 999px; font: inherit; background: var(--surface); color: var(--ink);
}
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: .28rem .7rem; font-size: .82rem; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.lit-list { display: grid; gap: .8rem; }
.lit-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.lit-meta { display: flex; flex-wrap: wrap; gap: .5rem .9rem; color: var(--muted); font-size: .82rem; margin-bottom: .25rem; }
.lit-item h3 { font-size: 1.02rem; margin-bottom: .25rem; }
.lit-item .en { color: var(--muted); font-size: .86rem; margin-bottom: .45rem; }
.lit-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.lit-tags span { background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: .12rem .5rem; font-size: .76rem; }
.empty { padding: 1.2rem; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

.trial-list { display: grid; gap: .8rem; }
.trial {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.trial h3 { margin-bottom: .2rem; }
.trial .meta { color: var(--muted); font-size: .85rem; }
.trial .status { font-weight: 700; font-size: .85rem; }
.trial .status.active { color: var(--ok); }
.trial .status.done { color: var(--brand-strong); }
.trial .status.stopped { color: var(--danger); }

.resource-card .questions { padding-left: 1.2rem; }
.resource-card .questions li { margin: .5rem 0; }
.checklist { list-style: none; padding-left: 0; }
.checklist li { position: relative; padding-left: 1.5rem; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .62em; width: .55rem; height: .3rem;
  border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
}
.safety-lead { font-weight: 600; }
.safety-block { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem .85rem; margin: .6rem 0; background: var(--surface); }
.safety-block.danger { border-color: var(--danger); background: var(--danger-soft); }
.safety-block.warn { border-color: var(--warn); background: var(--warn-soft); }
.safety-block p { margin: .3rem 0 0; color: var(--muted); }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 1rem; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 1.6rem 0; margin-top: 1rem; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 1.2rem; align-items: start; }
.footer-inner p { margin: .2rem 0; color: var(--muted); font-size: .88rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .8rem; }
.footer-meta { text-align: right; }

@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; }
  .trial { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-meta { text-align: left; }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .wrap { width: min(100% - 1.6rem, var(--max)); }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; left: .8rem; right: .8rem; top: calc(100% + .4rem);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: .6rem; box-shadow: var(--shadow); flex-direction: column;
  }
  .site-nav.open { display: flex; }
  .theme-toggle { margin-left: 0; }
  .hero-stats { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header, .notice, .hero, .site-footer, .section-head, .toolbar,
  .literature #literature-list, .trial-list, .card-links, .btn { display: none !important; }
  .section { padding: 0; }
  .section.alt { background: #fff; border: 0; }
  .card { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  body.print-mode * { visibility: hidden; }
  body.print-mode .print-target, body.print-mode .print-target * { visibility: visible; }
  body.print-mode .print-target { position: absolute; left: 0; top: 0; width: 100%; }
}
