/* 平台版面：頂部列、地圖、側欄、講師導覽列、播放器與各步驟型別。token 在 base.css。 */

/* 章節配色 */
.theme-green { --t: var(--c-primary); --t-dark: var(--c-primary-dark); --t-soft: var(--c-primary-soft); }
.theme-blue { --t: var(--c-blue); --t-dark: var(--c-blue-dark); --t-soft: var(--c-blue-soft); }
.theme-purple { --t: var(--c-purple); --t-dark: var(--c-purple-dark); --t-soft: var(--c-purple-soft); }
.theme-orange { --t: var(--c-orange); --t-dark: var(--c-orange-dark); --t-soft: var(--c-orange-soft); }
.theme-gold { --t: var(--c-gold); --t-dark: var(--c-gold-dark); --t-soft: var(--c-gold-soft); }


.boot { padding: 40vh 0; text-align: center; color: var(--c-muted); }
.boot-error { max-width: 47.5rem; margin: 10vh auto; padding: 1.5rem; }
.boot-error pre { white-space: pre-wrap; background: var(--c-red-soft); color: var(--c-red-dark); padding: 1rem; border-radius: var(--radius); font-size: 0.875rem; }

/* ---------- 頂部列 ---------- */
.top { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(0.5rem); border-bottom: 0.125rem solid var(--c-line); }
.top-inner { max-width: 73.75rem; margin: 0 auto; padding: 0.5rem 1rem; display: flex; align-items: center; gap: 0.75rem; }
.brand { display: flex; align-items: center; gap: 0.625rem; text-decoration: none; color: inherit; min-width: 0; }
.brand-mark { font-size: 1.75rem; line-height: 1; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* 頁首擠的時候（英文站名較長）站名縮成「…」，不撐出橫向捲軸 */
.brand-text small { color: var(--c-muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.pill { display: inline-flex; align-items: center; gap: 0.125rem; font-weight: 800; padding: 0.25rem 0.625rem; border-radius: 999px; font-size: .9rem; white-space: nowrap; }
.pill-xp { background: var(--c-gold-soft); color: #8a6200; }
.pill-streak { background: var(--c-orange-soft); color: var(--c-orange-dark); }
.pill-streak .ico { width: 1em; height: 1em; }
.top-wrong b { margin-left: 0.125rem; }
.top-wrong.has-wrong { --b-fg: var(--c-red-dark); }
.top-menu { font-size: 1.3rem; line-height: 1; }
.top-full { display: none; font-size: 1.1rem; }
.top-sfx .ico { width: 1.15em; height: 1.15em; }
.top-sfx.is-off { --b-fg: var(--c-muted); }
/* 語系切換（家用站才有）：顯示「要切過去的語言」 */
.top-lang { font-weight: 800; letter-spacing: .02em; min-width: 2.6rem; }
.teach .top-full { display: inline-flex; }

.menu { position: fixed; top: 3.75rem; right: 1rem; z-index: 60; min-width: 14.375rem; padding: 0.5rem; box-shadow: 0 0.625rem 1.875rem rgba(0, 0, 0, .12); }
.menu-item { display: block; width: 100%; text-align: left; padding: 0.625rem 0.75rem; border: 0; background: none; border-radius: 0.625rem; cursor: pointer; font-weight: 700; text-decoration: none; color: var(--c-text); }
.menu-item:hover { background: var(--c-surface-2); }
.menu-meta { font-size: .78rem; padding: 0.5rem 0.75rem 0.25rem; border-top: 0.125rem solid var(--c-line); margin-top: 0.375rem; line-height: 1.5; }

/* ---------- 首頁版面 ---------- */
.home { max-width: 73.75rem; margin: 0 auto; padding: 1rem 1rem 7.5rem; display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 2rem; align-items: start; }
.home-map { min-width: 0; }
.hero { text-align: center; padding: 1.125rem 0.5rem 0.375rem; }
.hero-title { margin: 0; font-size: 1.7rem; line-height: 1.3; letter-spacing: .02em; }
.hero-sub { margin: 0.25rem 0 0; color: var(--c-muted); }
.home-side { position: sticky; top: 4.75rem; display: flex; flex-direction: column; gap: 0.875rem; }
.side-card { padding: 1rem; }
.side-h { font-weight: 800; font-size: 1rem; margin-bottom: 0.5rem; }
.side-p { margin: 0 0 0.75rem; font-size: .92rem; }
.side-big strong { font-size: 2rem; line-height: 1; }
.side-big span { color: var(--c-muted); font-weight: 700; }
.meter { height: 0.875rem; background: var(--c-locked); border-radius: 999px; overflow: hidden; margin: 0.625rem 0 0.875rem; }
.meter-fill { height: 100%; background: var(--c-primary); border-radius: 999px; transition: width .6s var(--ease); box-shadow: inset 0 -0.1875rem 0 rgba(0, 0, 0, .12); }
.side-done { font-weight: 700; color: var(--c-primary-dark); }
.side-chapters { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.side-ch { width: 100%; display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.625rem; border: 0.125rem solid var(--c-line); background: var(--c-surface); border-radius: 0.75rem; cursor: pointer; text-align: left; }
.side-ch:hover { background: var(--c-surface-2); }
.side-ch-dot { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--t); flex: none; }
.side-ch.is-closed .side-ch-dot { background: var(--c-locked-dark); }
.side-ch-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.side-ch-text small { color: var(--c-muted); font-size: .75rem; font-weight: 700; }
.side-ch-text span { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-ch-n { margin-left: auto; font-weight: 800; color: var(--t-dark); }
.side-ch-tag { margin-left: auto; display: inline-flex; align-items: center; gap: 0.25rem; font-size: .78rem; font-weight: 800; color: var(--c-orange-dark); white-space: nowrap; }
.cone-xs { width: 1rem; height: 1rem; }

/* ---------- 章節橫幅 ---------- */
.chapter { margin: 1.625rem auto 0; max-width: 38.75rem; }
.ch-banner {
  display: flex; align-items: center; gap: 1rem;
  background: var(--t); color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.25rem;
  box-shadow: 0 0.3125rem 0 var(--t-dark);
}
.ch-banner-text { min-width: 0; flex: 1; }
.ch-label { font-weight: 800; opacity: .9; font-size: .9rem; letter-spacing: .05em; }
.ch-title { margin: 0.125rem 0 0.125rem; font-size: 1.35rem; line-height: 1.35; }
.ch-desc { margin: 0; opacity: .95; font-size: .93rem; }
.ch-draft { display: inline-flex; align-items: center; gap: .3em; margin-top: .5rem; padding: .1rem .65rem; border-radius: 999px; background: rgba(255, 255, 255, .22); font-size: .78rem; font-weight: 800; }
.chapter.is-closed .ch-draft { background: var(--c-locked); }
.ch-meter { display: flex; flex-direction: column; align-items: center; gap: 0.125rem; flex: none; }
.ch-meter-text { font-weight: 800; font-size: .85rem; }
.ring { width: 2.875rem; height: 2.875rem; display: block; }
.ring svg { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 6; }
.ring-fg { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray .6s var(--ease); }
.chapter.is-closed .ch-banner { background: #eef0f2; color: var(--c-muted); box-shadow: 0 0.3125rem 0 var(--c-locked-dark); border: 0.125rem dashed var(--c-locked-dark); }
.ch-closed { display: flex; flex-direction: column; align-items: center; gap: 0.125rem; flex: none; font-weight: 800; color: var(--c-orange-dark); }
.cone-banner { width: 2.875rem; height: 2.875rem; }

/* ---------- 路徑與節點 ---------- */
.path { position: relative; width: 20rem; max-width: 100%; margin: 0.5rem auto 0; }
.path-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.path-line .seg { fill: none; stroke: var(--c-locked); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 2 18; }
.path-line .seg-lit { stroke: var(--t); stroke-dasharray: none; opacity: .5; }
.path-line .seg-closed { stroke: var(--c-locked-dark); stroke-dasharray: 2 16; opacity: .6; }

.node-wrap { position: absolute; width: 0; height: 0; z-index: 1; }
.node {
  position: absolute; left: -2.375rem; top: -2.375rem; width: 4.75rem; height: 4.75rem;
  border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--t); color: #fff;
  box-shadow: 0 0.4375rem 0 var(--t-dark), inset 0 -0.25rem 0 rgba(0, 0, 0, .08);
  transition: transform .1s, box-shadow .1s, filter .2s;
  -webkit-tap-highlight-color: transparent;
}
.node:hover { filter: brightness(1.05); }
.node:active { transform: translateY(0.375rem); box-shadow: 0 1px 0 var(--t-dark); }
.node-emoji { font-size: 2.125rem; line-height: 1; filter: drop-shadow(0 0.125rem 0 rgba(0, 0, 0, .12)); }
.node-badge { position: absolute; right: -0.25rem; bottom: -0.125rem; width: 1.75rem; height: 1.75rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 0.1875rem solid var(--c-bg); }
.node-badge .ico { width: 0.9375rem; height: 0.9375rem; }
.node-badge-done { background: var(--c-primary); color: #fff; }
.node-badge-lock { background: var(--c-locked-dark); color: #fff; }

.state-done .node { background: var(--c-gold); box-shadow: 0 0.4375rem 0 var(--c-gold-dark), inset 0 -0.25rem 0 rgba(0, 0, 0, .06); }
.state-done .node:active { box-shadow: 0 1px 0 var(--c-gold-dark); }
.state-locked .node, .state-closed .node { background: var(--c-locked); box-shadow: 0 0.4375rem 0 var(--c-locked-dark); }
.state-locked .node-emoji { filter: grayscale(1); opacity: .45; }
.state-closed .node { background: #f4f5f6; border: 0.1875rem dashed var(--c-locked-dark); box-shadow: 0 0.375rem 0 #dfe2e6; }
.node-cone { width: 2.875rem; height: 2.875rem; }
.state-current .node::before {
  content: ""; position: absolute; inset: -0.625rem; border-radius: 50%;
  border: 0.3125rem solid var(--t); opacity: .35;
  animation: pulse 1.8s var(--ease) infinite;
}
@keyframes pulse { 0% { transform: scale(.92); opacity: .5; } 70% { transform: scale(1.14); opacity: 0; } 100% { opacity: 0; } }
/* 其他段落的第一站：可以開始，但不搶「下一站」的焦點（不跳動、圈圈淡一點） */
.state-current.is-later .node::before { animation: none; transform: none; opacity: .16; }
.node-review.state-current.is-later .node-chest-ico { animation: none; }

.node-bubble {
  position: absolute; left: 50%; top: -4.75rem; transform: translateX(-50%);
  background: var(--c-surface); color: var(--t-dark); border: 0.125rem solid var(--c-line);
  font-weight: 800; padding: 0.25rem 0.875rem; border-radius: 0.75rem; white-space: nowrap;
  letter-spacing: .08em; animation: bob 1.6s ease-in-out infinite; pointer-events: none;
}
.node-bubble::after { content: ""; position: absolute; left: 50%; bottom: -0.5625rem; width: 0.875rem; height: 0.875rem; background: var(--c-surface); border-right: 0.125rem solid var(--c-line); border-bottom: 0.125rem solid var(--c-line); transform: translateX(-50%) rotate(45deg); }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -0.375rem); } }
.node-avatar { position: absolute; top: -1.625rem; font-size: 2.5rem; line-height: 1; animation: bob2 2.2s ease-in-out infinite; pointer-events: none; }
.node-avatar-left { left: -7rem; }
.node-avatar-right { left: 4rem; }
@keyframes bob2 { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-0.3125rem) rotate(4deg); } }

.node-label { position: absolute; left: 50%; top: 2.875rem; transform: translateX(-50%); width: 9.375rem; text-align: center; line-height: 1.3; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 0.125rem; }
.node-label strong { font-size: .98rem; }
.state-locked .node-label strong, .state-closed .node-label strong { color: var(--c-locked-text); }
.node-tag-closed { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 800; color: var(--c-orange-dark); background: var(--c-orange-soft); padding: 0 0.5rem; border-radius: 999px; }

.node-chest { background: transparent !important; box-shadow: none !important; }
.node-chest-ico { width: 4rem; height: 4rem; filter: drop-shadow(0 0.25rem 0 rgba(0, 0, 0, .12)); }
.node-review.state-locked .node-chest-ico { filter: grayscale(1) opacity(.5); }
.node-review.state-current .node-chest-ico { animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-8deg); } 90% { transform: rotate(8deg); } 95% { transform: rotate(-4deg); } }

/* 剛解鎖的站：彈一下 */
.node-wrap.just-unlocked .node { animation: unlockPop .9s var(--ease); }
.node-wrap.just-unlocked .node::after { content: ""; position: absolute; inset: -0.875rem; border-radius: 50%; border: 0.25rem solid var(--c-gold); animation: unlockRing 1.1s ease-out forwards; }
@keyframes unlockPop { 0% { transform: scale(.6); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes unlockRing { from { transform: scale(.7); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }

/* 講師聚光燈 */
.teach .node-wrap.is-spot { z-index: 5; }
.teach .node-wrap.is-spot .node { outline: 0.3125rem solid var(--c-purple); outline-offset: 0.375rem; }
.teach .map:has(.is-spot) .node-wrap:not(.is-spot):not(.is-open) { opacity: .55; transition: opacity .3s; }
.node-wrap.is-open { z-index: 6; }

.map-end { text-align: center; margin: 1.875rem 0 0; font-weight: 700; }
.stage-divider { max-width: 38.75rem; margin: 2.75rem auto 0; display: flex; align-items: center; gap: 0.75rem; color: var(--c-muted); font-weight: 800; font-size: .95rem; letter-spacing: .04em; }
.stage-divider::before, .stage-divider::after { content: ""; flex: 1; height: 0.125rem; background: var(--c-line-strong); border-radius: 999px; }
.stage-divider span { text-align: center; flex: 0 1 auto; }
.node-week { font-size: .72rem; font-weight: 700; color: var(--c-muted); }

/* ---------- 彈出卡 ---------- */
.pop {
  position: absolute; z-index: 20; width: 18.75rem; max-width: 100%;
  background: var(--t); color: #fff; border-radius: var(--radius);
  padding: 1rem; box-shadow: 0 0.3125rem 0 var(--t-dark), 0 0.875rem 1.875rem rgba(0, 0, 0, .14);
  animation: popIn .18s var(--ease);
}
.pop::before { content: ""; position: absolute; top: -0.5625rem; left: var(--arrow-x, 50%); width: 1.125rem; height: 1.125rem; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 0.1875rem; }
@keyframes popIn { from { transform: translateY(-0.375rem) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.pop-head { display: flex; align-items: flex-start; gap: 0.625rem; position: relative; }
.pop-title { font-size: 1.2rem; font-weight: 800; line-height: 1.3; }
.pop-sub { opacity: .92; font-size: .9rem; }
.pop-nth { margin-left: auto; font-weight: 800; font-size: .8rem; background: rgba(255, 255, 255, .22); padding: 0.125rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.pop-goal { margin: 0.625rem 0 0.25rem; font-size: .92rem; line-height: 1.55; }
.pop-meta { font-size: .82rem; opacity: .9; margin-bottom: 0.75rem; }
.pop-actions { display: flex; flex-direction: column; gap: 0.625rem; position: relative; }
.pop .btn-primary { --b-bg: #fff; --b-fg: var(--t-dark); --b-edge: rgba(0, 0, 0, .18); --b-border: #fff; }
.pop .btn-ghost { --b-fg: #fff; }
.pop-msg-lock { display: flex; align-items: center; gap: 0.375rem; font-weight: 700; margin: 0.5rem 0 0.75rem; font-size: .92rem; }
.pop-msg-lock .ico { width: 1em; height: 1em; }
.pop.pop-locked, .pop.pop-closed { background: #f4f5f6; color: var(--c-text); box-shadow: 0 0.3125rem 0 var(--c-locked-dark), 0 0.875rem 1.875rem rgba(0, 0, 0, .12); }
.pop.pop-locked .pop-nth, .pop.pop-closed .pop-nth { background: var(--c-locked); }
.pop.pop-done { background: var(--c-gold); color: #4b3600; box-shadow: 0 0.3125rem 0 var(--c-gold-dark), 0 0.875rem 1.875rem rgba(0, 0, 0, .14); }
.pop.pop-done .btn-gold { --b-bg: #fff; --b-fg: #8a6200; --b-edge: var(--c-gold-dark); --b-border: #fff; }
.pop.pop-done .pop-nth { background: rgba(255, 255, 255, .45); }
.pop-msg-cone { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.625rem; }
.cone-pop { width: 3.25rem; height: 3.25rem; flex: none; }
.pop-msg-cone strong { color: var(--c-orange-dark); font-size: 1.05rem; }

/* ---------- 繼續學習卡 ---------- */
.resume { max-width: 38.75rem; margin: 0.75rem auto 0; display: flex; align-items: center; gap: 1rem; padding: 0.875rem 1rem; border-color: var(--t, var(--c-line)); box-shadow: 0 0.25rem 0 var(--t-soft, var(--c-line)); }
.resume-emoji { font-size: 2.25rem; line-height: 1; flex: none; }
.resume-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.resume-text small { color: var(--t-dark, var(--c-muted)); font-weight: 800; font-size: .78rem; letter-spacing: .04em; }
.resume-text strong { font-size: 1.1rem; }
.resume-text .muted { font-size: .82rem; }
.resume-bar { height: 0.375rem; background: var(--c-locked); border-radius: 999px; margin-top: 0.375rem; overflow: hidden; }
.resume-bar i { display: block; height: 100%; background: var(--t, var(--c-primary)); border-radius: 999px; }
.resume-go { flex: none; min-width: 6.5rem; }
@media (max-width: 600px) {
  .resume { flex-wrap: wrap; }
  .resume-go { width: 100%; }
}

/* ---------- 我的成就 ---------- */
.badge-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.badge-cell { display: flex; flex-direction: column; align-items: center; gap: 0.125rem; padding: 0.375rem 0.25rem; border-radius: 0.75rem; background: var(--c-surface-2); text-align: center; filter: grayscale(1); opacity: .55; }
.badge-cell.is-on { filter: none; opacity: 1; background: var(--c-gold-soft); box-shadow: inset 0 0 0 0.125rem var(--c-gold); }
.badge-ico { font-size: 1.5rem; line-height: 1; }
.badge-name { font-size: .68rem; font-weight: 700; line-height: 1.25; }
.cel-badges { margin: 1.25rem auto 0; max-width: 26rem; display: flex; flex-direction: column; gap: 0.5rem; animation: popIn .4s var(--ease) .5s both; }
.cel-badges-h { font-weight: 800; color: #8a6200; }
.cel-badge { display: flex; align-items: center; gap: 0.75rem; text-align: left; padding: 0.625rem 0.875rem; border-radius: var(--radius); background: var(--c-gold-soft); box-shadow: inset 0 0 0 0.125rem var(--c-gold); }
.cel-badge-ico { font-size: 2rem; line-height: 1; }
.cel-badge span { display: flex; flex-direction: column; line-height: 1.35; }
.cel-badge small { color: var(--c-muted); }
.cel-streak { margin: 0.875rem 0 0; font-weight: 800; color: var(--c-orange-dark); }

/* ---------- 年度課表 ---------- */
.plan-page { grid-column: 1 / -1; max-width: 84rem; width: 100%; margin: 0 auto; }
.plan-head { text-align: center; padding: 0.5rem 0 0.25rem; }
.plan-head .btn { margin-bottom: 0.5rem; }
.plan-meter { max-width: 24rem; margin: 0.75rem auto 0.25rem; }
.plan-progress { font-size: .85rem; font-weight: 700; }
.plan-stage { margin: 1.75rem 0 0.625rem; font-size: 1.05rem; color: var(--c-muted); display: flex; align-items: center; gap: 0.75rem; }
.plan-stage::after { content: ""; flex: 1; height: 0.125rem; background: var(--c-line-strong); border-radius: 999px; order: 1; }
.plan-stage small { order: 2; font-size: .8rem; font-weight: 800; color: var(--c-muted); white-space: nowrap; }
.plan-stage small.is-all { color: #8a6200; }
/* 一週一張卡：寬螢幕排成多欄，手機一欄 */
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 0.625rem; }
.plan-week { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.625rem 0.75rem 0.75rem; background: var(--c-surface); border: 0.125rem solid var(--c-line); border-radius: var(--radius); min-width: 0; transition: border-color .15s ease, transform .15s ease; }
.plan-week.is-now { border-color: var(--c-blue); box-shadow: 0 0.25rem 0 var(--c-blue-soft); }
.plan-week.is-extra { background: var(--c-surface-2); border-style: dashed; }
.plan-wk { display: flex; align-items: center; gap: 0.5rem; line-height: 1.3; flex-wrap: wrap; }
.plan-wk small { color: var(--c-muted); font-weight: 700; }
.plan-items { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.plan-unit { display: flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.625rem; border-radius: 0.75rem; border: 0.125rem solid var(--c-line); background: var(--c-surface-2); color: inherit; text-decoration: none; min-width: 0; transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
a.plan-unit:hover { border-color: var(--t); background: var(--t-soft); transform: translateY(-0.0625rem); }
a.plan-unit:active { transform: translateY(0.0625rem); }
.plan-unit.is-done { border-color: var(--c-gold); background: var(--c-gold-soft); }
.plan-unit.is-closed { opacity: .7; }
.plan-unit .node-tag-closed { margin-left: auto; }
.plan-dot { width: 1.75rem; height: 1.75rem; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--t); color: #fff; font-size: .95rem; }
.plan-unit.is-done .plan-dot { background: var(--c-gold); color: #5a4100; font-weight: 800; }
.plan-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.plan-text small { color: var(--c-muted); font-size: .72rem; font-weight: 700; }
.plan-text span { font-weight: 700; }
.plan-extra { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.125rem 0; }
@media (prefers-reduced-motion: reduce) { .plan-week, .plan-unit { transition: none; } a.plan-unit:hover, a.plan-unit:active { transform: none; } }

/* ---------- 講師導覽列 ---------- */
.tour { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 0.625rem 1rem calc(0.625rem + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .95); border-top: 0.125rem solid var(--c-line); backdrop-filter: blur(0.375rem); }
.tour-inner { max-width: 47.5rem; margin: 0 auto; display: flex; align-items: center; gap: 0.625rem; }
.tour-badge { background: var(--c-purple); color: #fff; font-weight: 800; font-size: .8rem; padding: 0.1875rem 0.625rem; border-radius: 999px; }
.tour-label { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.tour-label small { color: var(--c-muted); font-weight: 700; }
.tour-label strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.05rem; }

/* ---------- 頁尾、彈窗、提示 ---------- */
.foot { max-width: 73.75rem; margin: 0 auto; padding: 1.125rem 1rem 1.875rem; display: flex; flex-wrap: wrap; gap: 0.375rem 1.125rem; justify-content: space-between; font-size: .8rem; border-top: 0.125rem solid var(--c-line); }
.teach .foot { padding-bottom: 6rem; }
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(20, 24, 28, .45); display: flex; align-items: center; justify-content: center; padding: 1rem; animation: fade .15s; }
.modal { width: 100%; max-width: 28.75rem; padding: 1.375rem; box-shadow: 0 1.25rem 3.125rem rgba(0, 0, 0, .2); }
.modal h2 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.625rem; margin-top: 1.125rem; flex-wrap: wrap; }
.help p { margin: 0 0 0.625rem; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.toast {
  position: fixed; left: 50%; bottom: 1.75rem; z-index: 120; transform: translate(-50%, 1.25rem);
  background: #2f3437; color: #fff; padding: 0.75rem 1.125rem; border-radius: 0.875rem; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 2rem); text-align: center; line-height: 1.5;
}
.toast small { font-weight: 500; opacity: .85; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-warn { background: var(--c-orange-dark); }
.has-player .toast { bottom: 6.875rem; }

/* ---------- 播放器 ---------- */
.layer { position: relative; z-index: 50; }
body.has-player { overflow: hidden; }
.player { --pl-w: 47.5rem; position: fixed; inset: 0; z-index: 50; background: var(--c-surface); display: flex; flex-direction: column; animation: fade .18s; }
.pl-top { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem; max-width: calc(var(--pl-w) + 2rem); width: 100%; margin: 0 auto; }
.pl-progress { flex: 1; min-width: 0; }
.pl-title { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 0.25rem; }
.pl-bar { height: 1rem; background: var(--c-locked); border-radius: 999px; overflow: hidden; }
.pl-bar-fill { height: 100%; width: 0; background: var(--t, var(--c-primary)); border-radius: 999px; transition: width .4s var(--ease); box-shadow: inset 0 -0.25rem 0 rgba(0, 0, 0, .1); position: relative; }
.pl-bar-fill::after { content: ""; position: absolute; left: 0.5rem; right: 0.5rem; top: 0.25rem; height: 0.25rem; border-radius: 0.25rem; background: rgba(255, 255, 255, .35); }
.pl-count { font-weight: 800; color: var(--c-muted); font-size: .9rem; white-space: nowrap; }
.pl-close { color: var(--c-muted); }
.pl-share .ico { width: 1em; height: 1em; }
/* 捲動區：內容＋底部區（回饋、按鈕）同一欄。小螢幕底部區在視窗最下；大螢幕整塊垂直置中、按鈕緊跟內容 */
.pl-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; }
.pl-inner { width: 100%; max-width: var(--pl-w); margin: 0 auto; flex: 1 0 auto; display: flex; flex-direction: column; }
.pl-stage { flex: 1 0 auto; padding: 1.125rem 1.25rem 2.5rem; position: relative; }
.pl-dock { position: sticky; bottom: 0; z-index: 3; background: var(--c-surface); border-top: 0.125rem solid var(--c-line); }
.pl-foot { padding: 0.875rem 1rem calc(0.875rem + env(safe-area-inset-bottom)); }
/* 站台注入的浮動按鈕（sites/*.json 的 bottomInset）：窄螢幕時按鈕列、講師導覽列往上讓開；大螢幕按鈕在內容欄裡，不會撞到角落 */
@media (max-width: 1023px) {
  .pl-foot { padding-bottom: calc(0.875rem + env(safe-area-inset-bottom) + var(--site-bottom-inset, 0px)); }
  .tour { padding-bottom: calc(0.625rem + env(safe-area-inset-bottom) + var(--site-bottom-inset, 0px)); }
}
.pl-foot-inner { display: flex; align-items: center; gap: 0.75rem; }
.pl-foot-mid { flex: 1; display: flex; justify-content: center; }
.pl-main { min-width: 9.375rem; }
.pl-main-short { display: none; }

/* 答題回饋（底部滑出） */
.pl-feedback { display: none; }
.pl-feedback.show { display: block; animation: slideUp .22s var(--ease); }
.pl-feedback.is-ok { background: #d7f5e3; color: #0f6a3e; }
.pl-feedback.is-bad { background: #fde3e3; color: #a11f1f; }
.fb-inner { padding: 0.875rem 1.25rem; display: flex; gap: 0.875rem; align-items: flex-start; }
.fb-icon { width: 2.5rem; height: 2.5rem; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.fb-icon .ico { width: 1.375rem; height: 1.375rem; }
.is-ok .fb-icon { color: var(--c-primary-dark); }
.is-bad .fb-icon { color: var(--c-red); }
.fb-text strong { font-size: 1.1rem; }
.fb-explain { margin-top: 0.125rem; color: var(--c-text); }
.fb-explain p { margin: 0.25rem 0 0; }
@keyframes slideUp { from { transform: translateY(1rem); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 步驟共用 ---------- */
.st-anim { animation: stepIn .28s var(--ease); }
@keyframes stepIn { from { transform: translateY(0.625rem); opacity: 0; } to { transform: none; opacity: 1; } }
.st-title { font-size: 1.45rem; line-height: 1.4; margin: 0.375rem 0 0.625rem; outline: none; }
.st-body { font-size: 1.05rem; }
.st-body p { margin: 0 0 .8em; }
.st-body ul, .st-body ol { margin: 0 0 .8em; padding-left: 1.4em; }
.st-body li { margin: .2em 0; }
.md-note { margin: 0 0 .8em; padding: 0.625rem 0.875rem; background: var(--c-blue-soft); border-left: 0.3125rem solid var(--c-blue); border-radius: 0.625rem; }
.st-kicker { display: inline-block; font-weight: 800; font-size: .8rem; letter-spacing: .08em; color: var(--c-purple-dark); background: var(--c-purple-soft); padding: 0.125rem 0.625rem; border-radius: 999px; }
.st-emoji { font-size: 4.75rem; line-height: 1; text-align: center; margin: 1.125rem 0 0.375rem; animation: bob3 3s ease-in-out infinite; }
.st-emoji-sm { font-size: 2.875rem; text-align: left; margin: 0.25rem 0 0; animation: none; }
@keyframes bob3 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.375rem); } }
.st-intro { text-align: center; padding-top: 4vh; }
.st-intro .st-title { font-size: 1.75rem; }
.st-intro .st-body { max-width: 37.5rem; margin: 0 auto; }
.st-done { display: inline-flex; align-items: center; gap: 0.375rem; font-weight: 800; color: var(--c-primary-dark); margin-top: 0.875rem; }
.st-done .ico { width: 1.1em; height: 1.1em; }

.callout { border-radius: var(--radius); padding: 0.75rem 1rem; margin-top: 0.875rem; border: 0.125rem solid; }
.callout p { margin: 0.25rem 0 0; }
.callout-h { font-weight: 800; }
.callout-tip { background: var(--c-gold-soft); border-color: #ffe08a; }
.callout-warn { background: var(--c-red-soft); border-color: #f8bcbc; }
.callout-note { background: var(--c-blue-soft); border-color: #b9e1f7; }

.t-note { margin-top: 1.375rem; border: 0.125rem dashed var(--c-purple); background: var(--c-purple-soft); border-radius: var(--radius); padding: 0.75rem 1rem; }
.t-note-h { font-weight: 800; color: var(--c-purple-dark); font-size: .9rem; }
.t-note p { margin: 0.25rem 0 0; }

/* analogy */
.an-head { display: grid; grid-template-columns: 1fr 1.75rem 1fr; gap: 0.625rem; font-weight: 800; color: var(--c-muted); font-size: .85rem; margin: 0.625rem 0 0.375rem; }
.an-rows { display: flex; flex-direction: column; gap: 0.625rem; }
.an-row { display: grid; grid-template-columns: 1fr 1.75rem 1fr; gap: 0.625rem; align-items: stretch; }
.an-left, .an-right { border-radius: var(--radius); padding: 0.75rem 0.875rem; border: 0.125rem solid var(--c-line); background: var(--c-surface); font-weight: 700; }
.an-left { background: var(--c-surface-2); }
.an-arrow { display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--c-muted); font-size: 1.2rem; }
.an-hidden { cursor: pointer; color: var(--c-blue-dark); border-style: dashed; border-color: var(--c-blue); background: var(--c-blue-soft); font-weight: 800; box-shadow: 0 0.25rem 0 #b9e1f7; transition: transform .08s; }
.an-hidden:active { transform: translateY(0.1875rem); box-shadow: none; }
.an-row.is-open .an-right { border-color: var(--t, var(--c-primary)); background: var(--t-soft, var(--c-primary-soft)); animation: flipIn .3s var(--ease); }
.an-note { font-weight: 500; font-size: .92rem; color: var(--c-text); margin-top: 0.125rem; }
.an-all { margin-top: 0.75rem; }
@keyframes flipIn { from { transform: rotateX(70deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* reveal */
.rv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.25rem, 1fr)); gap: 0.75rem; margin: 0.875rem 0; }
.rv-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.375rem;
  padding: 1rem 0.625rem 0.875rem; border-radius: var(--radius); border: 0.125rem solid var(--c-line); background: var(--c-surface);
  cursor: pointer; font-weight: 800; box-shadow: 0 0.25rem 0 var(--c-line); transition: transform .08s, box-shadow .08s, border-color .15s;
}
.rv-item:active { transform: translateY(0.25rem); box-shadow: none; }
.rv-item.is-sel { border-color: var(--t, var(--c-blue)); background: var(--t-soft, var(--c-blue-soft)); box-shadow: 0 0.25rem 0 var(--t, var(--c-blue)); }
.rv-icon { font-size: 2.125rem; line-height: 1; }
.rv-check { position: absolute; top: 0.375rem; right: 0.375rem; width: 1.375rem; height: 1.375rem; border-radius: 50%; background: var(--c-primary); color: #fff; display: flex; align-items: center; justify-content: center; }
.rv-check .ico { width: 0.8125rem; height: 0.8125rem; }
.rv-detail { border-radius: var(--radius); padding: 0.875rem 1.125rem; background: var(--c-surface-2); border: 0.125rem solid var(--c-line); min-height: 5.625rem; }
.rv-detail p { margin: 0.375rem 0 0; }
.rv-detail ul { margin: 0.375rem 0 0; padding-left: 1.3em; }
.rv-detail-h { font-weight: 800; font-size: 1.1rem; }
.rv-empty { display: flex; align-items: center; justify-content: center; color: var(--c-muted); font-weight: 700; }
.rv-figure { margin-top: 0.75rem; }

/* 終端機畫面（示範用） */
.term-box { margin: 0.625rem 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--c-code-bg); box-shadow: 0 0.125rem 0 rgba(0, 0, 0, .15); }
.term-bar { display: flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.75rem; background: #2b3140; color: #aab2c0; font-size: .75rem; font-weight: 700; }
.term-bar i { width: 0.625rem; height: 0.625rem; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 0.375rem; }
.term { margin: 0; padding: 0.75rem 0.875rem; color: var(--c-code-text); font-family: var(--mono); font-size: .82em; line-height: 1.6; overflow-x: auto; white-space: pre; }
.term-line { display: block; }
/* md-lite 的 ``` 程式碼區塊（講解裡的程式範例；和終端機同一套深色） */
.md-code { margin: 0.625rem 0; padding: 0.75rem 0.875rem; border-radius: var(--radius-sm); background: var(--c-code-bg); color: var(--c-code-text); font-family: var(--mono); font-size: .82em; line-height: 1.6; overflow-x: auto; white-space: pre; tab-size: 2; max-width: 100%; }
.md-code code { font: inherit; background: none; padding: 0; color: inherit; border: 0; }
.md-code[data-lang]::before { content: attr(data-lang); display: block; margin-bottom: 0.375rem; color: #aab2c0; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
/* 手機：字小一號，一行約可看到 42 個字元；表格類輸出（ps、docker ps、psql）仍保留對齊、左右捲動 */
@media (max-width: 600px) { .term, .md-code { font-size: .74em; padding: 0.625rem 0.75rem; } }
.term-cmd { color: #8be9a8; }
.term-err { color: #ff8585; font-weight: 700; }
.term-warn { color: #ffd479; }
.rv-foot { margin-top: 0.5rem; font-size: .9rem; }

/* quiz */
.q-opts { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.q-opt {
  display: flex; align-items: flex-start; gap: 0.75rem; width: 100%; text-align: left;
  padding: 0.875rem 1rem; border-radius: var(--radius); border: 0.125rem solid var(--c-line); background: var(--c-surface);
  cursor: pointer; box-shadow: 0 0.25rem 0 var(--c-line); font-size: 1.02rem; transition: transform .08s, box-shadow .08s, background .15s, border-color .15s;
}
.q-opt:not([disabled]):hover { background: var(--c-surface-2); }
.q-opt:not([disabled]):active { transform: translateY(0.25rem); box-shadow: none; }
.q-key { flex: none; width: 1.875rem; height: 1.875rem; border-radius: 0.5625rem; border: 0.125rem solid var(--c-line); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; color: var(--c-muted); }
.q-text { display: flex; flex-direction: column; gap: 0.25rem; padding-top: 0.125rem; }
.q-why { font-size: .9rem; color: var(--c-text); opacity: .85; }
.q-opt.is-picked { border-color: var(--c-blue); background: var(--c-blue-soft); box-shadow: 0 0.25rem 0 var(--c-blue); }
.q-opt.is-picked .q-key { border-color: var(--c-blue); color: var(--c-blue-dark); }
.q-opt.is-correct { border-color: var(--c-primary); background: #e4f8ec; box-shadow: 0 0.25rem 0 var(--c-primary); cursor: default; }
.q-opt.is-correct .q-key { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.q-opt.is-wrong { border-color: var(--c-red); background: var(--c-red-soft); box-shadow: 0 0.25rem 0 var(--c-red); cursor: default; animation: shake .35s; }
.q-opt.is-wrong .q-key { background: var(--c-red); border-color: var(--c-red); color: #fff; }
.q-opt.is-dim { opacity: .55; cursor: default; }
.q-hint { font-size: .82rem; margin-top: 0.75rem; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-0.375rem); } 75% { transform: translateX(0.375rem); } }

/* order */
.od-label { font-size: .85rem; font-weight: 700; margin: 0.875rem 0 0.375rem; }
.od-slots { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.od-slot { display: flex; align-items: center; gap: 0.625rem; min-height: 3.25rem; padding: 0.375rem 0.625rem; border-radius: var(--radius); border: 0.125rem dashed var(--c-line-strong); background: var(--c-surface-2); }
.od-slot.is-filled { border-style: solid; background: var(--c-surface); }
.od-slot.is-correct { border-color: var(--c-primary); background: #e4f8ec; }
.od-slot.is-wrong { border-color: var(--c-red); background: var(--c-red-soft); }
.od-n { width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--c-locked); color: var(--c-muted); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; font-size: .9rem; }
.od-slot.is-filled .od-n { background: var(--t, var(--c-primary)); color: #fff; }
.od-empty { font-size: .88rem; }
.od-pool { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.od-chip { text-align: left; padding: 0.625rem 0.875rem; border-radius: 0.75rem; border: 0.125rem solid var(--c-line); background: var(--c-surface); font-weight: 700; cursor: pointer; box-shadow: 0 0.25rem 0 var(--c-line); transition: transform .08s, box-shadow .08s; }
.od-chip:not([disabled]):active { transform: translateY(0.25rem); box-shadow: none; }
.od-slot .od-chip { flex: 1; box-shadow: none; border: 0; padding: 0.375rem 0.25rem; background: transparent; }
.od-answer { margin-top: 0.875rem; padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--c-gold-soft); border: 0.125rem solid #ffe08a; }
.od-answer ol { margin: 0.375rem 0 0; padding-left: 1.4em; }

/* match */
.mt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.875rem; }
.mt-col { display: flex; flex-direction: column; gap: 0.625rem; }
.mt-item { padding: 0.75rem 0.875rem; border-radius: var(--radius); border: 0.125rem solid var(--c-line); background: var(--c-surface); font-weight: 700; cursor: pointer; box-shadow: 0 0.25rem 0 var(--c-line); text-align: left; min-height: 3.375rem; min-width: 0; overflow-wrap: anywhere; transition: transform .08s, box-shadow .08s; }
.mt-item:not([disabled]):active { transform: translateY(0.25rem); box-shadow: none; }
.mt-item.is-sel { border-color: var(--c-blue); background: var(--c-blue-soft); box-shadow: 0 0.25rem 0 var(--c-blue); }
.mt-item.is-matched { border-color: var(--c-primary); background: #e4f8ec; color: var(--c-primary-dark); box-shadow: none; opacity: .75; cursor: default; }
.mt-item.is-bad { border-color: var(--c-red); background: var(--c-red-soft); animation: shake .35s; }
.mt-hint { font-size: .85rem; margin-top: 0.625rem; }

/* widget 外框 */
.w-frame { position: relative; margin-top: 0.75rem; border: 0.125rem solid var(--c-line); border-radius: var(--radius-lg); padding: 1rem; background: var(--c-surface); }
.w-done-badge { position: absolute; top: -0.875rem; right: 0.875rem; display: none; align-items: center; gap: 0.25rem; background: var(--c-primary); color: #fff; font-weight: 800; font-size: .8rem; padding: 0.1875rem 0.625rem; border-radius: 999px; box-shadow: 0 0.1875rem 0 var(--c-primary-dark); z-index: 2; }
.w-done-badge.show { display: inline-flex; animation: popIn .25s var(--ease); }
.w-done-badge .ico { width: 1em; height: 1em; }

/* summary */
.sum-list { list-style: none; padding: 0; margin: 0.875rem 0 0; display: flex; flex-direction: column; gap: 0.625rem; }
.sum-list li { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem 0.875rem; border-radius: var(--radius); background: var(--t-soft, var(--c-primary-soft)); font-weight: 700; animation: stepIn .35s var(--ease) both; }
.sum-check { flex: none; width: 1.625rem; height: 1.625rem; border-radius: 50%; background: var(--t, var(--c-primary)); color: #fff; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.sum-check .ico { width: 0.875rem; height: 0.875rem; }

/* 完成畫面 */
.celebrate { text-align: center; padding: 6vh 0 0.625rem; position: relative; z-index: 1; }
.cel-icon { font-size: 6rem; line-height: 1; animation: celPop .6s var(--ease); display: inline-flex; }
.cel-icon .ico { width: 7.5rem; height: 7.5rem; }
.cel-icon.is-fail { animation: none; }
@keyframes celPop { 0% { transform: scale(.3) rotate(-20deg); opacity: 0; } 60% { transform: scale(1.15) rotate(6deg); opacity: 1; } 100% { transform: none; } }
.cel-title { font-size: 1.7rem; margin: 0.75rem 0 0.25rem; }
.cel-text { color: var(--c-muted); margin: 0 0 1.25rem; font-size: 1.05rem; }
.cel-stats { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
.cel-stat { min-width: 6.875rem; border-radius: var(--radius); border: 0.125rem solid; overflow: hidden; display: flex; flex-direction: column; }
.cel-stat span { font-size: .78rem; font-weight: 800; color: #fff; padding: 0.1875rem 0.5rem; letter-spacing: .06em; }
.cel-stat strong { font-size: 1.25rem; padding: 0.5rem 0.625rem; background: var(--c-surface); }
.stat-xp { border-color: var(--c-gold); } .stat-xp span { background: var(--c-gold); color: #6b4c00; } .stat-xp strong { color: #8a6200; }
.stat-quiz { border-color: var(--c-primary); } .stat-quiz span { background: var(--c-primary); } .stat-quiz strong { color: var(--c-primary-dark); }
.stat-time { border-color: var(--c-blue); } .stat-time span { background: var(--c-blue); } .stat-time strong { color: var(--c-blue-dark); }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.confetti i { position: absolute; top: -1.25rem; width: 0.625rem; height: 1rem; border-radius: 0.1875rem; animation-name: fall; animation-timing-function: cubic-bezier(.3, .6, .5, 1); animation-fill-mode: forwards; opacity: .9; }
@keyframes fall { to { top: 105%; transform: translateX(2.5rem) rotate(540deg); opacity: 0; } }

/* ---------- 響應式 ---------- */
/* 繼續學習卡下方的精簡數字：側欄排到最下面（窄螢幕）時才顯示 */
.mini-stats { display: none; max-width: 38.75rem; margin: 0.625rem auto 0; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.mini-stat { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.3125rem 0.75rem; border-radius: 999px; background: var(--c-surface); border: 0.125rem solid var(--c-line); font-size: .88rem; font-weight: 700; color: var(--c-text); line-height: 1.3; }
.mini-stat b { font-weight: 800; }
button.mini-stat { cursor: pointer; font: inherit; font-size: .88rem; font-weight: 700; }
button.mini-stat:hover { border-color: var(--c-blue); }
/* 側欄按鈕：站名很長時換行，不撐出水平捲軸 */
.side-card .btn-block { white-space: normal; height: auto; min-height: 2.75rem; line-height: 1.35; padding-top: 0.5rem; padding-bottom: 0.5rem; text-align: center; }
@media (max-width: 980px) {
  .home { grid-template-columns: minmax(0, 1fr); gap: 1.125rem; }
  .home-side { position: static; order: 2; }
  .mini-stats { display: flex; }
}
@media (max-width: 600px) {
  .top-inner { padding: 0.5rem 0.75rem; gap: 0.5rem; }
  .brand-mark { font-size: 1.5rem; }
  .brand-text small { display: none; }
  .brand-text { display: none; }
  .top-teach-text, .pl-share-text { display: none; }
  .pill-streak { display: none; }
  /* 窄螢幕頁首：拿掉全螢幕鈕、縮小間距，避免「⋯」被擠出畫面（講師模式字級較大時尤其明顯） */
  .top-full, .teach .top-full { display: none; }
  .top-right { gap: 0.3rem; min-width: 0; }
  .brand { flex: none; }
  .pill-xp { padding: 0.2rem 0.5rem; }
  .top-right .btn-sm { padding: .3em .55em; }
  .top-right .btn-icon.btn-sm { min-width: 2.25rem; }
  .top-wrong { padding: .3em .6em; }
  html[lang="en"] .top-wrong-text { display: none; }   /* 英文 "Mistakes" 比「錯題」長很多，窄螢幕只留 📒 和題數（按鈕有 title） */
  .home { padding: 0.625rem 1rem 7.5rem; }
  .hero-title { font-size: 1.35rem; }
  .ch-banner { padding: 0.875rem 1rem; }
  .ch-title { font-size: 1.15rem; }
  .ch-desc { font-size: .85rem; }
  .node-avatar-left { left: -6rem; }
  .pl-top { padding: 0.5rem 0.75rem; gap: 0.5rem; }
  .pl-stage { padding: 0.875rem 1rem 1.875rem; }
  .st-title { font-size: 1.25rem; }
  .st-intro .st-title { font-size: 1.45rem; }
  .pl-main { min-width: 0; flex: 1; }
  .pl-main-long { display: none; }
  .pl-main-short { display: inline; }
  .pl-back > span:not(.ico) { display: none; }
  .pl-back { min-width: 3rem; padding: .4em .7em; }
  .pl-foot-mid { flex: 0 1 auto; }
  .an-row, .an-head { grid-template-columns: 1fr 1.25rem 1fr; gap: 0.375rem; }
  .an-left, .an-right { padding: 0.625rem; font-size: .92rem; }
  .mt-item { padding: 0.625rem; font-size: .92rem; }
  .tour-badge { display: none; }
}

/* 平板寬度：英文標籤比中文長（Mistakes、Instructor mode），頁首先收起次要的字，只留圖示（按鈕都有 title）；
   講師模式多一顆全螢幕鈕，這個寬度用不到，也收起來 */
@media (max-width: 860px) {
  html[lang="en"] .top-teach-text, html[lang="en"] .top-wrong-text, html[lang="en"] .pill-streak { display: none; }
}
@media (max-width: 760px) {
  .top-full, .teach .top-full { display: none; }
}
/* 680 以下頁首放不下語系切換鈕：改用「⋯」選單裡的「🌐」項目（頁首和公司站一樣寬） */
@media (max-width: 680px) {
  .top-lang { display: none; }
}

/* 很窄的手機（320）：XP 收到側欄進度裡看就好 */
@media (max-width: 360px) {
  .pill-xp { display: none; }
  .node-label { width: 7.5rem; }
}

/* ---------- 大螢幕／投影機（1024 以上） ---------- */
@media (min-width: 1024px) {
  .player { --pl-w: min(92vw, 58rem); }
  .player.has-note { --pl-w: min(94vw, 80rem); }
  .pl-inner { flex: 0 0 auto; margin: auto; }            /* 內容＋按鈕一起垂直置中（內容太長時自動變回靠上捲動） */
  .pl-stage { flex: none; padding: 1.5rem 2rem 1rem; }
  .pl-dock { border-top: 0; padding-top: 1rem; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--c-surface) 1rem); }
  .pl-foot { padding: 0.5rem 2rem 1.75rem; }
  .pl-feedback.show { margin: 0 2rem 0.75rem; border-radius: var(--radius); }
  .fb-inner { padding: 1rem 1.25rem; }
  .st-intro { padding-top: 0; }
  .celebrate { padding-top: 2vh; }
  .pl-main { min-width: 12rem; }
}
/* 1400 以上：講師備註放右側欄，與主內容並排 */
@media (min-width: 1400px) {
  .player.has-note .pl-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 24rem); column-gap: 2.5rem; align-items: start; }
  .player.has-note .pl-stage > .st { grid-column: 1; grid-row: 1; }
  .player.has-note .t-note { grid-column: 2; grid-row: 1; margin-top: 0.75rem; position: sticky; top: 1rem; }
  .st-title { font-size: 1.85rem; }
  .st-intro .st-title { font-size: 2.2rem; }
  .st-body { font-size: 1.12rem; }
  .st-emoji { font-size: 5.5rem; }
  .q-opt { font-size: 1.08rem; padding: 1rem 1.25rem; }
}
