/* Google 試算表課前自學：共用樣式 */

:root {
  color-scheme: light dark;
  --bg: #f7f9f7;
  --surface: #ffffff;
  --surface-2: #eef3ef;
  --text: #1c2420;
  --text-2: #4b5852;
  --border: #d5ddd8;
  --primary: #17703f;
  --primary-hover: #115a32;
  --primary-soft: #e3f2e8;
  --on-primary: #ffffff;
  --ok: #17703f;
  --ok-soft: #e3f2e8;
  --bad: #b3261e;
  --on-bad: #fff;
  --bad-soft: #fbe9e7;
  --info: #1d5fa8;
  --info-soft: #e6eef9;
  --warn: #8a5a00;
  --warn-soft: #fdf3d8;
  --warn-border: #e3b341;
  --preview: #6b3fa0;
  --preview-soft: #f1eafa;
  --focus: #1d5fa8;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 2px 8px rgb(0 0 0 / 5%);
  --radius: 10px;
  --header-h: 60px;
  --nav-w: 264px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614;
    --surface: #1b211e;
    --surface-2: #232b27;
    --text: #e6ece8;
    --text-2: #a9b5ae;
    --border: #35403a;
    --primary: #58c486;
    --primary-hover: #7ad3a0;
    --primary-soft: #1d3527;
    --on-primary: #0b1a11;
    --ok: #6fd39a;
    --ok-soft: #1d3527;
    --bad: #ff8a80;
    --on-bad: #2a0d0b;
    --bad-soft: #3a1f1d;
    --info: #8ab8f0;
    --info-soft: #1c2a3b;
    --warn: #f2c25b;
    --warn-soft: #352b14;
    --warn-border: #a8801f;
    --preview: #c4a3f0;
    --preview-soft: #2b2238;
    --focus: #8ab8f0;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-padding-top: calc(var(--header-h) + 64px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

@media (min-width: 1024px) { body { font-size: 18px; } }

a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.4; margin: 1.6em 0 0.6em; }
h1 { font-size: 1.9rem; margin-top: 0; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.17rem; }
p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.5em; }
li + li { margin-top: 0.25em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.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;
}

.skip-link { position: absolute; left: 8px; top: -100px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 6px; }
.skip-link:focus { top: 8px; }

/* ---------- Windows／Mac 切換 ---------- */
html[data-os="mac"] .only-win,
html:not([data-os="mac"]) .only-mac { display: none !important; }

kbd {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.86em;
  line-height: 1.3;
  padding: 0.1em 0.45em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  white-space: nowrap;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* ---------- 頁首 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: 100%;
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px; flex: none;
  background:
    linear-gradient(var(--on-primary), var(--on-primary)) 50% 33% / 60% 2px no-repeat,
    linear-gradient(var(--on-primary), var(--on-primary)) 50% 66% / 60% 2px no-repeat,
    linear-gradient(var(--on-primary), var(--on-primary)) 40% 50% / 2px 60% no-repeat,
    var(--primary);
}
.header-progress { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 0.9rem; color: var(--text-2); white-space: nowrap; }
.progress-bar { display: block; width: 120px; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.progress-bar-fill { display: block; height: 100%; width: 0; background: var(--primary); transition: width 0.3s; }

.os-toggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex: none; }
.os-btn {
  font: inherit; font-size: 0.88rem; padding: 4px 12px; min-height: 36px;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer;
}
.os-btn + .os-btn { border-left: 1px solid var(--border); }
.os-btn[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); font-weight: 700; }

.menu-btn {
  display: none; align-items: center; gap: 6px;
  font: inherit; font-size: 0.9rem; min-height: 40px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer;
}
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; }
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -5px; }
.menu-icon::after { top: 5px; }

/* ---------- 版面 ---------- */
.site-body { display: flex; align-items: flex-start; }
.site-nav {
  position: sticky; top: var(--header-h);
  width: var(--nav-w); flex: none;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.95rem;
}
.nav-inner { padding: 16px 12px 32px; }
.site-nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; line-height: 1.45;
}
.site-nav a:hover { background: var(--surface-2); }
.site-nav a.is-current { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav-heading { margin: 18px 10px 4px; font-size: 0.8rem; font-weight: 700; color: var(--text-2); letter-spacing: 0.05em; }
.nav-units, .nav-pages { list-style: none; padding: 0; margin: 0; }
.nav-units li + li, .nav-pages li + li { margin-top: 2px; }
.nav-num { width: 1.2em; text-align: center; color: var(--text-2); font-variant-numeric: tabular-nums; }
.nav-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 20px 10px 0; font-size: 0.8rem; color: var(--text-2); }
.nav-legend .status-icon:not(:first-child) { margin-left: 8px; }

.status-icon { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid var(--text-2); display: inline-block; position: relative; }
.status-in_progress { border-color: var(--info); background: linear-gradient(90deg, var(--info) 50%, transparent 50%); }
.status-completed { border-color: var(--ok); background: var(--ok); }
.status-completed::after {
  content: ""; position: absolute; left: 3px; top: 0px; width: 4px; height: 7px;
  border: solid var(--surface); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.site-main { flex: 1; min-width: 0; padding: 40px 48px 64px; }
.site-main > * { max-width: 800px; }
.site-main > .wide { max-width: 1100px; }

@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .site-nav {
    position: fixed; left: 0; top: var(--header-h); z-index: 40;
    height: calc(100dvh - var(--header-h));
    transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow);
    visibility: hidden;
  }
  body.nav-open .site-nav { transform: none; visibility: visible; }
  body.nav-open::after { content: ""; position: fixed; inset: var(--header-h) 0 0; background: rgb(0 0 0 / 35%); z-index: 30; }
  .site-main { padding: 28px 16px 48px; }
  .header-inner { padding: 0 16px; gap: 10px; }
  .progress-bar { width: 64px; }
}
@media (max-width: 560px) {
  .brand { font-size: 0; gap: 0; }
  .header-progress { font-size: 0.8rem; }
  .progress-bar { display: none; }
  .os-btn { padding: 4px 9px; }
  h1 { font-size: 1.6rem; }
}

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 0.95rem; font-weight: 700; line-height: 1.3;
  min-height: 44px; padding: 8px 18px;
  border-radius: 8px; border: 1px solid transparent; cursor: pointer; text-decoration: none; text-align: center;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-secondary { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.btn-secondary:hover { background: var(--primary-soft); }
.btn-text { background: none; color: var(--text-2); padding: 8px 4px; font-weight: 400; text-decoration: underline; min-height: 36px; }
.btn-lg { font-size: 1.05rem; padding: 10px 24px; min-height: 50px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-danger { background: var(--bad); color: var(--on-bad); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mt-s { margin-top: 10px; }
.mt-m { margin-top: 14px; }
.page-narrow { margin: 0 auto; max-width: 800px; }

/* ---------- 提示框 ---------- */
.callout {
  --c: var(--info); --c-soft: var(--info-soft);
  border: 1px solid var(--c); border-left-width: 5px;
  background: var(--c-soft);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 0 0 1.4em;
}
.callout > :last-child { margin-bottom: 0; }
.callout-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--c); margin-bottom: 0.3em; }
.callout-title::before {
  content: "i"; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--c); color: var(--surface);
  font-size: 0.8rem; font-weight: 700; line-height: 1;
}
.callout-key { --c: var(--ok); --c-soft: var(--ok-soft); }
.callout-key .callout-title::before { content: "★"; }
.callout-warn { --c: var(--warn); --c-soft: var(--warn-soft); border-color: var(--warn-border); border-left-color: var(--warn); }
.callout-warn .callout-title::before { content: "!"; }
.callout-os .callout-title::before { content: "⌘"; }
.callout-os.only-win .callout-title::before { content: "⊞"; }
.callout-preview { --c: var(--preview); --c-soft: var(--preview-soft); }
.callout-preview .callout-title::before { content: "→"; }

/* 新聞情境 */
.callout-story { --c: var(--info); --c-soft: var(--info-soft); }
.callout-story .callout-title::before { content: "✎"; }

/* 看更多、截圖收合 */
details.more, details.shot-more {
  margin: 0 0 1.2em; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
details.more > summary, details.shot-more > summary {
  cursor: pointer; padding: 8px 14px; font-weight: 500; color: var(--primary); list-style: none;
}
details.more > summary::-webkit-details-marker, details.shot-more > summary::-webkit-details-marker { display: none; }
details.more > summary::before, details.shot-more > summary::before { content: "▸ "; display: inline-block; transition: transform 0.15s; }
details[open].more > summary::before, details[open].shot-more > summary::before { transform: rotate(90deg); }
details.more > summary:hover, details.shot-more > summary:hover { background: var(--surface-2); }
details.more > :not(summary), details.shot-more > :not(summary) { margin-left: 14px; margin-right: 14px; }
details.more > :last-child, details.shot-more > :last-child { margin-bottom: 14px; }
details.more > summary + *, details.shot-more > summary + * { margin-top: 8px; }

/* 段落內的模擬練習：琥珀色粗框＋「動手做」標籤，和截圖明顯不同；完成後變綠色 */
.sim-inline { margin: 1.4em 0 1.8em; }
.sim-inline:has(.sim-panel) {
  border: 3px solid var(--warn-border); border-radius: 14px; padding: 12px;
  background: color-mix(in srgb, var(--warn-soft) 70%, var(--surface));
}
.sim-inline.is-done:has(.sim-panel) { border-color: var(--ok); background: color-mix(in srgb, var(--ok-soft) 60%, var(--surface)); }
.sim-inline-tag {
  align-self: flex-start; margin: -2px 0 0; padding: 3px 14px; border-radius: 99px;
  background: var(--warn); color: #fff; font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em;
}
.sim-inline.is-done .sim-inline-tag { background: var(--ok); }
/* 深色模式的 --ok 是淺綠色，白字對比不足，改用深色字 */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sim-inline.is-done .sim-inline-tag { color: #0b2a17; } }
:root[data-theme="dark"] .sim-inline.is-done .sim-inline-tag { color: #0b2a17; }
.sim-inline .sim-task-line { font-size: 1.08rem; font-weight: 700; }
.sim-inline .sim-task-line::before { content: "👉 "; }
.sim-inline-label { font-weight: 700; color: var(--primary); margin: 0 0 6px; }

/* 小節進度列 */
.section-progress {
  position: sticky; top: var(--header-h); z-index: 20;
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  margin: 0 0 1.4rem; padding: 8px 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border); font-size: 0.9rem;
}
.section-progress-label { margin: 0; font-weight: 700; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 200px; }
.section-progress ol { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.section-progress li + li { margin-top: 0; }
.section-dot {
  /* 點擊範圍 24px（WCAG 2.5.8），看得見的圓點 14px；未完成的邊框用次要文字色，對比 ≥ 3:1 */
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
}
.section-dot::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; box-sizing: border-box;
  border: 2px solid var(--text-2); background: var(--surface);
}
.section-dot.is-done::before { background: var(--ok); border-color: var(--ok); }
.section-dot.is-current::before { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.section-dot:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- 單元頁 ---------- */
.unit-head { margin-bottom: 2rem; }
.eyebrow { color: var(--text-2); font-size: 0.9rem; margin-bottom: 0.3em; font-weight: 500; }
.mobile-note { display: none; }
@media (max-width: 767px) { .mobile-note { display: block; } }

main section { margin-bottom: 3rem; }
main section > h2:first-child { margin-top: 0; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.unit-head + section > h2:first-child,
.resume-bar + section > h2:first-child { border-top: 0; padding-top: 0; }

.goal-list { list-style: none; padding: 0; }
.goal-list li { position: relative; padding-left: 1.8em; }
.goal-list li::before { content: "✓"; position: absolute; left: 0.2em; color: var(--ok); font-weight: 700; }

.steps { list-style: none; padding: 0; counter-reset: step; }
.steps > li {
  position: relative; counter-increment: step;
  padding: 2px 0 2px 2.6em; margin-bottom: 0.7em;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0.15em;
  width: 1.75em; height: 1.75em; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary);
  font-size: 0.9em; font-weight: 700;
}
.steps-title { font-weight: 700; margin-bottom: 0.4em; }

.summary-list li::marker { color: var(--primary); }

.table-wrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.95em; }
th, td { border-bottom: 1px solid var(--border); padding: 9px 12px; text-align: left; vertical-align: top; }
thead th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }

/* 示意用的小型工作表（不是模擬器） */
.mini-sheet { border-collapse: collapse; width: auto; font-size: 0.88rem; background: #fff; color: #1f1f1f; font-family: var(--font); }
.mini-sheet th, .mini-sheet td { border: 1px solid #d4d4d4; padding: 3px 10px; min-width: 64px; white-space: nowrap; }
.mini-sheet thead th, .mini-sheet tbody th { background: #f3f3f3; color: #555; font-weight: 400; text-align: center; min-width: 32px; }
.mini-sheet .num { text-align: right; }
.mini-sheet .bad-cell { background: #fde2e1; outline: 2px solid #c42b1c; outline-offset: -2px; }
.mini-sheet .hl { background: #dff0e5; outline: 2px solid #17703f; outline-offset: -2px; }
.mini-sheet .merged { text-align: center; vertical-align: middle; }
.sheet-caption { font-size: 0.9rem; color: var(--text-2); margin: 0.4em 0 1.2em; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 1.4em; }
.compare-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.compare-item .table-wrap { border: 0; margin: 0; background: transparent; }
.compare-label { font-weight: 700; margin-bottom: 0.5em; }
.compare-label.bad { color: var(--bad); }
.compare-label.ok { color: var(--ok); }

/* 模擬器尚未完成 */
.sim-placeholder {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 20px; background: var(--surface);
}
.sim-placeholder > :last-child { margin-bottom: 0; }
.tag-optional { display: inline-block; vertical-align: 0.2em; font-size: 0.8rem; font-weight: 700; padding: 1px 10px; margin-right: 10px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.optional-note { color: var(--text-2); font-size: 0.95rem; }
.sim-badge { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); margin-bottom: 0.6em; }

/* 練習檔 */
.download-line { margin-bottom: 1em; }
.checklist { list-style: none; padding: 0; margin: 0 0 0.6em; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.checklist li + li { margin-top: 6px; }
.checklist input { width: 20px; height: 20px; margin-top: 0.3em; flex: none; accent-color: var(--primary); }
.checklist label { cursor: pointer; flex: 1; }
.checklist input:checked + label { color: var(--text-2); }
.checklist-count { font-size: 0.9rem; color: var(--text-2); }
.checklist-count.ok { color: var(--ok); font-weight: 700; }

/* 測驗 */
.quiz-question {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 16px 18px; margin: 0 0 16px; min-width: 0;
}
.quiz-question legend { display: contents; }
.quiz-num { display: block; font-size: 0.85rem; font-weight: 700; color: var(--text-2); }
.quiz-q { display: block; font-weight: 700; margin-bottom: 0.6em; }
.quiz-code { font-family: var(--mono); background: var(--surface-2); padding: 10px 14px; border-radius: 8px; overflow-x: auto; font-size: 0.9rem; margin: 0 0 0.8em; white-space: pre-wrap; }
.quiz-options { display: grid; gap: 8px; }
.quiz-option {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.quiz-option:hover { background: var(--surface-2); }
.quiz-option input { width: 18px; height: 18px; margin-top: 0.35em; accent-color: var(--primary); flex: none; }
.quiz-option-text { flex: 1; min-width: 0; }
.quiz-option:has(input:disabled) { cursor: default; }
.quiz-option:has(input:disabled):hover { background: none; }
.quiz-option.is-answer { border-color: var(--ok); background: var(--ok-soft); }
.quiz-option.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.quiz-mark { font-size: 0.85rem; font-weight: 700; margin-left: auto; }
.mark-ok { color: var(--ok); }
.mark-bad { color: var(--bad); }
.quiz-feedback:empty { display: none; }
.quiz-confirm { margin-top: 12px; }
.quiz-feedback:focus { outline: none; }
.quiz-feedback { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.quiz-feedback > :last-child { margin-bottom: 0; }
.feedback-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 0.3em; }
.feedback-title.ok, .quiz-score.ok, .complete-status.ok { color: var(--ok); }
.feedback-title.bad, .quiz-score.bad { color: var(--bad); }
.feedback-icon {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; font-size: 0.85rem;
  border: 2px solid currentColor;
}
.quiz-summary { border-radius: var(--radius); background: var(--surface-2); padding: 16px 18px; margin-bottom: 16px; }
.quiz-summary:empty { display: none; }
.quiz-score { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; font-weight: 700; margin-bottom: 0.4em; }
.exam-intro { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.exam-submit { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.exam-status { margin: 0; color: var(--text-2); }

/* 完成區 */
.complete-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.complete-box > :last-child { margin-bottom: 0; }
.complete-status { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; font-weight: 700; }
.condition-list { list-style: none; padding: 0; }
.condition-list li.ok { color: var(--ok); }
.quiz-optional-note { font-size: 0.9rem; color: var(--text-2); }
.backup-reminder { margin-top: 1em; }

.resume-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  background: var(--info-soft); border: 1px solid var(--info); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 2rem;
}
.resume-bar p { margin: 0; font-weight: 500; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.pager-link { display: flex; flex-direction: column; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; line-height: 1.5; }
.pager-link:hover { border-color: var(--primary); }
.pager-next { text-align: right; grid-column: 2; }
.pager-dir { font-size: 0.82rem; color: var(--text-2); }

/* ---------- 首頁 ---------- */
.hero { margin-bottom: 2rem; }
.hero-lead { font-size: 1.1rem; color: var(--text-2); }
.continue-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 1.4em; box-shadow: var(--shadow); }
.continue-label { font-size: 0.88rem; color: var(--text-2); margin-bottom: 0.2em; }
.continue-where { font-size: 1.2rem; font-weight: 700; }
.continue-section { font-weight: 400; color: var(--text-2); font-size: 1rem; }
.overview-line { color: var(--text-2); }
.unit-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.unit-cards li + li { margin-top: 0; }
.unit-card a {
  display: flex; flex-direction: column; gap: 2px; height: 100%;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); text-decoration: none; line-height: 1.5;
}
.unit-card a:hover { border-color: var(--primary); }
.unit-card.is-completed a { border-color: var(--ok); }
.unit-card-num { font-size: 0.82rem; color: var(--text-2); font-weight: 700; }
.unit-card-title { font-weight: 700; font-size: 1.05rem; }
.unit-card-meta { font-size: 0.85rem; color: var(--text-2); margin-bottom: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 700; margin-top: auto; }
.badge-completed { color: var(--ok); }
.badge-in_progress { color: var(--info); }
.badge-not_started { color: var(--text-2); }

/* ---------- 其他頁面 ---------- */
.plain-list { list-style: none; padding: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 1.4em; }
.panel > :last-child { margin-bottom: 0; }
.panel h2 { margin-top: 0; font-size: 1.25rem; }
.form-msg { font-weight: 500; min-height: 1.75em; margin: 0.6em 0 0; }
.form-msg.ok { color: var(--ok); }
.form-msg.bad { color: var(--bad); }
textarea, input[type="text"], input[type="number"] {
  font: inherit; font-size: 0.95rem; width: 100%;
  padding: 8px 10px; border: 1px solid var(--text-2); border-radius: 8px;
  background: var(--surface); color: var(--text);
}
textarea { min-height: 110px; font-family: var(--mono); font-size: 0.82rem; word-break: break-all; }
label.field { display: block; font-weight: 700; margin: 0.8em 0 0.3em; }
.field-hint { font-size: 0.88rem; color: var(--text-2); margin: 0.2em 0 0; }
input[type="file"] { font: inherit; font-size: 0.95rem; max-width: 100%; }

.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; list-style: none; padding: 0; }
.shortcut-grid li + li { margin-top: 0; }
.shortcut-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; height: 100%; }
.shortcut-name { font-weight: 700; margin: 0 0 0.3em; }
.shortcut-keys { margin: 0; }
.shortcut-note { font-size: 0.85rem; color: var(--text-2); margin: 0.3em 0 0; }

.download-list { list-style: none; padding: 0; }
.download-item { display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.download-item + .download-item { margin-top: 10px; }
.download-info { flex: 1 1 280px; }
.download-info p { margin: 0; }
.download-name { font-weight: 700; }
.download-desc, .download-units { font-size: 0.9rem; color: var(--text-2); }

.cert-card {
  background: var(--surface); border: 2px solid var(--primary); border-radius: 14px;
  padding: 28px; text-align: center; max-width: 560px; margin: 0 auto 1.4em;
}
.cert-eyebrow { color: var(--text-2); margin-bottom: 0.2em; }
.cert-title { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.cert-fields { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; text-align: left; max-width: 340px; margin: 0 auto 1.2em; }
.cert-fields dt { color: var(--text-2); }
.cert-fields dd { margin: 0; font-weight: 700; }
.cert-code { font-family: var(--mono); font-size: 1.25rem; letter-spacing: 0.08em; }
.cert-units { list-style: none; padding: 0; text-align: left; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2px 16px; font-size: 0.9rem; color: var(--text-2); }
.cert-units li + li { margin-top: 0; }
.cert-units li.ok { color: var(--ok); }

@media print {
  .site-header, .site-nav, .no-print, .pager { display: none !important; }
  .site-main { padding: 0; }
  body { background: #fff; color: #000; }
}

/* ---------- 介面示意圖（固定淺色，與 Excel 預設一致） ---------- */
.ui-map {
  margin: 0 0 1.4em; border: 1px solid #c8c8c8; border-radius: 10px; overflow: hidden;
  background: #fff; color: #1f1f1f; font-size: 0.85rem; line-height: 1.4;
}
.ui-no {
  display: inline-grid; place-items: center; flex: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: #c42b1c; color: #fff; font-size: 0.75rem; font-weight: 700; margin-right: 6px;
}
.ui-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; padding: 6px 12px; background: #f3f3f3; border-bottom: 1px solid #e0e0e0; }
.ui-tab.is-on { color: #17703f; font-weight: 700; border-bottom: 2px solid #17703f; }
.ui-ribbon { display: flex; align-items: center; padding: 16px 12px; background: #f9f9f9; border-bottom: 1px solid #e0e0e0; color: #555; }
.ui-formula { display: flex; align-items: stretch; gap: 6px; padding: 5px 8px; border-bottom: 1px solid #e0e0e0; }
.ui-namebox { display: flex; align-items: center; border: 1px solid #c8c8c8; padding: 2px 8px; min-width: 90px; }
.ui-fx { display: flex; align-items: center; padding: 0 6px; font-style: italic; color: #555; }
.ui-bar { display: flex; align-items: center; flex: 1; border: 1px solid #c8c8c8; padding: 2px 8px; color: #555; }
.ui-grid { display: grid; grid-template-columns: 34px repeat(4, minmax(48px, 1fr)); }
.ui-grid > span { height: 26px; border-right: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; }
.ui-corner, .ui-colhead, .ui-rowhead { background: #f3f3f3; color: #555; display: grid; place-items: center; }
.ui-cell.is-active { outline: 2px solid #17703f; outline-offset: -2px; }
.ui-labels { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 12px; border-top: 1px solid #e0e0e0; }
.ui-labels > span { display: flex; align-items: center; }
.ui-sheets { display: flex; align-items: center; gap: 10px; padding: 4px 12px; background: #f3f3f3; border-top: 1px solid #e0e0e0; }
.ui-sheet.is-on { background: #fff; padding: 0 10px; border-bottom: 2px solid #17703f; color: #17703f; font-weight: 700; }
.ui-plus { color: #555; }
.ui-status { display: flex; align-items: center; padding: 3px 12px; background: #f3f3f3; border-top: 1px solid #e0e0e0; color: #555; }
.ui-zoom { margin-left: auto; }

/* Excel 實際畫面截圖 */
figure.shot { margin: 0 0 1.4em; }
figure.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
figure.shot figcaption { font-size: 0.9rem; color: var(--text-2); margin-top: 0.4em; }
.shot-note { display: block; font-size: 0.85rem; }

/* 課前檢測：實作結果與各面向成績 */
.evidence-item { margin-bottom: 6px; }
.evidence-item input { max-width: 240px; }
.evidence-item .form-msg { min-height: 0; margin-top: 0.3em; }
.exam-areas td:first-of-type { white-space: nowrap; }
.exam-areas .ok { color: var(--ok); font-weight: 500; }
.cert-who { margin-bottom: 20px; }
.cert-who input { max-width: 320px; }
.practice-verify { margin-top: 16px; }
.practice-verify input { max-width: 240px; }
