/* Reusable chrome on top of the existing light theme. */
body {
  font-family: var(--ds-font-sans);
}

.app-header {
  box-shadow: inset 0 -2px 0 #075985;
}

.brand-title {
  font-size: var(--ds-size-2);
  letter-spacing: 0.01em;
}

.brand-subtitle {
  letter-spacing: 0.08em;
}

.tool-btn,
.article-action-btn,
.font-btn,
.side-tab-pill,
.tab-pill {
  border-radius: var(--ds-radius);
}

.article-headline {
  font-weight: 650;
  letter-spacing: -0.03em;
}

.article-body h2 {
  letter-spacing: -0.02em;
}

.article-part-label {
  font-family: var(--ds-font-mono);
  letter-spacing: 0.04em;
}

.ds-panel {
  background: var(--ds-surface);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius);
  box-shadow: var(--ds-shadow);
  padding: var(--ds-space-5);
}

.ds-kicker {
  margin: 0 0 var(--ds-space-2);
  font-family: var(--ds-font-mono);
  font-size: var(--ds-size-1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-silicon-ink);
}

.ds-section {
  margin: var(--ds-space-6) 0;
}

.ds-section h2 {
  margin: 0 0 var(--ds-space-2);
  font-size: var(--ds-size-4);
  line-height: var(--ds-leading-tight);
  letter-spacing: -0.02em;
}

.ds-section > p {
  margin: 0 0 var(--ds-space-4);
  color: var(--ds-slate);
  line-height: var(--ds-leading-body);
}

.chart-grid,
.illus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ds-space-4);
}

.chart-card,
.illus-slot {
  min-width: 0;
  background: var(--ds-surface);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius);
  padding: var(--ds-space-4);
}

.chapter-figure {
  margin: 18px 0 22px;
  padding: 12px 12px 8px;
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius);
  background: var(--ds-surface);
}

.chapter-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

/* 窄螢幕：圖面維持可讀寬度（圖內字約 10.5px 以上），圖框可左右滑動，圖說仍依螢幕寬度換行 */
@media screen and (max-width: 640px) {
  .chapter-figure {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .chapter-figure svg {
    min-width: 600px;
  }
  /* 圖說固定在圖框左緣：左右滑動圖面時，示意標章與圖說仍留在畫面內 */
  .chapter-figure figcaption {
    position: sticky;
    left: 0;
  }
}

.chapter-figure figcaption {
  margin-top: 8px;
  font-size: var(--ds-size-1);
  line-height: 1.5;
  color: var(--ds-slate);
}

.chart-card h3,
.illus-slot figcaption {
  margin: var(--ds-space-3) 0 0;
  font-size: var(--ds-size-2);
  line-height: 1.5;
  color: var(--ds-ink);
}

.chart-axis {
  margin: 0 0 var(--ds-space-3);
  font-size: var(--ds-size-1);
  line-height: 1.5;
  color: var(--ds-slate);
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.bar-chart li {
  display: grid;
  grid-template-columns: minmax(7.5rem, 1.15fr) minmax(0, 1.6fr) auto;
  gap: var(--ds-space-2);
  align-items: center;
  min-width: 0;
  font-size: var(--ds-size-2);
  line-height: 1.35;
  color: var(--ds-ink);
}

.bar-label {
  min-width: 0;
}

.bar-track {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: 999px;
  background: var(--ds-silicon);
}

.bar-fill.is-wafer {
  background: var(--ds-wafer);
}

.bar-value {
  font-family: var(--ds-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--ds-size-1);
  color: var(--ds-silicon-ink);
}

.chart-source,
.illus-badge {
  display: block;
  margin-top: var(--ds-space-2);
  font-size: var(--ds-size-1);
  line-height: 1.5;
  color: var(--ds-slate);
}

.illus-badge {
  display: inline-block;
  margin: 0 var(--ds-space-2) 0 0;
  padding: 1px 6px;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
}

.illus-slot img,
.illus-fallback {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: var(--ds-surface-2);
}

.illus-fallback {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--ds-space-2);
  padding: var(--ds-space-4);
  border: 1px dashed var(--ds-silicon);
  color: var(--ds-silicon-ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(224, 242, 254, 0.9)),
    repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(7, 89, 133, 0.08) 18px, rgba(7, 89, 133, 0.08) 19px);
}

.illus-fallback strong {
  font-family: var(--ds-font-mono);
  font-size: var(--ds-size-1);
  word-break: break-all;
}

.fab-flow-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--ds-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.fab-flow-strip a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 72px;
  padding: var(--ds-space-2) var(--ds-space-3);
  border: 1px solid var(--ds-line);
  border-top: 3px solid var(--ds-silicon);
  border-radius: 4px;
  background: var(--ds-surface);
  color: var(--ds-ink);
  text-decoration: none;
}

.fab-flow-strip a:hover {
  border-color: var(--ds-wafer);
  background: #f0fdfa;
}

.fab-flow-strip span {
  font-family: var(--ds-font-mono);
  font-size: 11px;
  color: var(--ds-silicon-ink);
}

.fab-flow-strip strong {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .chart-grid,
  .illus-grid,
  .fab-flow-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .chart-grid,
  .illus-grid,
  .fab-flow-strip {
    grid-template-columns: 1fr;
  }

  .bar-chart li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .bar-label {
    grid-column: 1 / -1;
  }
}

.route-panel[hidden] { display: none !important; }

html.boot-home .app-toc,
html.boot-explore .app-toc,
body.is-home .app-toc,
body.is-part .app-toc,
body.is-glossary .app-toc,
body.is-missing .app-toc {
  display: none;
}

.part-title-link {
  display: block;
  text-decoration: none;
}

.part-title-link:hover {
  color: var(--ds-silicon, #075985);
}

.home-hero,
.part-entry {
  max-width: 920px;
}

.home-hero h1,
.part-entry h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: #0f172a;
}

.home-lead {
  margin: 0;
  max-width: 42rem;
  font-size: 18px;
  line-height: 1.7;
  color: #334155;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.home-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #0f766e;
  border-radius: 6px;
  color: #0f766e;
  font-weight: 650;
  text-decoration: none;
}

.home-action.is-primary {
  background: #0f766e;
  color: #ffffff;
}

.part-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.part-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 16px;
  border: 1px solid var(--ds-line, #cbd5e1);
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
}

.part-card strong {
  font-size: 18px;
  line-height: 1.35;
}

.part-card span:last-child {
  color: #334155;
  font-size: 14px;
  line-height: 1.55;
}

.home-figure { margin-top: 28px; }

.route-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 18px;
  font-size: 14px;
}

.route-crumb a { color: #075985; }

.part-chapter-list {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.part-chapter-link {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid #e2e8f0;
  color: #0f172a;
  text-decoration: none;
}

.part-chapter-link span {
  font-family: var(--ds-font-mono, ui-monospace, monospace);
  font-size: 12px;
  color: #075985;
}

@media (max-width: 720px) {
  .part-card-grid { grid-template-columns: 1fr; }
  .home-hero h1, .part-entry h1 { font-size: clamp(28px, 8vw, 36px); }
}

@media (prefers-reduced-motion: no-preference) {
  .home-action,
  .part-card,
  .part-chapter-link,
  .part-title-link {
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
  }
  .home-action:hover,
  .part-card:hover {
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-action,
  .part-card,
  .part-chapter-link,
  .explored-model-badge {
    animation: none;
    transition: none;
  }
}

.glossary-term {
  color: #075985;
  text-underline-offset: 3px;
}

.glossary-page,
.further-reading,
.fab-flow,
.not-found,
.chapter-preview,
.reading-meter {
  min-width: 0;
}

.reading-progress-track.is-idle { visibility: hidden; }

.reading-meter {
  margin: 0 0 12px;
  color: #334155;
  font-size: 14px;
}

.chapter-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.chapter-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 44px;
  padding: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
}

.chapter-preview strong {
  font-size: 18px;
  line-height: 1.35;
}

.chapter-preview-summary {
  color: #334155;
  font-size: 14px;
  line-height: 1.55;
}

.chapter-pagination.is-compact {
  margin: 0 0 20px;
  padding-top: 0;
  border-top: 0;
}

.page-nav-card { min-width: 0; }
.nav-title { overflow-wrap: break-word; }

.chapter-pagination .page-nav-card:last-child:not(:only-child) {
  text-align: right;
  align-items: flex-end;
}

.chapter-preview:focus-visible,
.page-nav-card:focus-visible,
.route-crumb a:focus-visible,
.not-found a:focus-visible,
.home-action:focus-visible {
  outline: 3px solid #0f766e;
  outline-offset: 3px;
}

.site-404 .app-header { height: auto; min-height: 64px; }
.site-404 .brand-title { max-width: none; white-space: normal; }
.site-404 .main-canvas { border-right: 0; max-width: 880px; }
.site-404 .home-actions { flex-direction: column; align-items: stretch; }
.site-404 .home-action { gap: 0.45em; justify-content: center; flex-wrap: wrap; }
.site-404 .home-action [lang="en"]::before { content: "· "; font-weight: 550; }

@media (prefers-reduced-motion: reduce) {
  .reading-progress-bar { transition: none; }
}

.glossary-filter {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0 12px;
  color: #334155;
  font-weight: 650;
}

.glossary-filter input {
  min-height: 44px;
  width: min(100%, 420px);
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  color: #0f172a;
  background: #ffffff;
}

.glossary-count,
.glossary-alt,
.glossary-back,
.further-meta {
  color: #334155;
  font-size: 14px;
}

.glossary-entry {
  padding: 16px 0;
  border-top: 1px solid #e2e8f0;
}

.glossary-entry[hidden] { display: none; }

.glossary-entry h2 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.35;
  color: #0f172a;
}

.glossary-entry abbr {
  margin-left: 8px;
  color: #075985;
  font-size: 14px;
  text-decoration: none;
}

.glossary-entry.is-targeted {
  background: #f0fdfa;
}

.glossary-back {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.fab-flow-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.fab-station {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
  font: inherit;
}

.fab-station .station-num {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.fab-station span {
  min-width: 0;
}

.fab-station .station-num circle {
  fill: #f0fdfa;
  stroke: #0f766e;
}

.fab-station .station-num text {
  fill: #0f172a;
  font-size: 11px;
  font-weight: 700;
}

.fab-station[aria-pressed="true"] {
  border-color: #0f766e;
  background: #f0fdfa;
}

.fab-station:focus-visible {
  outline: 3px solid #0f766e;
  outline-offset: 2px;
}

.fab-flow-detail {
  padding: 16px;
  border: 1px solid #ccfbf1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
}

.fab-flow-detail h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.further-reading {
  margin: 36px 0;
}

.further-reading ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.further-reading li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid #e2e8f0;
}

.further-reading a {
  color: #075985;
  overflow-wrap: anywhere;
}

@media (prefers-color-scheme: dark) {
  html:not([data-color-scheme="light"]):not([data-theme="litho-amber"]) {
    --chrome-page: #0b1220;
    --chrome-bg: #0f172a;
    --chrome-ink: #f8fafc;
    --chrome-muted: #cbd5e1;
    --chrome-line: #334155;
    --chrome-hover: #1e293b;
    --chrome-link: #7dd3fc;
  }
}

html[data-color-scheme="dark"] {
  --chrome-page: #0b1220;
  --chrome-bg: #0f172a;
  --chrome-ink: #f8fafc;
  --chrome-muted: #cbd5e1;
  --chrome-line: #334155;
  --chrome-hover: #1e293b;
  --chrome-link: #7dd3fc;
}

body { background: var(--chrome-page, var(--bg-app)); }
.app-header {
  background: var(--chrome-bg, var(--bg-surface-trans));
  border-bottom-color: var(--chrome-line, var(--border-subtle));
}
.brand-title { color: var(--chrome-ink, var(--text-main)); }
.brand-subtitle { color: var(--chrome-muted, var(--semi-blue)); }
.app-sidebar {
  background: var(--chrome-bg, var(--bg-surface));
  border-color: var(--chrome-line, var(--border-subtle));
}
.part-title { color: var(--chrome-muted, var(--text-muted)); }
.chapter-nav-link { color: var(--chrome-ink, var(--text-secondary)); }
.chapter-nav-link:hover {
  background: var(--chrome-hover, var(--bg-app));
  color: var(--chrome-ink, var(--text-main));
}
.ch-number { color: var(--chrome-muted, var(--text-muted)); }
.app-footer {
  background: var(--chrome-bg, var(--bg-surface));
  color: var(--chrome-muted, var(--text-muted));
  border-top-color: var(--chrome-line, var(--border-subtle));
}
.footer-attribution { color: var(--chrome-ink, var(--text-secondary)); }
.footer-attribution a { color: var(--chrome-link, var(--semi-blue-dark)); }

.app-container { max-width: none; }

.article-headline,
.article-body p,
.article-body .semi-ul,
.article-body .semi-ol,
.article-body h2,
.article-body h3 {
  max-width: 75ch;
}

.figure-caption { font-weight: 650; color: #0f172a; }
.figure-source { display: block; margin-top: 4px; font-size: 14px; line-height: 1.5; color: #334155; }

.semi-table { font-variant-numeric: tabular-nums; }
.semi-table th {
  white-space: normal;
  line-height: 1.35;
  position: sticky;
  top: 0;
  z-index: 1;
}
.semi-table th:first-child,
.semi-table td:first-child {
  position: sticky;
  left: 0;
}
.semi-table thead th:first-child {
  z-index: 3;
  background: var(--bg-surface-alt);
}
.semi-table tbody td:first-child {
  z-index: 2;
  background: var(--bg-surface);
  font-weight: 650;
  color: var(--text-main);
  box-shadow: 1px 0 0 var(--border-subtle);
}
.semi-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--bg-surface-alt) 65%, var(--bg-surface));
}
.semi-table tbody tr:hover td {
  background: color-mix(in srgb, var(--semi-blue-light) 70%, var(--bg-surface));
}

.sourced-chart {
  margin: 28px 0;
  padding: 16px 16px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-surface);
  min-width: 0;
  max-width: 100%;
}
.sourced-chart .figure-source,
.sourced-chart .sourced-url {
  overflow-wrap: anywhere;
}
.sourced-chart .table-container { max-width: 100%; }

/* 圖已涵蓋的長表格：收進「展開完整表格」，點開後內容與原表相同（section-diagrams.js foldTables） */
.table-fold { margin: 16px 0 24px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: #ffffff; }
.table-fold > summary { cursor: pointer; padding: 10px 14px; color: #0f766e; font-weight: 600; line-height: 1.6; }
.table-fold > summary:hover { background: #f0fdfa; }
.table-fold > summary:focus-visible { outline: 3px solid #0284c7; outline-offset: -3px; }
.table-fold[open] > summary { border-bottom: 1px solid var(--border-subtle); }
.table-fold > .table-container { margin: 0; border: 0; border-radius: 0 0 var(--radius-md) var(--radius-md); box-shadow: none; }

/* 範本段落整段收合：段首圖照常顯示，正文與表格收進「展開本段全文」（section-diagrams.js foldSection） */
.section-fold { margin: 16px 0 24px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: #ffffff; }
.section-fold > summary { cursor: pointer; padding: 10px 14px; color: #0f766e; font-weight: 600; line-height: 1.6; }
.section-fold > summary:hover { background: #f0fdfa; }
.section-fold > summary:focus-visible { outline: 3px solid #0284c7; outline-offset: -3px; }
.section-fold[open] > summary { border-bottom: 1px solid var(--border-subtle); margin-bottom: 12px; }
.section-fold > :not(summary) { margin-inline: 14px; }
.section-fold > .table-container { margin: 12px 14px 14px; }

/* 第 1 階段樣板：說明框與粗體標籤條列改成圖示卡片（content-cards.js）。顏色用 --semi-* token，黃光主題自動跟著換 */
.ui-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.callout.is-carded .callout-badge .ui-icon { width: 15px; height: 15px; stroke-width: 2; margin-right: 6px; vertical-align: -3px; }
.callout.is-carded .card + .card { margin-top: 16px; }
.callout.is-carded .card-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.callout.is-carded .card-title .ui-icon { width: 22px; height: 22px; }
.card-term .card-title .ui-icon { color: var(--semi-blue); }
.card-knowhow .card-title .ui-icon { color: var(--semi-amber); }
.card-tiles { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-width: none; }
.card-tiles.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-tiles.chain { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-tiles > li { position: relative; display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: 8px; background: rgba(255, 255, 255, 0.75); line-height: 1.65; }
.card-tiles .tile-body > strong { display: block; }
.icon-list .li-body > strong { margin-right: 0.4em; }
.card-tiles .ui-icon { margin-top: 2px; }
.card-tiles [data-label="definition"] .ui-icon, .card-tiles [data-label="situation"] .ui-icon { color: var(--semi-blue); }
.card-tiles [data-label="usage"] .ui-icon, .card-tiles [data-label="practice"] .ui-icon { color: var(--semi-teal); }
.card-tiles [data-label="terms"] .ui-icon, .card-tiles [data-label="why"] .ui-icon { color: var(--semi-amber); }
.card-tiles [data-label="confusion"] .ui-icon, .card-tiles [data-label="risk"] .ui-icon { color: #9a3412; }
/* 情境 → 做法 → 為什麼 → 沒做會怎樣：格間箭頭表示先後；相關章節獨占最後一列 */
.card-tiles.chain > li:nth-child(-n+3)::after { content: ''; position: absolute; right: -7px; top: 50%; width: 6px; height: 6px; border-top: 2px solid #94a3b8; border-right: 2px solid #94a3b8; transform: translateY(-50%) rotate(45deg); }
.card-tiles > li[data-label="related"] { grid-column: 1 / -1; align-items: center; padding: 2px 4px; border: 0; background: transparent; }
.card-tiles > li[data-label="related"] .ui-icon { width: 16px; height: 16px; margin: 0; color: #64748b; }
.card-tiles > li[data-label="related"] .tile-body > strong { display: inline; margin-right: 6px; }
/* 正文條列 → 圖示卡格 */
.article-body .icon-list { list-style: none; padding: 0; margin: 16px 0 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; max-width: min(100%, 60rem); }
.icon-list > li { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 8px 12px; border: 1px solid var(--border-subtle); border-radius: 10px; background: #ffffff; line-height: 1.65; }
.icon-list .ui-icon, .icon-list .li-num { width: 28px; height: 28px; padding: 5px; border-radius: 8px; color: var(--semi-teal); background: var(--semi-teal-light); }
.icon-list .li-num { display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0; font-weight: 700; }
/* 晶圓位置 → 前一站、本章、下一站 */
.track-steps > li { display: flex; gap: 8px; align-items: flex-start; }
.track-steps .ui-icon { width: 26px; height: 26px; padding: 4px; border-radius: 50%; color: #64748b; background: #f1f5f9; }
.track-steps > li.is-current .ui-icon { color: #ffffff; background: var(--semi-teal); }
@media (max-width: 640px) {
  /* 手機：卡片改成左側圖示一欄的緊湊列，不畫格框，高度接近原本的條列 */
  .card-tiles.grid, .card-tiles.chain { grid-template-columns: 1fr; gap: 6px; }
  .card-tiles > li { padding: 2px 0; border: 0; background: transparent; }
  .card-tiles .tile-body > strong { display: inline; margin-right: 0.4em; }
  .card-tiles.chain > li:nth-child(-n+3)::after { display: none; }
  .article-body .icon-list { grid-template-columns: 1fr; gap: 6px; }
  .icon-list > li { padding: 2px 0; border: 0; background: transparent; }
  .icon-list .ui-icon, .icon-list .li-num { width: 24px; height: 24px; padding: 4px; }
}

/* 2.17.0 介面圖示：首頁十二站、各部卡、側欄、章節標頭、翻頁、各部頁與情境探索共用 icons.js；全部裝飾用（aria-hidden），文字不變 */
/* 站號在上、站點圖示在下，疊在左欄；站名保留原本的寬度，不因加圖示而多折行 */
.fab-station { display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; row-gap: 4px; align-items: center; }
.fab-station .station-num { grid-column: 1; grid-row: 1; justify-self: center; width: 32px; height: 32px; }
.fab-station .station-icon { grid-column: 1; grid-row: 2; justify-self: center; width: 24px; height: 24px; color: #0f766e; }
.fab-station > span { grid-column: 2; grid-row: 1 / span 2; }
.fab-flow-detail .station-detail-icon { width: 56px; height: 56px; padding: 10px; border-radius: 12px; color: #0f766e; background: #f0fdfa; }
.part-card { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; align-items: start; }
.part-card .part-icon { width: 40px; height: 40px; padding: 8px; border-radius: 10px; color: var(--semi-teal); background: var(--semi-teal-light); }
.part-card-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
/* 該部各章圖示放在右上角，與「N 章」同一列，不多佔高度 */
.part-card span.part-chapter-icons { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; color: var(--text-muted); }
.part-chapter-icons .ui-icon { width: 18px; height: 18px; }
.part-title-link { display: flex; align-items: center; gap: 6px; }
.part-title-icon { width: 14px; height: 14px; stroke-width: 2; }
.ch-title-wrap { display: flex; align-items: flex-start; min-width: 0; }
.ch-title-wrap .ch-number { margin-top: 1px; }
.ch-icon { width: 16px; height: 16px; margin: 1px 6px 0 0; color: var(--text-muted); }
.chapter-nav-link.is-active .ch-icon { color: var(--semi-blue-dark); }
.explored-model-badge .ui-icon, .star-indicator .ui-icon, .read-check-indicator .ui-icon { width: 12px; height: 12px; stroke-width: 2.25; vertical-align: -1px; }
.star-indicator .ui-icon { fill: currentColor; }
.article-part-label { display: inline-flex; align-items: center; gap: 6px; }
.part-label-icon { width: 16px; height: 16px; }
.article-headline { display: flex; align-items: flex-start; gap: 16px; }
.article-headline .headline-icon { width: 48px; height: 48px; margin-top: 2px; padding: 9px; border-radius: 12px; stroke-width: 1.6; color: var(--semi-teal); background: var(--semi-teal-light); }
.nav-direction { display: inline-flex; align-items: center; gap: 6px; }
.nav-direction .nav-arrow { width: 16px; height: 16px; stroke-width: 2; }
.nav-title { display: flex; align-items: flex-start; gap: 8px; }
.nav-title .nav-chapter-icon { width: 20px; height: 20px; margin-top: 1px; color: var(--semi-teal); }
.chapter-pagination .page-nav-card:last-child:not(:only-child) .nav-direction, .chapter-pagination .page-nav-card:last-child:not(:only-child) .nav-title { justify-content: flex-end; }
.chapter-preview { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; align-content: start; }
.chapter-preview > :not(.preview-icon) { grid-column: 2; }
.chapter-preview .preview-icon { grid-column: 1; grid-row: 1 / span 2; width: 32px; height: 32px; padding: 6px; border-radius: 8px; color: var(--semi-teal); background: var(--semi-teal-light); }
.glossary-cards-link { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px; padding: 10px 14px; border: 1px solid var(--semi-teal); border-radius: 8px; color: var(--semi-teal); font-weight: 600; line-height: 1.5; text-decoration: none; }
.glossary-cards-link:hover { background: var(--semi-teal-light); }
.glossary-cards-link:focus-visible { outline: 3px solid var(--semi-teal); outline-offset: 2px; }
.scenario-number .scenario-icon { width: 24px; height: 24px; color: inherit; }
.flow-node strong { display: flex; align-items: center; gap: 8px; }
.flow-node .node-icon { width: 24px; height: 24px; color: var(--semi-teal); }
.flow-arrow .ui-icon { display: block; width: 18px; height: 18px; stroke-width: 2; }
@media (max-width: 640px) {
  .fab-station { grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; }
  .fab-station .station-num { width: 28px; height: 28px; }
  .fab-station .station-icon { width: 22px; height: 22px; }
  .fab-flow-detail .station-detail-icon { width: 40px; height: 40px; padding: 7px; }
  /* 窄螢幕翻頁卡只留方向箭頭：章節圖示會把章名擠成更多行 */
  .nav-title .nav-chapter-icon { display: none; }
  .article-headline { gap: 10px; }
  .article-headline .headline-icon { width: 32px; height: 32px; margin-top: 3px; padding: 6px; border-radius: 8px; }
  .chapter-preview { grid-template-columns: 28px minmax(0, 1fr); }
  .chapter-preview .preview-icon { width: 28px; height: 28px; padding: 5px; }
}
/* 窄手機：各部卡的章節圖示列回到正常排版，放在說明下方，不壓到「N 章」（375px 以下會重疊） */
@media (max-width: 420px) {
  .part-card span.part-chapter-icons { position: static; grid-column: 2; margin-top: 10px; flex-wrap: wrap; }
}
@media print {
  .article-headline .headline-icon, .nav-arrow, .nav-chapter-icon { display: none; }
}
.sourced-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.sourced-url {
  display: block;
  margin-top: 4px;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.sourced-plot { margin: 16px 0; }
.sourced-plot-title {
  margin: 14px 0 8px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}
.sourced-bar {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  grid-template-areas:
    "year value"
    "track track";
  gap: 4px 8px;
  align-items: center;
  margin-bottom: 8px;
}
.sourced-bar-wide {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "year"
    "value"
    "track";
}
.sourced-bar-wide .sourced-bar-value { justify-self: start; }
.sourced-bar-year { grid-area: year; min-width: 0; overflow-wrap: anywhere; color: #0f172a; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.sourced-bar-track {
  grid-area: track;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
.sourced-bar-fill {
  display: block;
  height: 100%;
  background: #0f766e;
}
.sourced-bar-value {
  grid-area: value;
  justify-self: end;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #334155;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.sourced-data-table caption {
  caption-side: bottom;
  padding-top: 8px;
  color: #334155;
  font-size: 13px;
  text-align: left;
}

.article-body .table-container,
.article-body .table-fold,
.article-body .section-fold,
.article-body .chapter-figure,
.article-body .sourced-chart,
.article-body .engineering-object-mount,
.article-body pre,
.article-body .mermaid,
.wafer-track-banner,
.chapter-pagination {
  max-width: min(100%, 60rem);
}

.home-hero,
#home-slot,
.part-entry {
  max-width: min(100%, 80rem);
}

.sidebar-rail { display: none; }

.sidebar-rail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
}

.sidebar-rail-btn:hover { border-color: #0f766e; color: #0f766e; }

.sidebar-rail-btn:focus-visible,
.toc-drawer-toggle:focus-visible {
  outline: 3px solid #0f766e;
  outline-offset: 2px;
}

@media (min-width: 861px) {
  .sidebar-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  html[data-sidebar="rail"] .app-sidebar,
  .app-sidebar.is-rail {
    width: 64px;
    padding: 12px 8px;
    overflow-x: hidden;
  }
  html[data-sidebar="rail"] .sidebar-panel,
  .app-sidebar.is-rail .sidebar-panel {
    display: none;
  }
  html[data-sidebar="open"] .sidebar-rail,
  .app-sidebar:not(.is-rail) .sidebar-rail {
    flex-direction: row;
    justify-content: flex-end;
    margin-bottom: 8px;
  }
  html[data-sidebar="open"] .sidebar-rail a,
  .app-sidebar:not(.is-rail) .sidebar-rail a {
    display: none;
  }
}

@media (min-width: 1201px) {
  .toc-drawer-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    margin-bottom: 12px;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
  }
  html[data-toc="closed"] .app-toc,
  .app-toc.is-collapsed {
    width: 64px;
    padding: 12px 8px;
    overflow-x: hidden;
  }
  html[data-toc="closed"] .toc-heading,
  html[data-toc="closed"] #tocList,
  .app-toc.is-collapsed .toc-heading,
  .app-toc.is-collapsed #tocList {
    display: none;
  }
  html[data-toc="closed"] .toc-toggle-label,
  .app-toc.is-collapsed .toc-toggle-label,
  html[data-toc="closed"] .controls-label,
  .app-toc.is-collapsed .controls-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  html[data-toc="closed"] .reading-controls-bar,
  .app-toc.is-collapsed .reading-controls-bar {
    flex-direction: column;
    align-items: center;
    margin: 8px 0 0;
    padding: 0;
    border: 0;
    gap: 6px;
  }
  html[data-toc="closed"] .font-size-btns,
  .app-toc.is-collapsed .font-size-btns {
    flex-direction: column;
  }
  html[data-toc="closed"] .font-btn,
  .app-toc.is-collapsed .font-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar,
  .app-toc { transition: none; }
}

/* Stage 1：首頁及 ch04 閱讀樣板；其他章節保留原版面。 */
body.is-home .home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 12px 40px;
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid #d9e6e3;
}
body.is-home .home-hero > .ds-kicker { grid-column: 1 / -1; margin: 0; }
body.is-home .home-hero h1 { grid-column: 1; grid-row: 2 / span 2; margin: 0; text-wrap: balance; font-size: clamp(36px, 3.8vw, 54px); line-height: 1.16; }
body.is-home .home-lead { grid-column: 2; align-self: end; font-size: 17px; }
body.is-home .home-actions { grid-column: 2; align-self: start; gap: 10px; margin-top: 8px; }
body.is-home #home-fab-flow { margin-bottom: 40px; }
body.is-home #home-fab-flow .fab-flow { margin: 0; padding: 28px; border: 1px solid #c8ded8; border-radius: 10px; background: #f3faf7; }
body.is-home #home-fab-flow h2 { margin: 8px 0 12px; font-size: clamp(26px, 2.5vw, 34px); line-height: 1.2; }
body.is-home #home-fab-flow .fab-flow-list { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-block: 24px; }
body.is-home #home-fab-flow .fab-station { height: 100%; min-height: 82px; padding: 12px; column-gap: 10px; row-gap: 4px; font-size: 15px; line-height: 1.4; cursor: pointer; }
body.is-home #home-fab-flow .fab-station[aria-pressed="true"] { border-color: #0f766e; background: #e0f4ed; box-shadow: inset 0 -3px #0f766e; }
body.is-home #home-fab-flow .fab-flow-detail { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 24px; padding: 20px; border-color: #bdd6ce; }
body.is-home #home-fab-flow .fab-flow-detail .station-detail-icon { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
body.is-home #home-fab-flow .fab-flow-detail h3 { grid-column: 2; margin: 0; }
body.is-home #home-fab-flow .fab-flow-detail p { grid-column: 2; margin: 0; max-width: 68ch; font-size: 16px; line-height: 1.65; }
body.is-home #home-fab-flow .fab-flow-detail a { grid-column: 3; grid-row: 1 / span 2; align-self: center; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid #0f766e; border-radius: 6px; color: #0f766e; font-weight: 650; text-decoration: none; }

body.is-chapter-sample .article-header { margin-bottom: 24px; max-width: 80rem; }
body.is-chapter-sample .article-headline { max-width: 34ch; font-size: clamp(30px, 3.2vw, 44px); font-weight: 650; line-height: 1.22; }
body.is-chapter-sample .article-header .reading-meter { margin: 12px 0 0; }
body.is-chapter-sample .chapter-key-takeaways { max-width: 80rem; margin: 0 0 24px; padding: 20px 24px; background: #f3faf7; border: 1px solid #c8ded8; border-left: 3px solid #0f766e; border-radius: 6px; }
body.is-chapter-sample .chapter-key-takeaways h2 { margin: 0 0 12px; font-size: 20px; font-weight: 650; line-height: 1.4; display: flex; justify-content: space-between; }
body.is-chapter-sample .chapter-key-takeaways ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 36px; margin: 0; padding-left: 22px; font-size: var(--article-font-size); line-height: 1.65; }
body.is-chapter-sample .chapter-key-takeaways li { margin: 0; padding-left: 2px; }
body.is-chapter-sample .chapter-reading-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; max-width: 80rem; padding-block: 12px; margin-bottom: 16px; border-block: 1px solid #e2e8f0; }
body.is-chapter-sample .chapter-reading-tools .chapter-pagination { margin: 0; gap: 16px; align-self: start; }
body.is-chapter-sample .chapter-reading-tools .page-nav-card { padding: 8px 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
body.is-chapter-sample .chapter-reading-tools .nav-title { font-size: 14px; }
body.is-chapter-sample .chapter-reading-tools .app-toc { position: static; inset: auto; width: 100%; height: auto; min-width: 0; max-height: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 0; overflow: visible; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
body.is-chapter-sample .app-toc .toc-drawer-toggle { display: flex; align-items: center; width: auto; min-height: 44px; margin: 0; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: #ffffff; }
body.is-chapter-sample .app-toc .toc-toggle-label,
body.is-chapter-sample .app-toc .controls-label { position: static; width: auto; height: auto; margin: 0; clip: auto; overflow: visible; white-space: normal; }
body.is-chapter-sample .app-toc .reading-controls-bar { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; }
body.is-chapter-sample .app-toc .font-size-btns { flex-direction: row; }
body.is-chapter-sample .app-toc .font-btn { min-width: 40px; min-height: 44px; }
body.is-chapter-sample .app-toc .toc-heading { display: none; }
body.is-chapter-sample .app-toc:not(.is-collapsed) #tocList { display: block; grid-column: 1 / -1; columns: 2; column-gap: 20px; margin: 0; }
body.is-chapter-sample .app-toc #tocList li { break-inside: avoid; }
body.is-chapter-sample .chapter-scenario-link { max-width: 80rem; margin: 0 0 20px; padding-block: 10px; font-size: 14px; }
body.is-chapter-sample .article-body > .callout-wafer-pos { max-width: 80rem; margin-top: 0; padding: 16px 20px; }
body.is-chapter-sample .callout-wafer-pos ul { max-width: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-bottom: 0; font-size: 14px; line-height: 1.65; }
body.is-chapter-sample .callout-wafer-pos li { margin: 0; }
body.is-chapter-sample .article-body > .semi-p,
body.is-chapter-sample .article-body > .semi-ul,
body.is-chapter-sample .article-body > .semi-ol { max-width: 72ch; }
/* 卡片與圖示條列不受正文行寬限制，用滿內容區（與圖同寬），才能排成多欄而不被擠高 */
body.is-chapter-sample .article-body > .semi-ul.icon-list { max-width: min(100%, 60rem); }
.article-body .callout .semi-ul.card-tiles { max-width: none; }
body.is-chapter-sample .article-body .engineering-object-mount { max-width: 80rem; }
@media (min-width: 981px) {
  .eng-obj-card:is([aria-labelledby="engObjCh00Title"], [aria-labelledby="engObjCh01Title"], [aria-labelledby="engObjCh02Title"], [aria-labelledby="engObjCh03Title"], [aria-labelledby="engObjCh04Title"], [aria-labelledby="engObjCh05Title"], [aria-labelledby="engObjCh06Title"], [aria-labelledby="engObjCh07Title"], [aria-labelledby="engObjCh08Title"], [aria-labelledby="engObjCh09Title"], [aria-labelledby="engObjCh10Title"], [aria-labelledby="engObjCh11Title"], [aria-labelledby="engObjCh12Title"], [aria-labelledby="engObjCh13Title"], [aria-labelledby="engObjCh14Title"], [aria-labelledby="engObjCh15Title"], [aria-labelledby="engObjCh16Title"], [aria-labelledby="engObjCh17Title"], [aria-labelledby="engObjCh18Title"], [aria-labelledby="engObjCh19Title"], [aria-labelledby="engObjCh20Title"], [aria-labelledby="engObjCh21Title"], [aria-labelledby="engObjCh22Title"], [aria-labelledby="engObjCh23Title"], [aria-labelledby="engObjCh24Title"]) .eng-obj-stage.is-view-split { grid-template-columns: minmax(0, 1.6fr) minmax(280px, .7fr); }
}
@media (max-width: 1100px) {
  body.is-home .home-hero { display: block; }
  body.is-home .home-hero h1 { margin-block: 12px 16px; }
  body.is-home .home-actions { margin-top: 20px; }
  body.is-home #home-fab-flow .fab-flow-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.is-chapter-sample .chapter-reading-tools { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body.is-home .home-hero { padding-bottom: 24px; margin-bottom: 24px; }
  body.is-home .home-hero h1 { font-size: 36px; }
  body.is-home .home-lead { font-size: 16px; }
  body.is-home #home-fab-flow .fab-flow { padding: 18px 14px; }
  body.is-home #home-fab-flow .fab-flow-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body.is-home #home-fab-flow .fab-station { min-height: 78px; padding: 8px; column-gap: 8px; font-size: 14px; }
  body.is-home #home-fab-flow .fab-flow-detail { grid-template-columns: 40px minmax(0, 1fr); gap: 0 12px; align-items: center; padding: 16px; }
  body.is-home #home-fab-flow .fab-flow-detail .station-detail-icon { grid-row: 1; }
  body.is-home #home-fab-flow .fab-flow-detail p, body.is-home #home-fab-flow .fab-flow-detail a { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
  body.is-home #home-fab-flow .fab-flow-detail p { margin-block: 10px; }
  body.is-chapter-sample .article-top-bar { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  body.is-chapter-sample .article-headline { font-size: 30px; }
  body.is-chapter-sample .chapter-key-takeaways { padding: 16px 18px; }
  body.is-chapter-sample .chapter-key-takeaways ol { grid-template-columns: 1fr; font-size: var(--article-font-size); gap: 10px; }
  body.is-chapter-sample .app-toc .controls-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  body.is-chapter-sample .app-toc .toc-drawer-toggle { font-size: 13px; }
  body.is-chapter-sample .app-toc:not(.is-collapsed) #tocList { columns: 1; }
  body.is-chapter-sample .callout-wafer-pos ul { grid-template-columns: 1fr; gap: 10px; }
}

/* B2: readable CH20 controls on the established light chapter template. */
body.is-chapter-sample .eng-obj-card[aria-labelledby="engObjCh20Title"] .ch20-model-controls {
  background: #ffffff !important;
}

/* B2 review follow-up: only CH19 status badges and the CH21 calculator title. */
.eng-obj-card[aria-labelledby="engObjCh19Title"] .ch19-test-status {
  background: #ffffff !important;
}
.eng-obj-card[aria-labelledby="engObjCh19Title"] .ch19-test-status[data-status="pass"] {
  color: #065f46 !important;
}
.eng-obj-card[aria-labelledby="engObjCh19Title"] .ch19-test-status[data-status="error"],
.eng-obj-card[aria-labelledby="engObjCh19Title"] .ch19-test-status[data-status="false_open"] {
  color: #b91c1c !important;
}
.eng-obj-card[aria-labelledby="engObjCh19Title"] .ch19-test-status[data-status="over_scrub"] {
  color: #92400e !important;
}
.ch21-physics-calc-modal .calc-title {
  color: #0f172a;
}


/* B3：只修薄膜狀態徽章與本批兩章計算器標題的對比。 */
.eng-obj-card[aria-labelledby="engObjCh05Title"] .ch05-cvd-status {
  background: #ffffff !important;
}
.eng-obj-card[aria-labelledby="engObjCh05Title"] .ch05-cvd-status[data-regime="surface"] {
  color: #065f46 !important;
}
.eng-obj-card[aria-labelledby="engObjCh05Title"] .ch05-cvd-status[data-regime="mass"] {
  color: #b91c1c !important;
}
.b3-physics-calc-modal .calc-title { color: #0f172a; }


/* B4：只調整清洗控制區／狀態字及本批兩章計算器標題。 */
.eng-obj-card[aria-labelledby="engObjCh09Title"] .ch09-acoustic-controls {
  background: #ffffff !important;
}
.eng-obj-card[aria-labelledby="engObjCh09Title"] .ch09-cavitation-status[data-status="destructive"] {
  color: #b91c1c !important;
}
.eng-obj-card[aria-labelledby="engObjCh09Title"] .ch09-cavitation-status[data-status="transition"] {
  color: #92400e !important;
}
.eng-obj-card[aria-labelledby="engObjCh09Title"] .ch09-cavitation-status[data-status="controlled"] {
  color: #065f46 !important;
}
.b4-physics-calc-modal .calc-title { color: #0f172a; }


/* B4 實看補正：兩組清洗刻度以三欄換行，保留完整文字與值。 */
.eng-obj-card[aria-labelledby="engObjCh09Title"] .ch09-control-ticks {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  font-size: 11px !important;
  line-height: 1.35;
}
.eng-obj-card[aria-labelledby="engObjCh09Title"] .ch09-control-ticks > span:nth-child(2) { text-align: center; }
.eng-obj-card[aria-labelledby="engObjCh09Title"] .ch09-control-ticks > span:last-child { text-align: right; }


/* B5：只提高本批 CH07／CH10 計算器標題的文字對比。 */
.b5-physics-calc-modal .calc-title { color: #0f172a; }

/* B5: keep the calculator badge readable on its light header. */
.b5-physics-calc-modal .calc-badge { color: #0f766e; background: #ecfdf5; border-color: #99f6e4; }


/* B6: retain readable calculator headings and badges on the light surface. */
.b6-physics-calc-modal .calc-title { color: #0f172a; }
.b6-physics-calc-modal .calc-badge { color: #0f766e; background: #ecfdf5; border-color: #99f6e4; }


/* B6: scoped light-surface controls; retain all values and slider ranges. */
.eng-obj-card[aria-labelledby="engObjCh12Title"] .ch12-geometry-controls { background: #f8fafc !important; border-color: #cbd5e1 !important; }
.eng-obj-card[aria-labelledby="engObjCh12Title"] .ch12-geometry-controls span { color: #334155 !important; }
.eng-obj-card[aria-labelledby="engObjCh12Title"] .ch12-geometry-controls > div > div:last-child { font-size: 11px !important; flex-wrap: wrap; gap: 4px 8px; }

/* B6: keep CH12 photo hotspot descriptions below the image and clear of all pins. */
.eng-obj-card[aria-labelledby="engObjCh12Title"] .eng-obj-photo-panel > .photo-hotspot-tooltip,
.eng-obj-card[aria-labelledby="engObjCh13Title"] .eng-obj-photo-panel > .photo-hotspot-tooltip,
.eng-obj-card[aria-labelledby="engObjCh14Title"] .eng-obj-photo-panel > .photo-hotspot-tooltip,
.eng-obj-card[aria-labelledby="engObjCh15Title"] .eng-obj-photo-panel > .photo-hotspot-tooltip,
.eng-obj-card[aria-labelledby="engObjCh16Title"] .eng-obj-photo-panel > .photo-hotspot-tooltip,
.eng-obj-card[aria-labelledby="engObjCh17Title"] .eng-obj-photo-panel > .photo-hotspot-tooltip,
.eng-obj-card[aria-labelledby="engObjCh18Title"] .eng-obj-photo-panel > .photo-hotspot-tooltip,
.eng-obj-card[aria-labelledby="engObjCh00Title"] .eng-obj-photo-panel > .photo-hotspot-tooltip,
.eng-obj-card[aria-labelledby="engObjCh01Title"] .eng-obj-photo-panel > .photo-hotspot-tooltip {
  position: static;
  width: auto;
  max-width: none;
  transform: none;
  margin: 12px 16px 0;
  box-shadow: none;
}


/* B7: scoped calculator contrast and visible keyboard focus for node selection. */
.b7-physics-calc-modal .calc-title { color: #0f172a; }
.b7-physics-calc-modal .calc-badge { color: #0f766e; background: #ecfdf5; border-color: #99f6e4; }
.eng-obj-card[aria-labelledby="engObjCh14Title"] .node-btn:focus-visible > rect { stroke: #0f766e; stroke-width: 3px; }


/* B7: retain the two memory-state badges on a readable light surface. */
.eng-obj-card[aria-labelledby="engObjCh13Title"] .ch13-status-badge { background: #ffffff !important; color: #075985 !important; }
.eng-obj-card[aria-labelledby="engObjCh13Title"] .ch13-status-badge[data-low="true"] { color: #b91c1c !important; }


/* B8：只改善兩章計算器標題對比及圖案選擇的鍵盤焦點。 */
.b8-physics-calc-modal .calc-title { color: #0f172a; }
.b8-physics-calc-modal .calc-badge { color: #0f766e; background: #ecfdf5; border-color: #99f6e4; }
.eng-obj-card[aria-labelledby="engObjCh16Title"] [data-pattern]:focus-visible { stroke: #0f766e; stroke-width: 3px; outline: none; }
/* 保留兩張原圖的比例，讓並列／照片模式的座標圖釘對準原始影像。 */
.eng-obj-card:is([aria-labelledby="engObjCh15Title"], [aria-labelledby="engObjCh16Title"]) .eng-obj-stage.is-view-split { align-items: start; }
.eng-obj-card:is([aria-labelledby="engObjCh15Title"], [aria-labelledby="engObjCh16Title"]) .eng-obj-stage:is(.is-view-split, .is-view-photo) .photo-img-wrap { flex: none; min-height: 0; }
.eng-obj-card:is([aria-labelledby="engObjCh15Title"], [aria-labelledby="engObjCh16Title"]) .eng-obj-stage:is(.is-view-split, .is-view-photo) .eng-real-photo { height: auto; max-height: none; }
.eng-obj-card:is([aria-labelledby="engObjCh15Title"], [aria-labelledby="engObjCh16Title"]) .eng-obj-stage:is(.is-view-split, .is-view-photo) .photo-img-wrap:hover .eng-real-photo { transform: none; }


/* B9：兩章限定閱讀比例、計算器對比與等價鍵盤控制。 */
.b9-physics-calc-modal .calc-title { color: #0f172a; }
.b9-physics-calc-modal .calc-badge { color: #0f766e; background: #ecfdf5; border-color: #99f6e4; }
.eng-obj-card[aria-labelledby="engObjCh17Title"] [data-spc-mode]:focus-visible,
.eng-obj-card[aria-labelledby="engObjCh18Title"] [data-sim]:focus-visible { stroke: #0f766e; stroke-width: 3px; outline: none; }
.eng-obj-card[aria-labelledby="engObjCh18Title"] .ocap-sim-btn + text { pointer-events: none; }
.eng-obj-card:is([aria-labelledby="engObjCh17Title"], [aria-labelledby="engObjCh18Title"]) .eng-obj-stage.is-view-split { align-items: start; }
.eng-obj-card:is([aria-labelledby="engObjCh17Title"], [aria-labelledby="engObjCh18Title"]) .eng-obj-stage:is(.is-view-split, .is-view-photo) .photo-img-wrap { flex: none; min-height: 0; }
.eng-obj-card:is([aria-labelledby="engObjCh17Title"], [aria-labelledby="engObjCh18Title"]) .eng-obj-stage:is(.is-view-split, .is-view-photo) .eng-real-photo { height: auto; max-height: none; }
.eng-obj-card:is([aria-labelledby="engObjCh17Title"], [aria-labelledby="engObjCh18Title"]) .eng-obj-stage:is(.is-view-split, .is-view-photo) .photo-img-wrap:hover .eng-real-photo { transform: none; }


/* B10：只調整製造全景與晶圓廠運作的既有元件。 */
.b10-physics-calc-modal .calc-title { color: #0f172a; }
.b10-physics-calc-modal .calc-badge { color: #0f766e; background: #ecfdf5; border-color: #99f6e4; }
.eng-obj-card[aria-labelledby="engObjCh00Title"] .journey-node:focus-visible { outline: 2px solid #0f766e; outline-offset: 3px; }
/* B10: explanations below photos can be pointed to and text-selected. */
.eng-obj-card[aria-labelledby="engObjCh00Title"] .eng-obj-photo-panel > .photo-hotspot-tooltip,
.eng-obj-card[aria-labelledby="engObjCh01Title"] .eng-obj-photo-panel > .photo-hotspot-tooltip { pointer-events: auto; }

.eng-obj-card[aria-labelledby="engObjCh01Title"] .ch01-model-controls { background: #ffffff !important; }
.eng-obj-card[aria-labelledby="engObjCh01Title"] .ch01-model-controls span { color: #334155 !important; }
.eng-obj-card:is([aria-labelledby="engObjCh00Title"], [aria-labelledby="engObjCh01Title"]) .eng-obj-stage.is-view-split { align-items: start; }
.eng-obj-card:is([aria-labelledby="engObjCh00Title"], [aria-labelledby="engObjCh01Title"]) .eng-obj-stage:is(.is-view-split, .is-view-photo) .photo-img-wrap { flex: none; min-height: 0; }
.eng-obj-card:is([aria-labelledby="engObjCh00Title"], [aria-labelledby="engObjCh01Title"]) .eng-obj-stage:is(.is-view-split, .is-view-photo) .eng-real-photo { height: auto; max-height: none; }
.eng-obj-card:is([aria-labelledby="engObjCh00Title"], [aria-labelledby="engObjCh01Title"]) .eng-obj-stage:is(.is-view-split, .is-view-photo) .photo-img-wrap:hover .eng-real-photo { transform: none; }

/* B10 CH01指定正文：手機保留水平閱讀，避免固定首欄遮住敘述。
   以本章特有標題限定範圍；異常段落包含既有插入的流程圖。
   2.15.0 範本段落整段收合後，表格位於「段首圖 + .section-fold」之內。 */
@media (max-width: 600px) {
  .article-body:has(#cleanroom-amhs-and-facility-clauses, #無塵室amhs與廠務條例總覽) :is(#cleanroom-amhs-and-facility-clauses, #quantitative-governing-laws-and-3d-process-windows, #failure-signatures-and-root-cause-diagnostics, #無塵室amhs與廠務條例總覽, #定量物理定律與3d製程視窗, #現場異常徵兆與跨站根因排查) + .chapter-figure + .section-fold > .table-container .semi-table,
  .article-body:has(#cleanroom-amhs-and-facility-clauses, #無塵室amhs與廠務條例總覽) :is(#failure-signatures-and-root-cause-diagnostics, #現場異常徵兆與跨站根因排查) + .chapter-figure + .section-fold > .table-container .semi-table { min-width: 960px; }
  .article-body:has(#cleanroom-amhs-and-facility-clauses, #無塵室amhs與廠務條例總覽) :is(#cleanroom-amhs-and-facility-clauses, #quantitative-governing-laws-and-3d-process-windows, #failure-signatures-and-root-cause-diagnostics, #無塵室amhs與廠務條例總覽, #定量物理定律與3d製程視窗, #現場異常徵兆與跨站根因排查) + .chapter-figure + .section-fold > .table-container .semi-table :is(th, td),
  .article-body:has(#cleanroom-amhs-and-facility-clauses, #無塵室amhs與廠務條例總覽) :is(#failure-signatures-and-root-cause-diagnostics, #現場異常徵兆與跨站根因排查) + .chapter-figure + .section-fold > .table-container .semi-table :is(th, td) { min-width: 210px; }
  .article-body:has(#cleanroom-amhs-and-facility-clauses, #無塵室amhs與廠務條例總覽) :is(#cleanroom-amhs-and-facility-clauses, #quantitative-governing-laws-and-3d-process-windows, #failure-signatures-and-root-cause-diagnostics, #無塵室amhs與廠務條例總覽, #定量物理定律與3d製程視窗, #現場異常徵兆與跨站根因排查) + .chapter-figure + .section-fold > .table-container .semi-table :is(th, td):first-child,
  .article-body:has(#cleanroom-amhs-and-facility-clauses, #無塵室amhs與廠務條例總覽) :is(#failure-signatures-and-root-cause-diagnostics, #現場異常徵兆與跨站根因排查) + .chapter-figure + .section-fold > .table-container .semi-table :is(th, td):first-child { position: static; box-shadow: none; }
}

/* Remaining chapters: retain the accepted light calculator title and badge. */
.finish-physics-calc-modal .calc-title { color: #0f172a; }
.finish-physics-calc-modal .calc-badge { color: #0f766e; background: #ecfdf5; border-color: #99f6e4; }

/* Remaining chapters: preserve full reference-photo geometry and keep explanations below pins. */
.eng-obj-card:is([aria-labelledby="engObjCh02Title"], [aria-labelledby="engObjCh03Title"], [aria-labelledby="engObjCh22Title"], [aria-labelledby="engObjCh23Title"], [aria-labelledby="engObjCh24Title"]) .eng-obj-stage.is-view-split { align-items: start; }
.eng-obj-card:is([aria-labelledby="engObjCh02Title"], [aria-labelledby="engObjCh03Title"], [aria-labelledby="engObjCh22Title"], [aria-labelledby="engObjCh23Title"], [aria-labelledby="engObjCh24Title"]) .eng-obj-stage:is(.is-view-split, .is-view-photo) .photo-img-wrap { flex: none; min-height: 0; }
.eng-obj-card:is([aria-labelledby="engObjCh02Title"], [aria-labelledby="engObjCh03Title"], [aria-labelledby="engObjCh22Title"], [aria-labelledby="engObjCh23Title"], [aria-labelledby="engObjCh24Title"]) .eng-obj-stage:is(.is-view-split, .is-view-photo) .eng-real-photo { height: auto; max-height: none; }
.eng-obj-card:is([aria-labelledby="engObjCh02Title"], [aria-labelledby="engObjCh03Title"], [aria-labelledby="engObjCh22Title"], [aria-labelledby="engObjCh23Title"], [aria-labelledby="engObjCh24Title"]) .eng-obj-stage:is(.is-view-split, .is-view-photo) .photo-img-wrap:hover .eng-real-photo { transform: none; }
.eng-obj-card:is([aria-labelledby="engObjCh02Title"], [aria-labelledby="engObjCh03Title"], [aria-labelledby="engObjCh22Title"], [aria-labelledby="engObjCh23Title"], [aria-labelledby="engObjCh24Title"]) .eng-obj-photo-panel > .photo-hotspot-tooltip { position: static; width: auto; max-width: none; transform: none; margin: 12px 16px 0; box-shadow: none; pointer-events: auto; }

/* Existing appendices: readable columns with keyboard-scrollable tables on narrow screens. */
@media (max-width: 600px) {
  .article-body:has(#engObjGlossaryTitle, #engObjJargonTitle, #engObjReadingTitle) > .table-container .semi-table, .article-body:has(#engObjGlossaryTitle, #engObjJargonTitle, #engObjReadingTitle) > .table-fold > .table-container .semi-table { min-width: 720px; }
  .article-body:has(#engObjGlossaryTitle, #engObjJargonTitle, #engObjReadingTitle) > .table-container .semi-table :is(th, td), .article-body:has(#engObjGlossaryTitle, #engObjJargonTitle, #engObjReadingTitle) > .table-fold > .table-container .semi-table :is(th, td) { min-width: 180px; }
  .article-body:has(#engObjGlossaryTitle, #engObjJargonTitle, #engObjReadingTitle) > .table-container .semi-table :is(th, td):first-child, .article-body:has(#engObjGlossaryTitle, #engObjJargonTitle, #engObjReadingTitle) > .table-fold > .table-container .semi-table :is(th, td):first-child { position: static; box-shadow: none; }
}

/* 2.35.0 附錄 B 行話表：手機寬改排成緊湊列表（Sam 2026-11-07 核可「只改行話表」）。
   同一張表只改顯示方式：表頭留作一行欄名說明；第 1、2 欄排同一行，其餘欄往下排；列與列之間用細線分隔。
   文字不變，也不必左右捲。桌機與列印仍是表格；改 display 後的表格角色由 section-diagrams.js 的 compactTables 補上。
   選擇器沿用上方附錄規則的 :has() 範圍且權重較高，該規則（含列印時的最小寬度）本身不動。 */
@media screen and (max-width: 600px) {
  .article-body:has(#engObjJargonTitle) > .table-container.table-compact { overflow: visible; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  .article-body:has(#engObjJargonTitle) > .table-container.table-compact .semi-table { display: block; width: 100%; min-width: 0; }
  .article-body:has(#engObjJargonTitle) > .table-container.table-compact .semi-table :is(thead, tbody, tr, th, td) { display: block; min-width: 0; position: static; box-shadow: none; }
  .article-body:has(#engObjJargonTitle) > .table-container.table-compact .semi-table thead tr { display: flex; flex-wrap: wrap; row-gap: 2px; padding: 0 2px 8px; }
  .article-body:has(#engObjJargonTitle) > .table-container.table-compact .semi-table thead th { padding: 0 8px; border: 0; background: none; font-size: 13px; line-height: 1.5; font-weight: 650; color: var(--text-muted); }
  .article-body:has(#engObjJargonTitle) > .table-container.table-compact .semi-table thead th:first-child { padding-left: 0; }
  .article-body:has(#engObjJargonTitle) > .table-container.table-compact .semi-table thead th + th { border-left: 1px solid var(--border-subtle); }
  .article-body:has(#engObjJargonTitle) > .table-container.table-compact .semi-table tbody tr { padding: 8px 2px; border-bottom: 1px solid var(--border-subtle); }
  .article-body:has(#engObjJargonTitle) > .table-container.table-compact .semi-table tbody td { padding: 0; border: 0; background: none; }
  .article-body:has(#engObjJargonTitle) > .table-container.table-compact .semi-table tbody td:first-child { display: inline; margin-right: 8px; font-weight: 650; color: var(--text-main); }
  .article-body:has(#engObjJargonTitle) > .table-container.table-compact .semi-table tbody td:nth-child(2) { display: inline; }
  .article-body:has(#engObjJargonTitle) > .table-container.table-compact .semi-table tbody td:nth-child(n+3) { margin-top: 2px; }
  .article-body:has(#engObjJargonTitle) > .table-container.table-compact .semi-table tbody td:nth-child(n+3):last-child { font-size: 14px; }
}

/* Remaining chapters: remove nonsemantic decoration that crosses labels; retain all model graphics and controls. */
.eng-obj-card:is([aria-labelledby="engObjCh02Title"], [aria-labelledby="engObjCh03Title"], [aria-labelledby="engObjCh22Title"], [aria-labelledby="engObjCh23Title"], [aria-labelledby="engObjCh24Title"], [aria-labelledby="engObjGlossaryTitle"], [aria-labelledby="engObjJargonTitle"], [aria-labelledby="engObjReadingTitle"]) :is(.eng-kinetic-overlay, .eng-kinetic-wave) { display: none; }
