/* ==========================================================================
   components.css — 元件層樣式（app.css 頂端 design tokens 為唯一依據）
   拆檔原因：app.css 加上本檔內容原本單檔會超過 400 行規範，依 §0 拆檔規則
   切開；tokens 只放 app.css 一份，本檔純消費變數不重複定義。
   ========================================================================== */

/* -- Stats bar (今日頁) -- */
.stats-row { display: flex; gap: var(--space-3); margin-bottom: var(--space-5); }
.stat-tile { flex: 1; text-align: center; }
.stat-tile .stat-value { font-size: var(--font-size-2xl); font-weight: 700; color: var(--color-brand-600); }
.stat-tile .stat-label { font-size: var(--font-size-xs); color: var(--color-text-muted); margin-top: 2px; }
.sync-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-warn-bg);
  color: #92400e;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
}
@media (prefers-color-scheme: dark) { .sync-banner { color: #fcd34d; } }
.offline-banner {
  background: var(--color-text-faint);
  color: var(--color-surface);
  text-align: center;
  font-size: var(--font-size-xs);
  padding: var(--space-1);
}

/* -- Flip Card（3D 翻轉） -- */
.flip-card-wrap { perspective: 1200px; margin-bottom: var(--space-5); }
.flip-card {
  position: relative;
  min-height: 320px;
  transform-style: preserve-3d;
  transition: transform 500ms cubic-bezier(0.4, 0.2, 0.2, 1);
}
.flip-card.is-flipped { transform: rotateY(180deg); }
.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  padding: var(--space-6) var(--space-5);
  overflow-y: auto;
}
.flip-face-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  text-align: center;
}
.flip-face-back { transform: rotateY(180deg); }
.flip-hint { color: var(--color-text-faint); font-size: var(--font-size-xs); }
.headword-text { font-size: var(--font-size-3xl); font-weight: 700; word-break: break-word; }
.kk-text { color: var(--color-text-muted); font-size: var(--font-size-lg); }

/* -- Card back content blocks（複習卡背面／詞庫詳情共用） -- */
.back-section { margin-bottom: var(--space-4); }
.back-section-title { font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-faint); margin-bottom: var(--space-2); }
.pos-chip-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pos-chip { background: var(--color-brand-50); color: var(--color-brand-700); border-radius: var(--radius-full); padding: 2px var(--space-3); font-size: var(--font-size-sm); }
.meaning-line { margin-bottom: var(--space-1); }
.meaning-pos { color: var(--color-brand-600); font-weight: 600; margin-right: var(--space-2); }
.example-item { padding: var(--space-3) 0; border-top: 1px solid var(--color-border); }
.example-item:first-child { border-top: none; padding-top: 0; }
.example-en { display: flex; align-items: flex-start; gap: var(--space-2); }
.example-zh { color: var(--color-text-muted); font-size: var(--font-size-sm); margin-top: 2px; }
.source-tag { font-size: 10px; padding: 1px 6px; border-radius: var(--radius-full); background: var(--color-border); color: var(--color-text-muted); flex: none; margin-top: 3px; }
.note-box { background: var(--color-warn-bg); border-radius: var(--radius-md); padding: var(--space-3); font-size: var(--font-size-sm); }

/* -- Review answer buttons -- */
.review-actions { display: flex; gap: var(--space-3); }
.review-actions .btn { min-height: 56px; font-size: var(--font-size-lg); }
.speak-btn { background: var(--color-brand-50); color: var(--color-brand-600); border-radius: var(--radius-full); width: 40px; height: 40px; border: none; flex: none; display: inline-flex; align-items: center; justify-content: center; }

/* -- Wordbank list -- */
.wordbank-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); cursor: pointer; }
.wordbank-item:last-child { border-bottom: none; }
.wordbank-item-main { flex: 1; min-width: 0; }
.wordbank-item .headword-text { font-size: var(--font-size-lg); }
.wordbank-meaning-preview { color: var(--color-text-muted); font-size: var(--font-size-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint-text { color: var(--color-text-faint); font-size: var(--font-size-xs); margin-bottom: var(--space-4); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }

/* -- Exam -- */
.progress-bar { height: 6px; border-radius: var(--radius-full); background: var(--color-border); overflow: hidden; margin-bottom: var(--space-5); }
.progress-bar-fill { height: 100%; background: var(--color-brand-600); transition: width var(--transition-base); }
.choice-btn { display: block; width: 100%; text-align: left; padding: var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--color-border-strong); background: var(--color-surface); margin-bottom: var(--space-3); min-height: var(--touch-target); }
.choice-btn.is-selected { border-color: var(--color-brand-600); background: var(--color-brand-50); }
.choice-btn.is-correct { border-color: var(--color-success-500); background: var(--color-success-bg); }
.choice-btn.is-wrong { border-color: var(--color-danger-500); background: var(--color-danger-bg); }
.cloze-sentence { font-size: var(--font-size-lg); margin-bottom: var(--space-5); line-height: 1.8; }
.cloze-blank { border-bottom: 2px solid var(--color-brand-500); padding: 0 var(--space-2); font-weight: 700; }
.listen-play-btn { width: 96px; height: 96px; border-radius: var(--radius-full); background: var(--color-brand-600); color: #fff; border: none; display: flex; align-items: center; justify-content: center; margin: var(--space-6) auto; }
.listen-play-btn svg { width: 36px; height: 36px; fill: #fff; }
.score-ring { width: 160px; height: 160px; margin: var(--space-6) auto; }
.wrong-item { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.wrong-item:last-child { border-bottom: none; }
.wrong-answer { color: var(--color-danger-600); }
.wrong-correct { color: var(--color-success-600); }

/* -- Placeholder（M5b 開發中） -- */
.placeholder-box {
  text-align: center;
  padding: var(--space-10) var(--space-4);
  color: var(--color-text-muted);
}

/* -- Modal / sheet（詳情、待確認流程用全螢幕覆蓋） -- */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: 60;
  display: flex;
  align-items: flex-end;
}
.sheet-panel {
  background: var(--color-bg);
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  max-height: 92dvh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-y: auto;
  padding: var(--space-5);
  padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom));
}
.sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
