/* 吉他學習系統：淺色、圓潤的極簡設計
   圓角：--r-sm 標籤與小元件、--r 按鈕與輸入、--r-lg 卡片與面板；不使用陰影；強調色只用於互動與目前狀態 */
:root {
  --bg: #FFFFFF;
  --side: #F6F7F9;
  --hover: #F5F6F8;
  --hover-2: #EBEDF1;
  --sel: #EEF4FC;
  --track: #EEF0F3;
  --line: #E6E8EC;
  --ctl: #D6DAE0;
  --ctl-hover: #9AA1AC;
  --ink: #111418;
  --ink-2: #2B3038;
  --body: #1D2128;
  --muted: #5F6672;
  --faint: #8A919C;
  --accent: #0B63CE;
  --accent-hover: #0A56B3;
  --accent-soft: #E6EFFB;
  --ok: #1F8A5B;
  --warn: #B4690E;
  --danger: #B42318;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --spring: cubic-bezier(.34, 1.3, .64, 1);
  --spring-soft: cubic-bezier(.34, 1.1, .64, 1);
  --ease: cubic-bezier(.2, 0, 0, 1);
  --font: Inter, "Noto Sans TC", system-ui, -apple-system, "Segoe UI", "Microsoft JhengHei", "PingFang TC", sans-serif;
  --tabbar-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h1 { font-size: 32px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 .7em; }
code { font-size: .92em; background: var(--track); padding: 1px 6px; border-radius: var(--r-sm); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.en { color: var(--muted); font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* ── Layout ───────────────────────────── */
.app { min-height: 100vh; }
.sidebar { display: none; }
main { padding: 28px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); outline: none; }
/* 內容置中，寬螢幕不會在右側留下大片空白 */
.page { width: 100%; max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; gap: 32px; }
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  main { padding: 40px clamp(24px, 4vw, 56px) 72px; }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 12px 16px; background: var(--side); border-right: 1px solid var(--line); }
}

/* ── Sidebar ──────────────────────────── */
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 12px 28px; font-size: 15px; font-weight: 600; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-icon { flex: none; display: block; width: 26px; height: 26px; }
.nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.nav-ind { position: absolute; left: 0; right: 0; top: 0; height: 40px; border-radius: var(--r); background: var(--hover-2); opacity: 0; pointer-events: none; transition: transform 340ms var(--spring), opacity 160ms var(--ease); }
.nav a { position: relative; height: 40px; display: flex; align-items: center; gap: 12px; padding: 0 12px; font-size: 14px; color: var(--ink-2); border-radius: var(--r); }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.side-recent { margin-top: 36px; padding: 0 12px; display: flex; flex-direction: column; gap: 10px; }
.side-recent .label { font-size: 12px; font-weight: 500; color: var(--muted); }
.side-recent a { font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.side-recent a:hover { color: var(--accent); }
/* 側欄底部：帳號按鈕；點了往上展開功能選單。同步狀態用頭像右下角的徽章表示 */
.acct { position: relative; margin-top: auto; padding-top: 16px; }
.acct-btn { width: 100%; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 10px; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; transition: border-color 160ms var(--ease); }
.acct-btn:hover, .acct-btn[aria-expanded="true"] { border-color: var(--ctl-hover); }
.acct-btn > svg { flex: none; color: var(--muted); }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.who b, .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who b { font-size: 13px; font-weight: 600; color: var(--ink); }
.who span { font-size: 12px; color: var(--muted); }
.who span.off { color: #8F5208; }
.avatar { position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; line-height: 1; }
.avatar.guest { background: var(--track); color: var(--muted); }
.avatar.lg { width: 36px; height: 36px; font-size: 15px; }
.badge { position: absolute; right: -4px; bottom: -4px; width: 16px; height: 16px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--bg); background: var(--ok); display: flex; align-items: center; justify-content: center; }
.badge.off { background: var(--warn); }
.badge.sync { background: var(--faint); }
.badge svg { width: 8px; height: 8px; }
.badge.sync svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.acct-menu { position: absolute; left: 0; right: 0; bottom: 64px; z-index: 30; display: flex; flex-direction: column; padding: 6px; background: var(--bg); border: 1px solid var(--ctl); border-radius: var(--r-lg); transform-origin: 50% 100%; animation: pop 180ms var(--spring-soft); }
.acct-menu[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.acct-menu hr { height: 1px; margin: 6px 4px; border: 0; background: var(--line); }
.mi { width: 100%; height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-2); font-size: 13px; text-align: left; cursor: pointer; transition: background-color 120ms var(--ease); }
a.mi { color: var(--ink-2); }
.mi:hover, .mi:focus-visible { background: var(--hover); color: var(--ink); }
.mi > svg { flex: none; }
.mi > span { flex: 1; }
.mi .ext { color: var(--muted); }
.acct-menu .guest { display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 12px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--ctl); border-radius: var(--r); background: var(--bg); color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; transition: background-color 160ms var(--ease), border-color 160ms var(--ease); }
.gbtn:hover { background: var(--hover); border-color: var(--ctl-hover); }

/* ── Tabbar（手機） ───────────────────── */
.tabbar { position: fixed; inset: auto 0 0 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--bg); border-top: 1px solid var(--line); z-index: 20; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 11px; }
.tabbar a svg { width: 20px; height: 20px; }
.tabbar a.active { color: var(--accent); font-weight: 600; }
@media (min-width: 900px) { .tabbar { display: none; } }
/* 手機版：首頁右上角的頭像，點了開「設定與備份」（電腦版用側欄的帳號選單） */
.m-acct { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
@media (min-width: 900px) { .m-acct { display: none; } }

/* ── 設定與備份彈出視窗（手機版是從下方滑出的面板） ── */
/* 間距：區塊上下各 20、區塊標題到內容 12、列表每一列上下各 12 */
body:has(.modal[open]) { overflow: hidden; }
.modal { width: min(560px, calc(100vw - 32px)); max-width: none; max-height: min(800px, calc(100dvh - 48px)); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--bg); color: var(--ink); overflow: hidden; }
.modal[open] { display: flex; flex-direction: column; animation: pop 200ms var(--spring-soft); }
.modal::backdrop { background: rgba(17, 20, 24, .42); }
.m-grip { display: none; }
.m-head { display: flex; align-items: center; gap: 12px; padding: 20px 16px 4px 24px; }
.m-head h2 { flex: 1; font-size: 18px; }
.icon-btn { flex: none; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: var(--r); background: none; color: var(--muted); cursor: pointer; transition: background-color 160ms var(--ease); }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.m-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 24px; }
.m-foot { display: flex; align-items: center; gap: 16px; padding: 16px 24px; border-top: 1px solid var(--line); }
.m-foot > span { flex: 1; font-size: 12px; color: var(--muted); }
.m-foot .btn.primary { min-height: 40px; padding: 0 20px; font-size: 14px; font-weight: 600; }
.set-sec { display: flex; flex-direction: column; padding: 20px 0 8px; }
.set-sec + .set-sec { border-top: 1px solid var(--line); }
.set-sec h3 { margin: 0; font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--muted); }
.set-sec.pad { padding-bottom: 20px; }
.set-sec.pad h3 { margin-bottom: 12px; }
.set-desc { margin: 0 0 12px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.set-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; }
.set-row + .set-row { border-top: 1px solid var(--track); }
.set-row > p { flex: 1; min-width: 0; margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.set-row .who { gap: 2px; line-height: 1.4; }
.set-row .who b { font-size: 14px; font-weight: 500; white-space: normal; }
.set-row .who b.name { font-weight: 600; }
.set-row .who span { white-space: normal; }
.set-row .who label { cursor: pointer; }
.set-row .switch { padding: 0; }
.stepper { flex: none; display: flex; align-items: center; height: 36px; border: 1px solid var(--ctl); border-radius: var(--r); overflow: hidden; }
.stepper button { width: 36px; height: 100%; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.stepper button:hover { background: var(--hover); }
.stepper input[type="text"] { width: 44px; height: 100%; min-height: 0; padding: 0; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; background: var(--bg); text-align: center; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stepper input[type="text"]:focus { border-color: var(--line); box-shadow: inset 0 0 0 2px var(--accent); }
.stepper :focus-visible { outline-offset: -2px; border-radius: 0; }
/* 列右側的小按鈕（登出、刪除…）同樣大小、右邊對齊 */
.set-row .btn.sm { flex: none; min-height: 36px; }
.set-row .btn.danger:hover { color: var(--danger); background: #FDF1F0; border-color: #F2C9C4; }
.confirm-box { display: flex; flex-direction: column; gap: 12px; margin: 0 0 12px; padding: 14px 16px; border: 1px solid #F2C9C4; border-radius: var(--r); background: #FDF1F0; }
.confirm-box p { margin: 0; font-size: 13px; line-height: 1.6; color: #7A1A12; }
.confirm-box .row { justify-content: flex-end; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #FFFFFF; font-weight: 600; }
.btn.danger-solid:hover { background: #9A1E14; border-color: #9A1E14; color: #FFFFFF; }
.m-links { display: none; }
@media (max-width: 899px) {
  .modal { width: 100%; margin: auto 0 0; max-height: calc(100dvh - 48px); border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .modal[open] { animation: sheet 280ms var(--ease); }
  .m-grip { display: flex; justify-content: center; padding-top: 8px; }
  .m-grip::before { content: ""; width: 36px; height: 4px; border-radius: 2px; background: var(--ctl); }
  .m-head { padding: 8px 8px 0 20px; }
  .icon-btn { width: 44px; height: 44px; }
  .m-body { padding: 0 20px; }
  .m-foot { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); }
  .m-foot > span { display: none; }
  .m-foot .btn.primary { flex: 1; min-height: 48px; font-size: 15px; }
  .set-row { gap: 12px; }
  .stepper { height: 40px; }
  .stepper button { width: 44px; }
  .set-row .btn.sm { min-height: 40px; font-size: 14px; }
  .m-links { display: flex; gap: 20px; padding: 16px 0 20px; border-top: 1px solid var(--line); font-size: 13px; }
}
@keyframes sheet { from { transform: translateY(100%); } }

/* ── 通用元件 ─────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .sub { margin-top: 6px; font-size: 14px; color: var(--muted); }
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); padding: 24px; }
.panel > h2 { margin-bottom: 16px; }
/* 非官方聲明：標示條（課程地圖、課程頁）與每頁底部的頁尾 */
.credit { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 14px 18px; border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--r); background: var(--side); }
.credit-t { flex: 1 1 320px; min-width: 0; }
.credit-t p { margin: 4px 0 0; font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.credit-tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--warn); letter-spacing: .02em; }
.credit-en { font-size: 12px !important; color: var(--muted) !important; }
.credit .btn { flex: none; }
.site-foot { margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.site-foot p { margin: 0 auto; max-width: 720px; text-align: center; font-size: 12px; line-height: 1.75; color: var(--muted); }
.site-foot p + p { margin-top: 4px; }
.section > h2 { margin-bottom: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.cols { display: grid; gap: 40px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.split { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.split > .grow { flex: 999 1 460px; min-width: 0; }
.split > .rail { flex: 1 1 280px; min-width: 0; max-width: 360px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid var(--ctl); border-radius: var(--r); background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 260ms var(--spring); }
.btn:hover { border-color: var(--ctl-hover); color: var(--ink); background: var(--hover); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #FFFFFF; min-height: 44px; padding: 0 22px; font-size: 15px; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #FFFFFF; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--danger); }
.btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--sel); }
.btn:disabled { opacity: .5; cursor: default; }

input[type="text"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--ctl); border-radius: var(--r); background: var(--bg); transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
label.field { display: block; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.search { position: relative; width: min(100%, 320px); }
.search svg { position: absolute; left: 12px; top: 12px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px; }

/* 膠囊分頁（等級、篩選）：淺灰軌道裡滑動的白色膠囊 */
.tabs { position: relative; display: flex; gap: 6px; width: max-content; max-width: 100%; padding: 4px; background: var(--side); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; flex: none; min-width: 72px; height: 36px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; transition: color 200ms var(--ease); }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.tabs .ind { position: absolute; left: 0; top: 4px; height: 36px; width: 72px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; transition: transform 360ms var(--spring), width 360ms var(--spring); pointer-events: none; }

/* 滑鼠移過預選：灰色底滑到游標所在的選項（和側邊欄相同的手感） */
.tabs > .hov, .seg > .hov { position: absolute; left: 0; width: 0; opacity: 0; background: var(--hover-2); pointer-events: none; transition: transform 340ms var(--spring), width 340ms var(--spring), opacity 160ms var(--ease); }
.tabs > .hov { top: 4px; height: 36px; border-radius: 9px; }
.seg > .hov { top: 3px; bottom: 3px; border-radius: 7px; }

/* 分段控制（速度、狀態） */
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 3px; background: var(--side); border: 1px solid var(--line); border-radius: var(--r); }
.seg .ind { position: absolute; top: 3px; bottom: 3px; left: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; transition: transform 360ms var(--spring), background-color 200ms var(--ease), border-color 200ms var(--ease); pointer-events: none; }
.seg button { position: relative; min-width: 52px; height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; transition: color 200ms var(--ease); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.seg.status { display: grid; width: 100%; }
.seg.status button { height: 36px; font-size: 14px; }
.seg.status[data-st="doing"] .ind { background: var(--accent); border-color: var(--accent); }
.seg.status[data-st="done"] .ind { background: var(--ink); border-color: var(--ink); }
.seg.status[data-st="doing"] button[aria-pressed="true"], .seg.status[data-st="done"] button[aria-pressed="true"] { color: #FFFFFF; }

/* 開關 */
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 4px; border: 0; background: transparent; font-size: 13px; color: var(--ink); cursor: pointer; }
.switch .track { position: relative; width: 34px; height: 20px; border-radius: 10px; background: #C7CCD3; transition: background-color 200ms var(--ease); }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #FFFFFF; transition: transform 300ms cubic-bezier(.34, 1.5, .64, 1); }
.switch[aria-checked="true"] .track { background: var(--accent); }
.switch[aria-checked="true"] .knob { transform: translateX(14px); }

/* 核取標籤 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips input + span { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border: 1px solid var(--ctl); border-radius: 999px; font-size: 13px; transition: border-color 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease); }
.chips input:checked + span { border-color: var(--accent); background: var(--sel); color: var(--accent); font-weight: 600; }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips .btn.sm { border-radius: 999px; padding: 0 14px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; font-size: 12px; color: var(--muted); background: var(--track); border-radius: 999px; white-space: nowrap; }

.progress { height: 4px; background: var(--track); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width 480ms var(--spring-soft); }
.progress.thick { height: 6px; }

/* 統計：淺灰圓角方塊 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; }
.stats > div { background: var(--side); border-radius: var(--r-lg); padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.stats .progress { background: var(--hover-2); }
@media (max-width: 520px) { .stats { gap: 8px; } .stats > div { padding: 16px; } .stats .v { font-size: 24px; } }
.stats .k { font-size: 13px; color: var(--muted); }
.stats .v { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats .v small { font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; }

/* 列表：圓角卡片，列與列之間細線分隔 */
.list { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--bg); }
.list > li, .list > a, .list > button, .list > .item { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.list > :last-child { border-bottom: 0; }
ul.list, ol.list { list-style: none; margin: 0; padding: 0; }
.list a.item, a.item { color: var(--ink); transition: background-color 160ms var(--ease); }
.list a.item:hover { background: var(--hover); }
.item .t { flex: 1; min-width: 0; }
.item .t b { display: block; font-weight: 400; font-size: 15px; }
.item .t span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.item .m { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.arrow { width: 14px; height: 14px; color: var(--faint); transition: transform 280ms var(--spring), color 160ms; flex: none; }
a.item:hover .arrow { transform: translateX(3px); color: var(--ink); }
.empty { color: var(--muted); padding: 24px 18px; font-size: 14px; }

/* ── 今日 ────────────────────────────── */
.page.home { max-width: 1080px; gap: 28px; }
.home-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "sub right" "h1 right"; column-gap: 12px; row-gap: 6px; align-items: end; }
.home-head .sub { grid-area: sub; margin: 0; }
.home-head h1 { grid-area: h1; }
.home-head .right { grid-area: right; gap: 8px; flex-wrap: nowrap; }
@media (max-width: 760px) { .home-head { grid-template-areas: "sub right" "h1 h1"; align-items: center; } .home-head h1 { font-size: 24px; } }
.streak { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: #FFF4E5; color: #8F5208; font-size: 13px; font-weight: 600; white-space: nowrap; }
.home-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.home-row > :first-child { flex: 1.45 1 460px; min-width: 0; }
.home-row > :last-child { flex: 1 1 320px; min-width: 0; }
.home-row + .home-row { align-items: flex-start; }
/* 手機：今天的練習排在繼續上課前面 */
@media (max-width: 760px) { .home-row .goal { order: -1; } }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); }
.ell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbtn { padding: 0; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 500; cursor: pointer; }
.linkbtn:hover { color: var(--accent-hover); }

/* 繼續上課 */
.continue { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.continue .thumb { flex: 1 1 220px; max-width: 300px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--track) center / cover no-repeat; display: flex; align-items: center; justify-content: center; }
.continue .info { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.continue .head { display: flex; flex-direction: column; gap: 4px; }
.continue h2 { font-size: 24px; letter-spacing: -0.01em; }
.continue .cont-mod { display: flex; flex-direction: column; gap: 8px; }
.continue .cont-mod .ell { flex: 1; }
.continue .cont-mod .num { flex: none; white-space: nowrap; }
@media (max-width: 760px) { .continue { padding: 12px 12px 18px; gap: 16px; } .continue .thumb { flex-basis: 100%; max-width: none; } .continue .info { padding: 0 4px; } .continue h2 { font-size: 21px; } .continue .btn.primary { flex: 1; min-height: 48px; } }
.play-dot { width: 52px; height: 52px; border-radius: 50%; background: #FFFFFF; display: flex; align-items: center; justify-content: center; }
.continue-done { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.continue-done h2 { margin: 0 !important; }

/* 今天的練習 */
.goal { display: flex; flex-direction: column; gap: 20px; padding: 24px; border-radius: var(--r-lg); background: var(--side); }
.goal-main { display: flex; align-items: center; gap: 24px; }
.goal-ring { position: relative; flex: none; width: 116px; height: 116px; }
.goal-ring svg { display: block; }
.goal-ring .track { stroke: var(--hover-2); }
.goal-ring .val { stroke: var(--accent); transition: stroke-dasharray 600ms var(--spring-soft); }
.goal-ring .val.done { stroke: var(--ok); }
.goal-ring-v { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.goal-ring-v b { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.goal-ring-v span { font-size: 12px; color: var(--muted); }
.goal-kv { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.goal-kv > div, .kv { display: flex; flex-direction: column; gap: 2px; }
.goal-kv span, .kv span { font-size: 13px; color: var(--muted); }
.goal-kv b { font-size: 20px; font-weight: 600; }
.kv b { font-size: 18px; font-weight: 600; }
.goal-kv small, .kv small { font-size: 14px; font-weight: 400; color: var(--muted); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.week .col { width: 100%; height: 48px; display: flex; align-items: flex-end; }
.week i { display: block; width: 100%; background: #B9D0EE; border-radius: 4px; transition: height 520ms var(--spring-soft); }
.week i.zero { height: 3px !important; background: var(--hover-2); }
.week .today i:not(.zero) { background: var(--accent); }
.week .d { font-size: 12px; color: var(--muted); }
.week .today .d { color: var(--accent); font-weight: 600; }
.goal-btn { margin-top: auto; min-height: 44px; font-size: 15px; }
@media (max-width: 760px) { .goal { padding: 20px; gap: 18px; } .goal-ring { transform: scale(.86); margin: -8px; } .goal-btn { min-height: 48px; } }

/* 第二排右欄 */
.home-side { display: flex; flex-direction: column; gap: 20px; }
.card { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.card.soft { border-color: transparent; background: var(--side); gap: 12px; padding: 18px 22px; }
.card h2 { font-size: 18px; }
.card.soft h2 { font-size: 15px; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: end; height: 56px; }
.bars i { display: block; background: #B9D0EE; border-radius: 3px; transition: height 520ms var(--spring-soft); }
.bars i.hi { background: var(--accent); }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ctl-hover); }
.dot.doing { background: var(--warn); }
.dot.done { background: var(--ok); }
.grade-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.grade-seg span { height: 6px; border-radius: 99px; background: var(--hover-2); overflow: hidden; }
.grade-seg i { display: block; height: 100%; background: var(--accent); }
.grade-seg span.cur { background: #D3DFF0; }
.home-foot { margin-top: 12px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: center; }
.home-foot p { margin: 0; max-width: 520px; text-align: center; font-size: 12px; line-height: 1.7; color: var(--muted); }

/* 練習清單 */
.todo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; margin-bottom: 12px; }
.todo-head .t { display: flex; align-items: baseline; gap: 10px; }
.todo-bar { margin-bottom: 12px; }
.todo-bar.full > i { background: var(--ok); }
.todo-done { margin: 12px 0 0; padding: 12px 16px; border-radius: var(--r); background: #EDF7F1; color: #17683F; font-size: 14px; }
.todo-done a { color: #17683F; font-weight: 600; text-decoration: underline; }
.todo-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.task { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 8px 0 18px; border: 0; background: transparent; text-align: left; cursor: pointer; transition: background-color 160ms var(--ease); }
.task:hover { background: var(--hover); }
.task .box { flex: none; width: 20px; height: 20px; border: 1.5px solid var(--ctl-hover); border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: background-color 160ms var(--ease), border-color 160ms var(--ease); }
.task .box svg { width: 12px; height: 12px; transform: scale(0); opacity: 0; transition: transform 320ms cubic-bezier(.34, 1.6, .64, 1), opacity 120ms var(--ease); }
.task[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); }
.task[aria-pressed="true"] .box svg { transform: scale(1); opacity: 1; }
.task .name { flex: 1; min-width: 0; font-size: 15px; transition: color 160ms var(--ease); }
.task[aria-pressed="true"] .name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--ctl-hover); }
.task .m { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.todo-row .go { flex: none; width: 44px; display: flex; align-items: center; justify-content: center; color: var(--faint); transition: color 160ms var(--ease), background-color 160ms var(--ease); }
a.go:hover { color: var(--ink); background: var(--hover); }
.task-edit { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
form.task-edit { border: 0; padding: 12px 0 0; }
.task-edit .ename, .task-edit input[name="name"] { flex: 3 1 0; min-width: 0; }
.task-edit .emeta, .task-edit input[name="meta"] { flex: 2 1 0; min-width: 0; }
.task-edit .btn { flex: none; }

/* ── 課程 ─────────────────────────────── */
.course-page .page-head .sub { max-width: 560px; }
.course-body { display: flex; flex-direction: column; gap: 32px; }
.btn-link { padding: 0; border: 0; background: none; color: var(--accent); font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; }
.btn-link:hover { color: var(--accent-hover); }

/* 等級路線：依程度分組，每級一張卡片；手機改成左右滑動 */
.path { display: flex; flex-wrap: wrap; gap: 16px; }
.path .lv { flex: var(--n) 1 calc(var(--n) * 130px); min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.lv-head { display: flex; justify-content: space-between; gap: 8px; padding: 0 4px; font-size: 12px; color: var(--muted); }
.lv-head span:first-child { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.lv-grades { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; }
.g-card { display: flex; flex-direction: column; gap: 8px; min-height: 108px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); text-align: left; cursor: pointer; transition: background-color 160ms var(--ease), border-color 160ms var(--ease); }
.g-card:hover { background: var(--hover); }
.g-card[aria-pressed="true"] { padding: 13.5px; border: 1.5px solid var(--accent); background: var(--sel); }
.g-card .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.g-card .top b { font-size: 15px; font-weight: 600; }
.g-card[aria-pressed="true"] .top b { color: var(--accent); }
.g-card .top .num { font-size: 12px; color: var(--muted); white-space: nowrap; }
.g-card .sub { flex: 1; font-size: 13px; line-height: 1.45; color: var(--muted); }
.g-card .g-lv { display: none; font-size: 12px; color: var(--muted); }

/* 等級總覽：說明、數字、各單元進度條，右邊是接下來的課 */
.g-hero { display: flex; flex-wrap: wrap; gap: 24px; padding: 28px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.g-info { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.g-title { display: flex; flex-direction: column; gap: 6px; }
.g-title .eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); }
.g-title h2 { font-size: 26px; letter-spacing: -0.01em; line-height: 1.25; }
.g-title p { margin: 0; max-width: 560px; font-size: 14px; color: var(--ink-2); }
.g-stats { margin: 0; display: flex; flex-wrap: wrap; gap: 12px 32px; }
.g-stats div { display: flex; flex-direction: column; }
.g-stats dt { font-size: 12px; color: var(--muted); }
.g-stats dd { margin: 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.g-strip { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.g-strip .segs { display: flex; gap: 3px; height: 8px; }
.g-strip .segs > span { flex: 1 1 0; border-radius: 3px; background: var(--track); overflow: hidden; }
.g-strip .segs i { display: block; height: 100%; background: var(--accent); transition: width 480ms var(--spring-soft); }
.g-strip .segs i.full { background: var(--ok); }
.g-strip .ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.g-next { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 12px; background: var(--side); }
.g-next .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.g-next .thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); background: #1D2128 center / cover no-repeat; display: flex; align-items: center; justify-content: center; }
.g-next .thumb .play-dot { width: 48px; height: 48px; transition: transform 260ms var(--spring); }
.g-next .thumb:hover .play-dot { transform: scale(1.08); }
.g-next .thumb .dur { position: absolute; left: 10px; bottom: 10px; padding: 1px 8px; border-radius: var(--r-sm); background: rgba(0, 0, 0, .65); color: #FFFFFF; font-size: 12px; font-variant-numeric: tabular-nums; }
.g-next .nt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.g-next .nt b { font-size: 16px; font-weight: 600; line-height: 1.4; }
.g-next .nt > span { font-size: 13px; color: var(--muted); }
.g-next .m-dur { display: none; }
.g-next .acts { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.g-next p { margin: 0; font-size: 14px; color: var(--ink-2); }

/* 單元路線（左）＋本級資源（右） */
.g-main { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.g-mods { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.g-rail { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1300px) { .g-rail { max-width: 360px; } }
.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .st { width: 12px; height: 12px; }
.legend .st.doing::after { width: 4px; height: 4px; }
.legend .st.done::after { width: 4px; height: 2px; border-width: 0 0 1.4px 1.4px; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl > li { position: relative; display: flex; gap: 16px; padding-bottom: 12px; }
.tl > li::before { content: ""; position: absolute; left: 15px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl > li:first-child::before { top: 32px; }
.tl > li:last-child::before { bottom: auto; height: 32px; }
.tl > li:only-child::before { display: none; }
.tl > li.done::before { background: var(--ok); }
.tl .node { position: relative; z-index: 1; flex: none; width: 28px; height: 28px; margin: 18px 2px 0; border-radius: 50%; border: 1.5px solid #B8BEC7; background: var(--bg); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tl > .done .node { border-color: var(--ok); background: var(--ok); color: #FFFFFF; }
.tl > .cur .node { border-color: var(--accent); background: var(--accent); color: #FFFFFF; outline: 4px solid var(--accent-soft); }
.mod-card { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.tl > .cur .mod-card { border: 1.5px solid var(--accent); }
.mod-head { width: 100%; min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; border: 0; border-radius: 13px; background: transparent; text-align: left; cursor: pointer; transition: background-color 160ms var(--ease); }
.mod-head:hover { background: var(--hover); }
.mod.open .mod-head { border-radius: 13px 13px 0 0; }
.mod-head .name { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mod-head .name small { font-size: 12px; color: var(--muted); }
.mod-head .name b { font-size: 15px; font-weight: 600; line-height: 1.45; }
.mod-head .chs { display: flex; flex-wrap: wrap; gap: 6px; }
.mod-head .chs span { min-width: 28px; height: 24px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--ctl); border-radius: var(--r-sm); font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.mod-head .end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.mod-head .cnt { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl > .done .mod-head .cnt { color: var(--ok); font-weight: 600; }
.tl > .cur .mod-head .cnt { color: var(--accent); font-weight: 600; }
.chev { width: 14px; height: 14px; color: var(--muted); flex: none; transition: transform 320ms var(--spring); }
.mod.open .chev { transform: rotate(180deg); }
.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 360ms var(--spring-soft); }
.mod.open .collapse, .pa.open .collapse { grid-template-rows: 1fr; }
.collapse > div { overflow: hidden; min-height: 0; }
.mod-goal { margin: 4px 16px 12px; padding: 10px 14px; border-radius: var(--r); background: var(--side); font-size: 13px; color: var(--ink-2); }
.mod-goal b { margin-right: 8px; color: var(--ink); font-weight: 600; }
.lessons { list-style: none; margin: 0; padding: 0 12px 14px; }
.lessons a { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 8px; color: var(--ink); transition: background-color 160ms var(--ease); }
.lessons a:hover { background: var(--hover); color: var(--ink); }
.lessons .next a { background: var(--sel); }
.lessons .i { width: 22px; flex: none; font-size: 12px; color: var(--muted); }
.lessons .t { flex: 1; min-width: 0; padding: 10px 0; font-size: 14px; line-height: 1.45; }
.lessons .d { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lessons .tag.next { background: var(--accent); color: #FFFFFF; font-weight: 600; }
.lessons .done .t { color: var(--muted); }
.lessons .doing .t { font-weight: 600; }

/* 右欄卡片 */
.rail-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.rail-card .hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rail-card .hd span { font-size: 12px; color: var(--muted); }
.rail-card p { margin: 0; font-size: 13px; color: var(--ink-2); }
.rail-card .links { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 14px; font-weight: 500; }
.rail-card .links:empty { display: none; }
.ch-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ch-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 1px solid transparent; border-radius: var(--r); background: var(--side); color: var(--ink); text-align: center; transition: background-color 160ms var(--ease); }
.ch-tile:hover { background: var(--hover-2); color: var(--ink); }
.ch-tile.done { border-color: var(--line); background: var(--bg); }
.ch-tile.done:hover { background: var(--hover); }
.ch-tile.doing { background: var(--sel); }
.ch-tile svg { width: 52px; height: 61px; }
.ch-tile.todo svg .fdot { fill: var(--muted); }
.ch-tile b { font-size: 13px; font-weight: 600; line-height: 1.25; word-break: break-word; }
.ch-tile span { font-size: 11px; line-height: 1.3; color: var(--muted); }
.ch-tile.done span { color: var(--ok); font-weight: 600; }
.ch-tile.doing span { color: var(--accent); font-weight: 600; }
.pa-head { display: flex; align-items: center; gap: 10px; }
.pa-head .ico { width: 36px; height: 36px; flex: none; border-radius: var(--r); background: var(--side); display: flex; align-items: center; justify-content: center; color: var(--ink-2); }
.pa .collapse { margin: 0 -12px -8px; }
.pa-list { max-height: 420px; overflow-y: auto; padding: 0 0 4px; }

@media (max-width: 760px) {
  .course-body { gap: 24px; }
  .path { flex-wrap: nowrap; gap: 8px; margin: 0 -16px; padding: 0 16px 4px; overflow-x: auto; scrollbar-width: none; }
  .path::-webkit-scrollbar { display: none; }
  .path .lv { flex: none; }
  .lv-head { display: none; }
  .lv-grades { display: flex; gap: 8px; }
  .g-card { flex: none; width: 124px; min-height: 0; gap: 4px; padding: 10px 12px; }
  .g-card[aria-pressed="true"] { padding: 9.5px 11.5px; }
  .g-card .top b { font-size: 14px; }
  .g-card .sub { display: none; }
  .g-card .g-lv { display: block; }
  .g-hero { gap: 20px; padding: 0; border: 0; border-radius: 0; }
  .g-title h2 { font-size: 22px; }
  .g-stats { gap: 8px 20px; }
  .g-stats dd { font-size: 17px; }
  .g-next { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 12px; padding: 16px; border-radius: 14px; }
  .g-next.all-done { display: flex; }
  .g-next .lbl { grid-column: 1 / -1; margin-bottom: -4px; }
  .g-next .thumb { border-radius: 8px; }
  .g-next .thumb .play-dot { width: 32px; height: 32px; }
  .g-next .thumb .dur { display: none; }
  .g-next .nt b { font-size: 15px; }
  .g-next .nt > span { font-size: 12px; }
  .g-next .m-dur { display: inline; }
  .g-next .acts { grid-column: 1 / -1; }
  .g-next .acts .btn.primary { flex: 1; min-height: 48px; }
  .g-main { gap: 24px; }
  .tl > li { gap: 10px; padding-bottom: 10px; }
  .tl > li::before { left: 12px; }
  .tl > li:first-child::before { top: 29px; }
  .tl > li:last-child::before { height: 29px; }
  .tl .node { width: 24px; height: 24px; margin: 17px 1px 0; font-size: 11px; }
  .tl > .cur .node { outline-width: 3px; }
  .mod-head { flex-wrap: nowrap; min-height: 58px; gap: 10px; padding: 10px 12px; }
  .mod-head .name { flex: 1 1 auto; }
  .mod-head .name b { font-size: 14px; }
  .mod-head .chs { display: none; }
  .mod-goal { margin: 2px 8px 8px; }
  .lessons { padding: 0 6px 10px; }
  .lessons .i { display: none; }
  .ch-tiles { display: flex; gap: 8px; margin: 0 -20px; padding: 0 20px 2px; overflow-x: auto; scrollbar-width: none; }
  .ch-tile { flex: none; width: 72px; }
}
.st { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #B8BEC7; display: flex; align-items: center; justify-content: center; }
.st.doing { border-color: var(--accent); }
.st.doing::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.st.done { border-color: var(--ok); background: var(--ok); }
.st.done::after { content: ""; width: 6px; height: 3px; border: solid #FFFFFF; border-width: 0 0 1.6px 1.6px; transform: translateY(-1px) rotate(-45deg); }

/* ── 和弦圖（SVG） ────────────────────── */
svg .str { stroke: var(--faint); }
svg .fret { stroke: var(--ctl); stroke-width: 1.2; }
svg .nut { stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; }
svg .fdot { fill: var(--accent); }
svg .fnum { fill: #FFFFFF; font-size: 9px; font-weight: 700; text-anchor: middle; dominant-baseline: central; font-family: var(--font); }
svg .fpos { fill: var(--muted); font-size: 9px; dominant-baseline: central; font-family: var(--font); }
svg .mark { fill: none; stroke: var(--muted); stroke-width: 1.5; }
svg .mark-x { stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; }
/* 和弦小卡片：名稱＋簡短中文；選取時底下那塊淡藍底會滑過來（.cell-ind） */
.chord-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; align-content: start; }
@media (max-width: 520px) { .chord-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } }
.chord-cell { position: relative; z-index: 1; min-width: 0; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 8px 4px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink); cursor: pointer; transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 120ms var(--ease); }
.chord-cell b { font-size: 18px; font-weight: 600; line-height: 1.25; }
.chord-cell small { padding: 0 4px; font-size: 11px; line-height: 1.3; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.chord-cell:hover { border-color: var(--ctl-hover); }
.chord-cell:active { transform: scale(.96); }
.chord-cell[aria-pressed="true"] { border-color: transparent; color: var(--accent); }
.chord-cell[aria-pressed="true"] small { color: var(--accent); }
.chord-groups { position: relative; }
.cell-ind { position: absolute; left: 0; top: 0; z-index: 0; width: 0; height: 0; box-sizing: border-box; border: 1.5px solid var(--accent); border-radius: 12px; background: var(--accent-soft); opacity: 0; pointer-events: none; transition: transform 420ms var(--spring-soft), width 300ms var(--ease), height 300ms var(--ease), opacity 160ms var(--ease); }

/* 和弦頁：篩選列、依等級分組的列表、右側詳情（寬螢幕固定在右邊，較窄時移到列表上方） */
.chords-page { gap: 28px; }
.chord-filters { display: flex; flex-direction: column; gap: 12px; }
.tabs button .cnt { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--line); color: var(--muted); font-family: Inter, system-ui, sans-serif; font-size: 12px; font-weight: 500; line-height: 1; vertical-align: 1px; }
.tabs button[aria-selected="true"] .cnt { background: var(--track); }
/* 選單與詳情放在同一個畫面：選和弦不用捲整頁。
   寬螢幕：左邊是固定的和弦選單（自己捲動），右邊是詳情；
   手機：和弦選單變成一條橫向滑動的列，捲動時黏在畫面最上方 */
.chord-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.chord-pick { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pick-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--muted); }
.pick-hint kbd { padding: 0 6px; font-size: 11px; }
@media (hover: none) { .pick-hint { display: none; } }
.chord-groups { display: flex; flex-direction: column; gap: 18px; }
.chord-group { display: flex; flex-direction: column; gap: 8px; }
.cg-head { display: flex; align-items: baseline; gap: 8px; }
.cg-head h2 { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cg-head span { font-size: 12px; color: var(--muted); }
.cg-head span:not(.n) { display: none; }
.cg-head .n { margin-left: auto; }
.chord-pick .chord-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chord-pick .chord-cell { min-height: 56px; }
.chord-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px; border: 1px dashed var(--ctl); border-radius: var(--r-lg); }
.chord-empty span { font-size: 14px; color: var(--muted); }
.chord-panel { min-width: 0; display: flex; flex-direction: column; gap: 20px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); }
@media (min-width: 900px) {
  /* 詳情卡片最寬 680px，其餘空間給左邊選單（選單自動多排幾欄） */
  .chord-stage { grid-template-columns: minmax(292px, 1fr) minmax(0, 680px); }
  .chord-pick .chord-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .chord-panel { padding: 20px; gap: 16px; }
  .chord-pick { position: sticky; top: 24px; max-height: calc(100vh - 48px); padding: 16px 12px 0 16px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
  /* 捲動區四周留 8px（再用負邊距抵銷），選取框彈到邊緣、鍵盤焦點框都不會被裁掉 */
  .chord-pick .chord-groups { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--ctl) transparent; margin: 0 -4px 0 -8px; padding: 8px 4px 16px 8px; scroll-padding: 8px; }
}
@media (min-width: 1300px) {
  .chord-panel .cd-body { flex-wrap: nowrap; gap: 24px; }
  .chord-panel .cd-col:first-child { flex: 0 0 296px; position: sticky; top: 24px; align-self: flex-start; }
  .chord-panel .cd-col:last-child { flex: 1 1 0; gap: 18px; }
  .chord-panel .cd-diagram { padding: 16px 8px 12px; }
}
@media (max-width: 899px) {
  .chord-pick { position: sticky; top: 0; z-index: 15; margin: 0 -16px; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .pick-meta { display: none; }
  .chord-groups { flex-direction: row; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; margin: -8px -16px; padding: 8px 16px; scroll-padding: 0 16px; }
  .chord-groups::-webkit-scrollbar { display: none; }
  .chord-group { flex: none; flex-direction: row; align-items: center; gap: 8px; }
  .cg-head { flex: none; writing-mode: vertical-rl; padding: 0 2px; }
  .cg-head h2 { font-size: 12px; color: var(--muted); letter-spacing: .1em; }
  .cg-head .n { display: none; }
  .chord-pick .chord-grid { display: flex; gap: 8px; }
  .chord-pick .chord-cell { flex: none; width: 76px; min-height: 52px; }
  .chord-empty { flex: none; flex-direction: row; align-items: center; padding: 8px 12px; }
  .chord-empty span { display: none; }
}
@media (max-width: 520px) { .chord-panel { padding: 18px 16px; } }
.cd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.cd-name { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cd-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.cd-title .big { font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.cd-title span:not(.big) { font-size: 15px; color: var(--muted); }
.cd-zh { font-size: 15px; color: var(--ink-2); }
.cd-nav { flex: none; display: flex; gap: 6px; }
.cd-step { width: 44px; min-height: 44px; padding: 0; }
.cd-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cd-tags span { padding: 4px 10px; border-radius: 999px; background: var(--track); color: var(--ink-2); font-size: 12px; font-weight: 500; }
.cd-body { display: flex; flex-wrap: wrap; gap: 22px 28px; }
.cd-col { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.cd-col:first-child { gap: 14px; }
.cd-diagram { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.cd-diagram figcaption { font-size: 12px; line-height: 1.6; color: var(--muted); text-align: center; }
.cd-diagram svg .fnum { font-size: 7.5px; }
svg .snote { fill: var(--muted); font-size: 5.6px; font-weight: 500; text-anchor: middle; dominant-baseline: central; font-family: var(--font); transition: fill 120ms var(--ease); }
svg .snote.root { fill: var(--ink); font-weight: 700; }
svg .snote-bg { fill: transparent; transition: fill 120ms var(--ease); }
svg .snote-bg.on { fill: var(--sel); }
svg .snote.on { fill: var(--accent); }
.cd-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.cd-acts .btn { flex: 1 1 120px; min-height: 44px; }
/* 聽聽看：滑鼠移過去，圖示的四條音量柱跳動 */
.btn .wave { display: inline-flex; align-items: center; gap: 2px; height: 16px; }
.btn .wave i { display: block; width: 2.5px; height: 6px; border-radius: 2px; background: currentColor; }
.btn.primary:hover .wave i { animation: eq 700ms ease-in-out infinite alternate; }
.btn .wave i:nth-child(2) { animation-delay: 120ms; } .btn .wave i:nth-child(3) { animation-delay: 240ms; } .btn .wave i:nth-child(4) { animation-delay: 360ms; }
@keyframes eq { from { height: 4px; } to { height: 16px; } }
/* 大和弦圖（bigChord） */
.bc { position: relative; flex: none; width: 280px; height: 320px; }
.bc-nut { position: absolute; left: 30px; top: 56px; width: 220px; height: 6px; border-radius: 3px; background: var(--ink); }
.bc-fret { position: absolute; left: 30px; width: 220px; height: 1.5px; background: var(--ctl); }
.bc-str { position: absolute; top: 60px; height: 224px; border-radius: 2px; background: var(--muted); }
.bc-pos { position: absolute; left: 256px; font-size: 12px; font-weight: 500; color: var(--muted); }
.bc-mk { position: absolute; top: 22px; width: 16px; height: 16px; margin-left: -8px; color: var(--muted); }
.bc-mk.x { color: var(--faint); }
.bc-mk svg { display: block; }
.bc-dot, .bc-barre { position: absolute; z-index: 1; height: 34px; margin-top: -17px; border-radius: 17px; background: var(--accent); color: #FFFFFF; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.bc-dot { width: 34px; margin-left: -17px; }
.bc-anchor { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--ok); animation: ringPulse 1.6s var(--ease) infinite; }
.bc-vib { position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; overflow: visible; }
.bc-note { position: absolute; top: 294px; width: 40px; margin-left: -20px; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); transition: color 400ms var(--ease), transform 400ms var(--spring); }
.bc-note.root { color: var(--ink); font-weight: 700; }
.bc-note.on { color: var(--accent); transform: translateY(-4px) scale(1.25); transition-duration: 60ms; }
.fing tbody tr { transition: background-color 500ms var(--ease); }
.fing tbody tr.on { background: var(--accent-soft); transition-duration: 60ms; }
.fing.swap tbody td { animation: fadeUp 360ms var(--spring-soft) both; }
@media (max-width: 360px) { .bc { transform: scale(.9); margin: -16px -14px; } }
.cd-sec { display: flex; flex-direction: column; gap: 10px; }
.cd-sec h3 { font-size: 14px; }
.tones { display: flex; flex-wrap: wrap; gap: 8px; }
.tone { min-width: 52px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); }
.tone b { font-size: 17px; font-weight: 600; line-height: 1.2; }
.tone span { font-size: 11px; line-height: 1.3; color: var(--muted); }
.tone.root { border-color: var(--ink); background: var(--ink); color: #FFFFFF; }
.tone.root span { color: var(--ctl); }
.fing { width: 100%; border-collapse: collapse; font-size: 14px; }
.fing th, .fing td { padding: 7px 0; text-align: left; font-weight: 500; }
.fing thead th { padding: 0 0 6px; font-size: 12px; color: var(--muted); }
.fing tbody tr { border-top: 1px solid var(--track); }
.fing tbody th { color: var(--ink-2); }
.fing td:last-child, .fing th:last-child { text-align: right; }
.fing td.root { font-weight: 700; }
.fing tr.off td { color: var(--muted); }
.cd-more { display: flex; flex-direction: column; gap: 20px; }
.cd-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--side); font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.cd-note svg { flex: none; margin-top: 3px; color: var(--muted); }
.cd-lessons { display: flex; flex-direction: column; margin-top: -6px; }
.cd-lessons a { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--track); font-size: 14px; color: var(--ink); }
.cd-lessons a:hover { color: var(--accent); }
.cd-lessons svg { flex: none; color: var(--muted); }
.chord-mini { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); transition: background-color 160ms var(--ease); }
.chord-mini:hover { background: var(--hover); color: var(--ink); }
.chord-mini svg { width: 80px; height: 95px; }
.chord-mini b { font-size: 15px; }
.chord-row { display: flex; flex-wrap: wrap; gap: 12px; }
.fingering { margin: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.fingering div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.fingering div:last-child { border-bottom: 0; }
.fingering dt { color: var(--muted); }
.fingering dd { margin: 0; }
.fingering .off { color: var(--muted); }

/* ── 課程頁 ───────────────────────────── */
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--faint); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--track); border-radius: var(--r-lg); overflow: hidden; }
.video > iframe, .video > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .fallback { display: grid; place-items: center; text-align: center; padding: 20px; background: var(--track); color: var(--ink); }
.player-bar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 14px 0 0; }
.cc-line { font-size: 13px; color: var(--muted); padding-top: 10px; }
.cc-line details { margin-top: 6px; }
.cc-line summary { cursor: pointer; color: var(--accent); list-style: none; }
.cc-line summary::-webkit-details-marker { display: none; }
.cc-line details p { margin: 6px 0 0; }
.reading { display: flex; flex-direction: column; gap: 28px; font-size: 16px; line-height: 1.75; color: var(--body); }
.reading .lead { font-size: 18px; line-height: 1.6; font-weight: 500; color: var(--ink); margin: 0; }
.reading h2 { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.reading ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.reading ol li { display: flex; gap: 14px; }
.reading ol li > span { flex: none; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%; background: var(--side); color: var(--muted); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.reading .note { font-size: 13px; color: var(--muted); }
.prevnext { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.prevnext a { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); color: var(--ink); transition: background-color 160ms var(--ease), border-color 160ms var(--ease); min-width: 0; }
.prevnext a:hover { background: var(--hover); border-color: var(--ctl); }
.prevnext a.next { align-items: flex-end; text-align: right; }
.prevnext small { font-size: 12px; color: var(--muted); }
.prevnext span { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.rail-block > h3 { margin-bottom: 12px; font-size: 14px; }
.list.links .item { padding: 12px 16px; }
.list.links .item .t b { font-size: 14px; }
.stamps { list-style: none; margin: 12px 0 0; padding: 0; }
.stamps:empty { display: none; }
.stamps li { display: flex; align-items: flex-start; gap: 12px; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.stamps li:hover { background: var(--hover); }
.stamps .time { flex: none; min-width: 40px; border: 0; background: transparent; padding: 0; color: var(--accent); font-variant-numeric: tabular-nums; cursor: pointer; text-align: left; }
.stamps .txt { flex: 1; white-space: pre-wrap; word-break: break-word; }
.stamps .del { border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 0 4px; border-radius: 4px; }
.stamps .del:hover { color: var(--danger); }
.save-hint { font-size: 12px; color: var(--muted); }

/* ── 練習與工具 ───────────────────────── */
.pill { min-width: 44px; height: 34px; padding: 0 12px; border: 1px solid var(--ctl); border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease), transform 240ms var(--spring); }
.pill:hover { background: var(--hover); border-color: var(--ctl-hover); }
.pill:active { transform: scale(.95); }
.pill[aria-pressed="true"] { border-color: var(--accent); background: var(--sel); color: var(--accent); font-weight: 600; }
.pill.lg { height: 40px; padding: 0 14px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.dur { display: flex; gap: 8px; }
.dur-box { position: relative; display: flex; align-items: center; }
.dur-box span { position: absolute; right: 12px; font-size: 13px; color: var(--muted); pointer-events: none; }
.dur-box input { width: 104px; padding-right: 34px; font-variant-numeric: tabular-nums; }

/* 練習頁：統計卡 */
.pr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.pr-stat { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.pr-stat .k { font-size: 13px; color: var(--muted); }
.pr-stat .v { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pr-stat .v b { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.pr-stat .v small { font-size: 14px; color: var(--muted); }
.pr-stat .s { font-size: 13px; color: var(--muted); }
.pr-stat .progress { margin-top: auto; }
.pr-stat .progress > i.done { background: var(--ok); }

/* 這次練習：左邊計時或補記，右邊練了什麼、課程、心得 */
.sess { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.sess-flash { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 20px; background: #E7F4EE; border-bottom: 1px solid #CFE8DC; color: #17694A; font-size: 14px; }
.sess-flash > svg { flex: none; }
.sess-flash .t { flex: 1; min-width: 0; }
.sess-flash .undo { min-height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: none; color: #17694A; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sess-flash .undo:hover { background: #D5EDE2; }
.sess-flash .icon-btn { color: #17694A; }
.sess-flash .icon-btn:hover { background: #D5EDE2; color: #17694A; }
.sess-body { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.3fr); }
.sess-left { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 24px 28px 28px; background: var(--side); }
.sess-right { display: flex; flex-direction: column; gap: 22px; min-width: 0; padding: 24px 28px 28px; border-left: 1px solid var(--line); }
.sess-top { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.sess-top .tag { height: 26px; padding: 0 10px; font-weight: 600; }
.tag.live { gap: 6px; background: #E7F4EE; color: #17694A; }
.tag.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.pr-ring { position: relative; width: 232px; height: 232px; }
.pr-ring svg { display: block; width: 100%; height: 100%; }
.pr-ring circle { fill: none; stroke-width: 12; }
.pr-ring .track { stroke: var(--line); }
.pr-ring .val { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray 300ms var(--ease), stroke 200ms var(--ease); }
.pr-ring .val.done { stroke: var(--ok); }
.pr-ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.pr-ring-c .clock { font-size: 52px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.pr-ring-c .clock.running { color: var(--accent); }
.pr-ring-c .clock.paused { color: var(--muted); }
.pr-ring-c > span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 計時按鈕：取消｜開始／暫停／繼續｜結束並儲存 */
.timer-ctrl { display: grid; grid-template-columns: 96px auto 96px; align-items: start; justify-items: center; gap: 8px; }
.tc { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--ink); font-size: 13px; cursor: pointer; }
.tc-ico { display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 240ms var(--spring); }
.tc.main .tc-ico { width: 72px; height: 72px; background: var(--accent); color: #FFFFFF; }
.tc.main:hover .tc-ico { background: var(--accent-hover); }
.tc.side { margin-top: 10px; }
.tc.side .tc-ico { width: 52px; height: 52px; background: var(--bg); border: 1px solid var(--line); color: var(--ink-2); }
.tc.side:hover .tc-ico { background: var(--hover); border-color: var(--ctl); }
.tc.end .tc-ico { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.tc.end:hover .tc-ico { background: #DCE8FA; border-color: transparent; }
.tc:active .tc-ico { transform: scale(.93); }
.tc-lbl { color: var(--muted); font-weight: 500; white-space: nowrap; }
.tc.main .tc-lbl { color: var(--ink); font-weight: 600; }
.tc.end .tc-lbl { color: var(--accent); font-weight: 600; }
.tc:focus-visible { outline: none; }
.tc:focus-visible .tc-ico { outline: 2px solid var(--accent); outline-offset: 3px; }
/* 補記 */
.sess-left:has(.man-f) { align-items: stretch; }
.sess-note { margin: -8px 0 0; font-size: 13px; color: var(--muted); }
.man-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.man-f > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.man-f .quick { margin-top: 4px; }
.sess-f { display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.sess-f > b, .sess-f > legend b { font-size: 15px; font-weight: 600; color: var(--ink); }
.sess-f > legend { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 0; margin-bottom: 10px; }
.sess-f > legend span { font-size: 13px; color: var(--muted); }
.sess-f textarea { min-height: 84px; font-weight: 400; }
.pr-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sess-actions { display: flex; justify-content: flex-end; gap: 8px; }
.sess-hint { margin: 0; font-size: 13px; color: var(--muted); }
/* 相關課程：常用快選＋搜尋 */
.lp-sugg { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-sugg .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-search { width: 100%; }
.lp-res { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; margin: 0; padding: 6px; list-style: none; max-height: 320px; overflow-y: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px rgba(17, 24, 39, .08); }
.lp-res li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; }
.lp-res li[aria-selected="true"] { background: var(--hover); }
.lp-res li .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lp-res li b { font-weight: 500; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-res li .t span { font-size: 12px; color: var(--muted); }
.lp-res li.none { cursor: default; color: var(--muted); font-size: 13px; }

/* 趨勢：最近 14 天、這 30 天練了什麼 */
.pr-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.pr-card { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.pr-card-h { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.pr-card-h h2 { font-size: 16px; }
.pr-card-h .s { font-size: 12px; color: var(--muted); }
.pr-legend { display: inline-flex; align-items: center; gap: 6px; }
.pr-legend i { width: 18px; border-top: 1.5px dashed var(--muted); }
.pr-bars { display: flex; flex-direction: column; gap: 6px; }
.bars-plot { position: relative; height: 132px; display: flex; align-items: flex-end; gap: 6px; border-bottom: 1px solid var(--ctl); }
.goal-line { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--ctl-hover); pointer-events: none; z-index: 1; }
.bar-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.bar-v { font-size: 11px; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-v.today { color: var(--accent); font-weight: 600; }
.pr-bar { display: block; width: 100%; max-width: 22px; background: #7A98C4; border-radius: 4px 4px 1px 1px; }
.pr-bar.today { background: var(--accent); }
.pr-bar.zero { background: var(--line); border-radius: 2px; }
.bars-x { display: flex; gap: 6px; font-size: 11px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.bars-x span { flex: 1; min-width: 0; white-space: nowrap; }
.bars-x .today { color: var(--accent); font-weight: 600; }
.mix { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.mix li { display: grid; grid-template-columns: 76px minmax(0, 1fr) 84px; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); }
.mix .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mix .track { height: 10px; border-radius: 5px; background: var(--track); overflow: hidden; }
.mix .track i { display: block; height: 100%; border-radius: 5px; background: #7A98C4; }
.mix .v { text-align: right; }
.pr-empty { margin: 0; font-size: 14px; color: var(--muted); }
.pr-empty.box { padding: 32px; border: 1px dashed var(--ctl); border-radius: var(--r-lg); text-align: center; }

/* 歷史紀錄：依週分組 */
.hist { display: flex; flex-direction: column; gap: 16px; }
.hist-h { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.wk { display: flex; flex-direction: column; }
.wk-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 8px 10px; font-size: 13px; color: var(--muted); }
.wk-h h3 { font-size: 14px; color: var(--ink-2); }
.wk-h h3 .rng { margin-left: 8px; font-weight: 400; color: var(--muted); }
.wk-h h3 .rng.solo { margin-left: 0; font-weight: 600; color: var(--ink-2); }
.wk-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.wk-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: start; gap: 16px; padding: 14px 8px; border-bottom: 1px solid var(--line); transition: background-color 160ms var(--ease); }
.wk-list li:hover { background: var(--hover); }
.wk-list .when { display: flex; flex-direction: column; line-height: 1.3; }
.wk-list .when b { font-size: 15px; font-weight: 600; }
.wk-list .when span { font-size: 12px; color: var(--muted); }
.wk-list .what { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wk-list .top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.wk-list .top b { font-size: 15px; font-weight: 600; }
.wk-list .ls { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; font-size: 13px; }
.wk-list .note { margin: 0; font-size: 14px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.wk-list .del:hover { background: #FCEBEA; color: var(--danger); }

@media (max-width: 980px) {
  .sess-body { grid-template-columns: minmax(0, 1fr); }
  .sess-right { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .pr-stat { padding: 14px 16px; gap: 8px; }
  .pr-stat .v b { font-size: 24px; }
  .sess-left, .sess-right { padding: 20px 16px 24px; }
  .pr-ring { width: 208px; height: 208px; }
  .pr-ring-c .clock { font-size: 46px; }
  .pill.lg { height: 44px; padding: 0 16px; font-size: 14px; }
  .lp-sugg { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .lp-sugg .pill { flex: none; max-width: 240px; }
  .man-f .dur-box { flex: 1; }
  .man-f .dur-box input { width: 100%; }
  .man-f .quick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .man-f .quick .pill { min-width: 0; padding: 0; height: 44px; }
  .pr-card { padding: 18px 16px; }
  .bars-plot, .bars-x { gap: 3px; }
  .mix li { grid-template-columns: 64px minmax(0, 1fr) 76px; gap: 10px; }
  .wk-list li { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; padding: 14px 4px; }
  .wk-list .del { width: 44px; height: 44px; }
}
/* 工具頁：上方工具卡片，下方主舞台＋右側設定 */
.tool-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tool-card { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); color: var(--ink); transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 260ms var(--spring); }
.tool-card:hover { color: var(--ink); background: var(--hover); border-color: var(--ctl); }
.tool-card:active { transform: scale(.98); }
.tool-card .ico { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--side); color: var(--ink-2); display: flex; align-items: center; justify-content: center; transition: background-color 200ms var(--ease), color 200ms var(--ease); }
.tool-card .t { display: flex; flex-direction: column; min-width: 0; }
.tool-card b { font-size: 15px; font-weight: 600; }
.tool-card .t span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-card.on, .tool-card.on:hover { border-color: var(--accent); background: var(--sel); }
.tool-card.on .ico { background: var(--accent); color: #FFFFFF; }
.tool-card.on .t span { color: var(--accent); }
@media (max-width: 640px) {
  .tool-cards { gap: 8px; }
  .tool-card { flex-direction: column; gap: 6px; padding: 12px 4px 10px; border-radius: 14px; text-align: center; }
  .tool-card .ico { width: 36px; height: 36px; border-radius: 10px; }
  .tool-card .ico svg { width: 20px; height: 20px; }
  .tool-card b { font-size: 13px; font-weight: 500; }
  .tool-card.on b { font-weight: 600; color: var(--accent); }
  .tool-card .t span { display: none; }
}
.tool-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 1100px) { .tool-grid { grid-template-columns: minmax(0, 1fr); } }
.tool-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.tool-side .panel h2 { margin: 0; }
.tool-stage { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 32px clamp(20px, 3vw, 40px) 36px; transition: border-color 200ms var(--ease); }
.tool-stage.live { border-color: var(--accent); }
.stage-top { align-self: stretch; display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.stage-top > span:first-child { font-weight: 500; }
kbd { font-family: inherit; font-size: 12px; padding: 1px 8px; border: 1px solid var(--ctl); border-bottom-width: 2px; border-radius: var(--r-sm); background: var(--side); color: var(--ink-2); }
@media (hover: none) { .kbd-hint { display: none; } }
.stage-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn.stage-go { min-width: 180px; min-height: 52px; padding: 0 32px; font-size: 16px; font-weight: 600; gap: 10px; }
.btn.stage-btn { min-height: 52px; padding: 0 24px; font-size: 15px; }
/* 執行中：節拍器用淺藍（可以隨時再開）；一分鐘換和弦用淺紅（停止會讓這次作廢） */
.btn.primary.running { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.primary.running:hover { background: #D5E5FA; border-color: var(--accent); color: var(--accent); }
.btn.primary.running.halt { background: #FDECEA; border-color: #E3A29B; color: var(--danger); }
.btn.primary.running.halt:hover { background: #FADBD7; border-color: #D98A82; color: var(--danger); }
.lbl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.round-btn { width: 56px; height: 56px; flex: none; border-radius: 50%; border: 1px solid var(--ctl); background: var(--bg); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 240ms var(--spring); }
.round-btn:hover { background: var(--hover); border-color: var(--ctl-hover); }
.round-btn:active { transform: scale(.92); }
.round-btn.sm { width: 44px; height: 44px; }
.stats.mini { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats.mini > div { padding: 12px 14px; gap: 2px; border-radius: 12px; }
.stats.mini .k { font-size: 12px; }
.stats.mini .v { font-size: 24px; }
.stats.mini .v.best { color: var(--accent); }
.big-num { font-size: 72px; font-weight: 500; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; text-align: center; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.counter { display: flex; align-items: center; justify-content: center; gap: 12px; }
.counter .round-btn { width: 48px; height: 48px; }
.counter input { width: 112px; height: 56px; text-align: center; font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* 節拍器 */
.metro-main { gap: 28px; }
.tempo { display: flex; align-items: center; justify-content: center; gap: clamp(16px, 4vw, 40px); }
.bpm-display { text-align: center; min-width: 220px; }
.bpm-display .big-num { font-size: 112px; font-weight: 600; letter-spacing: -0.04em; }
.tempo-name { display: flex; justify-content: center; gap: 10px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.tempo-name span:first-child { font-weight: 600; color: var(--ink-2); letter-spacing: .04em; }
.beats { align-self: stretch; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
.beats i { height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-style: normal; border-radius: 14px; background: var(--track); border: 1px solid var(--track); color: var(--muted); transition: background-color 90ms linear, border-color 90ms linear, color 90ms linear, transform 240ms cubic-bezier(.34, 1.6, .64, 1); }
.beats i span { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.beats i em { display: flex; gap: 5px; }
.beats i em b { width: 6px; height: 6px; border-radius: 50%; background: var(--ctl-hover); }
.beats i.first { background: var(--accent-soft); border-color: #B9D0F0; color: var(--accent); }
.beats i.first em b { background: var(--accent); }
/* --pop 由程式依速度設定：越快彈跳越小，避免高速時閃爍 */
.beats i.on { background: var(--ink); border-color: var(--ink); color: #FFFFFF; transform: scale(calc(1 + .04 * var(--pop, 1))); }
.beats i.first.on { background: var(--accent); border-color: var(--accent); }
.beats i.on em b { background: rgba(255, 255, 255, .75); }
.range-wrap { align-self: stretch; display: flex; flex-direction: column; gap: 6px; }
.range-wrap input { margin: 0; }
.range-lbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.metro-quick { justify-content: center; gap: 8px; }
.metro-quick .pill { min-width: 52px; height: 36px; }
.metro-side { display: flex; flex-direction: column; gap: 20px; }
.metro-side .field { min-width: 0; }
.seg.full { display: grid; width: 100%; }
.seg.full button { height: 38px; font-size: 14px; }
.switch.wide { display: flex; justify-content: space-between; width: 100%; min-height: 44px; padding: 0; font-size: 14px; text-align: left; }
.switch.wide .track { flex: none; }
.switch.wide .sw-t { display: flex; flex-direction: column; }
.switch.wide small { font-size: 12px; color: var(--muted); }
.tempo-terms { display: flex; flex-direction: column; gap: 12px; }
.terms { display: flex; flex-direction: column; gap: 2px; }
.terms button { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r); background: transparent; color: var(--ink); text-align: left; cursor: pointer; transition: background-color 160ms var(--ease); }
.terms button:hover { background: var(--hover); }
.terms i { width: 8px; height: 8px; border-radius: 50%; background: var(--ctl); transition: background-color 160ms var(--ease); }
.terms .n { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.terms b { font-size: 14px; font-weight: 500; }
.terms .n span, .terms .r { font-size: 13px; color: var(--muted); }
.terms button[aria-pressed="true"] { background: var(--sel); }
.terms button[aria-pressed="true"] i { background: var(--accent); }
.terms button[aria-pressed="true"] b { color: var(--accent); font-weight: 600; }
@media (max-width: 520px) {
  .tool-stage { padding: 24px 16px; gap: 20px; }
  .tool-side .panel { padding: 20px 16px; }
  .tempo { gap: 16px; }
  .round-btn { width: 52px; height: 52px; }
  .bpm-display { min-width: 0; }
  .bpm-display .big-num { font-size: 88px; }
  .tempo-name { font-size: 13px; }
  .beats { gap: 8px; }
  .beats i { height: 60px; border-radius: 12px; gap: 6px; }
  .metro-quick { align-self: stretch; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .metro-quick .pill { min-width: 0; padding: 0; height: 44px; }
  .stage-actions { align-self: stretch; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px; }
  .btn.stage-go { min-width: 0; min-height: 56px; padding: 0 12px; }
  .btn.stage-btn { min-height: 56px; padding: 0 8px; }
}

/* 一分鐘換和弦：和弦圖在計時圓環兩側。
   尺寸跟著這個區塊本身的寬度走（不是視窗寬度），側邊欄、右側面板把它擠窄時也不會超出去 */
.chg-main { container-type: inline-size; }
.chg-stage { --ring: clamp(200px, 40cqi, 260px); --cw: clamp(88px, 20cqi, 132px); max-width: 100%; display: grid; grid-template-columns: auto auto auto; align-items: center; justify-content: center; gap: clamp(12px, 3cqi, 40px); }
.chord-mini.big { padding: 12px 14px 10px; border-radius: 14px; gap: 4px; }
.chord-mini.big svg { width: var(--cw); height: calc(var(--cw) * 1.182); }
.chord-mini.big b { font-size: 20px; font-weight: 600; }
.ring-wrap { position: relative; width: var(--ring); height: var(--ring); }
.ring { width: 100%; height: 100%; display: block; }
.ring-bg { fill: none; stroke: var(--track); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 120ms linear, stroke 200ms var(--ease); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.chg-main .big-num { font-size: calc(var(--ring) * 0.23); font-weight: 600; }
.chg-main .phase { font-size: 14px; color: var(--muted); }
.chg-main.live .phase { color: var(--accent); font-weight: 500; }
.chg-main.done .ring-fg { stroke: var(--ok); }
.chg-main.done .phase { color: var(--ok); font-weight: 500; }
.chg-result { align-self: stretch; width: 100%; max-width: 420px; margin: 0 auto; padding: 20px; border-radius: 14px; background: var(--side); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.chg-result label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.chg-side, .chg-score { display: flex; flex-direction: column; gap: 20px; }
.chg-select { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: end; }
.quick.pairs { gap: 8px; }
.quick.pairs .pill { height: 36px; padding: 0 14px; }
.spark-foot { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chg-all .gloss td { vertical-align: middle; }
.chg-all .gloss .prog { width: 30%; }
.chg-all .progress { height: 6px; }
.chg-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
@media (max-width: 700px) { .chg-all .gloss .prog { width: auto; } .chg-all .gloss td.prog .progress { margin: 6px 0 4px; } }
/* 區塊窄到三個並排放不下時：圓環在上、兩個和弦圖在下面並排 */
@container (max-width: 560px) {
  .chg-stage { --ring: clamp(200px, 64cqi, 240px); --cw: clamp(72px, calc(50cqi - 40px), 132px); width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-items: center; gap: 16px; }
  .chg-stage .ring-wrap { grid-column: 1 / -1; order: -1; }
}

/* 調音器：半圓錶盤＋六條弦示意 */
.mic-pill { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--side); color: var(--muted); font-weight: 500; transition: background-color 200ms var(--ease), color 200ms var(--ease); }
.mic-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mic-pill.on { background: var(--accent-soft); color: var(--accent); }
.mic-meter { display: none; width: 44px; height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.mic-pill.on .mic-meter { display: block; }
.mic-meter b { display: block; height: 100%; background: currentColor; transform-origin: left center; transform: scaleX(0); transition: transform 80ms linear; }
.mic-now { display: block; margin-top: 6px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.mic-now:empty { display: none; }
.tuner-main { gap: 18px; text-align: center; }
.dial-wrap { width: 100%; max-width: 440px; }
.dial { width: 100%; height: auto; display: block; }
.dial-track { fill: none; stroke: var(--track); stroke-width: 12; stroke-linecap: round; }
.dial-zone { fill: none; stroke: var(--ok); stroke-opacity: .35; stroke-width: 12; }
.dial-tick { fill: none; stroke: var(--ctl); stroke-width: 2; stroke-linecap: round; }
.dial-tick.major { stroke: var(--ctl-hover); }
.dial-needle { transform-box: view-box; transform-origin: 200px 205px; transition: transform 150ms var(--ease); }
.dial-needle line { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; transition: stroke 160ms var(--ease); }
.dial-needle circle { fill: var(--ink); transition: fill 160ms var(--ease); }
.dial-needle.ok line { stroke: var(--ok); }
.dial-needle.ok circle { fill: var(--ok); }
.dial-needle.off line { stroke: #C7CCD3; }
.dial-needle.off circle { fill: #C7CCD3; }
.gauge-labels { display: flex; justify-content: space-between; padding: 0 4px; font-size: 12px; color: var(--muted); }
.tuner-read { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tuner-note { font-size: 96px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; transition: color 160ms var(--ease); }
.tuner-note.ok { color: var(--ok); }
.tuner-target { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.tuner-freq { font-size: 13px; color: var(--muted); min-height: 1.6em; }
.tuner-hint { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; border-radius: 12px; background: var(--side); color: var(--muted); font-size: 14px; font-weight: 500; transition: background-color 160ms var(--ease), color 160ms var(--ease); }
.tuner-hint svg { flex: none; }
.tuner-hint.ok, .tuner-hint.done, .tuner-hint.all { background: #E8F5EE; color: var(--ok); }
.tuner-hint.low, .tuner-hint.high, .tuner-hint.far, .tuner-hint.dead, .tuner-hint.err { background: #FDF3E6; color: #8F520A; }
.tuner-hint.resume { background: var(--accent-soft); color: var(--accent); }
.tuner-hint.dead, .tuner-hint.err, .tuner-hint.silent, .tuner-hint.resume { max-width: 460px; padding: 10px 18px; text-align: left; line-height: 1.5; }
.tuner-note.stale { color: var(--faint); }
.seg.tuner-mode { align-self: center; }
.seg.tuner-mode button { min-width: 88px; height: 34px; font-size: 14px; }
.str-row { align-self: stretch; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.str { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); cursor: pointer; transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), opacity 160ms var(--ease); }
.str:hover { border-color: var(--ctl); }
.str[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.str-row.dim .str:not(.near) { opacity: .55; }
.str .chk { position: absolute; top: 5px; right: 5px; display: none; width: 16px; height: 16px; border-radius: 50%; background: var(--ok); color: #FFFFFF; align-items: center; justify-content: center; }
.str.done .chk { display: flex; }
.str.done:not(.near) b { color: var(--ok); }
.str i { height: 28px; border-radius: 2px; background: #C7CCD3; }
.str b { font-size: 18px; font-weight: 600; }
.str small { font-size: 11px; color: var(--muted); }
.str.near { border-color: var(--accent); background: var(--sel); color: var(--accent); }
.str.near i { background: var(--accent); }
.str.near small { color: var(--accent); }
.str.near.ok { border-color: var(--ok); background: #E8F5EE; color: var(--ok); }
.str.near.ok i { background: var(--ok); }
.str.near.ok small { color: var(--ok); }
.tuner-na { margin: 8px 0; max-width: 420px; }
.tuner-side { display: flex; flex-direction: column; gap: 16px; }
.tuner-side .head { display: flex; flex-direction: column; gap: 2px; }
.strings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.string-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 72px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--ink); cursor: pointer; transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 240ms var(--spring); }
.string-btn:hover { background: var(--hover); border-color: var(--ctl); }
.string-btn:active { transform: scale(.95); }
.string-btn b { font-size: 20px; }
.string-btn small { font-size: 11px; color: var(--muted); }
.string-btn[aria-pressed="true"] { background: var(--sel); border-color: var(--accent); color: var(--accent); }
.string-btn[aria-pressed="true"] small { color: var(--accent); }
.tuner-tips dd.tune { font-weight: 600; letter-spacing: .08em; }
.tuner-side select { width: 100%; }
.a4-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.a4-row .who b, .a4-row .who span { white-space: normal; }
@media (max-width: 520px) {
  .tuner-note { font-size: 80px; }
  .str-row { gap: 4px; }
  .str b { font-size: 16px; }
  .str small { display: none; }
  .seg.tuner-mode { align-self: stretch; display: grid; }
  .seg.tuner-mode button { min-width: 0; padding: 0 6px; }
}

/* ── 參考（表格）：圓角卡片 ─────────────── */
.gloss { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; font-size: 14px; }
.gloss th, .gloss td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.gloss tr:last-child td { border-bottom: 0; }
.gloss th { color: var(--muted); font-weight: 500; font-size: 13px; background: var(--side); }
.gloss .bad { color: var(--danger); text-decoration: line-through; text-decoration-thickness: 1px; }
@media (max-width: 700px) {
  .gloss thead { display: none; }
  .gloss tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .gloss tr:last-child { border-bottom: 0; }
  .gloss td { display: block; border: 0; padding: 2px 0; }
  .gloss td[data-l]::before { content: attr(data-l) "："; color: var(--muted); font-size: 12px; }
}

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #FFFFFF; padding: 10px 18px; border-radius: 12px; font-size: 14px; z-index: 50; animation: toastIn 420ms var(--spring); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 140%); } }
@media (min-width: 900px) { .toast { bottom: 24px; } }
/* 系統開啟「減少動態效果」：transition 與 animation 都直接跳到結果 */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; } }

/* ── 新手引導、關於本站 ───────────────── */
.welcome { border-color: var(--accent); background: var(--accent-soft); }
.welcome h2 { margin: 0 0 8px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.steps li { display: flex; gap: 12px; }
.steps li > span { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.steps b { display: block; font-size: 14px; color: var(--ink); margin-bottom: 4px; }
.steps p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
/* ── 關於本站 ─────────────────────────── */
.ab { width: 100%; max-width: 920px; display: flex; flex-direction: column; gap: 56px; }
.ab p { margin: 0; }
.ab h3 { margin: 0; }
.ab-hero { display: flex; flex-direction: column; gap: 20px; }
.ab-eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); }
.ab-hero h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; }
.ab-lead { max-width: 680px; font-size: 17px; line-height: 1.75; color: var(--ink-2); }
.ab-pills { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ab-pills li { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--side); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.ab-pills svg { color: var(--ok); }
.ab-toc { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.ab-toc > span { margin-right: 6px; font-size: 13px; color: var(--muted); }
.ab-toc a { display: inline-flex; align-items: center; height: 44px; padding: 0 12px; border-radius: var(--r); font-size: 14px; color: var(--ink-2); transition: background-color 160ms var(--ease); }
.ab-toc a:hover { background: var(--hover); color: var(--ink); }
.ab-sec { display: flex; flex-direction: column; gap: 20px; scroll-margin-top: 24px; }
.ab-sec h2 { font-size: 22px; }
.ab-sec-h { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.ab-sec-h p, .ab-desc { margin-top: 6px !important; font-size: 14px; color: var(--muted); }
.ab-p { max-width: 720px; font-size: 16px; line-height: 1.75; color: var(--body); }
.ab { container-type: inline-size; }
.ab-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@container (max-width: 600px) { .ab-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ab-stats > div { display: flex; flex-direction: column; gap: 4px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.ab-stats b { font-size: 32px; font-weight: 700; line-height: 1.1; color: var(--ink); }
.ab-stats span { font-size: 14px; color: var(--muted); }
.ab-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.ab-note { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 20px; padding: 24px; background: var(--side); border: 1px solid var(--line); border-radius: var(--r-lg); }
.ab-note .ab-ico { background: var(--bg); border: 1px solid var(--line); }
.ab-note .t { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ab-note h3 { font-size: 17px; }
.ab-note p { font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.ab-note .btn.primary { flex: none; font-size: 14px; font-weight: 600; padding: 0 16px; }
.ab-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.ab-cards > div { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.ab-cards p { font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.ab-seg button { height: 40px; padding: 0 16px; font-size: 14px; }
.ab-rows { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ab-row { display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 20px 24px; }
.ab-row + .ab-row { border-top: 1px solid var(--line); }
.ab-row .k { flex: 0 0 160px; display: flex; align-items: center; align-self: flex-start; gap: 8px; font-size: 14px; font-weight: 600; line-height: 1.7; color: var(--ink); }
.ab-row .v { flex: 1 1 320px; min-width: 0; font-size: 15px; line-height: 1.7; color: var(--body); }
.ab-row.warn { background: #FBF6EE; }
.ab-row.warn svg { color: var(--warn); }
.ab-nots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@container (max-width: 760px) { .ab-nots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ab-nots > div { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--side); border-radius: var(--r-lg); color: var(--ink-2); }
.ab-nots b { font-size: 15px; font-weight: 600; color: var(--ink); }
.ab-nots span { margin-top: -6px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.ab-list { border-top: 1px solid var(--line); }
.ab-list .ab-row { padding: 18px 0; border-top: 0; border-bottom: 1px solid var(--line); }
.ab-list .k { flex-basis: 200px; flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.4; }
.ab-list .k b { font-size: 15px; font-weight: 600; }
.ab-list .k span { font-size: 13px; font-weight: 400; color: var(--muted); }
.ab-list .note { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); }
.ab-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ab-step { display: flex; flex-direction: column; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.ab-step-h { display: flex; align-items: center; gap: 12px; }
.ab-step-h .n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #FFFFFF; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ab-step-h h3 { font-size: 16px; }
.ab-step-sub { margin: -12px 0 0 40px !important; font-size: 14px; line-height: 1.6; color: var(--muted); }
.ab-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.ab-fig { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.ab-fig figcaption { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.ab-fig figcaption b { margin-right: .7em; font-weight: 600; color: var(--ink); }
/* 示意圖：照實際介面重畫，不能操作 */
.ab-demo { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 20px; background: var(--side); border-radius: var(--r); pointer-events: none; user-select: none; }
.ab-demo > * { width: 100%; max-width: 300px; box-sizing: border-box; }
.ab-demo.wide > * { max-width: 520px; }
.ab-hl { display: inline-flex; flex: none; border-radius: var(--r); outline: 2px solid var(--accent); outline-offset: 2px; }
.ab-hl:has(.avatar) { border-radius: 50%; }
.demo-menu { display: flex; flex-direction: column; padding: 6px; background: var(--bg); border: 1px solid var(--ctl); border-radius: var(--r-lg); }
.demo-menu hr { width: auto; height: 1px; margin: 6px 4px; border: 0; background: var(--line); }
.demo-menu .guest { display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 12px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.demo-menu .mi.on { background: var(--accent-soft); color: var(--ink); font-weight: 600; outline: 2px solid var(--accent); outline-offset: -2px; }
.demo-acct { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: var(--bg); border: 1px solid var(--ctl-hover); border-radius: var(--r); }
.demo-acct > svg { flex: none; color: var(--muted); }
.demo-home { display: flex; flex-direction: column; gap: 6px; padding: 18px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); }
.demo-home .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.demo-home .sub { font-size: 14px; color: var(--muted); }
.demo-home .ab-hl { width: 44px; height: 44px; align-items: center; justify-content: center; }
.demo-home > b { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; color: var(--ink); }
.ab-demo > .demo-set { max-width: 400px; }
.demo-set { display: flex; flex-direction: column; padding: 16px 20px 4px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); }
.demo-set .h { font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--muted); }
.demo-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.demo-row + .demo-row { border-top: 1px solid var(--track); }
.demo-row > p { flex: 1; min-width: 0; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.demo-row .who { gap: 2px; line-height: 1.4; }
.demo-row .who b { font-size: 14px; font-weight: 500; white-space: normal; }
.demo-row .who span { white-space: normal; }
.demo-row .btn.sm { flex: none; }
.ab-demo .confirm-box { margin: 0; }
.ab-tip { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.ab-tip svg { flex: none; margin-top: 3px; color: var(--muted); }
.ab-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.ab-links a { display: flex; align-items: center; gap: 16px; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); transition: border-color 160ms var(--ease); }
.ab-links a:hover { border-color: var(--ctl-hover); color: var(--ink); }
.ab-links .ab-ico { background: var(--accent-soft); }
.ab-links .t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.ab-links .t b { font-size: 15px; font-weight: 600; }
.ab-links .t span { font-size: 13px; color: var(--muted); }
.ab-links a > svg { flex: none; color: var(--muted); }
@media (max-width: 640px) {
  .ab { gap: 44px; }
  .ab-note, .ab-step { padding: 20px; }
  .ab-row { padding: 16px 20px; }
  .ab-step-sub { margin-left: 0 !important; }
  .ab-seg { width: 100%; }
}

/* reCAPTCHA v3 標章：會壓到手機分頁列，依 Google 規定改在首頁與關於頁以文字註明 */
.grecaptcha-badge { visibility: hidden; }

/* ── 術語（舊名「參考」）：主欄 + 右側小幫手，窄螢幕小幫手移到下方 ── */
.tm { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.tm-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.tm-rail { flex: 1 1 280px; max-width: 100%; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1100px) { .tm-rail { max-width: 340px; position: sticky; top: 24px; } }
.tm-rail section { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.tm-rail h2 { font-size: 15px; }
.tm-rail p { margin: 0; font-size: 14px; color: var(--muted); }
.tm-rail .t-help { background: var(--side); border-color: transparent; }
.t-help ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--ink-2); }
.t-help li { display: flex; gap: 10px; }
.t-help .n { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--bg); border: 1px solid var(--ctl); display: grid; place-items: center; font-size: 12px; font-weight: 600; line-height: 1; }
.t-qstr { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; text-align: center; }
.t-qstr div { display: flex; flex-direction: column; padding: 6px 0; background: var(--side); border-radius: 8px; line-height: 1.3; }
.t-qstr b { font-size: 15px; }
.t-qstr span { font-size: 11px; color: var(--muted); }
.t-qfing { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink-2); }
.t-miss a { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; }

.t-search { display: flex; flex-direction: column; gap: 10px; }
.search.t-q { width: 100%; }
.search.t-q > svg { left: 18px; top: 19px; width: 18px; height: 18px; }
.search.t-q input { min-height: 56px; padding: 0 56px 0 48px; border-radius: 14px; font-size: 16px; }
.search.t-q input::-webkit-search-cancel-button { display: none; }
.search.t-q .clr { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--hover); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.search.t-q .clr svg { position: static; width: 14px; height: 14px; }
.search.t-q .clr:hover { background: var(--hover-2); color: var(--ink); }
.search.t-q .clr[hidden] { display: none; }
.t-tries { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; color: var(--muted); }
.t-tries button { flex: none; white-space: nowrap; min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 13px; cursor: pointer; transition: border-color 160ms var(--ease), background-color 160ms var(--ease); }
.t-tries button:hover { border-color: var(--ctl-hover); background: var(--hover); }
#cats .btn .n { font-size: 12px; font-weight: 500; color: var(--muted); }
#cats .btn[aria-pressed="true"] .n { color: inherit; }
.t-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.t-legend { display: inline-flex; align-items: center; gap: 6px; }
.t-legend s, .t-card s { color: var(--danger); background: #FEF1F0; border-radius: 4px; padding: 0 6px; text-decoration-thickness: 1px; }

.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.t-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.t-card .top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.t-card .top b { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.t-card .cat { flex: none; font-size: 12px; color: var(--muted); background: var(--hover); border-radius: var(--r-sm); padding: 1px 8px; }
.t-card .zh { font-size: 20px; font-weight: 600; line-height: 1.35; }
.t-card .bads { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.t-card .lbl { display: inline; margin: 0; font-size: inherit; color: var(--muted); } /* 蓋掉全站 .lbl 的 block 與下邊距，才會跟錯誤翻譯對齊 */
.t-card .alt { background: var(--hover); border-radius: 4px; padding: 0 6px; color: var(--ink-2); }
.t-card .alt small { margin-left: 4px; color: var(--muted); font-size: 12px; }
.t-card .note { margin: 0; font-size: 14px; color: var(--muted); }
.t-card mark { background: #FFF1B8; color: inherit; border-radius: 2px; }
.t-empty { grid-column: 1 / -1; border: 1px dashed var(--ctl); border-radius: var(--r-lg); padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 14px; }
.t-empty b { font-size: 16px; }
.t-empty span { color: var(--muted); }
.t-empty a { font-weight: 500; }

.t-phrases { display: flex; flex-direction: column; gap: 12px; }
.t-phrase { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.t-phrase .en { font-size: 16px; font-weight: 500; color: var(--ink-2); }
.t-phrase .zh { display: flex; gap: 10px; align-items: baseline; }
.t-phrase .zh svg { flex: none; color: var(--muted); transform: translateY(2px); }
.t-phrase .zh b { font-size: 19px; line-height: 1.4; }
.t-phrase .note { margin: 0; font-size: 14px; color: var(--muted); }
.t-keys { display: flex; flex-wrap: wrap; gap: 6px; }
.t-keys button { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--sel); color: var(--accent); font-size: 13px; cursor: pointer; transition: background-color 160ms var(--ease); }
.t-keys button:hover { background: var(--accent-soft); color: var(--accent-hover); }

.t-sec { display: flex; flex-direction: column; gap: 14px; }
.t-sec + .t-sec { margin-top: 12px; }
.t-sec h2 + p { margin: 4px 0 0; }
.t-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; }
.t-fig { margin: 0; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.t-fig figcaption { display: flex; flex-direction: column; line-height: 1.4; }
.t-fig figcaption b { font-size: 15px; }
.t-fig figcaption span { font-size: 13px; color: var(--muted); }
.t-strs { display: flex; flex-direction: column; gap: 10px; }
.t-srow { display: flex; align-items: center; gap: 10px; height: 18px; font-size: 13px; }
.t-srow b:first-child { width: 14px; color: var(--ink-2); }
.t-srow b:last-child { width: 14px; text-align: right; }
.t-srow .ln { flex: 1; background: var(--faint); border-radius: 2px; }
.t-cbox { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.t-cbox .lab, .t-cbox .grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); width: 150px; text-align: center; font-size: 13px; }
.t-cbox .lab span { font-size: 12px; color: var(--muted); }
.t-cbox .grid { height: 120px; border-top: 4px solid var(--ink-2); background: repeating-linear-gradient(to bottom, transparent 0 29px, var(--ctl) 29px 30px); }
.t-cbox .grid span { justify-self: center; height: 100%; background: var(--faint); }
.t-hands { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.t-hand { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.t-hand .fs { display: flex; justify-content: space-between; gap: 8px; }
.t-fg { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; line-height: 1.4; }
.t-fg .dot { width: 36px; height: 36px; margin-bottom: 4px; border-radius: 50%; background: var(--ink); color: #FFFFFF; display: grid; place-items: center; font-weight: 600; font-size: 15px; }
.t-fg .dot.ring { background: var(--bg); color: var(--ink); border: 1.5px solid var(--ink); }
.t-fg b { font-size: 14px; font-weight: 500; }
.t-fg > span:last-child { font-size: 12px; color: var(--muted); }
@media (max-width: 520px) { .t-card .zh { font-size: 18px; } .t-phrase { padding: 16px; } }

/* ── 互動與動畫 ───────────────────────────
   時間：按下 120ms、小元件出現 180ms、狀態切換 300ms、移動與進場 450–520ms；曲線沿用 --ease / --spring / --spring-soft
   原則：只在有事發生時動；一次一個重點；聲音只在使用者按下時播放 */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes boxpop { 0% { transform: scale(.78); } 55% { transform: scale(1.16); } 100% { transform: scale(1); } }
@keyframes swapIn { from { opacity: 0; transform: translateX(20px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
@keyframes ringPulse { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes playPulse { from { transform: scale(1); opacity: .6; } to { transform: scale(1.7); opacity: 0; } }
@keyframes cdPop { 0% { transform: scale(1.6); opacity: 0; } 40% { opacity: 1; } 100% { transform: scale(1); } }
@keyframes hurry { 0% { transform: scale(1); } 15% { transform: scale(1.06); } 30% { transform: scale(1); } }
@keyframes bump { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* 換頁：區塊依序往上浮入 */
.page.enter > * { animation: rise 520ms var(--ease) both; }
.page.enter > :nth-child(2) { animation-delay: 60ms; }
.page.enter > :nth-child(3) { animation-delay: 120ms; }
.page.enter > :nth-child(4) { animation-delay: 180ms; }
.page.enter > :nth-child(n+5) { animation-delay: 240ms; }

/* 今日：現在要做的事 */
.now-card { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--side); }
.now-card .now-t { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.now-card .now-t.swap { animation: swapIn 460ms var(--spring-soft) both; }
.now-card .eyebrow { display: flex; align-items: center; gap: 8px; }
.now-card .now-n { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.now-card .now-m { font-size: 14px; color: var(--muted); }
.now-card .acts { display: flex; flex-wrap: wrap; gap: 10px; }
.now-card .acts .btn { min-height: 48px; }
.now-card.all { background: #EDF7F1; border-color: #CBE8D8; }
.now-card.all .now-n { color: #17683F; }
.now-steps { display: flex; gap: 6px; }
.now-steps i { width: 8px; height: 8px; border-radius: 50%; background: var(--ctl); transition: background-color 200ms var(--ease), transform 300ms var(--spring); }
.now-steps i.done { background: var(--ok); }
.now-steps i.cur { background: var(--accent); transform: scale(1.3); }
.task.just .box { animation: boxpop 380ms var(--spring); }
.todo-row.cur .task { background: var(--sel); }
.todo-row.cur .task:hover { background: var(--accent-soft); }
.confetti-pt { position: fixed; left: 0; top: 0; width: 8px; height: 8px; margin: -4px 0 0 -4px; pointer-events: none; z-index: 60; }

/* 繼續上課：滑鼠移過去，播放鍵放大並往外擴散 */
.continue .thumb .play-dot { position: relative; transition: transform 300ms var(--spring); }
.continue .thumb:hover .play-dot, .continue .thumb:focus-visible .play-dot { transform: scale(1.1); }
.continue .thumb .play-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #FFFFFF; opacity: 0; }
.continue .thumb:hover .play-dot::after { animation: playPulse 1.4s var(--ease) infinite; }

/* 和弦：換和弦時圓點滑到新位置、留在原位的手指加綠圈 */
.cd-title .big.swap { animation: fadeUp 360ms var(--spring-soft) both; }
.cd-anchor { margin: 0; min-height: 22px; font-size: 13px; font-weight: 500; color: var(--muted); text-align: center; }
.cd-anchor.ok { color: #17683F; }
.cd-anchor b { font-weight: 600; }

/* 節拍器：左邊節拍器外殼與擺錘，右邊 BPM、拍點、調整；下方開始鈕與點拍子測速 */
.metro-row { align-self: stretch; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 24px 36px; }
.metro-body { position: relative; flex: none; width: 216px; height: 236px; }
.metro-body svg { position: absolute; inset: 0; }
.metro-body .mb-case { fill: var(--side); stroke: var(--line); stroke-width: 1.5; stroke-linejoin: round; }
.metro-body .mb-base { fill: var(--track); }
.metro-body .arm { position: absolute; left: 108px; bottom: 44px; width: 4px; height: 168px; margin-left: -2px; border-radius: 2px; background: var(--ink-2); transform-origin: 50% 100%; }
.metro-body .wt { position: absolute; left: -9px; width: 22px; height: 16px; border-radius: 4px; background: var(--accent); transition: top 300ms var(--spring); }
.metro-body .pivot { position: absolute; left: 100px; bottom: 36px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-2); }
.metro-ctl { flex: 1 1 280px; min-width: 0; max-width: 440px; display: flex; flex-direction: column; gap: 16px; }
.bpm-box { position: relative; align-self: flex-start; display: flex; align-items: baseline; gap: 10px; padding: 2px 12px; }
.bpm-box .big-num { font-size: 96px; font-weight: 600; letter-spacing: -0.04em; text-align: left; }
.bpm-box .bpm-u { font-size: 15px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.bpm-box .flash { position: absolute; inset: -4px; border-radius: 20px; border: 2px solid var(--accent); opacity: 0; pointer-events: none; }
.metro-ctl .tempo-name { justify-content: flex-start; margin: -12px 0 0 12px; }
.metro-ctl .tempo-name span:first-child { font-weight: 500; color: var(--muted); letter-spacing: 0; }
.beat-dots { display: flex; align-items: center; gap: 14px; min-height: 28px; padding-left: 12px; }
.beat-dots i { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--track); }
.beat-dots i.first { width: 22px; height: 22px; }
.beat-dots i.on { background: var(--accent); }
.beat-dots i.first.on { background: #E5732E; }
.bpm-adj { display: flex; align-items: center; gap: 10px; }
.bpm-adj input { flex: 1; min-width: 0; margin: 0; height: 28px; cursor: pointer; }
.metro-ctl .metro-quick { justify-content: flex-start; }
.metro-acts { display: flex; justify-content: center; }
.metro-main .stage-go { border-radius: 999px; }
.big-num.bump { animation: bump 320ms var(--spring); }
.tap-panel { align-self: stretch; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; padding: 16px 18px; border-radius: 12px; background: var(--side); }
.tap-pad { position: relative; overflow: hidden; flex: none; width: 96px; height: 96px; border-radius: 50%; border: 1.5px solid var(--accent); background: var(--bg); color: var(--accent); font-size: 14px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: background-color 160ms var(--ease), transform 100ms var(--ease); }
.tap-pad:hover { background: var(--accent-soft); }
.tap-pad:active { transform: scale(.92); }
.tap-pad .rip { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: var(--accent); opacity: 0; pointer-events: none; }
.tap-pad .rip.go { animation: tapRip 520ms var(--ease); }
@keyframes tapRip { 0% { transform: scale(0); opacity: .22; } 100% { transform: scale(1.6); opacity: 0; } }
.tap-t { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tap-t b { font-size: 15px; font-weight: 600; }
.tap-t > span { font-size: 13px; line-height: 1.6; color: var(--muted); }
.tap-row { display: flex; align-items: center; gap: 10px; min-height: 22px; font-size: 13px; font-weight: 500; color: var(--muted); }
.tap-row .ok { color: #17683F; }
.tap-dots { display: inline-flex; gap: 6px; }
.tap-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--ctl); transition: background-color 160ms var(--ease); }
.tap-dots i.on { background: var(--accent); animation: bump 260ms var(--spring); }
@media (max-width: 760px) { .metro-body { transform: scale(.82); margin: -20px -19px; } .bpm-box .big-num { font-size: 80px; } .metro-ctl { flex-basis: 100%; max-width: none; } }

/* 一分鐘換和弦：倒數彈出、最後 5 秒變橘色、聲音提示 */
.chg-main .big-num.pop { animation: cdPop 600ms var(--spring); }
.chg-main.hurry .ring-fg { stroke: #E5732E; }
.chg-main.hurry .ring-wrap { animation: hurry 1s var(--ease) infinite; }
.chg-cues { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: -8px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.chg-cues li { display: flex; align-items: center; gap: 6px; transition: color 200ms var(--ease); }
.chg-cues li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ctl); transition: background-color 200ms var(--ease); }
.chg-cues li.on { color: var(--ink); }
.chg-cues li.on::before { background: var(--accent); }
.badge-rec { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 14px; background: #E3F3EA; color: #17683F; font-size: 13px; font-weight: 600; animation: cdPop 520ms var(--spring) both; }

/* ── 選購指南（#/gear） ────────────────── */
/* 黃色只用在「推薦／必買」這類標籤，提醒新手先看；其他沿用全站色彩 */
.gear { --hl: #FFD84D; --hl-line: #E9C12F; --wood-ink: #3A3F4A; max-width: 1120px; gap: 88px; }
.gear p { margin: 0; }
.gear .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gr-hl { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--hl); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.gr-head { display: flex; flex-direction: column; gap: 10px; }
.gr-step { font-size: 14px; font-weight: 600; letter-spacing: .02em; color: var(--accent); }
.gr-head h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.gr-desc { max-width: 680px; font-size: 16px; line-height: 1.7; color: var(--muted); }
.gr-sec { display: flex; flex-direction: column; gap: 28px; scroll-margin-top: 24px; }
.gr-tip { padding: 16px 20px; border-radius: var(--r); background: var(--side); font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.gr-tip.small { font-size: 14px; }
.gr-tip b { color: var(--ink); }

/* 開頭 */
.gr-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; padding: clamp(28px, 5vw, 56px); border-radius: 24px; background: var(--side); border: 1px solid var(--line); }
.gr-hero-t { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.gr-eyebrow { font-size: 14px; font-weight: 600; color: var(--accent); }
.gr-hero h1 { font-size: clamp(32px, 5vw, 50px); font-weight: 700; line-height: 1.18; letter-spacing: -0.015em; }
.gr-lead { max-width: 560px; font-size: 17px; line-height: 1.75; color: var(--ink-2); }
.gr-hero-acts { gap: 12px !important; margin-top: 4px; }
.gr-hero-acts .btn { min-height: 48px; padding: 0 22px; font-size: 15px; border-radius: 999px; }
.gr-sum { flex: 1 1 300px; display: flex; flex-direction: column; gap: 10px; padding: 26px; border-radius: 20px; background: var(--bg); border: 1px solid var(--line); }
.gr-sum .k { font-size: 13px; font-weight: 600; color: var(--muted); }
.gr-sum .big { font-size: 21px; font-weight: 700; line-height: 1.5; }
.gr-sum mark { padding: 0 6px; background: var(--hl); color: var(--ink); }
.gr-sum .muted { font-size: 14px; }
.gr-sum-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.gr-sum-rows div { display: flex; justify-content: space-between; gap: 12px; }
.gr-sum-rows b { font-weight: 600; }
.gr-toc { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -60px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.gr-toc a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: var(--r); font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background-color 160ms var(--ease); }
.gr-toc a:hover { background: var(--hover); color: var(--ink); }
.gr-toc .num { font-weight: 600; color: var(--accent); }

/* STEP 01 類型 */
.gr-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.gr-pills button { min-height: 44px; padding: 0 20px; border: 1.5px solid var(--ctl); border-radius: 999px; background: var(--bg); color: var(--ink); font-size: 15px; font-weight: 500; cursor: pointer; transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 260ms var(--spring); }
.gr-pills button:hover { border-color: var(--ctl-hover); }
.gr-pills button:active { transform: scale(.97); }
.gr-pills button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #FFFFFF; font-weight: 600; }
.gr-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.gr-type { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 26px; border: 1.5px solid var(--line); border-radius: 20px; background: var(--bg); transition: border-color 200ms var(--ease), background-color 200ms var(--ease); }
.gr-type.on { border-color: var(--accent); }
.gr-badge { position: absolute; top: -1.5px; right: 22px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 6px; border-radius: 0 0 10px 10px; background: var(--accent); color: #FFFFFF; font-size: 13px; font-weight: 600; opacity: 0; transform: translateY(-6px); transition: opacity 200ms var(--ease), transform 320ms var(--spring); pointer-events: none; }
.gr-type.on .gr-badge { opacity: 1; transform: none; }
.gr-type-top { display: flex; align-items: center; gap: 20px; }
.gr-type-top img { flex: none; display: block; height: 150px; width: auto; }
.gr-type-top > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gr-type h3 { font-size: 24px; font-weight: 700; }
.gr-type-top span { font-size: 15px; color: var(--muted); }
.gr-type > p { font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.gr-type dl { margin: 0; display: grid; grid-template-columns: 80px 1fr; gap: 8px 12px; font-size: 14px; }
.gr-type dt { font-weight: 600; }
.gr-type dd { margin: 0; color: var(--ink-2); }

/* STEP 02 尺寸 */
.gr-sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.gr-sizes > div { display: flex; flex-direction: column; gap: 8px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.gr-sizes > .pick { border: 1.5px solid var(--accent); background: var(--accent-soft); }
.gr-sizes .inch { font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.gr-sizes h3 { font-size: 17px; }
.gr-sizes p:last-child { font-size: 14px; line-height: 1.7; color: var(--ink-2); }

/* STEP 03 預算 */
.gr-budget-ctl { display: flex; flex-direction: column; gap: 12px; }
.gr-kind-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.gr-kind button { height: 38px; min-width: 96px; padding: 0 18px; font-size: 14px; }
.gr-kind-note { font-size: 14px; color: var(--muted); }
.gr-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.gr-tiers button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 84px; padding: 14px 18px; border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--bg); color: var(--ink); text-align: left; cursor: pointer; transition: border-color 160ms var(--ease), background-color 160ms var(--ease); }
.gr-tiers button:hover { border-color: var(--ctl-hover); }
.gr-tiers button[aria-pressed="true"] { border-color: var(--accent); background: var(--sel); }
.gr-tiers .n { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; }
.gr-tiers .p { font-size: 14px; color: var(--muted); }
.gr-tiers .rec { display: none; height: 22px; font-size: 12px; }
.gr-tiers .is-rec .rec { display: inline-flex; }
.gr-tier { display: flex; flex-direction: column; gap: 20px; padding: clamp(20px, 3vw, 30px); border-radius: 20px; background: var(--side); }
.gr-tier > * { animation: fadeUp 280ms var(--ease) both; }
.gr-tier-top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px 36px; }
.gr-tier-top .t { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.gr-tier .k { font-size: 13px; font-weight: 600; color: var(--muted); }
.gr-tier-top h3 { font-size: 23px; font-weight: 700; line-height: 1.35; }
.gr-tier-top .t > p:last-child { max-width: 640px; font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.gr-total { flex: 1 1 240px; display: flex; flex-direction: column; gap: 2px; padding: 18px 22px; border-radius: var(--r-lg); background: var(--bg); border: 1.5px solid var(--accent); }
.gr-total span { font-size: 13px; color: var(--muted); }
.gr-total span:first-child { font-weight: 600; }
.gr-total b { font-size: 28px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; color: var(--accent); white-space: nowrap; }
.gr-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; }
.gr-facts > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.gr-facts span { font-size: 12px; font-weight: 600; color: var(--muted); }
.gr-facts b { font-size: 15px; font-weight: 600; }
.gr-cart { display: flex; flex-direction: column; gap: 6px; padding: 18px 22px 10px; border-radius: var(--r-lg); background: var(--bg); }
.gr-cart .rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); column-gap: 40px; }
.gr-cart .rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.gr-cart .rows .num { font-weight: 500; text-align: right; }
.gr-watch { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-radius: 12px; background: #FFF6D6; border: 1px solid var(--hl-line); }
.gr-watch svg { flex: none; margin-top: 2px; color: var(--warn); }
.gr-watch p { font-size: 14px; line-height: 1.7; color: var(--ink-2); }

/* 合板和單板 */
.gr-woods-box { display: flex; flex-direction: column; gap: 24px; padding: clamp(20px, 3vw, 30px); border: 1px solid var(--line); border-radius: 20px; }
.gr-woods-box h3, .gr-spend h3 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.gr-woods { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.gr-wood { display: flex; flex-direction: column; gap: 16px; padding: 22px; border-radius: var(--r-lg); background: var(--side); border: 1.5px solid var(--side); }
.gr-wood.pick { background: var(--accent-soft); border-color: var(--accent); }
.gr-wood-fig { display: flex; flex-direction: column; gap: 6px; }
.gr-wood-svg { display: block; width: 100%; height: 64px; }
.gr-wood-fig span { font-size: 12px; color: var(--muted); }
.gr-wood.pick .gr-wood-fig span, .gr-wood.pick .gr-wood-t p { color: var(--wood-ink); }
.gr-wood-t { display: flex; flex-direction: column; gap: 4px; }
.gr-wood-t h4 { margin: 0; font-size: 19px; font-weight: 700; }
.gr-wood-t p { font-size: 14px; line-height: 1.7; color: var(--muted); }
.gr-wood dl { margin: 0; display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 10px 12px; font-size: 14px; }
.gr-wood dt { font-weight: 600; }
.gr-wood dd { margin: 0; }
.gr-wood dd.b { font-weight: 600; }
.gr-dots { display: flex; gap: 6px; }
.gr-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--ctl); }
.gr-dots i.on { background: var(--accent); }

/* 錢先花在琴上 */
.gr-spend { display: flex; flex-direction: column; gap: 18px; padding: clamp(20px, 3vw, 28px); border-radius: 20px; background: var(--accent-soft); }
.gr-spend-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px; }
.gr-spend-h h3 { margin: 0; }
.gr-spend-h p { flex: 1 1 320px; font-size: 15px; line-height: 1.7; color: var(--wood-ink); }
.gr-spend-body { display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch; }
.gr-receipt { flex: 3 1 340px; min-width: 0; display: flex; flex-direction: column; padding: 20px 22px; border-radius: var(--r-lg); background: var(--bg); }
.gr-receipt .k { margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.gr-receipt .g { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--ctl); }
.gr-receipt .g > span { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.gr-receipt .g > .num { font-size: 24px; font-weight: 700; }
.gr-receipt .items { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px dashed var(--ctl); font-size: 14px; color: var(--ink-2); }
.gr-receipt .items > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.gr-receipt .sub { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; font-size: 14px; color: var(--ink-2); }
.gr-receipt .sub b { color: var(--ink); font-weight: 600; }
.gr-receipt .tot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 2px solid var(--ink); font-weight: 700; }
.gr-receipt .tot b { font-size: 19px; }
.gr-spend-side { flex: 2 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.gr-spend-side > div { flex: 1 1 auto; display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; border-radius: var(--r-lg); background: var(--bg); }
.gr-spend-side b { font-size: 16px; }
.gr-spend-side ul, .gr-amp-foot ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.gr-spend-side li, .gr-amp-foot li { display: flex; align-items: flex-start; gap: 10px; }
.gr-spend-side li svg, .gr-amp-foot li svg { flex: none; margin-top: 3px; color: var(--muted); }
.gr-spend-side li.yes svg { color: var(--accent); }

/* STEP 04 配件 */
.gr-band { padding: clamp(24px, 4vw, 48px); border-radius: 24px; background: var(--side); }
.gr-gears { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; align-items: stretch; }
.gr-gear { display: flex; flex-direction: column; padding: 24px; border-radius: 20px; background: var(--bg); border: 1px solid var(--line); }
.gr-gear.must { border: 1.5px solid var(--ink); }
.gr-gear-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 14px; color: var(--muted); }
.gr-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.gr-tag.must { background: var(--hl); color: var(--ink); }
.gr-tag.soon { background: var(--accent-soft); color: var(--accent); }
.gr-tag.later { border: 1px solid var(--ctl-hover); color: var(--muted); }
.gr-gear ul { margin: 0; padding: 0; list-style: none; }
.gr-gear li { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.gr-gear li:last-child { border-bottom: 0; }
.gr-gear li .row { gap: 2px 10px; align-items: baseline; }
.gr-gear li b { font-size: 15px; }
.gr-gear li .num { font-size: 13px; color: var(--muted); }
.gr-gear li p { font-size: 13px; line-height: 1.65; color: var(--muted); }
.gr-gear-note { display: flex; flex-direction: column; gap: 4px; margin-top: auto; padding: 14px 16px; border-radius: 12px; background: var(--side); font-size: 14px; }
.gr-gear-note p { font-size: 13px; color: var(--muted); }

/* 音箱 */
.gr-amp { display: flex; flex-direction: column; gap: 24px; padding: clamp(22px, 3.5vw, 34px); border-radius: 20px; background: var(--ink); color: #FFFFFF; scroll-margin-top: 24px; }
.gr-amp-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.gr-amp-top .t { flex: 999 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.gr-amp-top .row { gap: 12px; }
.gr-amp-top h3 { font-size: 26px; font-weight: 700; }
.gr-amp-top .t > p { max-width: 620px; font-size: 15px; line-height: 1.75; color: #D3D7DE; }
.gr-amp-rec { flex: 1 1 230px; display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: 14px; border: 1px solid #3A3F4A; font-size: 13px; color: #D3D7DE; }
.gr-amp-rec b { font-size: 26px; font-weight: 700; color: var(--hl); }
.gr-amp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.gr-amp-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--r-lg); background: #23262D; border: 1.5px solid #3A3F4A; }
.gr-amp-card.pick { border-color: var(--hl); }
.gr-amp-card h4 { margin: 0; font-size: 17px; font-weight: 700; }
.gr-amp-price { font-size: 16px; font-weight: 700; color: var(--hl); }
.gr-amp-card p { font-size: 14px; line-height: 1.7; color: #D3D7DE; }
.gr-amp-card .fit { margin-top: auto; padding-top: 10px; border-top: 1px solid #3A3F4A; font-size: 13px; }
.gr-amp-foot { display: flex; flex-wrap: wrap; gap: 20px; padding-top: 22px; border-top: 1px solid #3A3F4A; }
.gr-amp-foot .t { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.gr-amp-foot .t b { font-size: 16px; }
.gr-amp-foot ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 8px 24px; color: #D3D7DE; }
.gr-amp-foot li svg { color: var(--hl); }
.gr-amp-foot .q { flex: 1 1 250px; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 14px; background: #23262D; }
.gr-amp-foot .q p { font-size: 13px; line-height: 1.7; color: #D3D7DE; }

/* STEP 05 型號 */
.gr-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.gr-pick { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 20px; border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--bg); animation: fadeUp 280ms var(--ease) both; }
.gr-pick.hot { border-color: var(--ink); }
.gr-pick .ph { height: 210px; padding: 16px; border-radius: 12px; background: var(--hover); display: flex; align-items: center; justify-content: center; color: var(--faint); }
.gr-pick .ph img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.gr-pick .tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 6px; }
.gr-pick .tags > span:first-child { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--side); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.gr-pick h3 { padding: 0 6px; font-size: 18px; font-weight: 700; line-height: 1.35; }
.gr-pick .price { padding: 0 6px; font-size: 16px; font-weight: 700; }
.gr-pick p { padding: 0 6px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.gr-pick .fit { margin: auto 6px 0; padding: 10px 0 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }

/* STEP 06 試琴 */
.gr-checks { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.gr-checks li { display: flex; flex-direction: column; gap: 6px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.gr-checks .n { font-size: 26px; font-weight: 700; line-height: 1; color: var(--accent); }
.gr-checks b { font-size: 16px; }
.gr-checks li > span:last-child { font-size: 14px; line-height: 1.7; color: var(--muted); }
.gr-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 26px; border-radius: var(--r-lg); background: var(--ink); color: #FFFFFF; }
.gr-cta > div { flex: 999 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.gr-cta b { font-size: 17px; }
.gr-cta > div > span { font-size: 14px; line-height: 1.7; color: #D3D7DE; }
.gr-cta .gr-cta-btn { min-height: 46px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--hl); color: var(--ink); font-weight: 600; }
.gr-cta .gr-cta-btn:hover { background: #FFE27A; color: var(--ink); }

/* STEP 07 地雷 */
.gr-avoid { display: flex; flex-direction: column; border-top: 2px solid var(--ink); }
.gr-avoid > div { display: flex; flex-wrap: wrap; gap: 6px 32px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.gr-avoid b { flex: 1 1 280px; font-size: 17px; }
.gr-avoid span { flex: 999 1 400px; min-width: 0; font-size: 15px; line-height: 1.75; color: var(--muted); }

/* 結尾 */
.gr-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: clamp(24px, 4vw, 44px); border-radius: 24px; background: var(--accent-soft); }
.gr-foot > div { flex: 999 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.gr-foot h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 700; }
.gr-foot p { font-size: 15px; line-height: 1.75; color: var(--wood-ink); }
.gr-foot .btn.primary { min-height: 48px; border-radius: 999px; }

@media (max-width: 760px) {
  .gear { gap: 64px; }
  .gr-toc { margin-top: -40px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .gr-toc::-webkit-scrollbar { display: none; }
  .gr-toc a { flex: none; }
  .gr-type { padding: 22px; }
  .gr-type-top img { height: 120px; }
  .gr-hero-acts .btn { flex: 1 1 auto; }
}

/* 試琴清單（#/gear/checklist） */
.gear-list { max-width: 560px; gap: 20px; }
.gl-head { display: flex; flex-direction: column; gap: 12px; }
.gl-head h1 { font-size: 28px; }
.gl-head .sub { margin: 0; font-size: 14px; color: var(--muted); }
.gl-prog { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; font-size: 14px; }
.gl-prog > div:first-child { display: flex; justify-content: space-between; align-items: baseline; }
.gl-prog b { font-size: 16px; font-weight: 600; }
.gl-bar { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.gl-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width 360ms var(--ease), background-color 200ms var(--ease); }
.gl-bar i.ok { background: var(--ok); }
.gl-done { margin: 0; padding: 10px 14px; border-radius: var(--r); background: #FFD84D; font-size: 15px; font-weight: 600; animation: cdPop 520ms var(--spring) both; }
.gl-group { display: flex; flex-direction: column; }
.gl-group h2 { margin: 8px 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.gl-item { display: flex; align-items: flex-start; gap: 14px; width: 100%; min-height: 56px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.gl-item .box { flex: none; width: 24px; height: 24px; margin-top: 1px; border: 1.5px solid var(--ctl-hover); border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #FFFFFF; transition: background-color 160ms var(--ease), border-color 160ms var(--ease); }
.gl-item .box svg { transform: scale(0); opacity: 0; transition: transform 320ms cubic-bezier(.34, 1.6, .64, 1), opacity 120ms var(--ease); }
.gl-item .box.pop { animation: boxpop 360ms var(--spring); }
.gl-item[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); }
.gl-item[aria-pressed="true"] .box svg { transform: scale(1); opacity: 1; }
.gl-item .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gl-item .t b { font-size: 16px; font-weight: 600; }
.gl-item .t span { font-size: 13px; color: var(--muted); }
.gl-item[aria-pressed="true"] .t b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--ctl-hover); }
.gl-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 14px; }
.gl-foot a { display: inline-flex; align-items: center; gap: 4px; }
