/* ════════════════════════════════════════
   PANTONE 2026 Cloud Dancer Design System
   ════════════════════════════════════════ */
:root {
  /* Cloud Dancer Palette */
  --bg:          #F0EEE9;   /* Cloud Dancer — page background */
  --surface:     #FFFFFF;   /* card surface */
  --surface-2:   #FAF9F6;   /* subtle section bg */
  --border:      #E6E1D8;

  /* Accent — Comfort Zone palette */
  --primary:     #7A6251;   /* Woodrose */
  --primary-dark:#5E4B3C;
  --primary-light:#9E8272;
  --accent:      #D4938A;   /* Coral Haze */
  --accent-light:#EEC8C2;
  --warm:        #C4986A;   /* Shifting Sand */

  /* Semantic */
  --success:     #5E9E7A;
  --success-bg:  #EBF5EF;
  --error:       #C4504A;
  --error-bg:    #FCEEED;
  --warning:     #C4986A;
  --warning-bg:  #FBF3E8;

  /* Text */
  --text-1:  #2A1F18;   /* headings */
  --text-2:  #6B5B50;   /* body */
  --text-3:  #A89990;   /* muted */

  /* Effects */
  --shadow-sm:  0 1px 4px rgba(42,31,24,.06), 0 2px 8px rgba(42,31,24,.04);
  --shadow-md:  0 4px 16px rgba(42,31,24,.10), 0 1px 4px rgba(42,31,24,.06);
  --shadow-lg:  0 8px 32px rgba(42,31,24,.14), 0 2px 8px rgba(42,31,24,.08);
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-pill:100px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Noto Sans TC', 'PingFang TC', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: inherit; transition: all .2s; }
img { max-width: 100%; }

/* ── Feedback FAB ── */
.feedback-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px;
  box-shadow: var(--shadow-md); text-decoration: none;
  transition: background .2s, transform .2s;
}
.feedback-fab:hover { background: var(--primary-dark); transform: scale(1.05); }

/* ══════════════════════════════════════
   HEADER
   ══════════════════════════════════════ */
.site-header {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
}
.header-inner {
  max-width: 1000px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 20px;
}
.site-title {
  font-size: 18px; font-weight: 800;
  color: var(--primary);
  display: flex; align-items: center; gap: 8px;
}
.nav-links { display: flex; gap: 4px; }
.nav-link {
  color: var(--text-2); padding: 7px 14px;
  border-radius: var(--radius-pill); font-size: 14px; font-weight: 600;
  transition: all .15s;
}
.nav-link:hover { background: var(--bg); color: var(--primary); }
.nav-link.active { background: var(--primary); color: #fff; }
@media(max-width:480px) {
  .site-title { font-size: 15px; }
  .nav-link { padding: 6px 10px; font-size: 13px; }
}

/* ══════════════════════════════════════
   PAGE WRAPPER
   ══════════════════════════════════════ */
.page { max-width: 1000px; margin: 0 auto; padding: 28px 20px 60px; }

/* ══════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 700; transition: all .18s; }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-accent    { background: var(--accent); color: #fff; }
.btn-accent:hover  { filter: brightness(.92); transform: translateY(-1px); }
.btn-outline   { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost     { background: transparent; color: var(--text-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 16px; font-size: 13px; }
.btn-ghost:hover   { background: var(--surface); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.92); transform: translateY(-1px); }
.btn-danger    { background: var(--error); color: #fff; }
.btn-danger:hover  { filter: brightness(.92); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }

/* ══════════════════════════════════════
   CARD COMPONENT
   ══════════════════════════════════════ */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow .2s, transform .2s;
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-clickable { cursor: pointer; }
.card-clickable:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-body  { padding: 22px 24px; }
.card-title { font-size: 17px; font-weight: 800; color: var(--text-1); margin-bottom: 6px; }
.card-desc  { font-size: 13px; color: var(--text-2); line-height: 1.6; }

/* ══════════════════════════════════════
   CHIP / TAG
   ══════════════════════════════════════ */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700;
  background: var(--bg); color: var(--text-2); border: 1px solid var(--border);
}
.chip-primary { background: #EFE8E3; color: var(--primary); border-color: #D6C9C0; }
.chip-accent  { background: var(--accent-light); color: #8B3A32; border-color: #D4938A; }
.chip-success { background: var(--success-bg); color: #3D7A57; border-color: #A8D4B8; }
.chip-warning { background: var(--warning-bg); color: #8B5E2A; border-color: #D4B07A; }

/* ══════════════════════════════════════
   BADGE
   ══════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--error); color: #fff;
  border-radius: var(--radius-pill); font-size: 11px; font-weight: 800;
}

/* ══════════════════════════════════════
   HOME PAGE
   ══════════════════════════════════════ */
.hero-section {
  text-align: center; padding: 40px 0 32px;
}
.hero-label {
  display: inline-block;
  background: var(--accent-light); color: #8B3A32;
  padding: 5px 16px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700; margin-bottom: 16px;
}
.hero-title {
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 900; color: var(--text-1);
  line-height: 1.25; margin-bottom: 12px;
}
.hero-title span { color: var(--accent); }
.hero-subtitle { font-size: 15px; color: var(--text-2); max-width: 480px; margin: 0 auto; }

/* Stats bar */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 24px 0;
}
@media(max-width:600px) { .stats-row { grid-template-columns: repeat(2,1fr); } }
.stat-card { background: var(--surface); border-radius: var(--radius-md); padding: 18px 16px; text-align: center; border: 1px solid var(--border); }
.stat-num  { font-size: 28px; font-weight: 900; color: var(--primary); display: block; }
.stat-label{ font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Feature cards */
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 8px 0 24px; }
@media(max-width:540px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 28px 24px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: all .2s; display: block;
  position: relative; overflow: hidden;
}
.feature-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.feature-card-exam::before  { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.feature-card-vocab::before { background: linear-gradient(90deg, var(--warm), var(--accent-light)); }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon { font-size: 40px; margin-bottom: 14px; display: block; }
.feature-title { font-size: 20px; font-weight: 800; color: var(--text-1); margin-bottom: 8px; }
.feature-desc  { font-size: 13px; color: var(--text-2); margin-bottom: 16px; line-height: 1.7; }
.feature-tags  { display: flex; flex-wrap: wrap; gap: 6px; }

/* Recent list */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title  { font-size: 16px; font-weight: 800; color: var(--text-1); }
.recent-list { display: grid; gap: 8px; }
.recent-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 14px 18px; border: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.recent-year  { font-weight: 800; color: var(--primary); min-width: 50px; font-size: 15px; }
.recent-mode  { font-size: 12px; color: var(--text-2); background: var(--bg); padding: 3px 10px; border-radius: var(--radius-pill); }
.recent-score { font-weight: 800; font-size: 15px; }
.grade-a { color: var(--success); }
.grade-b { color: var(--warning); }
.grade-c { color: var(--error); }
.recent-date  { font-size: 12px; color: var(--text-3); margin-left: auto; }

/* ══════════════════════════════════════
   EXAM PAGE
   ══════════════════════════════════════ */
.page-heading { font-size: 22px; font-weight: 900; color: var(--text-1); margin-bottom: 6px; }
.page-subhead  { font-size: 14px; color: var(--text-2); margin-bottom: 24px; }

/* Mode grid */
.mode-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; margin-bottom: 28px; }
@media(max-width:500px) { .mode-grid { grid-template-columns: 1fr; } }
.mode-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 24px 22px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: all .2s; position: relative;
}
.mode-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.mode-icon  { font-size: 34px; margin-bottom: 10px; display: block; }
.mode-title { font-size: 17px; font-weight: 800; color: var(--text-1); margin-bottom: 5px; }
.mode-desc  { font-size: 13px; color: var(--text-2); }
.mode-badge { position: absolute; top: 14px; right: 14px; }

/* Section label */
.sub-heading {
  font-size: 15px; font-weight: 800; color: var(--text-1);
  margin: 0 0 12px; display: flex; align-items: center; gap: 8px;
}
.sub-heading::before { content:''; display:block; width:4px; height:18px; background:var(--accent); border-radius:2px; }

/* Year grid */
.year-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 24px; }
@media(max-width:480px) { .year-grid { grid-template-columns: repeat(2,1fr); } }
.year-card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 8px;
  text-align: center; cursor: pointer; transition: all .18s;
  font-size: 16px; font-weight: 800; color: var(--primary);
}
.year-card:hover { border-color: var(--primary); background: #EFE8E3; transform: translateY(-2px); }

/* Custom form */
.custom-panel {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 22px; border: 1px solid var(--border);
}
.form-label { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.year-check-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 16px; }
.year-check-grid label { font-size: 13px; display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.type-check-grid { display: flex; gap: 20px; margin-bottom: 16px; }
.type-check-grid label { font-size: 13px; display: flex; align-items: center; gap: 6px; color: var(--text-2); cursor: pointer; }
.skill-check-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.skill-check-grid label { font-size: 13px; display: flex; align-items: center; gap: 6px; color: var(--text-2); cursor: pointer; }
.form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.form-input { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 14px; background: var(--bg); color: var(--text-1); width: 90px; }
.form-input:focus { outline: none; border-color: var(--primary); }

/* ── Exam interface ── */
.exam-topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border-radius: var(--radius-md);
  padding: 12px 18px; border: 1px solid var(--border);
  margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.exam-label { font-weight: 800; font-size: 15px; color: var(--primary); }
.exam-counter { font-size: 13px; color: var(--text-2); }
.exam-timer { font-size: 16px; font-weight: 800; color: var(--error); margin-left: auto; }
@media(max-width:480px) {
  .exam-topbar { padding: 10px 14px; gap: 8px; }
  .exam-label { font-size: 14px; }
  .exam-timer { font-size: 14px; }
}

.progress-track { background: var(--border); border-radius: 4px; height: 6px; margin-bottom: 12px; overflow: hidden; }
.progress-fill  { background: linear-gradient(90deg, var(--primary), var(--accent)); height: 6px; border-radius: 4px; transition: width .4s; }

/* ── Question nav bar ── */
.q-nav-bar {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.qnav-btn {
  width: 32px; height: 32px; border-radius: 6px;
  border: none; cursor: pointer; font-size: 12px; font-weight: 700;
  transition: opacity .15s, transform .1s;
}
.qnav-btn:hover { opacity: .8; transform: scale(1.1); }
.qnav-unanswered { background: #D1D5DB; color: #374151; }
.qnav-correct    { background: #34D399; color: #fff; }
.qnav-wrong      { background: #F87171; color: #fff; }
.qnav-active     { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ── Two-column passage layout ── */
.exam-body { display: flex; flex-direction: column; gap: 14px; }
.exam-body.two-col { flex-direction: row; align-items: flex-start; gap: 20px; }
.exam-passage-col {
  flex: 1 1 50%; min-width: 0;
  position: sticky; top: 80px;
  max-height: calc(100vh - 120px); overflow-y: auto;
}
.exam-question-col { flex: 1 1 50%; min-width: 0; }
@media(max-width: 700px) {
  .exam-body.two-col { flex-direction: column; }
  .exam-passage-col { position: static; max-height: none; }
}

.passage-card {
  background: var(--surface-2); border-radius: var(--radius-md);
  padding: 16px 18px; font-size: 14px; line-height: 1.9;
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
}
.passage-card.text-only { white-space: pre-wrap; }
.passage-img {
  max-width: 100%; border-radius: var(--radius-md);
  display: block; margin: 0 auto;
}
.passage-img-missing {
  text-align: center; padding: 20px;
  color: var(--text-3); font-size: 13px;
  background: var(--bg); border-radius: var(--radius-sm);
}
.passage-blank {
  display: inline-block;
  font-weight: 700; color: var(--primary-dark);
  border-bottom: 2px solid var(--primary);
  padding: 0 3px; min-width: 20px; text-align: center;
}
.passage-text {
  margin-top: 12px; font-size: 15px; line-height: 1.7;
  color: var(--text-1);
}
.question-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.q-label { font-size: 12px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.q-text  { font-size: 16px; font-weight: 700; color: var(--text-1); margin-bottom: 18px; line-height: 1.7; }
.q-blank { display: inline-block; border-bottom: 2.5px solid var(--primary); min-width: 60px; text-align: center; color: transparent; font-weight: 900; }

/* 難易度 / 分項能力 標籤 */
.q-diff  { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); margin-left: 8px; vertical-align: middle; }
.q-diff-easy   { background: #DFFCE8; color: #2D7A4F; }
.q-diff-medium { background: #FFF8DC; color: #9A7000; }
.q-diff-hard   { background: #FCEEED; color: var(--error); }
.q-skill { display: inline-block; font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: var(--radius-pill); margin-left: 6px; vertical-align: middle; }
.q-rate  { display: inline-block; font-size: 11px; color: var(--text-3); margin-left: 6px; vertical-align: middle; }

.options-list { display: grid; gap: 10px; }
.option-btn {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg); border: 2px solid var(--border);
  border-radius: var(--radius-md); padding: 13px 18px;
  text-align: left; font-size: 14px; color: var(--text-1);
  transition: all .15s; cursor: pointer; width: 100%;
}
@media(max-width:480px) {
  .option-btn { padding: 11px 14px; gap: 10px; font-size: 13px; }
  .question-card { padding: 18px 16px; }
  .passage-card { font-size: 13px; padding: 12px 14px; }
}
.option-btn:hover:not(:disabled) { border-color: var(--primary-light); background: #EFE8E3; }
.option-letter { font-weight: 900; color: var(--primary); min-width: 22px; font-size: 15px; }
.option-btn.opt-correct { background: var(--success-bg); border-color: var(--success); }
.option-btn.opt-correct .option-letter { color: var(--success); }
.option-btn.opt-wrong   { background: var(--error-bg); border-color: var(--error); }
.option-btn.opt-wrong .option-letter   { color: var(--error); }

.feedback-card {
  margin-top: 14px; padding: 14px 18px;
  border-radius: var(--radius-md); font-size: 14px; font-weight: 600;
  line-height: 1.7;
}
.feedback-correct { background: var(--success-bg); color: #2D6B47; border: 1px solid #A8D4B8; }
.feedback-wrong   { background: var(--warning-bg); color: #6B4000; border: 1px solid #D4B07A; }
.feedback-card em { font-style: italic; color: var(--primary-dark); }

.hint-opts-grid { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-weight: 400; }
.hint-opt { display: flex; align-items: baseline; gap: 6px; font-size: 13px; }
.hint-opt strong { min-width: 16px; font-weight: 700; }

.exam-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }

/* ── Result page ── */
.result-hero {
  text-align: center; background: var(--surface);
  border-radius: var(--radius-lg); padding: 32px 24px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.result-score-big { font-size: clamp(32px, 8vw, 52px); font-weight: 900; color: var(--text-1); line-height: 1; }
.result-grade-tag {
  display: inline-block; margin-top: 10px;
  padding: 6px 20px; border-radius: var(--radius-pill);
  font-size: 16px; font-weight: 800;
}
.grade-tag-a { background: var(--success-bg); color: var(--success); }
.grade-tag-b { background: var(--warning-bg); color: var(--warning); }
.grade-tag-c { background: var(--error-bg); color: var(--error); }

.analysis-card, .wrong-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 22px 24px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.analysis-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.analysis-label { min-width: 60px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.analysis-track { flex: 1; background: var(--border); border-radius: 4px; height: 10px; }
.analysis-fill  { background: linear-gradient(90deg, var(--primary), var(--accent)); height: 10px; border-radius: 4px; transition: width .4s ease; }
.analysis-fill-good { background: linear-gradient(90deg, #3aa76d, #5EC98B); }
.analysis-fill-weak { background: linear-gradient(90deg, var(--error), #E07070); }
.analysis-val   { font-size: 13px; color: var(--text-2); min-width: 44px; text-align: right; font-weight: 700; }
.analysis-section-title { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }

.wrong-item {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  padding: 10px 0; border-bottom: 1px solid var(--bg); font-size: 13px;
}
.wrong-item:last-child { border-bottom: none; }
.wrong-qnum  { font-weight: 800; color: var(--primary); min-width: 50px; }
.wrong-qtext { flex: 1; color: var(--text-2); min-width: 200px; }
.wrong-ans   { width: 100%; padding-left: 58px; }
.mark-wrong   { color: var(--error); font-weight: 800; }
.mark-correct { color: var(--success); font-weight: 800; }
.no-wrong     { text-align: center; color: var(--success); font-size: 18px; padding: 20px; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
@media(max-width:400px) { .result-actions .btn { flex: 1 1 100%; } }

/* ══════════════════════════════════════
   VOCAB PAGE
   ══════════════════════════════════════ */

/* Tab bar */
.vtab-bar {
  display: flex; gap: 4px; background: var(--surface);
  padding: 6px; border-radius: var(--radius-lg); margin-bottom: 16px;
  border: 1px solid var(--border); overflow-x: auto;
}
.vtab {
  flex: 1; background: transparent; color: var(--text-2);
  padding: 9px 14px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 700; white-space: nowrap;
  position: relative; display: flex; align-items: center; justify-content: center; gap: 5px;
}
.vtab.active { background: var(--primary); color: #fff; }
.vtab:hover:not(.active) { background: var(--bg); }
.vtab-link { text-decoration: none; flex: 0 0 auto; border-left: 1px solid var(--border); margin-left: 4px; color: var(--primary) !important; font-weight: 700; }

/* Topic wrap - grid 等寬排列 */
.topic-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  padding: 2px 0 10px; margin-bottom: 8px;
}
.topic-chip {
  background: var(--surface);
  border: 1px solid var(--border); color: var(--text-2);
  padding: 8px 4px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700; cursor: pointer; transition: all .15s;
  white-space: nowrap; text-align: center; width: 100%;
}
.topic-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.topic-chip:hover:not(.active) { border-color: var(--primary-light); background: #EFE8E3; }

/* Status filter */
.status-filter { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.status-btn {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); padding: 6px 16px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 700; transition: all .15s;
}
.status-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.search-input {
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 7px 16px; font-size: 13px; background: var(--surface);
  color: var(--text-1); flex: 1; min-width: 120px; outline: none;
}
.search-input:focus { border-color: var(--primary); }

/* Flashcard */
.fc-meta { text-align: center; font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.fc-wrap { display: flex; justify-content: center; margin-bottom: 18px; perspective: 1000px; }
.flashcard {
  width: 100%; max-width: 520px; min-height: 220px;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 36px 28px; transition: transform .18s, box-shadow .18s;
  position: relative;
}
.flashcard:active { transform: scale(.98); }
.card-front, .card-back { text-align: center; width: 100%; }
.fc-word    { font-size: clamp(26px, 7vw, 38px); font-weight: 900; color: var(--text-1); margin-bottom: 8px; }
.fc-pos     { font-size: 13px; color: var(--text-3); font-style: italic; margin-bottom: 6px; }
.fc-hint    { font-size: 12px; color: var(--border); margin-top: 8px; }
.fc-topic   { position: absolute; top: 14px; right: 16px; }
.fc-chinese { font-size: clamp(22px, 6vw, 30px); font-weight: 800; color: var(--primary); margin-bottom: 10px; }
.fc-word-sm { font-size: 15px; color: var(--text-3); margin-bottom: 12px; }
.fc-speak-btn {
  background: none; border: 1.5px solid var(--border); border-radius: 50%;
  width: 38px; height: 38px; font-size: 18px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s; margin-bottom: 4px;
}
.fc-speak-btn:hover { background: var(--bg); border-color: var(--primary); transform: scale(1.1); }
.fc-example { min-height: 36px; margin-top: 10px; }
.fc-example-text {
  font-size: 13px; color: var(--text-2); font-style: italic;
  line-height: 1.6; padding: 8px 12px;
  background: var(--bg); border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-light);
  text-align: left;
}
.fc-example-loading { font-size: 12px; color: var(--text-3); }

.fc-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* Quiz */
.quiz-score-bar { text-align: right; font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.quiz-word-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 28px 24px; text-align: center;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin-bottom: 14px;
}
.quiz-word { font-size: clamp(15px, 3vw, 18px); font-weight: 600; color: var(--text-1); line-height: 1.8; }
.quiz-pos   { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.quiz-opts  { display: grid; gap: 10px; margin-bottom: 14px; }
.quiz-opt {
  background: var(--surface); border: 2px solid var(--border);
  color: var(--text-1); padding: 14px 20px; border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600; text-align: left; transition: all .15s;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--primary-light); background: #EFE8E3; }
.quiz-opt.opt-correct { background: var(--success-bg); border-color: var(--success); color: #2D6B47; }
.quiz-opt.opt-wrong   { background: var(--error-bg);   border-color: var(--error);   color: #8B2020; }
/* Quiz feedback */
.quiz-feedback {
  border-radius: var(--radius-md); padding: 14px 18px;
  margin-bottom: 14px; border: 1px solid var(--border);
}
.quiz-fb-correct { background: var(--success-bg); border-color: var(--success); }
.quiz-fb-wrong   { background: var(--error-bg);   border-color: var(--error); }
.quiz-fb-title {
  font-size: 14px; font-weight: 700; margin-bottom: 6px;
}
.quiz-fb-correct .quiz-fb-title { color: #2D6B47; }
.quiz-fb-wrong   .quiz-fb-title { color: var(--error); }
.quiz-fb-word { font-weight: 400; color: var(--text-2); }
.quiz-fb-sentence {
  font-size: 14px; font-style: italic; color: var(--text-2);
  line-height: 1.7; margin-bottom: 2px;
}
.quiz-fb-sentence-zh {
  font-size: 13px; color: var(--text-3); line-height: 1.6;
}

.quiz-result {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 36px 24px; text-align: center;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.quiz-result-score { font-size: 44px; font-weight: 900; color: var(--primary); margin: 10px 0; }

/* Smart review */
.smart-info { text-align: center; margin-bottom: 18px; }
.smart-num  { font-size: 36px; font-weight: 900; color: var(--primary); }
.smart-label{ font-size: 14px; color: var(--text-2); }
.smart-counter { text-align: center; font-size: 13px; color: var(--text-2); margin: 10px 0; }
.smart-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.smart-done {
  text-align: center; background: var(--surface);
  border-radius: var(--radius-lg); padding: 40px 24px;
  border: 1px solid var(--border);
}
.smart-done-emoji { font-size: 48px; display: block; margin-bottom: 12px; }
.smart-done-msg   { font-size: 18px; font-weight: 800; color: var(--text-1); margin-bottom: 16px; }

/* Stats */
.stats-4grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
@media(max-width:500px) { .stats-4grid { grid-template-columns: repeat(2,1fr); } }
.stats-card { background: var(--surface); border-radius: var(--radius-md); padding: 18px 14px; text-align: center; border: 1px solid var(--border); }
.stats-num   { font-size: 30px; font-weight: 900; color: var(--primary); }
.stats-label { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.pie-wrap    { display: flex; justify-content: center; align-items: center; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.pie-legend  { display: grid; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.legend-dot  { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.week-section h3 { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.week-bars { display: flex; align-items: flex-end; gap: 8px; height: 80px; }
.week-item  { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.week-bar   { background: var(--accent); border-radius: 4px 4px 0 0; width: 100%; min-height: 4px; }
.week-date  { font-size: 10px; color: var(--text-3); }
.week-val   { font-size: 11px; font-weight: 700; color: var(--text-2); }

/* Recommend */
.recommend-wrap { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }
.recommend-title { font-size: 14px; font-weight: 800; color: var(--text-2); margin-bottom: 10px; }
.recommend-link {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 20px;
  transition: all .2s; color: inherit;
}
.recommend-link:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.recommend-logo { font-size: 26px; }
.recommend-name { font-size: 15px; font-weight: 800; color: var(--primary); }
.recommend-sub  { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.recommend-arr  { margin-left: auto; color: var(--primary); font-size: 18px; font-weight: 800; }
