/* ============================================================
   / page — 2026 redesign (catalog + detail pages)
   Namespace: .bx-* to coexist with the legacy .b-* in beauty.css
   ============================================================ */

:root {
  /* Bridge legacy --bx-* tokens to the white/neutral tool palette in main.css.
   * Most templates reference these; aliasing avoids ~600 sed replacements. */
  --bx-accent:       var(--accent);
  --bx-accent-soft:  var(--accent-soft);
  --bx-accent-rim:   var(--accent-rim);
  --bx-accent-text:  var(--accent-text);
  --bx-edit-fg:      var(--accent-2);
  --bx-edit-bg:      var(--accent-2-soft);
  --bx-edit-rim:     var(--accent-2-rim);
  --bx-line:         var(--border);
  --bx-card-bg:      var(--surface);
  --bx-fg:           var(--text);
  --bx-fg-dim:       var(--text-muted);
  --bx-topbar-h:     56px;
  --bx-max:          960px;
  --bx-max-prose:    680px;
  --bx-pad:          24px;
  /* Use the new mono token */
  --bx-mono: var(--font-mono);
}

html { scroll-padding-top: calc(var(--bx-topbar-h) + 16px); }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.bx-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
}

/* Bottom-nav: stay fixed but pinned to viewport BOTTOM (override global top:0) */
.bx-body nav.bx-bottom-nav {
  top: auto;
  bottom: 0;
}

.bx-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;
}
.bx-sr-only:focus {
  position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto;
  padding: 8px 12px; background: var(--bx-accent); color: #fff; border-radius: 8px;
  z-index: 1000;
}

/* ─── Top bar ──────────────────────────────────────────────── */
.bx-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: var(--bx-topbar-h);
  padding: 0 var(--bx-pad);
  padding-top: env(safe-area-inset-top, 0);
  background: var(--bar-bg);
  backdrop-filter: saturate(110%) blur(8px);
  -webkit-backdrop-filter: saturate(110%) blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
}
.bx-brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  letter-spacing: -0.2px;
}
.bx-brand:hover { color: var(--text); }
.bx-brand-mark {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 0;
}
.bx-brand-text { display: inline-flex; align-items: baseline; gap: 10px; }
.bx-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.4px;
  color: var(--text);
}
.bx-brand-sub {
  font-weight: 500;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0;
}
@media (max-width: 520px) {
  .bx-brand-sub { display: none; }
}

.bx-topnav { margin-left: auto; display: flex; gap: 4px; }
.bx-topnav-link {
  display: inline-flex; align-items: center; height: 32px;
  padding: 0 12px; border-radius: 999px;
  color: var(--text-secondary); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.bx-topnav-link:hover { background: var(--surface2); color: var(--accent); }
/* Active section (skinvest-direction): rose + bold, no pill fill */
.bx-topnav-link[aria-current="page"] { color: var(--accent); font-weight: 600; }
.bx-topnav-dd-item[aria-current="page"] { color: var(--accent); font-weight: 600; }
.bx-topnav-link--brand {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
}
.bx-topnav-link--brand:hover { background: var(--accent-soft); color: var(--accent-text); }
.bx-topnav-link--icon { padding: 0 9px; gap: 0; }
.bx-topnav-link--icon svg { display: block; }

/* Dark-mode toggle button — reset native <button> chrome, swap sun/moon icon */
.bx-theme-toggle {
  background: none; border: none; cursor: pointer;
  font: inherit; color: var(--text-secondary);
}
/* More specific than `.bx-topnav-link--icon svg { display:block }` (0,1,1). */
.bx-theme-toggle .bx-theme-moon { display: none; }
:root[data-theme="dark"] .bx-theme-toggle .bx-theme-sun  { display: none; }
:root[data-theme="dark"] .bx-theme-toggle .bx-theme-moon { display: block; }

/* ─── Main container ──────────────────────────────────────── */
.bx-main {
  max-width: var(--bx-max);
  margin: 0 auto;
  padding: calc(var(--bx-topbar-h) + 40px) var(--bx-pad) 80px;
  outline: none;
}

/* ─── Hero — left-aligned ─────────────────────────────────── */
.bx-hero {
  padding: 56px 0 72px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 64px;
}
.bx-hero-title {
  margin: 0 0 28px;
  font-family: var(--font-display);
  font-size: clamp(32px, 5.4vw, 54px);
  line-height: 1.1;
  letter-spacing: -1px;
  font-weight: 600;
  color: var(--text);
  max-width: 20ch;
}
.bx-hero-sub {
  margin: 0;
  max-width: 58ch;
  font-size: 19px;
  line-height: 1.65;
  color: var(--text-secondary);
}
.bx-hero-sub strong {
  color: var(--text);
  font-weight: 600;
}

.bx-inline-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-rim);
  transition: opacity 0.18s;
}
.bx-inline-link:hover { opacity: 0.72; }

/* Above-the-fold compliance banner on /t/* /compare/* /programs/* pages.
   Kept visually quiet but unmissable; signals editorial-not-clinical
   position before readers see brand-named content. */
.bx-compliance-banner {
  margin: 24px 0 32px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.bx-compliance-banner strong { color: var(--text); }

/* ─── Section ─────────────────────────────────────────────── */
/* First home section ("如果你也在想這些") — visually grouped with hero as the
   lead layer, distinct from the catalog section below. Compresses the gap to
   hero so readers parse it as a continuation, not catalog navigation. */
.bx-section--stance {
  margin-top: -16px;
  padding-top: 24px;
}
.bx-section--stance + .bx-section {
  border-top: 1px solid var(--border);
  padding-top: 32px;
  margin-top: 56px;
}

.bx-section {
  margin: 48px 0;
}
.bx-section-head {
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.bx-section-title {
  display: flex; align-items: baseline; gap: 14px;
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text);
}
.bx-section-sub {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ─── Category nav (sticky-ish chips row) ──────────────────── */
.bx-cat-nav {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 32px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.bx-cat-nav-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid transparent;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12.5px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.bx-cat-nav-link:hover {
  background: var(--bx-accent-soft);
  color: var(--bx-accent-text);
  border-color: var(--bx-accent-rim);
}
.bx-cat-nav-code {
  font-family: var(--bx-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--bx-accent);
  padding: 1px 5px;
  background: var(--bx-accent-soft);
  border-radius: 3px;
}
.bx-cat-nav-count {
  font-family: var(--bx-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface3);
  padding: 1px 6px;
  border-radius: 999px;
}

/* ─── Category block ───────────────────────────────────────── */
.bx-cat {
  margin: 48px 0;
  scroll-margin-top: calc(var(--bx-topbar-h) + 24px);
}
.bx-cat-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.bx-cat-num {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 1;
  line-height: 1;
  padding-top: 8px;
}
.bx-cat-titles { display: block; min-width: 0; }
.bx-cat-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 3px 7px;
  border-radius: 2px;
  margin-bottom: 6px;
}
.bx-cat-name {
  display: block;
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}
.bx-cat-name-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}
.bx-cat-name-link:hover {
  color: var(--accent);
}
.bx-cat-blurb {
  display: block;
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.bx-cat-count,
.bx-section-count {
  font-family: var(--bx-mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text-secondary);
}
.bx-section-count { margin-left: 10px; vertical-align: middle; }
@media (max-width: 560px) {
  .bx-cat-head { grid-template-columns: 1fr auto; gap: 12px; }
}

/* ─── Collapsible category (home only) ─────────────────────── */
details.bx-cat > summary.bx-cat-head {
  cursor: pointer;
  list-style: none;
  user-select: none;
  grid-template-columns: 56px 1fr auto 18px;
  transition: border-color 0.15s;
}
details.bx-cat > summary.bx-cat-head::-webkit-details-marker { display: none; }
details.bx-cat > summary.bx-cat-head::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.18s ease;
  justify-self: center;
  align-self: center;
}
details.bx-cat[open] > summary.bx-cat-head::after {
  transform: rotate(-135deg) translateY(-3px);
}
details.bx-cat > summary.bx-cat-head:hover .bx-cat-name { color: var(--accent); }
details.bx-cat > summary.bx-cat-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
/* ─── §02 完整目錄 · sticky mini-TOC（catalog section 內 stick，外 unstick） ─── */
.bx-cat-toc {
  position: sticky;
  top: calc(var(--bx-topbar-h) + 4px);
  z-index: 5;
  margin: 8px 0 24px;
  padding: 6px 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.bx-cat-toc-link {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.bx-cat-toc-link:hover {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent-rim);
  text-decoration: none;
}
.bx-cat-toc-tag {
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
}
@media (max-width: 560px) {
  .bx-cat-toc { gap: 4px; margin-bottom: 18px; }
  .bx-cat-toc-link { font-size: 11.5px; padding: 4px 9px; }
}

/* ─── 困擾分群 cluster headers（A sub-block 內，4 個 cluster × 21 個 concern） ─── */
.bx-cluster {
  margin-top: 28px;
}
.bx-cluster:first-of-type {
  margin-top: 18px;
}
.bx-cluster-h {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
  font-weight: 500;
}
.bx-cluster-code {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}
.bx-cluster-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.15px;
}
.bx-cluster-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.bx-cluster-note {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 60ch;
}

/* ─── §02 完整目錄 · sub-block headers + category 入口卡 grid ───
 * Used only on the home page inside the unified catalog section.
 * Two sub-blocks (A 從困擾 / B 從機制) share .bx-cat-block; the latter
 * uses .bx-grid--catindex for 14 category 入口卡 (replaces the old
 * collapsed 14-details treatment list). */
.bx-cat-block {
  margin-top: 48px;
  scroll-margin-top: calc(var(--bx-topbar-h) + 24px);
}
.bx-cat-block:first-of-type { margin-top: 32px; }
.bx-cat-block-h {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.2px;
  color: var(--text);
}
.bx-cat-block-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-rim);
  padding: 2px 8px;
  border-radius: 3px;
  vertical-align: middle;
}
.bx-cat-block-name { color: var(--text); }
.bx-cat-block-count {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.bx-cat-block-note {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 60ch;
}
.bx-cat-block-cta {
  margin: 20px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.bx-cat-block-cta a { color: var(--accent); border-bottom: 1px solid var(--accent-rim); padding-bottom: 1px; }
.bx-cat-block-cta a:hover { border-bottom-color: var(--accent); text-decoration: none; }
.bx-cat-block-sep { opacity: 0.45; margin: 0 4px; }

/* 14 category 入口卡 grid（B sub-block）— desktop 2-col × 7 列、mobile 1-col。
 * 14 不是 3 或 4 的整數倍，會在 auto-fill 下出現尾排孤兒；改 2-col 對稱。 */
.bx-grid--catindex {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.bx-card--catindex {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s var(--ease-apple),
              box-shadow 0.18s var(--ease-apple),
              transform 0.18s var(--ease-apple);
}
.bx-card--catindex:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
}
@media (prefers-reduced-motion: reduce) {
  .bx-card--catindex:hover { transform: none; }
}
.bx-card-catindex-head {
  display: flex; align-items: baseline; gap: 8px;
  min-width: 0;
}
.bx-card-catindex-code {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 2px;
  flex-shrink: 0;
}
.bx-card-catindex-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.2px;
}
.bx-card-catindex-blurb {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.bx-card-catindex-foot {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}
.bx-card-catindex-count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.bx-card-catindex-arrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  transition: transform 0.18s;
}
.bx-card--catindex:hover .bx-card-catindex-arrow { transform: translateX(2px); }
@media (max-width: 720px) {
  .bx-cat-block { margin-top: 36px; }
  .bx-cat-block-h { font-size: 19px; }
  .bx-grid--catindex { grid-template-columns: 1fr; gap: 8px; }
}

/* ─── §02.5 居家基礎（非醫療，accent-2 綠系做區分）─── */
/* explainer block：為什麼是 30 前 */
.bx-homecare-why {
  margin: 20px 0 28px;
  padding: 18px 20px 14px;
  background: var(--accent-2-soft);
  border: 1px solid var(--accent-2-rim);
  border-radius: 4px;
}
.bx-homecare-why-h {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--accent-2);
}
.bx-homecare-why-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bx-homecare-why-list > li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 10px 0 0;
  border-top: 1px solid var(--accent-2-rim);
}
.bx-homecare-why-list > li:first-child { border-top: 0; padding-top: 0; }
.bx-homecare-why-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-2);
}
.bx-homecare-why-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}
.bx-homecare-why-body strong { color: var(--text); font-weight: 600; }

/* 4 大支柱 card grid */
.bx-homecare-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}
.bx-homecare-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.bx-homecare-card:hover {
  border-color: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px -8px var(--accent-2-rim);
}
.bx-homecare-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent-2);
}
.bx-homecare-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.bx-homecare-thesis {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent-2-text, var(--accent-2));
  line-height: 1.5;
}
.bx-homecare-bullets {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
}
.bx-homecare-bullets li { padding-left: 10px; position: relative; }
.bx-homecare-bullets li::before {
  content: "";
  position: absolute; left: 0; top: 9px;
  width: 4px; height: 1px;
  background: var(--accent-2);
}
.bx-homecare-go {
  margin-top: auto;
  padding-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  border-top: 1px dashed var(--accent-2-rim);
}

@media (max-width: 720px) {
  .bx-homecare-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 420px) {
  .bx-homecare-grid { grid-template-columns: 1fr; }
  .bx-homecare-why { padding: 16px 14px 12px; }
  .bx-homecare-why-list > li { grid-template-columns: 28px 1fr; gap: 8px; }
  .bx-homecare-card { padding: 16px 14px 14px; }
}

/* ─── Home-care index：4+4 分組與順序依賴 ───────────────────────── */
.bx-hc-block {
  max-width: var(--bx-max);
  margin: 0 auto 44px;
  padding: 0 var(--bx-pad);
}
.bx-hc-block-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.bx-hc-block-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: var(--accent-2-soft);
  border: 1px solid var(--accent-2-rim);
  padding: 4px 9px;
  border-radius: 2px;
  margin-bottom: 10px;
}
.bx-hc-block--bonus .bx-hc-block-tag {
  color: var(--text-muted);
  background: var(--surface2);
  border-color: var(--border);
}
/* onboarding = 起手式，比 base 更搶眼（強烈鼓勵新手點） */
.bx-hc-block--onboarding .bx-hc-block-tag {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-rim);
}
/* framework = 查找決策頁，比 bonus 中性、可區分 */
.bx-hc-block--framework .bx-hc-block-tag {
  color: var(--text-muted);
  background: transparent;
  border-color: var(--border-hover);
  border-style: dashed;
}
/* conditions = 特殊膚況軸，與外觀困擾型 concerns 並列 */
.bx-hc-block--conditions .bx-hc-block-tag {
  color: var(--accent-2);
  background: var(--accent-2-soft);
  border-color: var(--accent-2-rim);
}
.bx-hc-block-foot {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}
.bx-hc-block-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.bx-hc-block-sub {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.65;
}

.bx-hc-seq {
  max-width: var(--bx-max);
  margin: 0 auto 56px;
  padding: 28px var(--bx-pad) 8px;
  border-top: 1px solid var(--border);
}
.bx-hc-seq-h {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.bx-hc-seq-list {
  list-style: none;
  counter-reset: seq;
  margin: 0;
  padding: 0;
}
.bx-hc-seq-list > li {
  counter-increment: seq;
  position: relative;
  padding: 14px 0 14px 48px;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.bx-hc-seq-list > li::before {
  content: counter(seq, decimal-leading-zero);
  position: absolute;
  left: 0; top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-2);
}
.bx-hc-seq-list > li:last-child { border-bottom: 0; }
.bx-hc-seq-list strong {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 560px) {
  .bx-hc-seq-list > li { padding-left: 36px; font-size: 14px; }
  .bx-hc-block-title, .bx-hc-seq-h { font-size: 19px; }
}

/* ─── Grid + Cards ─────────────────────────────────────────── */
.bx-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.bx-grid--concerns { grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); }
.bx-grid--related  { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.bx-card {
  display: flex; gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.18s var(--ease-apple),
              box-shadow 0.18s var(--ease-apple),
              transform 0.18s var(--ease-apple);
  position: relative;
}
.bx-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text);
}
@media (prefers-reduced-motion: reduce) {
  .bx-card:hover { transform: none; }
}
/* Numerical mark for concern cards — quiet muted index; accent lives in the
   role/count chips instead, to keep the dense catalog from reading as rose dots */
.bx-card-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  opacity: 1;
  flex-shrink: 0;
  min-width: 28px;
  padding-top: 3px;
}

/* Category code badge for treatment cards (RF / HIFU / LSR / ...) */
.bx-card-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.bx-card-title {
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: -0.2px;
}
.bx-card-en {
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.bx-card-tagline {
  margin-top: 5px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.62;
}
.bx-card-meta {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 8px;
}
/* Don't reserve layout space when a card has no meta chips (e.g. concern
   cards without a 居家方案 chip) — avoids uneven card heights. */
.bx-card-meta:empty { display: none; }
.bx-card--mini { padding: 14px 16px; gap: 12px; }
.bx-card--mini .bx-card-num { font-size: 12px; min-width: 24px; }

/* 首頁問句卡 — 比 21 困擾卡標題更重、破題加重 */
.bx-card--question {
  border-color: var(--border);
}
.bx-card--question:hover {
  border-color: var(--accent-rim);
  background: var(--accent-soft);
}
.bx-card--question .bx-card-num {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.bx-card--question .bx-card-title {
  font-size: 17px;
  line-height: 1.4;
}
.bx-card--question .bx-card-tagline {
  font-size: 13.5px;
  color: var(--text-secondary);
}
.bx-card--question .bx-card-tagline strong {
  color: var(--accent);
  font-weight: 600;
}
.bx-card--mini .bx-card-title { font-size: 15px; }

.bx-chip {
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  font-size: 11.5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
}
.bx-chip--count { color: var(--accent); border-color: var(--accent-rim); background: var(--accent-soft); font-family: var(--font-mono); }
.bx-chip--home { color: var(--accent-2); border-color: var(--accent-2-rim); background: var(--accent-2-soft); }
.bx-chip--role {
  display: inline-block;
  align-self: flex-start;
  margin: 0 0 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-text);
  background: var(--accent-soft);
  border: 1px solid var(--accent-rim);
  border-radius: 3px;
}
.bx-chip--cat { background: var(--accent-soft); border-color: var(--accent-rim); color: var(--accent-text); text-decoration: none; }
a.bx-chip:hover { text-decoration: none; border-color: var(--accent-rim); color: var(--accent); }

/* ============================================================
   Detail page (treatment / concern)
   ============================================================ */
.bx-detail { max-width: var(--bx-max-prose); }

.bx-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.bx-bc-link { color: var(--text-secondary); text-decoration: none; }
.bx-bc-link:hover { color: var(--bx-accent-text); }
.bx-bc-sep { color: var(--text-muted); opacity: 0.7; }
.bx-bc-cur { color: var(--text); font-weight: 500; }

.bx-d-header {
  display: block;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.bx-d-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12.5px;
  letter-spacing: 0;
  color: var(--text-muted);
}
.bx-d-mark-label {
  color: var(--text-muted);
}
.bx-d-titles { min-width: 0; }
.bx-d-name {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(26px, 4.5vw, 36px);
  font-weight: 500;
  letter-spacing: -0.6px;
  line-height: 1.15;
  color: var(--text);
}
.bx-d-name-en {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0;
}
.bx-d-tagline {
  margin: 0;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
}
.bx-d-tagline--wide { max-width: 60ch; }
.bx-d-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 18px;
}

/* ─── Home-care 6 層光譜對應 badge（顯示在每篇 home-care guide 頂部）── */
.bx-layer-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  margin: 0 0 28px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px dashed var(--border-hover);
  border-radius: 10px;
}
.bx-layer-badges-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.bx-layer-badges-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.bx-layer-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 9px;
  background: var(--accent-2-soft);
  border: 1px solid var(--accent-2-rim);
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
}
.bx-layer-badge-num {
  font-weight: 600;
  color: var(--accent-2);
  white-space: nowrap;
}
.bx-layer-badge-mech {
  color: var(--text-muted);
}
.bx-layer-badges-link {
  margin-left: auto;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.bx-layer-badges-link:hover { text-decoration: underline; }
@media (max-width: 560px) {
  .bx-layer-badges { flex-direction: column; align-items: flex-start; }
  .bx-layer-badges-link { margin-left: 0; }
}

/* ─── In-page TOC strip ───────────────────────────────────── */
.bx-toc {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 40px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
@media (max-width: 1024px) {
  .bx-toc { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 700px) {
  .bx-toc { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .bx-toc { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Category prev/next pair nav ─────────────────────── */
.bx-cat-nav-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
  margin: 32px 0;
}
.bx-cat-pair-link {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.bx-cat-pair-link:hover {
  border-color: var(--bx-accent-rim);
  background: var(--surface2);
}
.bx-cat-pair-prev  { justify-content: flex-start; }
.bx-cat-pair-next  { justify-content: flex-end; text-align: right; }
.bx-cat-pair-home  { background: transparent; border-style: dashed; }
.bx-cat-pair-arrow {
  font-size: 18px;
  color: var(--bx-accent);
  opacity: 0.7;
}
.bx-cat-pair-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bx-cat-pair-label {
  font-family: var(--bx-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.bx-cat-pair-name { font-size: 15px; font-weight: 600; }
@media (max-width: 720px) {
  .bx-cat-nav-pair { grid-template-columns: 1fr; gap: 8px; }
  .bx-cat-pair-next { justify-content: flex-start; text-align: left; }
}

/* ─── Tool cross-link strip (detail pages) ─────────────── */
.bx-tool-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: 40px 0 32px;
  padding: 16px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-rim);
  border-radius: 4px;
}
.bx-tool-strip-prompt {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-text);
  flex-shrink: 0;
}
.bx-tool-strip-link {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.bx-tool-strip-link:hover {
  border-color: var(--accent);
  background: var(--surface);
  color: var(--accent);
}
.bx-tool-strip-link--primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.bx-tool-strip-link--primary:hover {
  background: var(--accent-text);
  border-color: var(--accent-text);
  color: var(--bg);
}

/* ─── Topnav dropdowns + Mobile bottom-nav ─────────────── */

/* Reset <details> default markers */
.bx-topnav-menu { position: relative; }
.bx-topnav-menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.bx-topnav-menu > summary::-webkit-details-marker { display: none; }
.bx-topnav-menu > summary::marker { content: ''; }

.bx-topnav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 60;
  box-shadow: 0 8px 24px rgba(26, 22, 19, 0.12);
}
.bx-topnav-dd-item {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 13.5px;
  transition: background 0.15s, color 0.15s;
}
.bx-topnav-dd-item:hover {
  background: var(--accent-soft);
  color: var(--accent-text);
  text-decoration: none;
}
.bx-topnav-dd-group {
  margin-top: 12px;
  padding: 4px 12px 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.bx-topnav-dd-group:first-child { margin-top: 0; border-top: 0; }

/* Close dropdown when clicking outside (handled via auto-close JS in topbar) */

/* Mobile bottom navigation */
.bx-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 45;
  height: 60px;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: var(--bar-bg);
  backdrop-filter: saturate(110%) blur(10px);
  -webkit-backdrop-filter: saturate(110%) blur(10px);
  border-top: 1px solid var(--border);
}
.bx-bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  position: relative;
}
.bx-bnav-item:hover, .bx-bnav-item:active {
  color: var(--accent);
}
.bx-bnav-item svg { opacity: 0.85; }
.bx-bnav-item:hover svg, .bx-bnav-item:active svg { opacity: 1; }
.bx-bnav-item.is-active { color: var(--accent); font-weight: 600; }
.bx-bnav-item.is-active svg { opacity: 1; }

@media (max-width: 720px) {
  .bx-bottom-nav { display: flex; }
  /* Keep dropdown reachable on mobile too */
  .bx-topnav { gap: 2px; }
  /* WCAG 2.5.5 touch target: 44×44 minimum on mobile */
  .bx-topnav-link { padding: 0 10px; font-size: 12.5px; min-height: 44px; }
  .bx-bnav-item { min-height: 44px; }
  /* Mobile: the bottom-nav is the single source of section nav; the topbar
     carries only brand + 更多 + search. One shared class so this can't
     silently rot when an href changes (replaces old stale [href="/#…"] hacks). */
  .bx-topnav-link--section { display: none; }
  /* Add bottom padding to main so content doesn't hide behind bottom-nav */
  .bx-main { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0)); }
}

/* ─── Compatibility Matrix ─────────────────────────────── */
.bx-compat-legend {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.bx-compat-chip {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
/* Brand-harmonised, AA-contrast (dark text on faint tint) — replaces the
   old dark-theme neon palette that rendered as low-contrast pastels on white. */
.bx-compat-green  { background: rgba(47, 110, 78, 0.10);  color: #2F6E4E; border: 1px solid rgba(47, 110, 78, 0.22); }
.bx-compat-amber  { background: rgba(138, 103, 0, 0.10);  color: #8A6700; border: 1px solid rgba(138, 103, 0, 0.22); }
.bx-compat-orange { background: rgba(176, 86, 14, 0.10);  color: #B0560E; border: 1px solid rgba(176, 86, 14, 0.22); }
.bx-compat-red    { background: rgba(192, 58, 43, 0.10);  color: #C03A2B; border: 1px solid rgba(192, 58, 43, 0.22); }

.bx-compat-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.bx-compat-table {
  border-collapse: collapse;
  font-size: 11.5px;
  width: 100%;
  min-width: 1000px;
}
.bx-compat-corner {
  font-family: var(--bx-mono);
  font-size: 10px;
  color: var(--text-muted);
  padding: 8px;
  background: var(--surface);
  position: sticky; left: 0; z-index: 2;
  text-align: center;
  letter-spacing: 0.3px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.bx-compat-header {
  background: var(--surface2);
  color: var(--text);
  font-weight: 600;
  padding: 10px 8px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.bx-compat-header--col {
  vertical-align: bottom;
}
.bx-compat-header--col span {
  display: inline-block;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.05em;
}
.bx-compat-header--row {
  text-align: right;
  position: sticky; left: 0; z-index: 1;
  border-right: 1px solid var(--border);
}
.bx-compat-cell {
  padding: 6px 8px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  min-width: 70px;
  vertical-align: top;
}
.bx-compat-cell.bx-compat-same {
  opacity: 0.45;
}
.bx-compat-label { display: block; font-weight: 600; font-size: 11px; }
.bx-compat-note {
  display: block;
  font-size: 9.5px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.3;
  white-space: normal;
}

/* ─── Inline SVG diagrams ─────────────────────────────── */
.bx-svg {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  margin: 24px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-sizing: border-box;
}
.bx-svg-caption {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin: -12px 0 24px;
  font-family: var(--bx-mono);
  letter-spacing: 0.4px;
}

/* ─── Wizard ───────────────────────────────────────────── */
/* Risk-population gate aside shown before every wizard */
.bx-wiz-gate {
  max-width: var(--bx-max-prose);
  margin: 24px auto 8px;
  padding: 16px 18px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-rim);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
}
.bx-wiz-gate-h {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-text);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.bx-wiz-gate-body {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
}
.bx-wiz-gate-list {
  margin: 0;
  padding-left: 1.4em;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
}
.bx-wiz-gate-list li { margin: 4px 0; }
.bx-wiz-gate-list strong { color: var(--text); }
.bx-wiz-gate-list a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.bx-wiz {
  max-width: var(--bx-max-prose);
  margin: 32px auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.bx-wiz-progress {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 28px;
  font-family: var(--bx-mono); font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.bx-wiz-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  overflow: hidden;
}
.bx-wiz-progress-fill {
  height: 100%;
  background: var(--bx-accent);
  transition: width 0.3s ease;
}
.bx-wiz-step, .bx-wiz-step-label { white-space: nowrap; }

.bx-wiz-q-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.4;
  color: var(--text);
}
.bx-wiz-q-hint {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
}
/* Disclaimer appended to wizard outcome (injected by wizard.js) */
.bx-wiz-disclaimer { margin-top: 24px; font-size: 13px; }
.bx-wiz-options {
  display: flex; flex-direction: column; gap: 10px;
}
.bx-wiz-option {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.6;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.bx-wiz-option:hover {
  border-color: var(--bx-accent-rim);
  background: var(--surface2);
  transform: translateY(-1px);
}
.bx-wiz-option-letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--bx-accent-soft);
  color: var(--bx-accent);
  border-radius: 8px;
  font-family: var(--bx-mono);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.bx-wiz-option:hover .bx-wiz-option-letter {
  background: var(--bx-accent);
  color: var(--bg);
}
.bx-wiz-option-label { flex: 1; }

.bx-wiz-outcome-head {
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.bx-wiz-outcome-badge {
  display: inline-block;
  font-family: var(--bx-mono);
  font-size: 10.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  background: var(--bx-accent-soft);
  color: var(--bx-accent);
  padding: 3px 9px;
  border-radius: 3px;
  margin-bottom: 16px;
}
.bx-wiz-outcome-title {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.25;
  color: var(--text);
}
.bx-wiz-outcome-summary {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

.bx-wiz-controls {
  display: flex; gap: 12px; justify-content: flex-end;
  margin-top: 24px;
}
.bx-wiz-back {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.bx-wiz-back:hover {
  border-color: var(--bx-accent-rim);
  color: var(--text);
}

/* ─── Compare Tool ─────────────────────────────────────── */
.bx-ct-picker { margin-bottom: 48px; }
.bx-ct-filter {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  position: sticky; top: calc(var(--bx-topbar-h) + 8px); z-index: 10;
}
.bx-ct-filter .bx-search-input { height: 36px; font-size: 13px; }
.bx-ct-status {
  font-family: var(--bx-mono); font-size: 12px;
  color: var(--text-muted); flex-shrink: 0;
}
.bx-ct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}
.bx-ct-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.bx-ct-card:hover {
  border-color: var(--bx-accent-rim);
  background: var(--surface2);
}
.bx-ct-card.is-selected {
  border-color: var(--bx-accent);
  background: var(--bx-accent-soft);
}
.bx-ct-card.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.bx-ct-card-check {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--bx-accent);
  flex-shrink: 0;
  margin-top: 2px;
}
.bx-ct-card.is-selected .bx-ct-card-check {
  background: var(--bx-accent);
  color: var(--bg);
  border-color: var(--bx-accent);
}
.bx-ct-card-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.bx-ct-card-title { font-weight: 600; font-size: 14px; }
.bx-ct-card-en { font-size: 11.5px; color: var(--text-muted); }
.bx-ct-card-meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 4px;
  font-size: 11.5px;
}
.bx-ct-card-cat {
  background: var(--surface2);
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--text-secondary);
}
.bx-ct-card-price {
  font-family: var(--bx-mono);
  color: var(--text-muted);
}

.bx-ct-compare { padding-top: 24px; border-top: 1px solid var(--border); }
.bx-ct-table-wrap { overflow-x: auto; margin-top: 16px; }
.bx-ct-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.bx-ct-table th, .bx-ct-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}
.bx-ct-table thead th {
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  border-bottom: 2px solid var(--bx-accent-rim);
  position: sticky; top: 0;
}
.bx-ct-table tbody th {
  background: var(--surface);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.3px;
  width: 110px;
  white-space: nowrap;
}
.bx-ct-table tbody tr:hover td,
.bx-ct-table tbody tr:hover th { background: var(--surface2); }
.bx-ct-link {
  color: var(--bx-accent-text);
  text-decoration: none;
  font-weight: 600;
}
.bx-ct-link:hover { text-decoration: underline; }

/* ─── Search page ─────────────────────────────────────── */
.bx-search-hero { padding: 24px 0 32px; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.bx-search-title {
  margin: 0 0 24px;
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.8px;
}
.bx-search-form {
  display: flex; gap: 8px;
  max-width: 720px;
}
.bx-search-input {
  flex: 1;
  height: 44px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.bx-search-input:focus {
  border-color: var(--bx-accent-rim);
  background: var(--surface2);
}
.bx-search-input::placeholder { color: var(--text-muted); }
.bx-search-btn {
  padding: 0 24px;
  height: 44px;
  background: var(--bx-accent);
  border: 0;
  border-radius: 8px;
  color: var(--bg);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.bx-search-btn:hover { opacity: 0.85; }
.bx-search-meta {
  margin: 20px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}
.bx-search-meta strong { color: var(--bx-accent-text); }

.bx-search-empty {
  padding: 32px 0;
  color: var(--text-secondary);
}
.bx-search-empty ul { margin: 12px 0; padding-left: 24px; }
.bx-search-empty li { margin: 4px 0; }

.bx-search-results { list-style: none; padding: 0; margin: 0; }
.bx-search-result { margin-bottom: 4px; }
.bx-search-result-link {
  display: block;
  padding: 18px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.bx-search-result-link:hover {
  border-color: var(--bx-accent-rim);
  background: var(--surface);
}
.bx-search-result-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.bx-search-result-section {
  font-family: var(--bx-mono);
  font-size: 10.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--bx-accent);
  background: var(--bx-accent-soft);
  padding: 2px 7px;
  border-radius: 3px;
  flex-shrink: 0;
}
.bx-search-result-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
}
.bx-search-result-sub {
  margin: 0 0 6px;
  color: var(--text-secondary);
  font-size: 13.5px;
}
.bx-search-result-snippet {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}
.bx-search-result-url {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 11.5px;
  font-family: var(--bx-mono);
  opacity: 0.6;
}

/* Sticky right-side mini TOC for long detail pages.
 * Hidden on narrow viewports; the horizontal top TOC handles mobile.
 * Only shows when viewport has space (>= 1280px). */
.bx-toc-stick {
  position: fixed;
  top: calc(var(--bx-topbar-h) + 32px);
  right: 16px;
  width: 180px;
  z-index: 30;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  max-height: calc(100vh - var(--bx-topbar-h) - 80px);
  overflow-y: auto;
}
.bx-toc-stick-head {
  font-family: var(--bx-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 10px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.bx-toc-stick-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 12.5px;
  transition: background 0.15s, color 0.15s;
}
.bx-toc-stick-item:hover {
  background: var(--surface2);
  color: var(--text);
}
.bx-toc-stick-item.is-active {
  background: var(--bx-accent-soft);
  color: var(--bx-accent-text);
  border-left: 2px solid var(--bx-accent);
  padding-left: 8px;
}
.bx-toc-stick-num {
  font-size: 10.5px;
  color: var(--text-muted);
  opacity: 0.7;
  flex-shrink: 0;
}
.bx-toc-stick-item--empty .bx-toc-stick-num { opacity: 0.35; }
.bx-toc-stick-item--empty { color: var(--text-muted); }

@media (min-width: 1280px) {
  .bx-toc-stick { display: flex; }
}

/* FAQ TOC: single column, longer question text */
.bx-toc--faq {
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.bx-toc--faq .bx-toc-item {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}
.bx-toc--faq .bx-toc-num {
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .bx-toc--faq { grid-template-columns: 1fr; }
}

/* Guide body — looser margins for narrative content */
.bx-guide-body {
  max-width: var(--bx-max-prose);
  margin: 0 auto;
  padding: 24px 0 40px;
}
.bx-guide-body--spaced { margin-top: 48px; }
.bx-guide-body h2 {
  margin: 40px 0 16px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.bx-guide-body h2:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.bx-guide-body h3 {
  margin: 24px 0 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.bx-toc-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 12px;
  background: transparent;
  border-radius: 9px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.bx-toc-item:hover {
  background: var(--surface2);
  color: var(--text);
}
.bx-toc-num {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0;
}
/* Unfilled sections: dim the number only. We don't show a pencil icon —
 * the empty-state card inside the section itself is honest signal enough,
 * and a pencil in the TOC made the whole page look broken on first load. */
.bx-toc-item--empty .bx-toc-num { color: var(--text-muted); opacity: 0.5; }
.bx-toc-item--empty { color: var(--text-muted); }

/* ─── Section blocks on detail page ───────────────────────── */
.bx-sec {
  margin: 0;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--bx-topbar-h) + 16px);
}
.bx-sec:first-of-type {
  border-top: 0;
  padding-top: 24px;
}
.bx-sec-h {
  margin: 0 0 22px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 1.2;
  color: var(--text);
}
.bx-sec-label { min-width: 0; }
.bx-sec-aside {
  display: block;
  margin-top: 4px;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
  text-transform: none;
}
@media (max-width: 560px) {
  .bx-sec-h {
    font-size: 21px;
  }
}

/* ─── Empty placeholder for un-filled sections ────────────── */
.bx-empty {
  display: flex; gap: 14px;
  padding: 18px 20px;
  background: var(--bx-edit-bg);
  border: 1px dashed var(--bx-edit-rim);
  border-radius: 12px;
  color: var(--bx-edit-fg);
}
.bx-empty-icon {
  font-size: 18px;
  opacity: 0.7;
  flex-shrink: 0;
  padding-top: 2px;
}
.bx-empty-body { flex: 1; min-width: 0; }
.bx-empty-label {
  font-size: 13px; font-weight: 600;
  color: var(--bx-edit-fg);
  margin-bottom: 4px;
}
.bx-empty-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── Prose styling for rendered markdown content ─────────── */
.bx-prose {
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--text);
}
.bx-prose p { margin: 0 0 18px; }
.bx-prose h3 {
  margin: 40px 0 14px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}
.bx-prose h4 {
  margin: 28px 0 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.bx-prose strong { color: var(--text); font-weight: 600; }
.bx-prose em { color: var(--text); font-style: italic; }
.bx-prose ul, .bx-prose ol { margin: 6px 0 18px; padding-left: 22px; }
.bx-prose li { margin: 6px 0; }
.bx-prose blockquote {
  margin: 24px 0;
  padding: 16px 0;
  border-top: 1px solid var(--accent-rim);
  border-bottom: 1px solid var(--accent-rim);
  border-left: 0;
  background: transparent;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.6;
  color: var(--text);
  border-radius: 0;
}
.bx-prose code {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--surface2);
  color: var(--accent-text);
  padding: 1px 6px;
  border-radius: 2px;
}
.bx-prose pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 4px;
  overflow-x: auto;
}
.bx-prose pre code { background: transparent; padding: 0; color: var(--text); }
.bx-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}
.bx-prose th, .bx-prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  /* Long unbreakable tokens (e.g. "Ceramide NP/AP/EOS") were forcing columns
     wider than viewport on mobile — break within token as fallback. */
  overflow-wrap: anywhere;
  word-break: normal;
}
.bx-prose th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: transparent;
  border-bottom: 1.5px solid var(--text);
}
.bx-prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}
.bx-prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent-rim);
}
.bx-prose a:hover {
  color: var(--accent-text);
  text-decoration-color: var(--accent);
}

/* ─── Related rows on detail page ─────────────────────────── */
.bx-related {
  margin: 56px 0;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
/* Secondary block: same-effect alternatives, visually quieter so the
   primary curation reads as the editor's first pick. */
.bx-related--secondary {
  margin-top: 24px;
  padding-top: 20px;
  opacity: 0.92;
}
.bx-related--secondary .bx-sec-h {
  color: var(--text-muted);
}
.bx-related--secondary .bx-sec-label {
  color: var(--text-muted);
}
.bx-related-more {
  margin-top: 16px;
  text-align: right;
}
.bx-related-more-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.bx-related-more-link:hover {
  background: var(--surface2);
  color: var(--bx-accent-text);
}

/* ─── Glossary hits (chip row under prose) ────────────────── */
.bx-glossary-hits {
  margin: 48px 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.bx-glossary-hit-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 12px;
}
.bx-glossary-hit-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12.5px;
  line-height: 1.4;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.bx-glossary-hit-chip strong {
  color: var(--text);
  font-weight: 600;
}
.bx-glossary-hit-chip span {
  font-family: var(--bx-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.bx-glossary-hit-chip:hover {
  border-color: var(--bx-accent);
  background: var(--surface2);
}
.bx-glossary-hit-chip:hover strong { color: var(--bx-accent-text); }

/* ─── Footer ──────────────────────────────────────────────── */
.bx-footer {
  margin: 64px 0 0;
  /* 水平 padding 對齊 main(--bx-pad),不然手機上文字頂到螢幕邊。 */
  padding: 28px var(--bx-pad) 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.65;
}
/* Mobile: footer 不被 fixed bottom-nav 蓋掉。放在 base 規則後讓 cascade 贏。 */
@media (max-width: 720px) {
  .bx-footer { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0)); }
}
.bx-footer-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 14px;
  padding: 10px 0;
}
@media (max-width: 560px) {
  .bx-footer-row { grid-template-columns: 1fr; gap: 4px; }
}
.bx-footer-label {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
}
.bx-footer-row p { margin: 0; }
.bx-footer-row strong { color: var(--text); }
.bx-footer-row a {
  color: var(--bx-accent-text);
  text-decoration: none;
}
.bx-footer-row a:hover { text-decoration: underline; }
.bx-footer-meta {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-family: var(--bx-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* ─── Focus rings (keyboard a11y table stakes) ─────────────── */
.bx-card:focus-visible,
.bx-toc-item:focus-visible,
.bx-topnav-link:focus-visible,
.bx-cat-nav-link:focus-visible,
.bx-brand:focus-visible,
.bx-chip:focus-visible,
.bx-bc-link:focus-visible {
  outline: 2px solid var(--bx-accent);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ─── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 700px) {
  :root { --bx-pad: 16px; }
  .bx-topnav-link { padding: 0 8px; font-size: 12px; }
  .bx-d-name { font-size: clamp(22px, 5.5vw, 28px); }
  /* Category chip strip becomes horizontally scrollable rather than wrapping
   * into a three-line wall. Fade is wider + dotted right-edge chevron makes
   * scrollability obvious on light backgrounds. */
  .bx-cat-nav {
    position: relative;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent);
  }
  /* Right-edge "→" affordance pinned to the scroll container itself */
  .bx-cat-nav::after {
    content: "›";
    position: sticky;
    right: 8px;
    top: 50%;
    transform: translateY(-2px);
    font-family: var(--font-mono);
    font-size: 16px;
    line-height: 1;
    color: var(--accent);
    opacity: 0.55;
    margin-left: -16px;
    flex-shrink: 0;
    pointer-events: none;
  }
  .bx-cat-nav-link {
    flex-shrink: 0;
    scroll-snap-align: start;
  }
}

/* Brand wordmark now stays visible on mobile — the topbar no longer carries
   section links (those moved to the bottom-nav), so there's room. The brand
   doubles as the "home" affordance (there's no 首頁 tab anymore). */

/* ─── Glossary page ──────────────────────────────────────── */
.bx-glossary-search {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--bx-line);
  border-radius: 12px;
  background: var(--bx-card-bg);
}
.bx-glossary-input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--bx-fg);
  font: inherit;
  font-size: 15px;
  outline: none;
  padding: 4px 0;
}
.bx-glossary-input::placeholder { color: var(--bx-fg-dim); }
.bx-glossary-count {
  font-size: 12px;
  color: var(--bx-fg-dim);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.bx-glossary-group {
  margin: 36px 0;
  border-top: 1px solid var(--bx-line);
  padding-top: 24px;
}
.bx-glossary-group-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.bx-glossary-group-num {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--bx-fg-dim);
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}
.bx-glossary-group-titles { flex: 1; }
.bx-glossary-group-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
}
.bx-glossary-group-blurb {
  margin: 0;
  font-size: 13px;
  color: var(--bx-fg-dim);
  line-height: 1.5;
}
.bx-glossary-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 720px) {
  .bx-glossary-list { grid-template-columns: 1fr 1fr; }
}
.bx-glossary-term {
  background: var(--bx-card-bg);
  border: 1px solid var(--bx-line);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bx-glossary-term-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  border-bottom: 1px dashed var(--bx-line);
  padding-bottom: 8px;
}
.bx-glossary-term-name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.bx-glossary-term-en {
  font-size: 12px;
  color: var(--bx-accent);
  letter-spacing: 0.04em;
  font-style: italic;
}
.bx-glossary-term-aka {
  font-size: 11px;
  color: var(--bx-fg-dim);
}
.bx-glossary-term-body {
  font-size: 14px;
  line-height: 1.6;
}
.bx-glossary-term-body p:first-child { margin-top: 0; }
.bx-glossary-term-body p:last-child { margin-bottom: 0; }

/* ─── Pricing page ───────────────────────────────────────── */
.bx-pricing-note {
  background: var(--bx-card-bg);
  border: 1px solid var(--bx-line);
  border-left: 3px solid var(--bx-accent);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 13px;
  line-height: 1.6;
}
.bx-pricing-note ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.bx-pricing-note li { margin: 4px 0; }
.bx-pricing-note p { margin: 6px 0 10px; font-size: 14px; color: var(--text-secondary); }
.bx-pricing-tabs {
  display: flex;
  gap: 4px;
  margin: 16px 0;
  padding: 4px;
  background: var(--bx-card-bg);
  border: 1px solid var(--bx-line);
  border-radius: 10px;
  width: fit-content;
}
.bx-pricing-tab {
  background: transparent;
  border: 0;
  color: var(--bx-fg-dim);
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.bx-pricing-tab:hover { color: var(--bx-fg); }
.bx-pricing-tab.is-active {
  background: var(--bx-accent);
  color: #1a0e0a;
  font-weight: 600;
}
.bx-pricing-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  padding: 12px 16px;
  border: 1px solid var(--bx-line);
  border-radius: 12px;
  background: var(--bx-card-bg);
}
.bx-pricing-cat {
  margin: 28px 0;
}
.bx-pricing-cat-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bx-line);
}
.bx-pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.bx-pricing-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--bx-fg-dim);
  padding: 8px 12px;
  border-bottom: 1px solid var(--bx-line);
  font-weight: 500;
  text-transform: uppercase;
}
.bx-pricing-table td {
  padding: 12px;
  border-bottom: 1px solid var(--bx-line);
  vertical-align: middle;
}
.bx-pricing-table tr:hover { background: rgba(214, 138, 126, 0.04); }
.bx-pr-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: inherit;
}
.bx-pr-link:hover .bx-pr-link-zh { color: var(--bx-accent); }
.bx-pr-link-zh { font-size: 14px; font-weight: 500; }
.bx-pr-link-en { font-size: 11px; color: var(--bx-fg-dim); letter-spacing: 0.04em; }
.bx-pr-price {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--bx-fg);
}
.bx-pr-dur {
  font-variant-numeric: tabular-nums;
  color: var(--bx-fg-dim);
  font-size: 13px;
}
.bx-pr-td-cat {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bx-pr-cat-name {
  font-size: 12px;
  color: var(--bx-fg-dim);
}
.bx-pr-th-price, .bx-pr-th-dur { text-align: right; }
.bx-pr-td-price, .bx-pr-td-dur { text-align: right; }
.bx-pricing-table--flat th, .bx-pricing-table--flat td {
  padding-left: 8px;
  padding-right: 8px;
}

@media (max-width: 720px) {
  .bx-pricing-table { font-size: 13px; }
  .bx-pricing-table--flat .bx-pr-th-cat,
  .bx-pricing-table--flat .bx-pr-td-cat { display: none; }
  .bx-pricing-cat-head .bx-cat-blurb { display: none; }
}

/* ─── ROI Ledger ──────────────────────────────────────────── */
.bx-roi-verdict { font-size: 18px; line-height: 1.7; }
.bx-roi-params {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.bx-roi-param {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}
.bx-roi-param-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.bx-roi-param-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.bx-roi-param-unit {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 6px;
}
.bx-roi-param-raw {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.bx-roi-kind {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bx-roi-kind--maint { background: var(--accent-2-soft); color: var(--accent-2); border: 1px solid var(--accent-2-rim); }
.bx-roi-kind--course { background: #F3EAD3; color: #7A5A00; border: 1px solid #DCC998; }
.bx-roi-kind--once { background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-rim); }
.bx-roi-kind--unknown { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }

.bx-roi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.bx-roi-table th, .bx-roi-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.bx-roi-table th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  background: transparent;
  border-bottom: 1.5px solid var(--text);
  padding: 10px 12px;
}
.bx-roi-table tr:hover { background: var(--surface2); }
.bx-roi-table .bx-right { text-align: right; font-family: var(--font-mono); }
.bx-roi-link { display: inline-flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--text); }
.bx-roi-link strong { font-family: var(--font-display); font-weight: 600; }
.bx-roi-link:hover strong { color: var(--accent); }
.bx-roi-cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.bx-roi-baseline {
  background: var(--accent-soft);
}
.bx-roi-baseline td {
  border-top: 1px solid var(--accent-rim);
  border-bottom: 1px solid var(--accent-rim);
  font-weight: 600;
}

.bx-table-wrap {
  overflow-x: auto;
  margin-top: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.bx-prose-muted {
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  .bx-roi-table { font-size: 12.5px; }
  .bx-roi-table th, .bx-roi-table td { padding: 10px 8px; }
}

/* ════════════════════════════════════════════════════════════
   HOME · Apple-direction redesign (2026-05) — scoped to .bx-home
   通透凈逸:大留白 · 大字 hero · 軟陰影卡 · iOS grouped-list 目錄。
   全部 .bx-home 開頭,只作用在首頁,不動 /c /t /category 共用 .bx-card。
   要回到舊首頁:刪掉這整段 + home.html 的 bx-home class。
   ════════════════════════════════════════════════════════════ */
/* Soft Apple-grey canvas so white cards/lists read as layers (iOS grouped bg).
   Only on home; the rest of the site keeps the pure-white tool surface. */
.bx-body--home { background: var(--bg); }
.bx-body--home .bx-topbar { background: var(--bar-bg); }

.bx-home {
  --ax-radius:       18px;
  --ax-radius-sm:    14px;
  /* --ax-shadow / --ax-shadow-hover inherited from :root (theme-aware) */
  --ax-sep:          var(--border);
}
@media (prefers-reduced-motion: reduce) {
  .bx-home .bx-card:hover,
  .bx-home .bx-card--catindex:hover { transform: none; }
}

/* ── Hero ── 大字、左對齊、留白分隔(去底線) ── */
.bx-home .bx-hero {
  padding: 64px 0 56px;
  border-bottom: none;
  margin-bottom: 0;
}
.bx-home .bx-hero-title {
  font-size: clamp(27px, 6.2vw, 60px);
  line-height: 1.2;
  letter-spacing: -1px;
  font-weight: 600;
  margin-bottom: 28px;
  /* em-based (CJK ≈ 1em/char) so the line-break stays at the 「。<br>」,
     not mid-sentence — `ch` under-sizes CJK and orphaned 「定。」. */
  max-width: 13em;
}
/* ── Section 節奏:大留白取代分隔線、大標題 ──
 * (2026-05-23: 完整目錄區拿掉後頁面縮短,72 → 48 避免底部過量留白。) */
.bx-home .bx-section { margin: 48px 0; }
/* Home footer 也跟著縮(其他頁不變):
 * 預設 .bx-footer margin-top 64 / padding-top 28 是給長頁面的;
 * 首頁短,降到 16/16 讓 footer 跟最後一張入口卡接得緊一點。 */
.bx-body--home .bx-footer { margin-top: 16px; padding-top: 16px; }
/* Home main 的底部 padding 從預設 80 降到 16(只首頁):
 * 80px 原是為「最後內容能完整滑過 fixed bottom-nav」預留,但其實 footer
 * 在下方自然就能讓最後一張卡滑到 nav 之上,所以可以收。 */
.bx-body--home .bx-main { padding-bottom: 16px; }
.bx-home .bx-section--stance { margin-top: 20px; padding-top: 0; }
.bx-home .bx-section--stance + .bx-section {
  border-top: none; padding-top: 0; margin-top: 80px;
}
.bx-home .bx-section-head {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 22px;
}
.bx-home .bx-section-title {
  display: block;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.8px;
}
.bx-home .bx-section-sub {
  font-size: 15px;
  line-height: 1.62;
  color: var(--text-secondary);
  margin-top: 10px;
}

/* ── Hero eyebrow + sub + CTA buttons (skinvest-direction homepage) ── */
.bx-home .bx-hero-eyebrow {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.bx-home .bx-hero-sub {
  margin: 0;
  max-width: 42em;
  font-size: clamp(15.5px, 2vw, 18px);
  line-height: 1.7;
  color: var(--text-secondary);
}
.bx-home .bx-hero-sub strong { color: var(--text); font-weight: 600; }
.bx-home .bx-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.bx-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: opacity 0.18s var(--ease-apple), background 0.18s, border-color 0.18s, color 0.18s;
}
.bx-btn--primary { background: var(--accent-strong); color: #fff; }
.bx-btn--primary:hover { opacity: 0.9; text-decoration: none; }
.bx-btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.bx-btn--ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ── 四步驟 cards ── */
.bx-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.bx-step {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--ax-radius);
  box-shadow: var(--ax-shadow);
  padding: 24px 22px 22px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s var(--ease-apple), box-shadow 0.2s var(--ease-apple);
}
.bx-step:hover { transform: translateY(-3px); box-shadow: var(--ax-shadow-hover); text-decoration: none; }
.bx-step-icon { color: var(--accent); }
.bx-step-icon svg { display: block; }
.bx-step-eyebrow {
  margin-top: 18px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.bx-step-title {
  margin-top: 6px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text);
}
.bx-step-desc {
  margin-top: 10px;
  flex: 1;
  font-size: 14px;
  line-height: 1.68;
  color: var(--text-secondary);
}
.bx-step-cta {
  margin-top: 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
}

/* ── 常用入口 quick links ── */
.bx-quicklinks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.bx-quicklink {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--ax-radius-sm);
  box-shadow: var(--ax-shadow);
  padding: 18px 18px;
  text-decoration: none;
  transition: transform 0.2s var(--ease-apple), box-shadow 0.2s var(--ease-apple), border-color 0.18s;
}
.bx-quicklink:hover { transform: translateY(-2px); box-shadow: var(--ax-shadow-hover); border-color: var(--accent-rim); text-decoration: none; }
.bx-quicklink-icon { color: var(--accent); margin-top: 2px; }
.bx-quicklink-icon svg { display: block; }
.bx-quicklink-text { display: flex; flex-direction: column; }
.bx-quicklink-label { font-size: 15px; font-weight: 600; color: var(--text); }
.bx-quicklink-desc { margin-top: 3px; font-size: 12.5px; color: var(--text-muted); }

@media (max-width: 860px) {
  .bx-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bx-quicklinks { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .bx-steps { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .bx-step:hover, .bx-quicklink:hover { transform: none; }
}

/* ── 「如果你也在想這些」6 張問句 → Apple feature cards(直立、軟陰影)── */
.bx-home .bx-section--stance .bx-grid--concerns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.bx-home .bx-card--question {
  flex-direction: column;
  gap: 0;
  padding: 24px 24px 22px;
  border: 1px solid transparent;
  border-radius: var(--ax-radius);
  background: var(--surface);
  box-shadow: var(--ax-shadow);
}
.bx-home .bx-card--question:hover {
  background: var(--surface);
  border-color: transparent;
  box-shadow: var(--ax-shadow-hover);
  transform: translateY(-3px);
}
.bx-home .bx-card--question .bx-card-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-top: 0;
  min-width: 0;
}
.bx-home .bx-card--question .bx-card-title {
  font-size: 19px;
  line-height: 1.45;
  letter-spacing: -0.4px;
  margin-bottom: 10px;
}
.bx-home .bx-card--question .bx-card-tagline {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-top: 0;
}

/* ── sticky 子節導覽 → 毛玻璃膠囊列 ── */
.bx-home .bx-cat-toc {
  border-top: none;
  border-bottom: 1px solid var(--border);
  background: var(--bar-bg);
  backdrop-filter: saturate(120%) blur(12px);
  -webkit-backdrop-filter: saturate(120%) blur(12px);
  padding: 8px 0;
}
.bx-home .bx-cat-toc-link {
  background: var(--surface);
  border-radius: 999px;
}

/* ── A/B 子區塊標題:大字、留白分隔 ── */
.bx-home .bx-cat-block { margin-top: 56px; }
.bx-home .bx-cat-block:first-of-type { margin-top: 36px; }
.bx-home .bx-cat-block-h {
  border-bottom: none;
  padding-bottom: 0;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.bx-home .bx-cat-block-note { font-size: 14.5px; margin-bottom: 22px; }

/* ── 困擾分群 cluster:iOS grouped-list section header ── */
.bx-home .bx-cluster { margin-top: 36px; }
.bx-home .bx-cluster:first-of-type { margin-top: 22px; }
.bx-home .bx-cluster-h {
  border-bottom: none;
  padding-bottom: 0;
  margin: 0 0 10px 4px;
}
.bx-home .bx-cluster-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.bx-home .bx-cluster-note {
  margin: 0 0 12px 4px;
  font-size: 13px;
}

/* ── 21 困擾卡 → iOS grouped inset list(圓角容器 + hairline 列 + chevron)── */
.bx-home .bx-cluster .bx-grid--concerns {
  display: block;
  gap: 0;
  background: var(--surface);
  border-radius: var(--ax-radius);
  box-shadow: var(--ax-shadow);
  overflow: hidden;
}
.bx-home .bx-cluster .bx-card--concern {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--ax-sep);
  box-shadow: none;
  padding: 15px 18px;
  gap: 14px;
  align-items: center;
}
.bx-home .bx-cluster .bx-card--concern:last-child { border-bottom: none; }
.bx-home .bx-cluster .bx-card--concern:hover {
  background: var(--surface2);
  box-shadow: none;
  transform: none;
  border-color: var(--ax-sep);
}
.bx-home .bx-cluster .bx-card--concern .bx-card-num {
  align-self: center;
  padding-top: 0;
  min-width: 22px;
  font-size: 12px;
}
.bx-home .bx-cluster .bx-card--concern .bx-card-meta {
  margin-top: 0;
  flex-shrink: 0;
  align-items: center;
}
/* chevron */
.bx-home .bx-cluster .bx-card--concern::after {
  content: "";
  flex-shrink: 0;
  width: 7px; height: 7px;
  margin-left: 2px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(-45deg);
  opacity: .4;
}

/* ── 14 機制入口卡 → 軟陰影卡 ── */
.bx-home .bx-card--catindex {
  border: 1px solid transparent;
  border-radius: var(--ax-radius-sm);
  box-shadow: var(--ax-shadow);
  padding: 18px 20px;
  gap: 10px;
}
.bx-home .bx-card--catindex:hover {
  border-color: transparent;
  background: var(--surface);
  box-shadow: var(--ax-shadow-hover);
  transform: translateY(-3px);
}
.bx-home .bx-card-catindex-name { font-size: 18px; font-weight: 600; }

/* ── 膠囊 chips ── */
.bx-home .bx-chip { border-radius: 999px; padding: 3px 10px; }

@media (max-width: 720px) {
  .bx-home .bx-section { margin: 40px 0; }
  .bx-home .bx-section--stance + .bx-section { margin-top: 60px; }
  .bx-home .bx-section--stance .bx-grid--concerns { grid-template-columns: 1fr; }
  .bx-home .bx-cluster .bx-card--concern { padding: 14px 16px; gap: 12px; }
}

/* ════════════════════════════════════════════════════════════
   DETAIL (/c · /t) · Apple-direction — scoped to .bx-body--detail
   白色閱讀紙面浮在灰畫布上(document-on-desk);TOC / related / banner
   皆為紙內灰 inset。共用 .bx-detail/.bx-sec/.bx-prose 結構不變。
   要回到舊詳情頁:刪掉這整段即可(body class 是既有的)。
   ════════════════════════════════════════════════════════════ */
.bx-body--detail { background: var(--bg); }
.bx-body--detail .bx-topbar { background: var(--bar-bg); }

/* — white reading sheet — */
.bx-body--detail .bx-main.bx-detail {
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--ax-shadow);
  max-width: 760px;
  margin: calc(var(--bx-topbar-h) + 28px) auto 64px;
  padding: 40px clamp(20px, 5vw, 48px) 48px;
}
@media (max-width: 800px) {
  .bx-body--detail { padding: 0 12px; }
  .bx-body--detail .bx-main.bx-detail {
    margin-top: calc(var(--bx-topbar-h) + 14px);
    margin-bottom: 40px;
    border-radius: 20px;
  }
}

/* — header: bigger Apple title — */
.bx-body--detail .bx-d-header {
  padding-bottom: 22px;
  margin-bottom: 28px;
}
.bx-body--detail .bx-d-name {
  font-weight: 600;
  font-size: clamp(28px, 6vw, 40px);
  letter-spacing: -0.8px;
  line-height: 1.1;
}
.bx-body--detail .bx-d-tagline { font-size: 16.5px; }

/* — compliance banner (treatment) → soft inset — */
.bx-body--detail .bx-compliance-banner {
  background: var(--surface2);
  border: none;
  border-left: 3px solid var(--accent);
  border-radius: 12px;
}

/* — section TOC → grey inset segmented control — */
/* Sticky horizontal scrollspy tab bar — sticks under the topbar, highlights
   the section currently in view (JS adds .is-active). Replaces the old static
   grid. Hidden ≥1280px, where the floating side rail takes over. */
.bx-body--detail .bx-toc:not(.bx-toc--faq) {
  position: sticky;
  top: calc(var(--bx-topbar-h) + 6px);
  z-index: 20;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--bar-bg);
  backdrop-filter: saturate(120%) blur(10px);
  -webkit-backdrop-filter: saturate(120%) blur(10px);
  border: none;
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 28px;
}
.bx-body--detail .bx-toc:not(.bx-toc--faq)::-webkit-scrollbar { display: none; }
.bx-body--detail .bx-toc:not(.bx-toc--faq) .bx-toc-item {
  flex: 0 0 auto;
  flex-direction: row;
  white-space: nowrap;
  padding: 7px 13px;
  border-radius: 8px;
}
/* active highlight (also applies to the FAQ TOC + side rail) */
.bx-body--detail .bx-toc-item:hover { background: var(--surface); }
.bx-body--detail .bx-toc-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}
@media (min-width: 1280px) {
  /* Wide screens: the floating side rail is the scrollspy; drop the top bar. */
  .bx-body--detail .bx-toc:not(.bx-toc--faq) { display: none; }
}

/* — sections: a touch more air; tighter Apple heading — */
.bx-body--detail .bx-sec { padding: 36px 0; }
.bx-body--detail .bx-sec-h {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

/* — related treatment / concern cards → grey insets within the sheet — */
.bx-body--detail .bx-card--mini {
  background: var(--surface2);
  border: 1px solid transparent;
  border-radius: 14px;
  box-shadow: none;
}
.bx-body--detail .bx-card--mini:hover {
  background: var(--surface);
  border-color: transparent;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.bx-body--detail .bx-card--mini .bx-card-title { font-size: 16px; }

/* — glossary chips + capsule chips — */
.bx-body--detail .bx-glossary-hit-chip {
  background: var(--surface2);
  border-color: transparent;
}
.bx-body--detail .bx-chip { border-radius: 999px; }

/* — empty-state placeholder: soften to match sheet — */
.bx-body--detail .bx-empty { border-radius: 14px; }

/* — admin (/admin/pricing · /admin/roi*) inherit the sheet; keep wide
     pricing / ROI tables scrollable so they never break the sheet — */
.bx-body--detail .bx-table-wrap { overflow-x: auto; }

/* — floating side TOC (≥1280px) → soft Apple panel — */
.bx-body--detail .bx-toc-stick {
  border: none;
  border-radius: 16px;
  box-shadow: var(--ax-shadow);
}

/* — footer aligned to sheet width — */
.bx-body--detail .bx-footer {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* ════════════════════════════════════════════════════════════
   INDEX / LISTING / TOOL · Apple-direction — scoped .bx-body--index
   灰畫布 + 浮動白卡(沿用首頁語言);困擾索引用 grouped-list;
   寬表格工具(相容矩陣 / 比較表)用白 panel 包裹。
   ════════════════════════════════════════════════════════════ */
.bx-body--index { background: var(--bg); }
.bx-body--index .bx-topbar { background: var(--bar-bg); }
.bx-body--index {
  --ax-radius:       18px;
  --ax-radius-sm:    14px;
  /* --ax-shadow / --ax-shadow-hover inherited from :root (theme-aware) */
}
@media (prefers-reduced-motion: reduce) {
  .bx-body--index .bx-card:hover { transform: none; }
}

/* — hero(子頁,比首頁小一號)— */
.bx-body--index .bx-hero {
  padding: 28px 0 36px;
  border-bottom: none;
  margin-bottom: 8px;
}
.bx-body--index .bx-hero-title {
  font-size: clamp(30px, 5.2vw, 44px);
  line-height: 1.1;
  letter-spacing: -1.2px;
  font-weight: 600;
  margin-bottom: 18px;
}
.bx-body--index .bx-hero-sub {
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.7;
  color: var(--text-secondary);
}

/* — section heads:大字、留白分隔 — */
.bx-body--index .bx-section { margin: 56px 0; }
.bx-body--index .bx-section-head { border-bottom: none; padding-bottom: 0; margin-bottom: 22px; }
.bx-body--index .bx-section-title {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.7px;
}
.bx-body--index .bx-section-sub { font-size: 14.5px; color: var(--text-secondary); margin-top: 8px; }

/* — sticky 子節導覽 → 毛玻璃膠囊列(concerns_index)— */
.bx-body--index .bx-cat-toc {
  border-top: none;
  border-bottom: 1px solid var(--border);
  background: var(--bar-bg);
  backdrop-filter: saturate(120%) blur(12px);
  -webkit-backdrop-filter: saturate(120%) blur(12px);
}
.bx-body--index .bx-cat-toc-link { background: var(--surface); border-radius: 999px; }

/* — feature cards:.bx-card--concern / --treatment 直接在 grid → 直立軟卡 — */
.bx-body--index .bx-card--concern,
.bx-body--index .bx-card--treatment {
  flex-direction: column;
  gap: 0;
  padding: 20px 22px;
  border: 1px solid transparent;
  border-radius: var(--ax-radius-sm);
  background: var(--surface);
  box-shadow: var(--ax-shadow);
  align-items: stretch;
}
.bx-body--index .bx-card--concern:hover,
.bx-body--index .bx-card--treatment:hover {
  background: var(--surface);
  border-color: transparent;
  box-shadow: var(--ax-shadow-hover);
  transform: translateY(-3px);
}
.bx-body--index .bx-card--concern .bx-card-num,
.bx-body--index .bx-card--treatment .bx-card-num {
  margin-bottom: 10px;
  padding-top: 0;
  min-width: 0;
}
.bx-body--index .bx-card-meta { margin-top: 12px; }

/* — concerns_index:cluster grouped inset list(沿用首頁)— */
.bx-body--index .bx-cluster { margin-top: 36px; }
.bx-body--index .bx-cluster-h { border-bottom: none; padding-bottom: 0; margin: 0 0 10px 4px; }
.bx-body--index .bx-cluster-name { font-size: 18px; font-weight: 600; letter-spacing: -0.3px; }
.bx-body--index .bx-cluster-note { margin: 0 0 12px 4px; font-size: 13px; }
/* /concerns 與 /treatments 統一:concern cluster 用 feature-card 網格
   (沿用上面通用的 .bx-body--index .bx-card--concern 直立軟卡規則),
   與 treatments 的分類卡網格一致。首頁 (.bx-home) 仍維持 grouped-list。 */

/* — treatments_index:.bx-cat 機制分區 + sticky chip 導覽 — */
.bx-body--index .bx-cat-nav {
  background: var(--bar-bg);
  backdrop-filter: saturate(120%) blur(10px);
  -webkit-backdrop-filter: saturate(120%) blur(10px);
  border: none;
  box-shadow: var(--ax-shadow);
}
.bx-body--index .bx-cat-head { border-bottom-color: var(--border); }
.bx-body--index .bx-cat-name { font-weight: 600; }

/* — category 上一個/下一個 配對導覽 → 軟卡 — */
.bx-body--index .bx-cat-pair-link {
  border: 1px solid transparent;
  border-radius: var(--ax-radius-sm);
  box-shadow: var(--ax-shadow);
}
.bx-body--index .bx-cat-pair-link:hover {
  border-color: transparent; background: var(--surface);
  box-shadow: var(--ax-shadow-hover); transform: translateY(-2px);
}
.bx-body--index .bx-cat-pair-home { box-shadow: none; background: transparent; }

/* — homecare_index:綠系卡 → 邊框換陰影 — */
.bx-body--index .bx-homecare-card {
  border-color: transparent;
  box-shadow: var(--ax-shadow);
}
.bx-body--index .bx-hc-block-head { border-bottom-color: var(--border); }
.bx-body--index .bx-hc-seq { border-top-color: var(--border); }

/* — 膠囊 chips — */
.bx-body--index .bx-chip { border-radius: 999px; }

/* — 搜尋結果 → 軟白卡 — */
.bx-body--index .bx-search-result {
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--ax-radius-sm);
  box-shadow: var(--ax-shadow);
  padding: 18px 20px;
}
.bx-body--index .bx-search-result:hover {
  box-shadow: var(--ax-shadow-hover);
  transform: translateY(-2px);
}
.bx-body--index .bx-search-input {
  background: var(--surface);
  border-radius: 999px;
  box-shadow: var(--ax-shadow);
}

/* — 寬表格工具(compare / compat)→ 內容包白 panel — */
.bx-body--index .bx-ct-table-wrap,
.bx-body--index .bx-ct-picker,
.bx-body--index .bx-compat-wrap {
  background: var(--surface);
  border-radius: var(--ax-radius);
  box-shadow: var(--ax-shadow);
  padding: 16px;
}

@media (max-width: 720px) {
  .bx-body--index .bx-section { margin: 44px 0; }
}

/* ════════════════════════════════════════════════════════════
   Tabs · CSS-only segmented control (radio:checked, no JS)
   Used by home 完整目錄 (從困擾 / 從機制). Both panels stay in the
   DOM (SEO-safe); only the checked one is shown.
   ════════════════════════════════════════════════════════════ */
.bx-tab-radio {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.bx-tab-list {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  margin: 0 0 26px;
  background: var(--surface2);
  border-radius: 999px;
}
.bx-tab {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px;
  padding: 8px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s var(--ease-apple), color 0.15s var(--ease-apple);
}
.bx-tab:hover { color: var(--text); }
/* active tab (checked radio → its label) */
#axis-concern:checked   ~ .bx-tab-list label[for="axis-concern"],
#axis-mechanism:checked ~ .bx-tab-list label[for="axis-mechanism"] {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
/* keyboard focus ring on the focused tab */
#axis-concern:focus-visible   ~ .bx-tab-list label[for="axis-concern"],
#axis-mechanism:focus-visible ~ .bx-tab-list label[for="axis-mechanism"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* panel switching */
.bx-tab-panel { display: none; }
#axis-concern:checked   ~ .bx-tab-panel--concern,
#axis-mechanism:checked ~ .bx-tab-panel--mechanism { display: block; }

/* ════════════════════════════════════════════════════════════
   /plan AI tool — auth/onboarding/products/dashboard/billing
   (Phase 2-5). Scoped under .bx-body--detail / .bx-body--index
   so the canvas + sheet treatment matches the rest of the site.
   ════════════════════════════════════════════════════════════ */

/* Narrower variant for forms */
.bx-body--detail .bx-main--narrow {
  max-width: 640px;
  margin: calc(var(--bx-topbar-h) + 28px) auto 64px;
}
@media (max-width: 800px) {
  .bx-body--detail .bx-main--narrow { padding: 0 12px; margin-top: calc(var(--bx-topbar-h) + 14px); }
}

/* White reading sheet on canvas (mirrors .bx-detail) */
.bx-body--detail .bx-detail-sheet {
  background: var(--surface);
  border-radius: var(--ax-radius, 18px);
  box-shadow: var(--ax-shadow);
  padding: 32px clamp(20px, 5vw, 40px) 40px;
}
.bx-body--detail .bx-detail-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.bx-body--detail .bx-detail-section:first-of-type { border-top: none; padding-top: 8px; }
.bx-body--detail .bx-detail-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 14px;
  letter-spacing: -0.2px;
}

.bx-hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}
.bx-hero-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin: 12px 0 0;
}

.bx-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 16px 0;
}
.bx-btn--small { padding: 6px 12px; font-size: 13px; }

/* Forms */
.bx-form { margin: 16px 0; }
.bx-field { display: block; margin: 14px 0; }
.bx-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.bx-field input[type="text"],
.bx-field input[type="email"],
.bx-field textarea,
.bx-field select,
.bx-field .bx-select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
.bx-field select,
.bx-field .bx-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23666' d='M6 8 0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.bx-field input:focus,
.bx-field textarea:focus,
.bx-field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.bx-fieldset {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
}
.bx-fieldset legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding: 0 6px;
}
.bx-radio,
.bx-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 12px 6px 0;
  cursor: pointer;
  font-size: 14px;
}
.bx-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 4px 12px;
  margin-top: 4px;
}

/* Dashboard cards (Index scope) */
.bx-body--index .bx-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0 28px;
}
.bx-body--index .bx-index-grid--3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.bx-body--index .bx-index-card {
  display: block;
  padding: 18px 20px;
  background: var(--surface);
  border-radius: var(--ax-radius, 18px);
  box-shadow: var(--ax-shadow);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.bx-body--index .bx-index-card:hover {
  box-shadow: var(--ax-shadow-hover);
  transform: translateY(-1px);
}
@media (prefers-reduced-motion: reduce) {
  .bx-body--index .bx-index-card:hover { transform: none; }
}
.bx-index-card-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.bx-index-card-sub {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.bx-body--index .bx-detail-section {
  margin-top: 28px;
  background: var(--surface);
  border-radius: var(--ax-radius, 18px);
  box-shadow: var(--ax-shadow);
  padding: 24px 28px;
}
.bx-body--index .bx-detail-section h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 12px;
}

.bx-index-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bx-index-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.bx-index-list li:last-child { border-bottom: none; }
.bx-index-list a { color: inherit; text-decoration: none; }
.bx-index-list a:hover { color: var(--accent); }

/* Product list */
.bx-product-list { list-style: none; padding: 0; margin: 0; }
.bx-product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.bx-product-row:last-child { border-bottom: none; }
.bx-product-info { flex: 1; min-width: 0; }
.bx-product-info strong { font-weight: 600; }

/* Per-category product groups (外用 / 口服 / 居家儀器) */
.bx-product-group + .bx-product-group { margin-top: 22px; }
.bx-product-group-h {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bx-product-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface2);
  border-radius: 999px;
  padding: 1px 9px;
  min-width: 22px;
  text-align: center;
}
.bx-product-empty { margin: 4px 0 0; }
.bx-product-actions { display: flex; align-items: flex-start; gap: 6px; }

/* Inline edit (pure HTML <details>, no JS) */
.bx-inline-edit summary {
  list-style: none;
  cursor: pointer;
}
.bx-inline-edit summary::-webkit-details-marker { display: none; }
.bx-inline-edit[open] {
  flex: 1;
  min-width: 0;
}
.bx-inline-edit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  background: var(--surface2);
  border-radius: 12px;
}
.bx-inline-edit-form .bx-field { margin: 0; }

/* Per-group add row: name grows, notes + button trail; wraps on mobile */
.bx-product-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.bx-product-add input[type="text"] {
  padding: 10px 12px;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  min-width: 0;
}
.bx-product-add input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.bx-product-add input[aria-invalid="true"] { border-color: var(--accent); }
.bx-product-add-name { flex: 2 1 180px; }
.bx-product-add-notes { flex: 1 1 120px; }
.bx-product-add .bx-field-error { flex-basis: 100%; }

/* Billing table */
.bx-detail-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}
.bx-detail-table th,
.bx-detail-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.bx-detail-table th {
  width: 30%;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.bx-detail-table td { word-break: break-word; overflow-wrap: anywhere; }

/* Report page */
.bx-report-disclaimer {
  padding: 12px 16px;
  margin: 0 0 20px;
  background: var(--surface2);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
}
.bx-report-body {
  /* Inherit detail-section spacing; let markdown tables/lists breathe */
  line-height: 1.7;
}
.bx-report-body h3 {
  font-size: 17px;
  font-weight: 600;
  margin-top: 28px;
}
.bx-report-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}
.bx-report-body th, .bx-report-body td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.bx-report-body th { font-weight: 600; }

.bx-chip {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--surface2);
  color: var(--text-muted);
  white-space: nowrap;
}
.bx-chip--warn { background: rgba(180, 80, 40, 0.12); color: var(--accent); }
.bx-chip--muted { background: var(--surface2); color: var(--text-muted); }

/* /plan a11y: required-field asterisk + focus-visible rings */
.bx-req {
  color: var(--accent);
  font-weight: 700;
  margin-left: 2px;
}
/* Visible focus indicators on /plan/* interactive controls */
.bx-radio:focus-within,
.bx-checkbox:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}
/* Native focus on the inputs themselves is hidden by :focus-within above —
   but keep keyboard-only via :focus-visible for explicit clarity */
.bx-radio input:focus-visible,
.bx-checkbox input:focus-visible { outline: none; }
.bx-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.bx-body--index .bx-index-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: var(--ax-shadow-hover);
}
/* The form text inputs already have :focus outline via .bx-field input:focus —
   switch them to :focus-visible so mouse clicks don't show a ring */
.bx-field input:focus,
.bx-field textarea:focus { outline: none; }
.bx-field input:focus-visible,
.bx-field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Form validation errors (server-side, inline) */
.bx-field-error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--accent-strong);
  font-weight: 500;
}
.bx-field input[aria-invalid="true"],
.bx-field textarea[aria-invalid="true"] {
  border-color: var(--accent-strong);
  background: color-mix(in oklch, var(--accent-strong) 5%, var(--surface));
}
.bx-field input[aria-invalid="true"]:focus-visible,
.bx-field textarea[aria-invalid="true"]:focus-visible {
  outline-color: var(--accent-strong);
}
.bx-fieldset[aria-invalid="true"] { border-color: var(--accent-strong); }
.bx-fieldset[aria-invalid="true"] legend { color: var(--accent-strong); }

/* Top-level error summary on onboarding */
.bx-form-error {
  padding: 12px 16px;
  margin: 12px 0 20px;
  background: color-mix(in oklch, var(--accent-strong) 8%, var(--surface));
  border-left: 3px solid var(--accent-strong);
  border-radius: 8px;
  font-size: 14px;
}
.bx-form-error strong { color: var(--accent-strong); display: block; margin-bottom: 4px; }
.bx-form-error ul { margin: 4px 0 0; padding-left: 20px; }

/* ─── Print stylesheet · 給 /plan/reports/{id} 列印 / 存成 PDF ──
 *
 * 設計目標：報告 = 可帶去皮膚科診間的諮詢文件。
 * - 隱藏：頂部 / 底部導覽、breadcrumb、CTA 按鈕、報告本身的「列印」按鈕
 * - 保留：報告 header、metadata、所有內容、disclaimer footer
 * - 黑白友善：強制 background:white + 移除 hover/transition
 * - URL 印在頁尾（讓帶去診間的人能回來找）
 */
@media print {
  @page {
    margin: 18mm 16mm;
    size: A4;
  }
  /* 預設 hide 所有 nav / chrome / 互動元素 */
  .bx-topbar, .bx-bottom-nav, .bx-breadcrumb,
  .bx-no-print, .bx-cta-row button, .bx-btn,
  nav, footer.bx-footer { display: none !important; }

  /* Body / layout: 不要 grey canvas / shadow / sheet float */
  body { background: white !important; color: black !important; font-size: 11pt; }
  .bx-main, .bx-detail, .bx-detail-sheet, .bx-main--narrow {
    max-width: none !important; margin: 0 !important; padding: 0 !important;
    box-shadow: none !important; border: none !important; background: white !important;
  }
  /* Hero / metadata 縮小 */
  .bx-hero-title { font-size: 18pt !important; margin: 0 0 6pt; }
  .bx-hero-eyebrow, .bx-hero-meta { font-size: 9pt !important; color: #555 !important; }
  /* Disclaimer aside: 邊框淺化 */
  .bx-report-disclaimer {
    border: 1px solid #999 !important; background: white !important;
    padding: 8pt !important; margin: 8pt 0 !important; font-size: 9.5pt !important;
  }
  /* Chips 改純文字 */
  .bx-chip, .bx-chip--accent, .bx-chip--warn, .bx-chip--muted {
    background: white !important; color: black !important;
    border: 1px solid #999 !important; padding: 1pt 5pt !important;
    font-size: 9pt !important;
  }
  /* Table 印刷友善 */
  .bx-report-body table, .bx-prose table {
    border-collapse: collapse !important; width: 100% !important;
    page-break-inside: avoid; font-size: 10pt !important;
  }
  .bx-report-body th, .bx-report-body td,
  .bx-prose th, .bx-prose td {
    border: 1px solid #999 !important; padding: 4pt 6pt !important;
    background: white !important; color: black !important;
  }
  /* 連結保留底線、印出 URL（醫師能 cross-reference） */
  .bx-report-body a, .bx-prose a {
    color: black !important; text-decoration: underline !important;
  }
  .bx-report-body a[href^="/"]::after,
  .bx-prose a[href^="/"]::after {
    content: " (skinvestclub.com" attr(href) ")";
    font-size: 8.5pt; color: #666;
  }
  /* H2/H3 不要在頁底斷開 */
  h1, h2, h3 { page-break-after: avoid; }
  /* Section 之間留 break-inside avoid */
  .bx-detail-section { page-break-inside: avoid; margin: 10pt 0 !important; }
  /* 移除 hover / transition / animation */
  *, *::before, *::after {
    transition: none !important; animation: none !important;
    box-shadow: none !important;
  }
}
