/* ===== 探索未來世界的能力 共用樣式 ===== */
/* 溫暖活潑主題：奶油底色、珊瑚橘主色、糖果色單元色；標題用 jf 粉圓（Huninn） */
:root {
  --bg: #fff8ef;
  --surface: #ffffff;
  --surface-2: #fff0dc;
  --ink: #3b2c22;
  --ink-2: #7a6556;
  --line: #f2dfc6;
  --accent: #e8553a;
  --accent-soft: #ffe3d6;
  --sun: #ffc94a;
  --good: #1f8a5b;
  --good-soft: #dff5e8;
  --bad: #d63d4f;
  --bad-soft: #ffe4e6;
  --tip: #c77a00;
  --tip-soft: #fff1c9;
  --u1: #e0592f;
  --u2: #0e8f7c;
  --u3: #d63f78;
  --u4: #7652d9;
  --u0: #a0592a;
  --en: #1a80c6;
  --plan: #b8620a;
  --econ: #2e7d46;
  --hist: #8a4b2e;
  --fit: #c2410c;
  --unit: var(--accent);
  --radius: 18px;
  --shadow: 0 2px 4px rgba(150, 90, 40, .06), 0 8px 24px rgba(150, 90, 40, .08);
  --shadow-lift: 0 4px 8px rgba(150, 90, 40, .08), 0 16px 36px rgba(150, 90, 40, .14);
  --sans: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
  --round: "Huninn", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --serif: "Songti TC", "Noto Serif TC", "PMingLiU", "MingLiU", serif;
  --on-color: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #211915;
    --surface: #2c221c;
    --surface-2: #372a21;
    --ink: #f8ecdf;
    --ink-2: #d2bba7;
    --line: #4b3a2e;
    --accent: #ff8a6b;
    --accent-soft: #45281f;
    --sun: #ffd36e;
    --good: #6fd39c;
    --good-soft: #1f3a2b;
    --bad: #ff8a95;
    --bad-soft: #452329;
    --tip: #ffc45c;
    --tip-soft: #43341a;
    --u1: #ff9a70;
    --u2: #52cdb6;
    --u3: #ff85b1;
    --u4: #b49bff;
    --u0: #e0a06f;
    --en: #6cc0f5;
    --plan: #f5b35a;
    --econ: #7fd49a;
    --hist: #e0a47f;
    --fit: #ff9a5c;
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
    --shadow-lift: 0 8px 28px rgba(0, 0, 0, .45);
    --on-color: #231a14;
  }
}

body[data-unit="1"] { --unit: var(--u1); }
body[data-unit="2"] { --unit: var(--u2); }
body[data-unit="3"] { --unit: var(--u3); }
body[data-unit="4"] { --unit: var(--u4); }
body[data-unit="0"] { --unit: var(--u0); }
body[data-unit="en"] { --unit: var(--en); }
body[data-unit="plan"] { --unit: var(--plan); }
body[data-unit="econ"] { --unit: var(--econ); }
body[data-unit="hist"] { --unit: var(--hist); }
body[data-unit="fit"] { --unit: var(--fit); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 116px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  letter-spacing: .02em;
}
img { max-width: 100%; }
a { color: var(--unit); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--round); line-height: 1.35; letter-spacing: .04em; }
h2 { font-size: 1.55rem; margin: 2.8rem 0 1rem; padding-bottom: .4rem; border-bottom: 2px solid var(--line); }
h2 .num { color: var(--unit); margin-right: .4rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 .6rem; }
p { margin: .6rem 0; }
b, strong { color: var(--ink); }
ul, ol { padding-left: 1.4rem; }
li { margin: .25rem 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: 1080px; margin: 0 auto; padding: .5rem 1rem;
  display: flex; align-items: center; gap: 1rem;
}
.brand {
  display: flex; align-items: center; gap: .5rem; flex-shrink: 0;
  color: var(--ink); text-decoration: none; font-weight: 700; font-family: var(--round);
}
.seal {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--accent); color: var(--on-color); font-size: 16px;
}
.section-nav, .site-nav { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.section-nav::-webkit-scrollbar, .site-nav::-webkit-scrollbar { display: none; }
.section-nav a, .site-nav a {
  white-space: nowrap; text-decoration: none; color: var(--ink-2);
  padding: .3rem .75rem; border-radius: 999px; font-size: .92rem;
}
.section-nav a:hover, .site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.section-nav a[aria-current] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.subnav { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--unit) 6%, transparent); }
.subnav .inner { padding-top: .35rem; padding-bottom: .35rem; }
.sub-home { flex-shrink: 0; font-weight: 700; font-size: .92rem; color: var(--ink); text-decoration: none; }
.sub-home:hover { color: var(--unit); }
.site-nav a[aria-current="page"] { background: var(--unit); color: var(--on-color); }
@media (max-width: 720px) {
  .site-header .inner { flex-direction: column; align-items: stretch; gap: .2rem; padding-top: .4rem; padding-bottom: .4rem; }
  .section-nav, .site-nav { margin-left: 0; }
}

/* ---------- layout ---------- */
main { max-width: 820px; margin: 0 auto; padding: 1rem 1.1rem 4rem; }
.wide { max-width: 1080px; }

.hero { padding: 2.2rem 0 1rem; }
.hero .eyebrow {
  display: inline-block; font-size: .85rem; font-weight: 700; letter-spacing: .1em;
  color: var(--unit); background: color-mix(in srgb, var(--unit) 12%, transparent);
  padding: .15rem .7rem; border-radius: 999px;
}
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); margin: .6rem 0 .5rem; }
.hero .lead { font-size: 1.08rem; color: var(--ink-2); }

.goals {
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--unit);
  border-radius: var(--radius); padding: .9rem 1.2rem; margin: 1.2rem 0; box-shadow: var(--shadow);
}
.goals h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.goals ul { margin: 0; }

.toc { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.toc a {
  font-size: .9rem; text-decoration: none; padding: .2rem .75rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-2); background: var(--surface);
}
.toc a:hover { border-color: var(--unit); color: var(--unit); }

/* ---------- blocks ---------- */
.callout {
  border-radius: var(--radius); padding: .9rem 1.1rem; margin: 1.1rem 0;
  background: var(--surface-2); border: 1px solid var(--line);
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout .title { font-weight: 700; display: block; margin-bottom: .2rem; }
.callout.tip { background: var(--tip-soft); border-color: color-mix(in srgb, var(--tip) 35%, transparent); }
.callout.key { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.callout.unit { background: color-mix(in srgb, var(--unit) 9%, var(--surface)); border-color: color-mix(in srgb, var(--unit) 30%, transparent); }
.callout.warn { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }

.example {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1.2rem; margin: 1rem 0; box-shadow: var(--shadow);
}
.example > :first-child { margin-top: 0; }
.example > :last-child { margin-bottom: 0; }
.example .src { font-family: var(--serif); font-size: 1.12rem; }
.example .arrow { color: var(--unit); font-weight: 700; }

.table-wrap { overflow-x: auto; margin: 1rem 0; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .96rem; }
th, td { padding: .6rem .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 700; }

.flow { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 1rem 0; }
.flow span.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: .35rem .8rem; font-weight: 700;
}
.flow span.step.on { background: var(--unit); color: var(--on-color); border-color: var(--unit); }
.flow .to { color: var(--ink-2); }

.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; margin: 1rem 0; }
.chip-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; }
.chip-card b { display: block; color: var(--unit); }

.steps-list { counter-reset: s; list-style: none; padding: 0; }
.steps-list > li {
  counter-increment: s; position: relative; padding: .9rem 1rem .9rem 3.4rem; margin: .7rem 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.steps-list > li::before {
  content: counter(s); position: absolute; left: 1rem; top: .9rem;
  width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--unit); color: var(--on-color); font-weight: 700; font-size: .95rem; line-height: 1;
}
.steps-list > li > :first-child { margin-top: 0; }
.steps-list > li > :last-child { margin-bottom: 0; }

.judge-card {
  font-family: var(--sans); background: var(--surface); border: 2px dashed var(--unit);
  border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0;
}
.judge-card ol { margin: .3rem 0 0; }

/* highlights */
.hl { background: color-mix(in srgb, var(--unit) 22%, transparent); padding: 0 .15em; border-radius: 4px; font-weight: 700; }
.m-body { border-bottom: 3px solid var(--u1); }
.m-word { border-bottom: 3px solid var(--u4); }
.m-vehicle { border-bottom: 3px solid var(--u3); }
.del { text-decoration: line-through; text-decoration-color: var(--bad); text-decoration-thickness: 2px; color: var(--ink-2); }
.zhuyin { font-size: .8em; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }

.passage {
  font-family: var(--serif); font-size: 1.08rem; line-height: 2;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.4rem; margin: 1rem 0; box-shadow: var(--shadow);
}
.passage h4 { text-align: center; margin: 0 0 .6rem; font-size: 1.15rem; }
.passage p { text-indent: 2em; margin: .5rem 0; }
.passage .pn { font-family: var(--sans); font-size: .75rem; color: var(--unit); font-weight: 700; margin-right: .3rem; text-indent: 0; }

/* ---------- practice ---------- */
.practice {
  margin: 3rem 0 1rem; padding: 1.3rem 1.2rem 1.5rem;
  background: color-mix(in srgb, var(--unit) 7%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--unit) 25%, transparent);
  border-radius: 20px;
}
.practice > h2 { margin-top: .2rem; border-bottom-color: color-mix(in srgb, var(--unit) 30%, transparent); }
.toolbar {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  position: sticky; top: 100px; z-index: 5; padding: .5rem .2rem; margin: 0 -.2rem .5rem;
  background: color-mix(in srgb, var(--unit) 7%, var(--bg));
}
@media (max-width: 720px) { .toolbar { position: static; } .score { flex-basis: 100%; } }
.score { font-weight: 700; margin-right: auto; font-size: .95rem; }
.score .bar { display: block; height: 6px; width: min(260px, 60vw); background: var(--line); border-radius: 99px; overflow: hidden; margin-top: .2rem; }
.score .bar i { display: block; height: 100%; width: 0; background: var(--unit); transition: width .3s; }

button, .btn {
  font: inherit; font-size: .92rem; cursor: pointer; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: .35rem .85rem; line-height: 1.5;
}
button:hover { border-color: var(--unit); }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--unit) 55%, transparent); outline-offset: 2px; }
.btn-primary { background: var(--unit); color: var(--on-color); border-color: var(--unit); }

.quiz-set { counter-reset: q; }
.q {
  counter-increment: q; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.1rem; margin: .9rem 0; box-shadow: var(--shadow);
}
.q-text { margin: 0 0 .6rem; }
.q-text::before {
  content: "第 " counter(q) " 題"; display: inline-block; margin-right: .5rem;
  font-size: .78rem; font-weight: 700; color: var(--unit);
  border: 1px solid color-mix(in srgb, var(--unit) 45%, transparent); border-radius: 6px; padding: 0 .4rem;
  vertical-align: 2px;
}
.q .sent { display: block; font-family: var(--serif); font-size: 1.1rem; margin: .3rem 0; }
.q-level { font-size: .75rem; font-weight: 700; color: var(--accent); margin-left: .3rem; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .5rem; counter-reset: o; }
.opts.long { grid-template-columns: 1fr; }
.opt {
  counter-increment: o; text-align: left; padding: .5rem .8rem; display: flex; gap: .5rem; align-items: baseline;
}
.opt::before { content: "(" counter(o, upper-alpha) ")"; color: var(--ink-2); font-weight: 700; flex-shrink: 0; }
.opt[disabled] { cursor: default; }
.opt.right { background: var(--good-soft); border-color: var(--good); color: var(--ink); }
.opt.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--ink); }
.show-all .opt.is-answer { background: var(--good-soft); border-color: var(--good); }
.feedback { font-weight: 700; margin: .6rem 0 0; }
.feedback.ok { color: var(--good); }
.feedback.no { color: var(--bad); }
.explain {
  margin-top: .6rem; padding: .7rem .9rem; border-radius: 10px;
  background: var(--surface-2); font-size: .96rem;
}
.explain > :first-child { margin-top: 0; }
.explain > :last-child { margin-bottom: 0; }
.explain::before { content: "💡 解析"; display: block; font-weight: 700; margin-bottom: .2rem; }
.retry { margin-top: .6rem; font-size: .85rem; }

.write {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin: .9rem 0; box-shadow: var(--shadow);
}
.write > h3:first-child, .write > p:first-child { margin-top: 0; }
.write h3 { font-size: 1.05rem; margin: 0 0 .4rem; font-family: var(--sans); }
.write h3::before { content: "✏️ "; }
textarea {
  width: 100%; min-height: 3.2em; resize: vertical; font: inherit; font-size: 1rem; line-height: 1.7;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: .5rem .7rem; margin: .3rem 0 .4rem;
  background-image: repeating-linear-gradient(transparent, transparent calc(1.7em - 1px), var(--line) calc(1.7em - 1px), var(--line) 1.7em);
  background-attachment: local; background-position: 0 .5rem;
}
.field-label { display: block; font-weight: 700; font-size: .92rem; margin-top: .5rem; }
.answer {
  margin-top: .5rem; padding: .7rem .9rem; border-radius: 10px;
  background: var(--good-soft); border-left: 4px solid var(--good); font-size: .96rem;
}
.answer > :first-child { margin-top: 0; }
.answer > :last-child { margin-bottom: 0; }
.answer::before { content: "✅ 參考答案"; display: block; font-weight: 700; color: var(--good); margin-bottom: .2rem; }
.show-all .answer[hidden], .show-all .explain[hidden] { display: block; }

.step-card { border-top: 1px dashed var(--line); padding-top: .4rem; margin-top: .6rem; }
.step-card:first-of-type { border-top: 0; }

/* ---------- home ---------- */
.home-hero { text-align: center; padding: 3rem 0 1.5rem; }
.home-hero h1 { font-size: clamp(2rem, 6vw, 3rem); margin: .5rem 0; }
.home-hero .lead { max-width: 36em; margin: 0 auto; }
.route { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 1rem; }
.route-card {
  display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 1.1rem 1.2rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  border-left: 6px solid var(--c);
  transition: transform .15s, box-shadow .15s;
}
.route-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(60, 40, 20, .1); }
.route-card .big {
  grid-row: span 3; width: 3rem; height: 3rem; border-radius: 12px; display: grid; place-items: center;
  background: var(--c); color: var(--on-color); font-family: var(--round); font-size: 1.5rem; font-weight: 700;
}
.route-card h3 { margin: 0; font-size: 1.2rem; }
.route-card p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.progress-line { font-size: .85rem; color: var(--ink-2); display: flex; align-items: center; gap: .5rem; }
.progress-line .bar { flex: 0 0 140px; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-line .bar i { display: block; height: 100%; width: 0; background: var(--c); }
.connector { text-align: center; color: var(--ink-2); font-size: .9rem; margin: -.4rem 0; }

.pager { display: flex; justify-content: space-between; gap: 1rem; margin: 3rem 0 0; flex-wrap: wrap; }
.pager a {
  flex: 1 1 220px; text-decoration: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .8rem 1rem; color: var(--ink);
}
.pager a small { display: block; color: var(--ink-2); }
.pager a.next { text-align: right; }

.site-footer { text-align: center; color: var(--ink-2); font-size: .85rem; padding: 2rem 1rem 3rem; border-top: 1px solid var(--line); }

/* ---------- hub ---------- */
.section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.section-card {
  display: flex; flex-direction: column; gap: .4rem;
  background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--c);
  border-radius: 18px; padding: 1.2rem 1.3rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
a.section-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(60, 40, 20, .1); }
.section-card .icon { font-size: 2rem; line-height: 1; }
.section-card h3 { margin: .2rem 0 0; font-size: 1.3rem; }
.section-card p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.section-card ul { margin: .3rem 0 0; padding-left: 1.2rem; font-size: .92rem; color: var(--ink-2); }
.section-card .go { margin-top: auto; padding-top: .5rem; font-weight: 700; color: var(--c); font-size: .92rem; }
.section-card.soon { border-style: dashed; border-top-style: dashed; box-shadow: none; background: transparent; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 0 .5rem; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); margin-right: .3rem; }
.page-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .7rem; margin: 1rem 0; }
.page-links a {
  display: block; text-decoration: none; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--unit); border-radius: 12px; padding: .7rem .9rem;
}
.page-links a b { display: block; }
.page-links a span { color: var(--ink-2); font-size: .9rem; }
.page-links a:hover { border-color: var(--unit); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }

/* ---------- hub hero（版型參考 drcwlin.pages.dev：滿版圖＋漸層＋左下文字） ---------- */
.hub-hero { position: relative; background: #3a2616; border-bottom: 1px solid var(--line); }
/* width:100% 必要：只寫 aspect-ratio + max-height 時，瀏覽器會用被夾住的高度反推寬度 */
.hub-hero-media {
  position: relative; width: 100%;
  aspect-ratio: 1536 / 1024; max-height: 80vh; min-height: 420px; overflow: hidden;
  background: linear-gradient(160deg, #bcd9ee 0%, #e6f0dc 55%, #9fcf8a 100%);
}
.hub-hero-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; }
.hub-hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 8% 100%, rgba(50,24,8,.78) 0%, rgba(50,24,8,.45) 45%, rgba(50,24,8,0) 75%),
    linear-gradient(180deg, rgba(50,24,8,0) 70%, rgba(50,24,8,.25) 100%);
}
.hub-hero-copy { position: absolute; inset: auto 0 0 0; z-index: 2; padding-block: clamp(20px, 4.5vw, 48px); color: #fff; }
.hub-hero-inner { padding-inline: clamp(1.1rem, 4vw, 3.5rem); }
/* 文字限寬靠左，避開畫面中間的雙胞胎 */
.hub-hero-inner > .lede, .hub-hero-inner > .hero-pills { max-width: 24rem; }
.hub-hero-copy .eyebrow {
  display: block; background: none; padding: 0; margin: 0 0 .5em;
  font-size: clamp(.75rem, 2.4vw, .85rem); letter-spacing: .18em; font-weight: 700; color: rgba(255,255,255,.88);
}
.hub-hero-copy h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.8rem); color: #fff; margin: 0 0 .35em; max-width: 24rem; line-height: 1.2;
  text-wrap: balance; text-shadow: 0 2px 16px rgba(0,0,0,.35);
}
.hub-hero-copy .lede {
  font-size: clamp(.98rem, 2.8vw, 1.15rem); color: rgba(255,255,255,.95);
  margin: 0; text-shadow: 0 1px 12px rgba(0,0,0,.5); text-wrap: balance; word-break: keep-all;
}
.hero-pills { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(16px, 3vw, 26px); }
.hero-pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 10px 20px; border-radius: 999px; font-size: clamp(.95rem, 2.6vw, 1.05rem); font-weight: 700;
  color: #fff; text-decoration: none; line-height: 1.4; white-space: nowrap;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.45); backdrop-filter: blur(6px);
  transition: background .18s ease, border-color .18s ease;
}
.hero-pill:hover { background: rgba(255,255,255,.26); border-color: rgba(255,255,255,.7); color: #fff; }
/* 小螢幕：圖在上、文字在下，避免文字比圖高而蓋住整張圖 */
@media (max-width: 720px) {
  .hub-hero-media { aspect-ratio: 3 / 2; max-height: 46vh; min-height: 0; }
  .hub-hero-media::after { background: linear-gradient(180deg, rgba(58,38,22,0) 60%, #3a2616 100%); }
  .hub-hero-copy { position: static; padding-block: 6px 26px; }
  .hub-hero-copy .lede { text-shadow: none; }
  .hub-hero-inner > .lede, .hub-hero-inner > .hero-pills { max-width: none; }
  .hub-hero-copy h1 { white-space: normal; }
  .hero-pill { padding: 10px 16px; white-space: normal; }
}

/* ========== 溫暖活潑主題：元件覆寫 ========== */
body {
  background:
    radial-gradient(760px 360px at 105% -40px, color-mix(in srgb, var(--sun) 26%, transparent), transparent 70%),
    radial-gradient(640px 320px at -8% 40px, color-mix(in srgb, var(--unit) 13%, transparent), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
}
h1, h2, h3 { font-weight: 400; letter-spacing: .03em; }
h1 { font-weight: 400; }
b, strong { font-weight: 700; }
h2 { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; border-bottom: 0; padding-bottom: 0; margin-top: 3rem; }
h2 .num {
  flex-shrink: 0; display: inline-grid; place-items: center; min-width: 2.3rem; height: 2.3rem; padding: 0 .55rem;
  margin-right: 0; border-radius: 13px; background: var(--unit); color: var(--on-color);
  font-size: .95rem; letter-spacing: 0; transform: rotate(-5deg);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--unit) 60%, #000);
}
h3 { color: var(--ink); }
a { font-weight: 500; }

/* header */
.site-header { background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 0; box-shadow: 0 2px 14px rgba(150, 90, 40, .08); }
.brand { font-weight: 400; font-size: 1.12rem; }
.seal {
  border-radius: 11px; transform: rotate(-6deg); font-family: var(--round);
  background: linear-gradient(135deg, var(--accent), var(--sun)); color: #fff;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 60%, #000);
}
.section-nav a, .site-nav a { font-weight: 500; transition: background .15s, color .15s; }
.section-nav a[aria-current] { box-shadow: none; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.subnav { border-top: 1px dashed var(--line); background: color-mix(in srgb, var(--unit) 9%, transparent); }
.sub-home { font-family: var(--round); font-weight: 400; font-size: 1rem; }
.site-nav a[aria-current="page"] { box-shadow: 0 2px 0 color-mix(in srgb, var(--unit) 60%, #000); }

/* 各頁 hero：彩色圓角卡片＋圓點裝飾 */
.hero, .home-hero {
  position: relative; overflow: hidden; margin: 1.6rem 0 1.2rem; padding: 2.1rem 1.7rem 1.9rem;
  border-radius: 30px; box-shadow: var(--shadow);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--unit) 20%, var(--surface)) 0%,
    color-mix(in srgb, var(--sun) 30%, var(--surface)) 100%);
}
.hero::before, .home-hero::before {
  content: ""; position: absolute; width: 230px; height: 230px; right: -70px; top: -80px; border-radius: 50%;
  background: color-mix(in srgb, var(--unit) 24%, transparent);
}
.hero::after, .home-hero::after {
  content: ""; position: absolute; width: 130px; height: 130px; right: 90px; bottom: -60px; border-radius: 50%;
  background: color-mix(in srgb, var(--sun) 50%, transparent);
}
.hero > *, .home-hero > * { position: relative; z-index: 1; }
.hero .eyebrow { background: var(--surface); color: var(--unit); box-shadow: var(--shadow); padding: .2rem .85rem; }
.hero .lead, .home-hero .lead { color: var(--ink); max-width: 38em; }
.home-hero { text-align: center; }
.home-hero .seal { transform: rotate(-6deg); }

/* 區塊 */
.goals { border: 2px dashed color-mix(in srgb, var(--unit) 45%, transparent); border-left-width: 2px; background: var(--surface); border-radius: 22px; }
.goals h3 { color: var(--unit); }
.toc a { background: var(--surface); border-color: transparent; box-shadow: var(--shadow); font-weight: 500; }
.toc a:hover { background: color-mix(in srgb, var(--unit) 12%, var(--surface)); color: var(--unit); }
.callout { border: 0; border-radius: 20px; background: var(--surface-2); box-shadow: inset 5px 0 0 color-mix(in srgb, var(--ink-2) 35%, transparent); padding-left: 1.3rem; }
.callout.tip { box-shadow: inset 5px 0 0 var(--sun); }
.callout.key { box-shadow: inset 5px 0 0 var(--accent); }
.callout.unit { box-shadow: inset 5px 0 0 var(--unit); }
.callout.warn { box-shadow: inset 5px 0 0 var(--bad); }
.callout .title { font-family: var(--round); font-weight: 400; font-size: 1.05rem; }
.example, .write, .q, .passage, .judge-card, .chip-card, .steps-list > li { border-radius: 20px; }
.example { border-color: transparent; }
.table-wrap { border-radius: 20px; border-color: transparent; box-shadow: var(--shadow); }
th { background: color-mix(in srgb, var(--unit) 14%, var(--surface)); color: var(--ink); font-family: var(--round); font-weight: 400; font-size: 1rem; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.flow span.step { border-radius: 999px; border-color: transparent; box-shadow: var(--shadow); }
.chip-card { border: 0; border-top: 5px solid var(--unit); box-shadow: var(--shadow); padding: .8rem 1rem; }
.chips .chip-card:nth-child(4n+2) { border-top-color: var(--sun); }
.chips .chip-card:nth-child(4n+3) { border-top-color: var(--accent); }
.chips .chip-card:nth-child(4n+4) { border-top-color: color-mix(in srgb, var(--unit) 55%, var(--sun)); }
.chip-card b { font-family: var(--round); font-weight: 400; font-size: 1.05rem; }
.steps-list > li { border-color: transparent; box-shadow: var(--shadow); }
.steps-list > li::before { border-radius: 11px; transform: rotate(-6deg); box-shadow: 0 2px 0 color-mix(in srgb, var(--unit) 60%, #000); }
.judge-card { border-color: color-mix(in srgb, var(--unit) 55%, transparent); background: color-mix(in srgb, var(--unit) 6%, var(--surface)); }
.passage { border-color: transparent; background: color-mix(in srgb, var(--sun) 10%, var(--surface)); }
.hl { background: color-mix(in srgb, var(--sun) 55%, transparent); border-radius: 6px; }

/* 練習區 */
.practice { border: 2px dashed color-mix(in srgb, var(--unit) 40%, transparent); border-radius: 30px; background: color-mix(in srgb, var(--unit) 7%, var(--bg)); }
.practice > h2 { margin-top: .2rem; }
.toolbar { background: transparent; backdrop-filter: blur(6px); border-radius: 16px; }
button, .btn { border-radius: 999px; font-weight: 500; transition: transform .12s, box-shadow .12s, background .15s; }
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(1px); }
.btn-primary { box-shadow: 0 3px 0 color-mix(in srgb, var(--unit) 60%, #000); }
.q, .write { border-color: transparent; }
.opt { border-radius: 14px; border-width: 2px; }
.opt:hover:not([disabled]) { background: color-mix(in srgb, var(--unit) 8%, var(--surface)); }
.q-text::before { border-radius: 999px; background: color-mix(in srgb, var(--unit) 12%, transparent); border-color: transparent; }
.explain, .answer { border-radius: 14px; }
textarea { border-radius: 14px; }
.score .bar, .progress-line .bar { height: 8px; }

/* 卡片與導覽 */
.route-card, .section-card { border-radius: 26px; border-color: transparent; }
.route-card { border-left: 0; box-shadow: var(--shadow); }
.route-card .big { border-radius: 16px; transform: rotate(-6deg); box-shadow: 0 3px 0 color-mix(in srgb, var(--c) 60%, #000); font-weight: 400; }
.route-card h3 { font-size: 1.25rem; }
.route-card:hover, a.section-card:hover, .page-links a:hover, .pager a:hover { box-shadow: var(--shadow-lift); transform: translateY(-3px); }
.section-card { border-top: 0; position: relative; overflow: hidden; padding-top: 1.5rem; }
.section-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 7px; background: linear-gradient(90deg, var(--c), var(--sun)); }
.section-card .icon {
  display: inline-grid; place-items: center; width: 3.2rem; height: 3.2rem; font-size: 1.8rem; border-radius: 18px;
  background: color-mix(in srgb, var(--c) 16%, var(--surface)); transform: rotate(-5deg);
}
.section-card h3 { font-size: 1.35rem; }
.section-card.soon { border: 2px dashed var(--line); }
.section-card.soon::before { display: none; }
.page-links a { border: 0; border-radius: 18px; box-shadow: var(--shadow); position: relative; padding-left: 1.2rem; transition: transform .15s, box-shadow .15s; }
.page-links a::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 5px; border-radius: 0 6px 6px 0; background: var(--unit); }
.page-links a b { font-family: var(--round); font-weight: 400; font-size: 1.08rem; }
.pager a { border: 0; border-radius: 18px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; font-family: var(--round); }
.site-footer { border-top: 0; background: var(--surface-2); margin-top: 2rem; border-radius: 30px 30px 0 0; }
.site-footer a { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  button:hover, .route-card:hover, a.section-card:hover, .page-links a:hover, .pager a:hover { transform: none; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .hero, .home-hero, .practice, .q, .write, .example, .chip-card, .table-wrap { box-shadow: none !important; background: #fff !important; }
  .hero::before, .hero::after, .home-hero::before, .home-hero::after { display: none; }
  .site-header, .subnav, .hub-hero, .toolbar, .retry, .reveal-btn, .pager, .site-footer, .toc { display: none !important; }
  .practice { background: none; border: 0; padding: 0; }
  .q, .write, .example, .passage { box-shadow: none; break-inside: avoid; }
  textarea { min-height: 5em; border: 0; border-bottom: 1px solid #999; }
  a { color: inherit; text-decoration: none; }
}
