@charset "UTF-8";
/* NP OSCE 理學檢查教學網站 — 共用設計系統
   三層語意色：墨綠 = 臨床知識｜琥珀 = OSCE 計分點｜磚紅 = 紅旗與停止規則 */

:root {
  --paper: #f5f1e7;
  --paper-2: #ebe5d8;
  --ink: #152b29;
  --muted: #60706c;
  --body: #334744;

  --accent: #0b5c55;          /* 臨床知識 */
  --accent-soft: #dce9e5;
  --score: #9a6207;           /* OSCE 計分點 */
  --score-soft: #f8ecd6;
  --score-line: #e0c48d;
  --warning: #9a3d2f;         /* 紅旗／停止 */
  --warning-soft: #f3dfd8;

  --line: #c9c2b4;
  --white: #fffdf8;
  --shadow: 0 18px 50px rgba(21, 43, 41, .08);
  --serif: "Songti TC", "Noto Serif TC", "Source Han Serif TC", Georgia, serif;
  --sans: "PingFang TC", "Noto Sans TC", "Source Han Sans TC", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1180px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, .22) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 32px;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
}

a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }

a:focus-visible,
summary:focus-visible {
  outline: 3px solid #c45b18;
  outline-offset: 4px;
}

img { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
li { margin: .42em 0; }
li::marker { color: var(--accent); font-weight: 700; }
h1, h2, h3, h4 { font-family: var(--serif); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--white);
  background: var(--accent);
  border: 2px solid var(--white);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

/* ── Masthead ─────────────────────────────────────────── */

.masthead {
  color: var(--white);
  background: var(--ink);
  border-bottom: 8px solid var(--accent);
}

.masthead-inner {
  width: min(var(--wrap), calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 44px;
  display: grid;
  grid-template-columns: 1fr minmax(240px, 340px);
  gap: 60px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 16px;
  color: #9dd0c7;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .19em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2.7rem, 6.4vw, 5.2rem);
  font-weight: 600;
  line-height: .97;
  letter-spacing: -.045em;
}

.subtitle {
  margin: 22px 0 0;
  max-width: 46ch;
  color: #d5e3df;
  font-size: clamp(1rem, 2vw, 1.28rem);
  letter-spacing: .03em;
}

.edition {
  padding-left: 22px;
  border-left: 1px solid rgba(255, 255, 255, .28);
  color: #d8dfdc;
  font-size: .87rem;
  line-height: 1.65;
}

.edition strong {
  display: block;
  margin-bottom: 7px;
  color: var(--white);
  font-size: 1.02rem;
}

/* ── 導覽列 ───────────────────────────────────────────── */

.utility-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.utility-inner {
  width: min(var(--wrap), calc(100% - 40px));
  margin: 0 auto;
  padding: 10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.navlink {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 13px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 700;
}

.navlink.primary { color: var(--white); background: var(--accent); }
.navlink:hover { background: var(--accent); color: var(--white); }
.navlink[aria-disabled="true"] { opacity: .3; pointer-events: none; }
.prepared { margin-left: auto; color: #53615e; font-size: .86rem; }

/* ── 版面 ─────────────────────────────────────────────── */

.layout {
  width: min(var(--wrap), calc(100% - 40px));
  margin: 40px auto 88px;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 52px;
  align-items: start;
}

.layout.full { grid-template-columns: minmax(0, 1fr); }

.toc {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 16px 0 20px;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.toc-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .71rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.toc a {
  display: flex;
  min-height: 40px;
  padding: 6px 0;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-size: .84rem;
  line-height: 1.4;
}

.toc a:hover { color: var(--accent); }
main { min-width: 0; }

.notice {
  margin: 0 0 40px;
  padding: 20px 22px;
  background: var(--warning-soft);
  border-left: 5px solid var(--warning);
  font-size: .93rem;
}

.notice strong { color: #6f291f; }
.notice p:last-child { margin-bottom: 0; }

section {
  padding: 50px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 76px;
}

section:first-of-type { border-top: 0; padding-top: 0; }

.section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

h2 {
  margin: 0 0 20px;
  font-size: clamp(1.85rem, 4.2vw, 3.1rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.025em;
}

h3 {
  margin: 32px 0 12px;
  font-size: 1.42rem;
  font-weight: 600;
  line-height: 1.3;
}

h4 {
  margin: 22px 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
}

.lead { max-width: 67ch; color: var(--body); font-size: 1.07rem; }

/* ── 重點陳述 ─────────────────────────────────────────── */

.core-rule {
  margin: 28px 0 0;
  padding: 24px 26px;
  color: var(--white);
  background: var(--accent);
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.8vw, 1.75rem);
  line-height: 1.45;
}

.core-rule small {
  display: block;
  margin-top: 10px;
  color: #cbe1dc;
  font-family: var(--sans);
  font-size: .78rem;
  line-height: 1.55;
}

.signal-grid, .two-col, .three-col {
  display: grid;
  gap: 24px;
  margin-top: 26px;
}

.signal-grid { grid-template-columns: repeat(3, 1fr); }
.two-col { grid-template-columns: repeat(2, 1fr); }
.three-col { grid-template-columns: repeat(3, 1fr); }

.signal { padding-top: 14px; border-top: 4px solid var(--accent); }

.signal b {
  display: block;
  margin-bottom: 6px;
  font-family: var(--serif);
  font-size: 1.2rem;
}

.signal p { margin: 0; color: var(--muted); font-size: .89rem; }

.safety-note {
  margin: 24px 0;
  padding: 18px 20px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  font-size: .92rem;
}

.safety-note p:last-child { margin-bottom: 0; }

.clinical-list {
  margin: 24px 0;
  padding: 18px 22px 18px 42px;
  background: rgba(255, 253, 248, .72);
  border-top: 3px solid var(--ink);
}

/* ── OSCE 計分層（琥珀）───────────────────────────────── */

.score-chip {
  display: inline-block;
  margin-left: .4em;
  padding: 1px 7px;
  color: var(--score);
  background: var(--score-soft);
  border: 1px solid var(--score-line);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  vertical-align: .18em;
  white-space: nowrap;
}

.score-panel {
  margin: 26px 0;
  background: var(--white);
  border: 2px solid var(--score);
}

.score-panel > h3,
.score-title {
  margin: 0;
  padding: 11px 18px;
  color: var(--white);
  background: var(--score);
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.score-panel > ul,
.score-panel > ol { margin: 0; padding: 17px 24px 19px 44px; }
.score-panel > ul li::marker,
.score-panel > ol li::marker { color: var(--score); }
.score-panel > p { margin: 0; padding: 16px 20px; }
.score-panel .inner { padding: 16px 20px; }
.score-panel .inner > :last-child { margin-bottom: 0; }

.deduction {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--score-line);
}

.deduction li {
  margin: 0;
  padding: 14px 0 14px 34px;
  position: relative;
  border-bottom: 1px solid var(--score-line);
  font-size: .93rem;
}

.deduction li::before {
  content: "−";
  position: absolute;
  left: 6px;
  top: 12px;
  color: var(--score);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
}

.deduction b { color: var(--score); }

/* ── 停止規則（磚紅）─────────────────────────────────── */

.stop-panel {
  margin: 32px 0;
  background: var(--white);
  border: 2px solid var(--warning);
}

.stop-title {
  margin: 0;
  padding: 11px 18px;
  color: var(--white);
  background: var(--warning);
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.stop-panel ul { margin: 0; padding: 17px 24px 19px 44px; }
.stop-panel li::marker { color: var(--warning); }

/* ── 步驟 ─────────────────────────────────────────────── */

.step-list {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
  border-top: 1px solid var(--ink);
}

.step-list > li {
  counter-increment: steps;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 20px;
  margin: 0;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 80px;
}

.step-list > li::before {
  content: counter(steps, decimal-leading-zero);
  color: var(--accent);
  font-family: var(--serif);
  font-size: 1.42rem;
  font-weight: 700;
  line-height: 1.35;
}

.step-list[data-start="1"] { counter-reset: steps 0; }
.step-list strong { display: block; margin-bottom: 4px; font-size: 1.05rem; }
.step-list p { margin: 0 0 .5em; color: var(--body); font-size: .95rem; }
.step-list p:last-child { margin-bottom: 0; }

.say {
  margin: .5em 0;
  padding: 9px 14px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  font-size: .9rem;
}

.say::before {
  content: "對病人說";
  display: block;
  color: var(--accent);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .1em;
}

.step-list figure {
  margin: 14px 0 0;
  max-width: 400px;
  border: 1px solid var(--line);
  box-shadow: none;
}

.step-list .figure-grid {
  margin-top: 14px;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 14px;
}

.step-list .figure-grid figure { max-width: none; }
.step-list figcaption { padding: 9px 12px 11px; font-size: .74rem; }
.step-list figcaption b { font-size: .8rem; }

.step-deduct {
  margin: .6em 0 0;
  padding: 9px 14px;
  background: var(--score-soft);
  border-left: 3px solid var(--score);
  font-size: .88rem;
}

.step-deduct::before {
  content: "常見扣分";
  display: block;
  color: var(--score);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .1em;
}

.step-deduct p { margin: 0; }

.quick-step {
  margin: 24px 0;
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.quick-step h4 { margin: 0 0 8px; }
.quick-step > :last-child { margin-bottom: 0; }

/* ── 圖 ───────────────────────────────────────────────── */

figure {
  margin: 30px 0;
  background: var(--white);
  box-shadow: var(--shadow);
}

figure img { width: 100%; }

figcaption {
  padding: 12px 15px 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: .78rem;
  line-height: 1.55;
}

figcaption b { display: block; margin-bottom: 3px; color: var(--ink); font-size: .86rem; }
figcaption .src { display: block; margin-top: 5px; color: #7b8783; font-size: .71rem; }

.slide-link {
  color: var(--accent);
  text-decoration-style: dotted;
  text-underline-offset: .16em;
  white-space: nowrap;
}

.slide-link:hover { color: var(--white); background: var(--accent); text-decoration: none; }
.slide-link::after { content: " ↗"; font-size: .85em; }

.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
  margin-top: 26px;
}

.figure-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.figure-grid figure { margin: 0; }
.figure-grid .wide { grid-column: 1 / -1; }
figure.contain img { aspect-ratio: 4 / 3; object-fit: contain; background: var(--white); }

/* ── 表 ───────────────────────────────────────────────── */

.site-table-wrap {
  margin: 26px 0;
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.site-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: .85rem;
  line-height: 1.55;
}

.site-table caption {
  padding: 13px 16px;
  color: var(--muted);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 700;
}

.site-table th,
.site-table td {
  padding: 12px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.site-table tr:last-child th,
.site-table tr:last-child td { border-bottom: 0; }
.site-table th:last-child,
.site-table td:last-child { border-right: 0; }
.site-table thead th { color: var(--white); background: var(--ink); font-size: .75rem; letter-spacing: .03em; }
.site-table tbody th { width: 15%; color: var(--accent); background: #edf3f0; font-family: var(--serif); font-size: 1rem; }
.site-table .lr { color: var(--score); font-weight: 700; white-space: nowrap; }

/* 實證表：LR 強度用字重與底色分層 */
.site-table td.lr-hi,
.site-table td.lr-lo {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.site-table td.lr-hi { color: #7a4a05; background: var(--score-soft); }
.site-table td.lr-lo { color: #1f5f57; background: var(--accent-soft); }
.site-table td.lr-ns { color: var(--muted); text-align: center; font-size: .82rem; }

.lr-scale {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 1px;
  margin: 24px 0;
  background: var(--line);
  border: 1px solid var(--line);
  text-align: center;
}

.lr-scale > div { padding: 12px 6px; background: var(--white); }
.lr-scale b { display: block; font-family: var(--serif); font-size: 1.2rem; }
.lr-scale span { color: var(--muted); font-size: .76rem; }
.lr-scale .up b { color: var(--score); }
.lr-scale .down b { color: var(--accent); }
.lr-scale .mid b { color: var(--muted); }

/* ── 試聽（音檔由 tools/sync_audio.py 於建置期注入）──────── */

.audio-slot { display: contents; }

.audio-slot audio {
  display: block;
  width: 100%;
  min-width: 165px;
  max-width: 230px;
  height: 34px;
}

.site-table td:has(> .audio-slot:empty) { color: var(--muted); }

.audio-note {
  margin: 22px 0;
  padding: 16px 18px;
  background: var(--paper-2);
  border-left: 4px solid var(--line);
  color: var(--muted);
  font-size: .86rem;
}

.audio-note > :last-child { margin-bottom: 0; }
.audio-note b { color: var(--ink); }

/* ── 對照卡 ───────────────────────────────────────────── */

.term-contrast {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 24px 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.term-contrast > div { padding: 17px 19px; background: var(--white); }
.term-contrast b { display: block; margin-bottom: 5px; font-family: var(--serif); font-size: 1.05rem; }
.term-contrast p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.55; }

.check-column {
  padding: 18px 20px;
  background: var(--white);
  border-top: 3px solid var(--ink);
}

.check-column h4 { margin: 0 0 8px; }
.check-column ul { margin: 0; padding-left: 1.2em; font-size: .9rem; }

/* ── 模組卡（首頁）────────────────────────────────────── */

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 1px;
  margin-top: 28px;
  background: var(--line);
  border: 1px solid var(--line);
}

.module-card {
  display: block;
  padding: 22px 24px 24px;
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
}

.module-card:hover { background: var(--accent-soft); }

.module-card img {
  width: calc(100% + 48px);
  margin: -22px -24px 16px;
  height: 132px;
  object-fit: cover;
  object-position: center 35%;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.module-card .num {
  display: block;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
}

.module-card b { display: block; margin: 8px 0 6px; font-family: var(--serif); font-size: 1.28rem; font-weight: 600; }
.module-card p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.6; }
.module-card .meta { margin-top: 12px; color: var(--score); font-size: .74rem; font-weight: 700; letter-spacing: .04em; }

/* ── 自測 ─────────────────────────────────────────────── */

.quiz { margin-top: 28px; border-top: 1px solid var(--ink); }

.quiz details {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.quiz summary {
  min-height: 44px;
  padding: 4px 0;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.5;
}

.quiz summary::marker { color: var(--accent); }
.quiz .answer {
  margin-top: 12px;
  padding: 16px 18px;
  background: var(--white);
  border-left: 4px solid var(--accent);
  font-size: .93rem;
}

.quiz .answer > :last-child { margin-bottom: 0; }
.quiz .answer b { color: var(--accent); }

/* ── 來源 ─────────────────────────────────────────────── */

.reference-list { margin-top: 24px; padding-left: 1.2em; color: var(--body); font-size: .87rem; }
.reference-list li { margin: .6em 0; }

.version-note {
  margin-top: 28px;
  padding: 18px 20px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .84rem;
}

.version-note > :last-child { margin-bottom: 0; }

footer.site-foot {
  padding: 30px 0 44px;
  color: var(--white);
  background: var(--ink);
  font-size: .85rem;
}

footer.site-foot .utility-inner { padding: 0; }
footer.site-foot a { color: #9dd0c7; }

/* ── 響應式 ───────────────────────────────────────────── */

@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .toc { position: static; max-height: none; }
  .toc a { min-height: 36px; }
  .masthead-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .edition { padding-left: 0; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .28); padding-top: 16px; }
  .signal-grid, .three-col, .figure-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .signal-grid, .two-col, .three-col,
  .figure-grid, .figure-grid.three,
  .term-contrast { grid-template-columns: minmax(0, 1fr); }
  .step-list > li { grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
  .prepared { margin-left: 0; width: 100%; }
  .masthead-inner { padding: 38px 0 32px; }
  section { padding: 38px 0; }
}

/* ── 列印 ─────────────────────────────────────────────── */

@media print {
  body { background: #fff; font-size: 11pt; line-height: 1.5; }
  .utility-bar, .toc, .skip-link, footer.site-foot { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); width: 100%; margin: 0; }
  .masthead { color: #000; background: #fff; border-bottom: 3px solid #000; }
  .masthead h1 { font-size: 24pt; }
  .eyebrow, .subtitle, .edition { color: #333; }
  section { padding: 14pt 0; break-inside: auto; }
  h2 { font-size: 16pt; }
  h3 { font-size: 12.5pt; }
  figure, .site-table-wrap, .score-panel, .stop-panel { box-shadow: none; break-inside: avoid; }
  .figure-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quiz details { break-inside: avoid; }
  .quiz details > *:not(summary) { display: block; }
  a { color: #000; text-decoration: none; }

  /* 新增元件的列印處理 */
  .lr-scale { break-inside: avoid; }
  .lr-scale > div { padding: 6pt 3pt; }
  .site-table td.lr-hi { background: #f4ece0 !important; color: #000; }
  .site-table td.lr-lo { background: #e8efed !important; color: #000; }
  .site-table td.lr-ns { color: #555; }
  .site-table thead th { color: #000 !important; background: #ddd !important; }
  .site-table tbody th { color: #000 !important; background: #f0f0f0 !important; }
  .score-title, .stop-title { color: #000 !important; background: #ddd !important; }
  .core-rule { color: #000 !important; background: #f0efe9 !important; border: 1pt solid #000; }
  .core-rule small { color: #444; }
  .module-card img, .audio-note, .audio-slot { display: none; }
  .slide-link::after { content: ""; }
  .slide-link { color: #000; }
  .step-list > li { break-inside: avoid; }
  .figure-grid { gap: 8pt; }
  .say, .step-deduct { border-left-width: 2pt; break-inside: avoid; }
  .site-table { min-width: 0; font-size: 8.5pt; }
  .site-table th, .site-table td { padding: 4pt 6pt; }
  .site-table-wrap { overflow: visible; border: 1pt solid #999; }
}
