/* ============================================================
   學測英文單字 2.0 — Soft Minimal 設計語言（2.1.1 正式版）
   token 制：淺/深 × 五強調色（藍/橘/綠/粉/灰）
   ============================================================ */

/* ---------- Tokens：淺色 ---------- */
:root {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-2: #F5F5F2;
  --ink: #252525;
  --muted: #787878;
  --border: #E8E7E3;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  --radius: 10px;
  --accent: #4A6FA5;
  --accent-soft: #EEF2F6;
  --good: #5A8A6A; --warn: #A8814A; --bad: #A85A4A;
  --font: Inter, "SF Pro Text", -apple-system, "Segoe UI",
          "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

/* ---------- Tokens：深色 ---------- */
html.dark {
  --bg: #1B1B19;
  --surface: #232321;
  --surface-2: #2B2B28;
  --ink: #ECECEA;
  --muted: #9A9A94;
  --border: #333331;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* ---------- 強調色 × 模式（10 組合） ---------- */
html[data-accent="blue"]  { --accent: #4A6FA5; --accent-soft: #EEF2F6; }
html[data-accent="orange"]{ --accent: #B8722F; --accent-soft: #F6EEE4; }
html[data-accent="green"] { --accent: #5A8A6A; --accent-soft: #EDF3EF; }
html[data-accent="pink"]  { --accent: #B06E85; --accent-soft: #F7EDF1; }
html[data-accent="gray"]  { --accent: #6B6F76; --accent-soft: #F0F0EE; }
html.dark[data-accent="blue"]   { --accent: #7FA3C9; --accent-soft: #26303B; }
html.dark[data-accent="orange"] { --accent: #D49A5E; --accent-soft: #33291D; }
html.dark[data-accent="green"]  { --accent: #7FA98C; --accent-soft: #22302A; }
html.dark[data-accent="pink"]   { --accent: #C996AB; --accent-soft: #33242B; }
html.dark[data-accent="gray"]   { --accent: #9A9AA0; --accent-soft: #2B2B2E; }

/* ---------- 基礎 ---------- */
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15.5px; line-height: 1.65;
  transition: background 0.18s ease, color 0.18s ease;
}
h2 { font-size: 1.02rem; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 0.92rem; font-weight: 600; margin: 14px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
a { color: var(--accent); }

#page { max-width: 520px; margin: 0 auto; padding: 10px 16px 24px; }
main { padding: 0 0 24px; }
footer {
  text-align: center; color: var(--muted); font-size: 0.78rem;
  padding: 18px 12px 22px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.card.error { border-color: #d8b0a8; }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-block; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 14px; font-size: 0.88rem; font-family: inherit;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { opacity: 0.92; }
.btn.subtle { background: transparent; border-color: transparent; color: var(--muted); }
.btn.subtle:hover { color: var(--ink); background: var(--surface-2); }
.btn.marked { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: default; }
.back-row { margin-bottom: 6px; }

/* ---------- ☰ 目錄 ---------- */
.chrome-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0 10px;
  position: relative;
  z-index: 100; /* 高於遮罩，展開選單時可點 */
}
#menu-fab, #back-fab {
  width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); font-size: 1.15rem; cursor: pointer;
  box-shadow: var(--shadow); transition: background 0.16s ease;
  display: inline-flex; align-items: center; justify-content: center;
}
#menu-fab:hover, #back-fab:hover { background: var(--surface-2); }
.menu-wrap { position: relative; }
#menu-overlay {
  position: fixed; inset: 0; z-index: 99;
  background: rgba(20, 20, 18, 0.35);
  display: none; opacity: 0; transition: opacity 0.18s ease;
}
#menu-overlay.open { display: block; opacity: 1; }
.menu {
  display: none;
  position: absolute; top: 48px; right: 0; min-width: 216px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.menu.open { display: block; }
.menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; color: var(--ink); text-decoration: none; font-size: 0.95rem;
  border-bottom: 1px solid var(--border); transition: background 0.16s ease;
}
.menu a:last-child { border-bottom: none; }
.menu a:hover, .menu a.active { background: var(--accent-soft); color: var(--accent); }
.menu a svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.menu a.active svg { color: var(--accent); }

/* ---------- 首頁：快捷 ---------- */
.quick-grid { display: flex; gap: 10px; margin-bottom: 12px; }
.quick-card {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; cursor: pointer;
  display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink);
  transition: border-color 0.16s ease, background 0.16s ease;
}
.quick-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.quick-card svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.quick-title { display: block; font-size: 0.95rem; font-weight: 600; }
.quick-desc { display: block; font-size: 0.76rem; color: var(--muted); }

/* ---------- 每日任務 ---------- */
.srs-summary { display: flex; gap: 12px; margin-bottom: 14px; }
.srs-box {
  flex: 1; background: var(--surface-2); border-radius: 10px;
  text-align: center; padding: 16px 12px; border: none; font-family: inherit; color: inherit;
}
.srs-box-btn { cursor: pointer; transition: background 0.16s ease; }
.srs-box-btn:hover { background: var(--accent-soft); }
.srs-box .num { font-size: 1.75rem; font-weight: 700; }
.srs-box .label { font-size: 0.85rem; color: var(--muted); }
.srs-box.due .num { color: var(--accent); }
.daily-list { margin-top: 4px; }
.daily-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 2px;
  border-bottom: 1px solid var(--border); font-size: 0.93rem;
}
.daily-item:last-child { border-bottom: none; }
.daily-word { font-weight: 600; }
.daily-zh { color: var(--muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.due-today { color: var(--accent); font-weight: 600; }

/* ---------- 排程管理 ---------- */
.sched-panel {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; margin-top: 10px;
}
.sched-row {
  display: flex; align-items: center; gap: 6px; padding: 7px 0;
  border-bottom: 1px dashed var(--border);
}
.sched-row:last-child { border-bottom: none; }
.sched-word {
  flex: 1; font-weight: 600; min-width: 70px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sched-row input[type="date"] {
  border: 1px solid var(--border); border-radius: 6px; padding: 3px 5px;
  font-family: inherit; font-size: 0.85rem; background: var(--surface); color: var(--ink);
}
.sched-row .btn { padding: 3px 8px; font-size: 0.85rem; }
.sched-hint { font-size: 0.78rem; color: var(--muted); margin: 2px 0 4px; }

/* ---------- 月曆（minimal） ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cal-head strong { font-size: 0.92rem; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-week { text-align: center; font-size: 0.72rem; color: var(--muted); padding: 3px 0; }
.cal-cell {
  position: relative; aspect-ratio: 1.25; border: none; border-radius: 7px;
  background: transparent; cursor: pointer; font-family: inherit; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2px; transition: background 0.16s ease;
}
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.empty { cursor: default; }
.cal-cell .cal-day { font-size: 0.85rem; line-height: 1.2; }
.cal-cell .cal-count { font-size: 0.68rem; color: var(--accent); line-height: 1.2; }
.cal-cell .cal-date { display: none; }
.cal-cell.today .cal-day {
  background: var(--accent); color: #fff; border-radius: 6px; padding: 0 7px;
}
.cal-preview {
  background: var(--surface-2); border-radius: 8px; padding: 8px 12px; margin-top: 8px;
}
.cal-preview-word {
  display: inline-block; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 9px; margin: 2px 3px 2px 0; font-size: 0.9rem;
}

/* ---------- 單詞卡 ---------- */
.flashcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  min-height: 150px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px; padding: 22px 18px; margin: 10px 0;
  cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background 0.16s ease;
}
.flashcard:active { background: var(--surface-2); }
.flashcard .lv { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.05em; }
.flashcard .word {
  font-size: 1.7rem; font-weight: 650; text-align: center;
  word-break: break-word; overflow-wrap: anywhere; white-space: pre-line;
}
.flashcard .word.zh-brief { font-size: 1.15rem; font-weight: 600; line-height: 1.6; }
.flashcard .word.zh-full {
  font-size: 0.95rem; font-weight: 500; text-align: left; line-height: 1.7;
  max-height: 220px; overflow-y: auto;
}
.flashcard .pos { color: var(--muted); font-size: 0.9rem; min-height: 1.3em; }
.status { text-align: center; color: var(--muted); font-size: 0.88rem; margin-bottom: 8px; }
.controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.hint { text-align: center; font-size: 0.78rem; color: var(--muted); margin: 4px 0; }

/* ---------- 等級選擇／模式卡 ---------- */
.level-grid, .mode-grid, .theme-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.level-item, .mode-card {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 13px; cursor: pointer; user-select: none;
  font-size: 0.92rem; position: relative;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.level-item:hover, .mode-card:hover { border-color: var(--accent); }
.mode-card { flex-direction: column; align-items: center; text-align: center; padding: 12px 10px; }
.mode-icon { font-size: 1.3rem; line-height: 1.2; }
.mode-title { font-weight: 600; font-size: 0.92rem; }
.mode-desc { font-size: 0.76rem; color: var(--muted); }
.level-item input, .mode-card input { accent-color: var(--accent); margin: 0; }

/* 目前選中的色調卡：框線＋✓ */
.theme-card.on, .accent-card.on { border: 2px solid var(--accent); background: var(--accent-soft); padding: 7px 9px; }
.theme-card.on::after, .accent-card.on::after {
  content: "✓"; position: absolute; top: 6px; right: 8px;
  font-weight: bold; color: var(--accent); font-size: 0.85rem;
}
.theme-dot {
  width: 18px; height: 18px; border-radius: 50%; display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ---------- 查詢頁 ---------- */
.search-row { display: flex; gap: 8px; margin: 8px 0; }
.search-row input, textarea#tr-input {
  flex: 1; min-width: 0; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.95rem; font-family: inherit; background: var(--surface); color: var(--ink);
  transition: border-color 0.16s ease;
}
.search-row input:focus, textarea#tr-input:focus { outline: none; border-color: var(--accent); }
textarea#tr-input { resize: vertical; width: 100%; }
.suggestion-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.suggestion {
  padding: 5px 12px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-family: inherit;
  font-size: 0.9rem; color: var(--ink); transition: border-color 0.16s ease;
}
.suggestion:hover { border-color: var(--accent); color: var(--accent); }

.word-detail .word-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.word-detail .word-title { font-size: 1.5rem; font-weight: 650; word-break: break-word; overflow-wrap: anywhere; }
.phonetic { color: var(--muted); font-size: 0.92rem; }
.word-detail .pos { color: var(--muted); }
.senses { margin: 4px 0 8px; padding-left: 1.2em; }
.senses li { padding: 2px 0; font-size: 0.95rem; }
.dict-senses {
  background: var(--surface-2); border-radius: 8px; padding: 10px 12px;
  font-size: 0.9rem; line-height: 1.7; margin: 8px 0;
}
.tense-table table { width: auto; margin: 4px 0; }
.tense-table th { background: transparent; color: var(--muted); font-weight: 500; }

/* ---------- 片語／例句 ---------- */
.collocations, .examples { margin: 6px 0; }
.collocations-title, .examples-title {
  font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; letter-spacing: 0.03em;
}
.col-item {
  display: flex; gap: 10px; align-items: baseline;
  padding: 5px 0; border-bottom: 1px solid var(--border);
}
.col-item:last-child { border-bottom: none; }
.col-p { font-weight: 600; min-width: 45%; }
.col-zh { color: var(--muted); font-size: 0.9rem; }
.example {
  border-left: 2px solid var(--accent); border-radius: 0 6px 6px 0;
  padding: 6px 10px; margin: 6px 0; background: var(--surface-2);
}
.example-en { font-size: 0.95rem; }
.example-zh { color: var(--muted); font-size: 0.88rem; }

/* ---------- 翻譯題 ---------- */
.tr-question {
  background: var(--surface-2); border-radius: 8px; padding: 12px 14px; margin: 8px 0;
}
.tr-line { display: flex; gap: 10px; margin: 4px 0; font-size: 1rem; line-height: 1.7; }
.tr-no {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--border); color: var(--muted);
  font-size: 0.78rem; display: flex; align-items: center; justify-content: center; margin-top: 3px;
}
.tr-user, .tr-answer-line { margin: 6px 0; line-height: 1.6; font-size: 0.95rem; }
.tr-label {
  display: inline-block; background: var(--surface-2); color: var(--muted);
  border-radius: 5px; font-size: 0.74rem; padding: 1px 8px; margin-right: 8px;
}
.tr-answers { background: var(--surface-2); border-radius: 8px; padding: 12px; margin: 8px 0; }
.tr-answer-line.alt { color: var(--muted); }
.tr-note {
  color: var(--ink); background: var(--accent-soft); border-radius: 6px;
  padding: 6px 10px; font-size: 0.88rem;
}
.tr-grading {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; margin: 8px 0;
}
.grade-head { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 0.95rem; }
.grade-score { color: var(--accent); }
.grade-verdict { border-radius: 6px; font-size: 0.78rem; padding: 1px 9px; font-weight: 500; }
.grade-verdict.v-good { background: var(--accent-soft); color: var(--accent); }
.grade-verdict.v-mid { background: var(--surface-2); color: var(--muted); }
.grade-verdict.v-bad { background: var(--surface-2); color: var(--warn); }
.grade-issue { font-size: 0.9rem; color: var(--muted); margin-top: 4px; }
.grade-issue.ok { color: var(--good); }
.grade-fixed { font-size: 0.9rem; margin-top: 4px; }
.grade-comment {
  border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px;
  color: var(--muted); font-size: 0.9rem;
}

/* ---------- 統計 ---------- */
.stat-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-cards .srs-box { flex: 1; min-width: 110px; }
.stat-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.stat-label { width: 130px; font-size: 0.86rem; color: var(--muted); flex: none; }
.stat-bar { flex: 1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.stat-bar span { display: block; height: 100%; border-radius: 3px; background: var(--accent); opacity: 0.8; }
.stat-val { width: 30px; text-align: right; font-size: 0.88rem; font-weight: 600; }

/* ---------- 表格 ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll td, .table-scroll th { white-space: nowrap; }
.table-scroll td.td-word { white-space: normal; min-width: 90px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 0.8rem;
  padding: 6px 8px; border-bottom: 1px solid var(--border);
}
td { padding: 9px 8px; border-bottom: 1px solid var(--border); }
tr:hover td { background: var(--surface-2); }

/* ---------- 同步 ---------- */
.sync-code {
  font-size: 1.7rem; font-weight: 600; letter-spacing: 0.22em; text-align: center;
  color: var(--accent); background: var(--accent-soft); border-radius: 8px;
  padding: 8px; user-select: all;
}
.save-form { background: var(--surface-2); border-radius: 8px; padding: 14px; margin: 8px 0; }

/* ---------- 徽章／狀態 ---------- */
.badge {
  display: inline-block; background: var(--surface-2); color: var(--muted);
  font-size: 0.72rem; padding: 1px 9px; border-radius: 999px; letter-spacing: 0.03em;
}
.finish {
  background: var(--accent-soft); color: var(--ink);
  padding: 10px 12px; border-radius: 8px; text-align: center; margin: 8px 0;
}
.warning { color: var(--warn); min-height: 1.4em; margin: 4px 0; font-size: 0.92rem; }
.hidden { display: none; }
.error { border-color: #d8b0a8; }

/* ---------- 路線圖 ---------- */
.roadmap { padding-left: 1.3em; line-height: 1.9; margin: 6px 0; font-size: 0.92rem; }

/* ---------- 字體大小 ---------- */
html.font-s { font-size: 14px; }
html.font-m { font-size: 15.5px; }
html.font-l { font-size: 18.5px; }

/* ---------- 響應式 ---------- */
@media (max-width: 480px) {
  main { padding: 10px 12px 20px; }
  .card { padding: 15px; }
  .flashcard .word { font-size: 1.55rem; }
  .stat-label { width: 104px; }
}

/* 快捷卡圖示容器（SVG 外層） */
.quick-icon { display: flex; flex: none; }
.quick-icon svg { width: 20px; height: 20px; color: var(--accent); }
.quick-card > span:last-child { flex: 1; min-width: 0; }

/* ============================================================
   2.1.1 月曆格改版：有複習的日期＝強調色底，字數放大加粗
   ============================================================ */
.cal-cell.has {
  background: var(--accent);
}
.cal-cell.has:hover {
  background: var(--accent);
  opacity: 0.9;
}
.cal-cell.has .cal-date {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.62rem;
  position: absolute;
  top: 2px;
  left: 4px;
}
.cal-cell.has .cal-count {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
}
/* 今天：外圈ring（強調色底的格子也能辨識） */
.cal-cell.today {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent);
}
/* 選中的日期（預覽中） */
.cal-cell.sel {
  outline: 1.5px dashed var(--muted);
  outline-offset: 1px;
}

/* 修正：強調色底的日期小字被舊規則 display:none 藏掉 → 重新顯示於左上角（細體小字） */
.cal-cell.has .cal-date {
  display: block;
  font-weight: 300;
  letter-spacing: 0.02em;
}

/* ============================================================
   2.1.1 用戶回饋：首頁下移避開 ☰；快捷卡圖示+文字置中
   ============================================================ */

/* 首頁內容下移（☰ 按鈕固定在右上，底部約 54px） */


/* 快捷卡：圖示在上、文字在下，整體置中 */
.quick-card {
  flex-direction: column;
  gap: 7px;
  padding: 18px 10px 16px;
  text-align: center;
}
.quick-card > span:last-child { flex: none; }
.quick-title { font-size: 1.02rem; }
.quick-icon svg { width: 24px; height: 24px; }

/* ============================================================
   2.1.1 用戶回饋第二批
   ============================================================ */

/* ---------- ① 今天格：純色底＋強調色外框 ---------- */
.cal-cell.today {
  background: var(--surface-2);
  box-shadow: 0 0 0 2px var(--accent);
}
.cal-cell.today .cal-day {
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-weight: 600;
}
.cal-cell.today.has {
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent);
}
.cal-cell.today.has .cal-count { color: #fff; }
.cal-cell.today.has .cal-date { color: rgba(255, 255, 255, 0.8); }

/* ---------- ② 練習模式卡：等大、置中 ---------- */
.mode-grid > .mode-card {
  flex: 1 1 0;
  min-width: 0;
  min-height: 118px;
  justify-content: center;
}
.mode-icon svg { width: 26px; height: 26px; }

/* ---------- ③ 返回鈕（左上，與目錄同規格）＋ 頂部頁面標籤 ---------- */
#back-fab { display: none; }
#back-fab.shown { display: inline-flex; }
#back-fab:hover { background: var(--surface-2); }
#back-fab svg { width: 18px; height: 18px; }
#top-label {
  flex: 1;
  text-align: center;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.06em;
}

/* ---------- ④ 單詞本卡片 ---------- */
.wb-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 8px 0;
  background: var(--surface);
}
.wb-card .wb-name { font-weight: 600; font-size: 0.98rem; }
.wb-card .wb-meta { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.wb-card .wb-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* ---------- ⑥ 設置頁選項放大、均勻分布 ---------- */
.card .mode-grid > .mode-card {
  flex: 1 1 0;
  min-height: 72px;
  padding: 13px 8px;
  justify-content: center;
}
.card .mode-grid { margin-bottom: 6px; }
.card .mode-grid > .mode-card input[type="radio"] { width: 17px; height: 17px; }

/* ---------- ⑤ 翻譯題：範圍列與題數滑桿 ---------- */
.scope-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.scope-head .st { font-size: 0.86rem; font-weight: 600; }
.scope-actions { display: flex; gap: 6px; }
.scope-actions .btn { padding: 4px 10px; font-size: 0.8rem; }
.scope-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  margin: 6px 0 10px;
  background: var(--surface);
}
.scope-list .level-item { border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; padding: 8px 2px; }
.scope-list .level-item:last-child { border-bottom: none; }
.count-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.count-row input[type="number"] {
  width: 76px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--ink);
}
.count-row input[type="range"] { flex: 1; accent-color: var(--accent); }

/* 今天格統一：純色底（中性）＋強調色外框；字數以強調色呈現 */
.cal-cell.today.has {
  background: var(--surface-2);
  box-shadow: 0 0 0 2px var(--accent);
}
.cal-cell.today.has .cal-count { color: var(--accent); }
.cal-cell.today.has .cal-date { color: var(--muted); }

/* ============================================================
   2.1.2 響應式：平板／電腦（橫向寬幕）
   手機維持單欄；≥900px 橫向改雙欄、內容拓寬至 2/3
   ============================================================ */

/* ---------- 首頁：每日任務／月曆／快捷 的排列 ---------- */
.home-layout { display: flex; flex-direction: column; }
.home-daily { order: 2; }
.home-cal { order: 3; }
.quick-grid { order: 1; }

@media (min-aspect-ratio: 5/4) {
  /* 內容拓寬：左右各留 1/6（內容 2/3） */
  #page { max-width: 66.7vw; }

  /* 首頁雙欄：左＝每日任務＋快捷，右＝複習月曆；兩欄等高 */
  .home-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    gap: 14px;
  }
  .home-daily { order: 1; grid-column: 1; grid-row: 1; }
  .quick-grid { order: 2; grid-column: 1; grid-row: 2; height: 100%; }
  .home-cal { order: 1; grid-column: 2; grid-row: 1 / span 2; height: 100%; }
  /* 快捷卡填滿剩餘高度，內容置中 */
  .quick-card { height: 100%; min-height: 96px; justify-content: center; }

  /* 寬幕下元件微調 */
  .flashcard { min-height: 190px; }
  .flashcard .word { font-size: 2.1rem; }

  /* 練習選單：畫面高度足夠時三卡拉長填滿（文字置中） */
  .chooser-card {
    min-height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .chooser-card .mode-grid { flex: 1; align-items: stretch; }
  .chooser-card .mode-card { min-height: 170px; }
}

/* 極寬螢幕（≥1600px）內容再放寬上限，避免過長行 */
@media (min-aspect-ratio: 16/9) {
  #page { max-width: 1060px; }
}

/* ============================================================
   2.1.2 調整：排程面板捲動＋任務卡標題列＋複習管理頁
   ============================================================ */

/* 任務卡標題列：標題左、調整鈕右 */
.task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.task-head h2 { margin: 0; }

/* 排程面板：一次約顯示 5 列，其餘捲動 */
.sched-scroll {
  max-height: 305px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- 複習管理頁 ---------- */
.review-layout { display: grid; gap: 12px; }
.review-layout .cal-card-wrap { order: 1; }
.review-layout .list-card-wrap { order: 2; }
@media (min-aspect-ratio: 5/4) {
  .review-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .review-layout .cal-card-wrap { order: 2; }
  .review-layout .list-card-wrap { order: 1; }
}
.review-day-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.mgmt-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.mgmt-row:last-child { border-bottom: none; }
.mgmt-row .mgmt-word {
  flex: 1;
  font-weight: 600;
  min-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgmt-row input[type="date"] {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--ink);
}
.mgmt-row .btn { padding: 4px 8px; font-size: 0.85rem; }
.mgmt-empty { color: var(--muted); }
