* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: "Noto Sans CJK HK", "Noto Sans TC", "PingFang TC", "PingFang HK", "Microsoft JhengHei", "Heiti TC", "Source Sans 3", "Noto Sans", system-ui, sans-serif;
  font-size: 20px;
  line-height: 1.55;
  color: #12343f;
  background: #e8f4f3;
  padding: 20px 16px 40px;
  overflow-x: hidden;
}
.page { max-width: 1100px; margin: 0 auto; }
img, svg, video { max-width: 100%; height: auto; }
img.fig, figure img, .diagram svg, .diag svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #f7fbfb;
}
header.banner {
  background: #0d7377;
  color: #fff;
  padding: 22px 28px;
  border-radius: 0;
}
.sitenav {
  background: #095c5f;
  color: #d7eeed;
  padding: 10px 28px;
  font-size: 16px;
  border-radius: 12px 12px 0 0;
  line-height: 1.45;
}
.sitenav a { color: #fff; text-decoration: none; font-weight: 700; }
.sitenav a:hover { text-decoration: underline; }

/* Companion bar: back to the disease site (learning path starts there) */
.companion-np {
  background: #e8f4f3;
  color: #12343f;
  padding: 10px 28px;
  font-size: 16px;
  line-height: 1.45;
  border-bottom: 1px solid #b7d4d2;
}
.companion-np a { color: #0d7377; font-weight: 700; text-decoration: none; }
.companion-np a:hover { text-decoration: underline; }
.companion-np .sep { color: #5a6f74; }

header.banner h1 { font-size: 30px; font-weight: 700; letter-spacing: 0.02em; }
header.banner p { font-size: 18px; margin-top: 6px; opacity: 0.95; }
.card {
  background: #fff;
  border: 2px solid #0d7377;
  border-top: none;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}
.intro, .sec, .foot { padding: 20px 28px; }
.notice {
  background: #fff6e8;
  border-bottom: 1px solid #e6d2b0;
  color: #6a3f00;
  font-size: 18px;
  padding: 16px 28px;
}
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 16px 28px;
  border-bottom: 1px solid #cce5e3;
  background: #f3faf9;
}
.toc a {
  color: #0d7377;
  text-decoration: none;
  font-size: 16px;
  border: 1px solid #0d7377;
  border-radius: 999px;
  padding: 4px 12px;
  white-space: normal;
  overflow-wrap: break-word;
  max-width: 100%;
  line-height: 1.35;
}
.toc a:hover { background: #e8f4f3; }
.intro { border-bottom: 1px solid #cce5e3; }
.sec { border-bottom: 1px solid #cce5e3; }
.sec h2 { font-size: 22px; color: #0d7377; margin-bottom: 12px; }
.sec h3 { font-size: 20px; color: #0d7377; margin: 18px 0 8px; }
.sec h4 { font-size: 18px; color: #0d7377; margin: 14px 0 6px; }
.pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 12px 0;
}
.trio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 12px 0;
}
.cap { font-size: 18px; color: #1b3a40; padding: 10px 0 2px; }
.credit { font-size: 14px; color: #5a6f74; padding: 0 0 6px; }
.foot { font-size: 15px; color: #5a6f74; background: #f3faf9; }
.foot p { margin: 8px 0; }
ul, ol { margin: 8px 0 8px 1.35em; }
li { margin: 7px 0; }
p { margin: 0 0 12px; }
a { color: #0d7377; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; margin: 12px 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 18px; }
th, td { border: 1px solid #b7d4d2; padding: 10px 12px; text-align: left; vertical-align: top; overflow-wrap: break-word; }
th { background: #0d7377; color: #fff; font-weight: 700; }
tr:nth-child(even) td { background: #f3faf9; }
.warn {
  background: #fdecee;
  border: 2px solid #9b2c3a;
  border-radius: 10px;
  padding: 16px 18px;
  margin: 8px 0 12px;
}
.warn h3 { color: #9b2c3a; margin: 0 0 8px; }
.box {
  background: #f3faf9;
  border: 1px solid #b7d4d2;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
}
.box.clinic {
  border-left: 6px solid #0d7377;
}
.box.clinic h3, .box.clinic h4 {
  color: #0d7377;
  margin: 0 0 8px;
  font-size: 18px;
}
.mnemonic {
  background: #e8f4f3;
  border: 2px solid #0d7377;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
  font-weight: 700;
  color: #0d7377;
}

/* Teaching diagrams */
.diagram, .diag {
  background: #f3faf9;
  border: 2px solid #0d7377;
  border-radius: 10px;
  padding: 14px 14px 8px;
  margin: 12px 0 8px;
  overflow: hidden;
}
.diagram .dtitle, .diag .dtitle {
  color: #0d7377;
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 10px;
}
.diag-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 10px;
}
.lbl-toggle, .page-lbl-toggle {
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #0d7377;
  background: #fff;
  border: 2px solid #0d7377;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  line-height: 1.3;
}
.lbl-toggle:hover, .page-lbl-toggle:hover,
.lbl-toggle[aria-pressed="true"], .page-lbl-toggle[aria-pressed="true"] {
  background: #0d7377;
  color: #fff;
}
.diag-hint { font-size: 15px; color: #5a6f74; }
.diag-info {
  background: #fff;
  border: 1px solid #b7d4d2;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0 6px;
  min-height: 1.4em;
  font-size: 17px;
}
.diag-info:empty { display: none; }
.diag-info strong { color: #0d7377; }

/* Clickable SVG / HTML hotspots */
.hotspot { cursor: pointer; }
.hotspot:focus { outline: none; }
.hotspot:focus .hit,
.hotspot.active .hit,
.hotspot:hover .hit {
  stroke: #0d7377;
  stroke-width: 3;
  fill: rgba(13, 115, 119, 0.10);
}
.labels-hidden .lbl {
  opacity: 0 !important;
  fill-opacity: 0 !important;
}
.labels-hidden text.lbl { pointer-events: none; }
.lbl-keep { opacity: 1; }
.labels-hidden .quiz-cell,
.labels-hidden td.quiz {
  color: transparent;
  text-shadow: none;
  user-select: none;
  cursor: pointer;
  position: relative;
}
.labels-hidden .quiz-cell::after,
.labels-hidden td.quiz::after {
  content: "？";
  color: #0d7377;
  position: absolute;
  left: 12px;
  top: 10px;
  font-weight: 700;
}
.labels-hidden .quiz-cell.revealed,
.labels-hidden td.quiz.revealed {
  color: inherit;
}
.labels-hidden .quiz-cell.revealed::after,
.labels-hidden td.quiz.revealed::after {
  content: none;
}
.labels-hidden .answer-key { display: none; }

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 0 0 8px;
}
.step {
  background: #fff;
  border: 1px solid #b7d4d2;
  border-radius: 10px;
  padding: 12px 12px 10px;
  min-width: 0;
}
.step .num {
  display: inline-block;
  background: #0d7377;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  border-radius: 999px;
  padding: 1px 10px;
  margin-bottom: 6px;
}
.step strong { color: #0d7377; }
.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin: 0 0 8px;
}
.compare .col {
  background: #fff;
  border: 2px solid #0d7377;
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}
.compare .col.sym { border-color: #9b2c3a; background: #fdecee; }
.compare .col.para { border-color: #0d7377; background: #e8f4f3; }
.compare .col h5 {
  margin: 0 0 8px;
  color: #0d7377;
  font-size: 18px;
}
.compare .col.sym h5 { color: #9b2c3a; }
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}
.pill {
  background: #fff;
  border: 2px solid #0d7377;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  color: #0d7377;
}
.pill.warnp, .pill.sym {
  border-color: #9b2c3a;
  color: #9b2c3a;
  background: #fdecee;
}
.pill.para {
  border-color: #0d7377;
  color: #0d7377;
  background: #e8f4f3;
}
.note { font-size: 16px; color: #5a6f74; margin: 4px 0 8px; }

/* Hub */
.hub-intro, .topics, .hub-foot { padding: 22px 28px; }
.hub-intro { border-bottom: 1px solid #cce5e3; }
.topics h2, .hub-intro h2 {
  font-size: 22px;
  color: #0d7377;
  margin: 22px 0 12px;
}
.topics h2:first-child { margin-top: 0; }
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 0 0 8px;
}
a.topic {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 2px solid #0d7377;
  border-radius: 12px;
  padding: 16px 18px;
  background: #f3faf9;
  min-width: 0;
}
a.topic:hover { background: #e8f4f3; }
a.topic h3 { font-size: 20px; color: #0d7377; margin-bottom: 8px; }
a.topic p { font-size: 17px; color: #1b3a40; margin: 0; }
a.topic .go { margin-top: 8px; font-size: 16px; font-weight: 700; color: #0d7377; }
a.topic.featured {
  border-width: 3px;
  background: #e8f4f3;
}
.group-note { font-size: 17px; color: #1b3a40; margin: 0 0 12px; }
.hub-foot { font-size: 15px; color: #5a6f74; background: #f3faf9; }
.hub-foot p { margin: 8px 0; }

.order-list { margin: 8px 0 12px 0; padding: 0; list-style: none; }
.order-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin: 8px 0;
}
.order-list .num {
  display: inline-block;
  background: #0d7377;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  border-radius: 999px;
  min-width: 1.8em;
  text-align: center;
  padding: 1px 8px;
  margin-top: 2px;
}

/* From-disease cards */
a.bridge {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 2px solid #0d7377;
  border-radius: 12px;
  padding: 16px 18px;
  background: #fff;
  margin: 0 0 12px;
}
a.bridge:hover { background: #f3faf9; }
a.bridge h3 { font-size: 20px; color: #0d7377; margin: 0 0 8px; }
a.bridge p { margin: 0 0 6px; font-size: 17px; }
a.bridge .go { font-size: 16px; font-weight: 700; color: #0d7377; margin: 8px 0 0; }

.toolbar-page {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  padding: 12px 28px;
  background: #f3faf9;
  border-bottom: 1px solid #cce5e3;
}

@media (max-width: 800px) {
  body { padding: 12px 10px 32px; }
  .sitenav, header.banner, .intro, .sec, .foot,
  .toc, .notice, .hub-intro, .topics, .hub-foot,
  .companion-np, .toolbar-page {
    padding-left: 16px;
    padding-right: 16px;
  }
  header.banner { padding-top: 16px; padding-bottom: 16px; }
  header.banner h1 { font-size: 24px; }
  header.banner p { font-size: 16px; }
  .sec h2, .topics h2, .hub-intro h2 { font-size: 21px; }
}
@media (max-width: 420px) {
  body { font-size: 18px; }
  .toc a { font-size: 15px; }
  table { font-size: 16px; }
}
