/* ==========================================================================
   TOEIC SRS Flashcards - Master Edition (v7.0)
   - 1. 深色 / 淺色模式完整支援 (Apple Dark / Light Mode)
   - 2. 學習打卡月曆 (Streak & Monthly Calendar)
   - 3. 測驗分流系統 (當日測驗 vs 當週錯題測驗)
   - 4. 卡片反面：字根同源詞與形近詞專區
   - 5. 側邊選單、頂部進度條、SRS 三按鈕
   ========================================================================== */

:root {
  /* 淺色模式色彩 */
  --bg-page: #f2f2f7;
  --bg-card: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #e2e8f0;
  
  --text-main: #111111;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-subtle: rgba(0, 0, 0, 0.05);

  --banner-blue: #0077c8;
  --banner-blue-light: #e6f3fc;
  --banner-blue-dark: #005fa3;

  --apple-blue: #0077c8;
  --apple-blue-bg: rgba(0, 119, 200, 0.1);

  --srs-again: #f36c3d;
  --srs-hard: #e60012;
  --srs-phrase: #7c3aed;
  --srs-easy: #22b14c;

  --font-sf: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

/* 深色模式色彩規範 (Apple Dark Theme) */
body.dark-mode {
  --bg-page: #000000;
  --bg-card: #1c1c1e;
  --bg-secondary: #2c2c2e;
  --bg-tertiary: #3a3a3c;
  
  --text-main: #f2f2f7;
  --text-secondary: #d1d5db;
  --text-muted: #8e8e93;
  --border-color: #38383a;
  --border-subtle: rgba(255, 255, 255, 0.08);

  --banner-blue: #0a84ff;
  --banner-blue-light: #1c2b3d;
  --banner-blue-dark: #64b5f6;

  --apple-blue: #0a84ff;
  --apple-blue-bg: rgba(10, 132, 255, 0.18);

  --srs-again: #ff9f0a;
  --srs-hard: #ff453a;
  --srs-phrase: #a78bfa;
  --srs-easy: #30d158;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-page);
  font-family: var(--font-sf);
  color: var(--text-main);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#app {
  width: 100%;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  background-color: var(--bg-card);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 35px rgba(0,0,0,0.08);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transition: background-color 0.2s ease;
}

/* ==========================================================================
   頂部導航列 (Top Bar)
   ========================================================================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 50;
}

.hamburger-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: transform 0.1s;
}
.hamburger-btn:active { transform: scale(0.92); }
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2.2px;
  background-color: var(--text-main);
  border-radius: 2px;
}

.progress-center-box {
  flex: 1;
  margin: 0 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.progress-track {
  width: 100%;
  height: 7px;
  background-color: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0077c8, #00b4d8);
  border-radius: 4px;
  transition: width 0.35s ease;
}

.main-speak-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: transform 0.1s;
}
.main-speak-btn:active { transform: scale(0.92); }
.main-speak-btn svg { width: 21px; height: 21px; fill: var(--text-main); }

/* ==========================================================================
   側邊抽屜選單 (Drawer) + 深淺色模式開關
   ========================================================================== */
.drawer-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.drawer-sidebar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 285px;
  background: var(--bg-card);
  z-index: 210;
  transform: translateX(-100%);
  transition: transform 0.26s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 25px rgba(0,0,0,0.18);
  padding-top: env(safe-area-inset-top, 16px);
  padding-bottom: env(safe-area-inset-bottom, 16px);
}
.drawer-sidebar.open { transform: translateX(0); }

.drawer-header {
  padding: 24px 20px 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--banner-blue);
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* 深淺色主題切換開關 (依需求 1) */
.theme-toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background-color 0.15s;
}

.drawer-nav-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}
.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 5px;
}
.drawer-nav-item:active { background-color: var(--bg-secondary); }
.drawer-nav-item.active {
  background-color: var(--banner-blue-light);
  color: var(--banner-blue);
}
.drawer-nav-item .nav-icon { font-size: 1.25rem; }

/* ==========================================================================
   多頁面容器切換
   ========================================================================== */
.view-container {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.view-container.active-view { display: flex; }

/* ==========================================================================
   第一頁：主要背單字區
   ========================================================================== */
.card-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  margin-bottom: 8px;
}
.category-select-wrapper { flex: 1; position: relative; }
.category-select {
  width: 100%;
  padding: 6px 24px 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  white-space: nowrap;
  text-overflow: ellipsis;
  outline: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.category-select:focus {
  border-color: var(--banner-blue);
}
.category-select-wrapper::after {
  content: "▼";
  font-size: 0.6rem;
  color: var(--text-muted);
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.word-top-tag-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.score-range-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  background-color: var(--banner-blue-light);
  border: 1px solid rgba(0, 119, 200, 0.25);
  color: var(--banner-blue);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.card-flipper-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}
.card-face {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 20px 14px 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.26s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.25s ease;
  background-color: var(--bg-card);
}
.card-face::-webkit-scrollbar { display: none; }
.card-face { -ms-overflow-style: none; scrollbar-width: none; }

.card-face.front-face { transform: translateX(0); opacity: 1; pointer-events: auto; }
.card-face.front-face.flipped { transform: translateX(-35%); opacity: 0; pointer-events: none; }
.card-face.back-face { transform: translateX(35%); opacity: 0; pointer-events: none; }
.card-face.back-face.flipped { transform: translateX(0); opacity: 1; pointer-events: auto; }
.card-face.slide-out-left {
  transform: translateX(-105%) !important;
  opacity: 0 !important;
  transition: transform 0.2s ease-in, opacity 0.18s ease-in;
}

.word-header-section { text-align: center; margin-top: 2px; margin-bottom: 12px; }
.word-speak-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
}
.word-speak-btn {
  background-color: var(--apple-blue-bg);
  color: var(--apple-blue);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s, background-color 0.15s;
}
.word-speak-btn:active {
  transform: scale(0.88);
}
.vocab-word {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.12;
  letter-spacing: -0.6px;
  word-break: break-word;
}
.vocab-phonetic {
  font-size: 1.06rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 400;
}
.vocab-meaning {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 8px;
  line-height: 1.35;
}

.section-banner-box { margin-top: 13px; }
.section-pill-banner {
  background: var(--banner-blue);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  padding: 7px 14px;
  border-radius: 8px;
  letter-spacing: 0.8px;
}
.section-body {
  padding: 8px 4px 2px 4px;
  font-size: 1.05rem;
  line-height: 1.55;
}
.section-body .en-text { font-weight: 600; color: var(--text-main); display: inline; }
.section-body .zh-text { color: var(--text-secondary); margin-top: 4px; font-weight: 400; }

.mini-speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.mini-speak-btn svg { width: 14px; height: 14px; fill: var(--banner-blue); }

.vocab-root-box {
  margin-top: 8px;
  padding: 10px 14px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  border-left: 4px solid var(--banner-blue);
  font-size: 0.95rem;
  line-height: 1.56;
  color: var(--text-secondary);
}
.vocab-root-box .root-tag {
  display: inline-block;
  font-weight: 700;
  color: var(--banner-blue);
  margin-bottom: 2px;
}

.flip-action-wrapper { margin-top: 16px; margin-bottom: 4px; }
.card-flip-sync-btn {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  border: 1.5px solid;
}
.btn-to-back {
  background-color: var(--banner-blue-light);
  border-color: var(--banner-blue);
  color: var(--banner-blue);
}
.btn-to-front {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-main);
}

/* ==========================================================================
   反面卡片：字根同源詞與形近詞專區 (依需求 4：在考點上方)
   ========================================================================== */
.back-header-info { text-align: center; margin-top: 4px; margin-bottom: 10px; }
.back-header-info h2 { font-size: 1.9rem; color: var(--text-main); font-weight: 800; }
.back-header-info p { color: var(--text-muted); font-size: 0.95rem; margin-top: 2px; }

/* 同根詞與形近詞專屬展示卡 */
.cognates-wrapper {
  margin-bottom: 12px;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
}
.cognate-pill-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--banner-blue);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.root-explain-box {
  background-color: var(--bg-card);
  border-left: 3.5px solid var(--apple-blue);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 9px;
  line-height: 1.4;
  border: 1px solid var(--border-color);
  border-left-width: 4px;
}
.cognate-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cognate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.08s, background-color 0.15s;
}
.cognate-row:active {
  transform: scale(0.98);
  background-color: var(--bg-secondary);
}
.cognate-left {
  flex: 1;
}
.cognate-word {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}
.cognate-meaning {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.exam-segment-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  font-size: 1rem;
  line-height: 1.6;
}
.exam-segment-title { font-weight: 700; color: var(--banner-blue); margin-bottom: 4px; }
.exam-segment-content { color: var(--text-secondary); }

/* 底部 SRS 操作按鈕列 (Again / 重要文法 / 重要片語 / Easy) */
.bottom-action-bar {
  padding: 6px 10px 10px 10px;
  display: flex;
  gap: 6px;
  background-color: var(--bg-card);
  flex-shrink: 0;
  border-top: 1px solid var(--border-subtle);
}
.srs-action-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 40px;
  border: none;
  border-radius: 9px;
  color: #ffffff;
  font-size: clamp(0.76rem, 2.9vw, 0.92rem);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.2px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.08s, filter 0.1s;
  box-sizing: border-box;
  padding: 0 4px;
}
.srs-action-btn:active { transform: scale(0.96); filter: brightness(0.92); }
.btn-srs-again { background-color: var(--srs-again); }
.btn-srs-hard { background-color: var(--srs-hard); }
.btn-srs-phrase { background-color: var(--srs-phrase); }
.btn-srs-easy { background-color: var(--srs-easy); }

/* ==========================================================================
   第二頁：弱點單字筆記本 (上英文下中文 + 左滑刪除)
   ========================================================================== */
.page-view-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  box-sizing: border-box;
}
.page-view-title {
  font-size: clamp(0.95rem, 3.8vw, 1.15rem);
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.page-view-title span {
  white-space: nowrap;
}
.weak-header-btn-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
}
.weak-header-btn {
  height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: clamp(0.75rem, 2.8vw, 0.84rem);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: nowrap;
  box-sizing: border-box;
  flex-shrink: 0;
  transition: all 0.15s;
}
.weak-header-btn.btn-primary {
  background-color: var(--apple-blue);
  color: #ffffff;
  border-color: var(--apple-blue);
}
.weak-header-btn:active {
  transform: scale(0.96);
}

.weak-list-scroll {
  flex: 1;
  overflow-y: auto;
  background-color: var(--bg-page);
  padding: 10px 14px;
}
.swipe-delete-wrapper {
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.swipe-delete-btn {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 80px;
  background-color: #ef4444;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
}
.swipe-front-card {
  position: relative;
  background: var(--bg-card);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
  transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}
.swipe-front-card.swiped-open { transform: translateX(-80px); }
.weak-card-text { flex: 1; padding-right: 12px; }
.weak-word-top { font-size: 1.22rem; font-weight: 800; color: var(--text-main); }
.weak-meaning-bottom { font-size: 0.98rem; font-weight: 500; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }

.weak-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.weak-play-btn svg { width: 16px; height: 16px; fill: var(--banner-blue); }

/* ==========================================================================
   第三頁：每日足跡 + 學習打卡月曆 (依需求 2)
   ========================================================================== */
.footprint-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  background-color: var(--bg-page);
}

/* 學習打卡月曆卡片 */
.calendar-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.streak-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #ff9500;
  background: rgba(255, 149, 0, 0.12);
  padding: 4px 10px;
  border-radius: 8px;
}
.calendar-month-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.cal-day-cell.empty { pointer-events: none; }
/* 有學習的日期底色標註 (依需求 2) */
.cal-day-cell.has-study {
  background-color: var(--banner-blue);
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 2px 5px rgba(0, 119, 200, 0.3);
}
.cal-day-cell.today-ring {
  border: 2px solid var(--banner-blue);
}
.cal-day-cell.selected {
  outline: 3px solid #ff9500 !important;
  outline-offset: 1px;
  font-weight: 900;
}

/* 每日足跡單日切換工具列 (依使用者要求：以每日顯示，累積久了不致過長) */
.footprint-date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 12px;
  gap: 8px;
}
.fp-nav-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.fp-nav-btn:hover {
  background: var(--banner-blue);
  color: #fff;
}
.fp-current-date-info {
  text-align: center;
  flex: 1;
}
.fp-current-date-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.fp-today-tag {
  font-size: 0.72rem;
  background: var(--banner-blue);
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}
.fp-current-date-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.fp-view-all-btn {
  background: none;
  border: none;
  color: var(--banner-blue);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0 4px;
}

.footprint-date-section { margin-bottom: 16px; }
.footprint-date-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.footprint-card-list {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.footprint-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footprint-item:last-child { border-bottom: none; }
.fp-word { font-size: 1.18rem; font-weight: 800; }
.fp-word.again-color { color: var(--srs-again); }
.fp-word.hard-color { color: var(--srs-hard); }
.fp-word.easy-color { color: var(--srs-easy); }
.fp-meaning-gray { font-size: 0.95rem; font-weight: 400; color: var(--text-muted); margin-top: 3px; }

/* ==========================================================================
   第四頁：單字測驗 (當日測驗 vs 當週錯題測驗，依需求 3)
   ========================================================================== */
.quiz-tab-bar {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 3px;
  margin: 12px 18px 4px 18px;
}
.quiz-tab-item {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.quiz-tab-item.active {
  background: var(--bg-card);
  color: var(--banner-blue);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.quiz-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
}
.quiz-score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.quiz-question-box {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-bottom: 18px;
}
.quiz-target-word {
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}
.quiz-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-option-btn {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  line-height: 1.4;
}
.quiz-option-btn:active { transform: scale(0.98); }
.quiz-option-btn.correct-choice {
  background-color: rgba(34, 197, 94, 0.15) !important;
  border-color: #22c55e !important;
  color: #16a34a !important;
}
.quiz-option-btn.wrong-choice {
  background-color: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
  color: #dc2626 !important;
}

/* ==========================================================================
   第五頁：管理設定
   ========================================================================== */
.settings-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background-color: var(--bg-page);
}
.settings-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.settings-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.goal-chips-row { display: flex; gap: 10px; margin-top: 8px; }
.goal-chip {
  flex: 1;
  padding: 10px 0;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
}
.goal-chip.active {
  background: var(--banner-blue);
  color: #ffffff;
  border-color: var(--banner-blue);
}

.action-big-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  font-size: 1.02rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  margin-bottom: 10px;
  transition: transform 0.1s;
}
.action-big-btn:active { transform: scale(0.97); }
.btn-primary { background-color: var(--banner-blue); color: #fff; }
.btn-secondary { background-color: var(--bg-secondary); color: var(--text-main); border: 1px solid var(--border-color); }
.btn-danger { background-color: rgba(239, 68, 68, 0.12); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

#toast {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
#toast.show { opacity: 1; }

/* ==========================================================================
   v8.0 新增樣式：朗讀反饋、達標卡、狀態頁籤、遮罩切換與測驗結算
   ========================================================================== */

/* 4. 朗讀 ICON 互動反饋 (簡潔雅致：hover 與 press 按下改色反饋) */
.main-speak-btn,
.word-speak-btn,
.mini-speak-btn,
.weak-play-btn {
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease, color 0.15s ease;
}

/* Hover 狀態微反饋 */
.main-speak-btn:hover,
.mini-speak-btn:hover,
.weak-play-btn:hover {
  background-color: var(--apple-blue-bg);
  border-color: rgba(0, 113, 227, 0.3);
}
.main-speak-btn:hover svg,
.mini-speak-btn:hover svg,
.weak-play-btn:hover svg {
  fill: var(--apple-blue);
}
.word-speak-btn:hover {
  background-color: rgba(0, 113, 227, 0.2);
}

/* Press (按下 / active) 反饋：輕巧微縮 + 變色 */
.main-speak-btn:active,
.mini-speak-btn:active,
.weak-play-btn:active {
  transform: scale(0.92);
  background-color: rgba(0, 113, 227, 0.18);
  border-color: var(--apple-blue);
}
.main-speak-btn:active svg,
.mini-speak-btn:active svg,
.weak-play-btn:active svg {
  fill: var(--apple-blue);
}
.word-speak-btn:active {
  transform: scale(0.9);
  background-color: rgba(0, 113, 227, 0.3);
}

/* 播放中狀態 (is-speaking)：沈穩雅致的藍色高亮，無誇張跳動與擴散光暈 */
.main-speak-btn.is-speaking,
.mini-speak-btn.is-speaking,
.weak-play-btn.is-speaking {
  background-color: var(--apple-blue-bg);
  border-color: var(--apple-blue);
}
.main-speak-btn.is-speaking svg,
.mini-speak-btn.is-speaking svg,
.weak-play-btn.is-speaking svg {
  fill: var(--apple-blue);
}
.word-speak-btn.is-speaking {
  background-color: var(--apple-blue);
  color: #ffffff;
}
.word-speak-btn.is-speaking svg {
  fill: #ffffff;
}

/* 2. 今日 20 個 Easy 達標成就卡 (依需求 2) */
.study-completed-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 36px 20px;
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  margin: 20px auto;
  max-width: 90%;
  animation: fadeIn 0.3s ease-out;
}
.completed-icon { font-size: 3.8rem; margin-bottom: 12px; }
.completed-title { font-size: 1.45rem; font-weight: 800; color: var(--text-main); margin-bottom: 8px; }
.completed-desc { font-size: 0.96rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }

/* 3. 正面常見搭配詞組 (依需求 3) */
.collocation-item {
  padding: 8px 2px;
  border-bottom: 1px dashed var(--border-subtle);
  line-height: 1.5;
}
.collocation-item:last-child {
  border-bottom: none;
}
.collocation-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--banner-blue);
  margin-bottom: 2px;
}
.collocation-text {
  font-size: 0.98rem;
  color: var(--text-main);
}

/* 7. 筆記本狀態頁籤 (Again / 重要文法 / 重要片語 / Easy) */
.status-tab-bar {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}
.status-tab-item {
  flex: 1 1 0;
  min-width: 0;
  height: 38px;
  padding: 0 4px;
  border-radius: 9px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-main);
  font-size: clamp(0.70rem, 2.7vw, 0.82rem);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
.status-tab-item:active {
  transform: scale(0.97);
}
.status-tab-item .tab-label {
  display: inline-block;
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.tab-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  min-width: 16px;
  height: 16px;
  border-radius: 10px;
  font-size: 0.70rem;
  font-weight: 700;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  line-height: 1;
  box-sizing: border-box;
}
.status-tab-item.active {
  background-color: var(--apple-blue);
  color: #ffffff;
  border-color: var(--apple-blue);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.28);
}
.status-tab-item.active .tab-count-pill {
  background-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-again { background-color: var(--srs-again); }
.dot-hard { background-color: var(--srs-hard); }
.dot-phrase { background-color: var(--srs-phrase); }
.dot-easy { background-color: var(--srs-easy); }

@media (max-width: 360px) {
  .status-tab-bar {
    gap: 4px;
    padding: 6px 6px;
  }
  .status-tab-item {
    font-size: 0.68rem;
    gap: 2px;
    padding: 0 2px;
    height: 36px;
  }
  .tab-count-pill {
    padding: 1px 3px;
    font-size: 0.65rem;
    min-width: 14px;
  }
}

/* 5. 遮罩工具列與隱藏單字/中文 (依需求 5) */
.mask-action-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 14px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}
.mask-toggle-btn {
  flex: 1;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}
.mask-toggle-btn.active {
  background-color: var(--banner-blue);
  color: #ffffff;
  border-color: var(--banner-blue);
}

/* 隱藏單字遮罩效果 */
.hide-words .weak-word-top,
.hide-words .fp-word {
  filter: blur(6px);
  user-select: none;
  transition: filter 0.2s ease;
}
.hide-words .weak-word-top:hover,
.hide-words .weak-word-top:active,
.hide-words .fp-word:hover,
.hide-words .fp-word:active {
  filter: none;
}

/* 隱藏中文遮罩效果 */
.hide-meanings .weak-meaning-bottom,
.hide-meanings .fp-meaning-gray {
  filter: blur(6px);
  user-select: none;
  transition: filter 0.2s ease;
}
.hide-meanings .weak-meaning-bottom:hover,
.hide-meanings .weak-meaning-bottom:active,
.hide-meanings .fp-meaning-gray:hover,
.hide-meanings .fp-meaning-gray:active {
  filter: none;
}

/* 點擊單字橫列跳轉反饋 */
.swipe-front-card,
.footprint-item {
  cursor: pointer;
  transition: background-color 0.12s;
}
.swipe-front-card:active,
.footprint-item:active {
  background-color: var(--bg-secondary);
}

/* 6. 測驗結算卡片 (依需求 6) */
.quiz-result-box {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  margin-top: 14px;
  animation: fadeIn 0.3s ease-out;
}
.quiz-result-icon { font-size: 3.6rem; margin-bottom: 10px; }
.quiz-result-title { font-size: 1.4rem; font-weight: 800; color: var(--text-main); margin-bottom: 6px; }
.quiz-result-score { font-size: 1.25rem; font-weight: 800; color: var(--apple-blue); margin-bottom: 8px; }
.quiz-result-notice { font-size: 0.92rem; color: var(--text-muted); }

/* ==========================================================================
   v10.0 新增樣式：遮罩單獨顯現、卡片切換手勢動畫、快閃背單字區
   ========================================================================== */

/* 3. 遮罩狀態下點選個別單字/中文獨立顯現 (依需求 3) */
.hide-words .weak-word-top.revealed,
.hide-words .fp-word.revealed,
.hide-meanings .weak-meaning-bottom.revealed,
.hide-meanings .fp-meaning-gray.revealed {
  filter: none !important;
  opacity: 1 !important;
  background-color: var(--apple-blue-bg) !important;
  border-radius: 4px;
  padding: 0 4px;
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.2);
  transition: filter 0.15s ease, background-color 0.15s ease;
}

/* 2. 手勢切換平移動畫 (依需求 2) */
.slide-out-left {
  animation: slideOutLeft 0.18s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.slide-out-right {
  animation: slideOutRight 0.18s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.slide-in-right {
  animation: slideInRight 0.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.slide-in-left {
  animation: slideInLeft 0.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes slideOutLeft {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-60px); opacity: 0; }
}
@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(60px); opacity: 0; }
}
@keyframes slideInRight {
  from { transform: translateX(60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideInLeft {
  from { transform: translateX(-60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 4. 快閃背單字區 (View: Flash Review) (依需求 4) */
.flash-progress-bar-wrap {
  padding: 6px 20px 10px 20px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}
.flash-progress-track {
  width: 100%;
  height: 6px;
  background-color: var(--bg-secondary);
  border-radius: 999px;
  overflow: hidden;
}
.flash-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.flash-card-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  perspective: 1200px;
}
.flash-card-container {
  width: 100%;
  max-width: 440px;
  min-height: 380px;
  position: relative;
}
.flash-card-inner {
  width: 100%;
  min-height: 380px;
  position: relative;
  transition: transform 0.45s cubic-bezier(0.34, 1.3, 0.64, 1);
  transform-style: preserve-3d;
}
.flash-card-inner.is-flipped {
  transform: rotateY(180deg);
}
.flash-card-face {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border: 1px solid var(--border-color);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flash-face-back {
  transform: rotateY(180deg);
}
.flash-card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flash-badge {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--apple-blue);
  background-color: var(--apple-blue-bg);
  padding: 3px 8px;
  border-radius: 6px;
}
.flash-front-center,
.flash-back-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 10px;
}
.flash-front-word {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1.15;
  word-break: break-word;
}
.flash-front-phonetic {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 400;
}
.flash-back-word {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 12px;
  word-break: break-word;
}
.flash-back-meaning {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--banner-blue);
  line-height: 1.4;
  word-break: break-word;
}
.flash-bottom-bar {
  margin-top: 12px;
}
.flash-flip-btn {
  width: 100%;
  height: 48px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  border-radius: 12px;
  background-color: var(--banner-blue) !important;
  color: #ffffff !important;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 119, 200, 0.35);
  margin-bottom: 0;
  letter-spacing: 0.5px;
}
.flash-flip-btn span {
  color: #ffffff !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  display: inline-block;
  line-height: 1;
}
.flash-flip-btn:active {
  transform: scale(0.97);
  filter: brightness(0.92);
}
.flash-choice-bar {
  display: flex;
  gap: 12px;
}
.flash-btn-unlearned {
  background-color: #ef4444 !important;
  color: #ffffff !important;
  height: 44px;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.flash-btn-remembered {
  background-color: #10b981 !important;
  color: #ffffff !important;
  height: 44px;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.flash-completed-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border-radius: 20px;
  padding: 32px 20px;
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  animation: fadeIn 0.3s ease-out;
}
.flash-stats-box {
  display: flex;
  gap: 14px;
  margin: 20px 0;
}
.flash-stat-item {
  flex: 1;
  background-color: var(--bg-secondary);
  border-radius: 12px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--border-color);
}
.flash-stat-item.stat-good .flash-stat-num { color: #10b981; }
.flash-stat-item.stat-bad .flash-stat-num { color: #ef4444; }
.flash-stat-num { font-size: 1.8rem; font-weight: 800; line-height: 1; margin-bottom: 6px; }
.flash-stat-lbl { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }

/* ==========================================================================
   弱點單字筆記本 / 足跡返回導航列
   ========================================================================== */
.weak-mode-return-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px 16px;
  animation: fadeIn 0.25s ease-out;
  background: var(--bg-card);
  border-bottom: 1.5px solid var(--border-color);
  margin-bottom: 8px;
}
.return-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--apple-blue) !important;
  color: #ffffff !important;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 119, 200, 0.32);
  transition: all 0.2s ease;
}
.return-source-btn:hover {
  opacity: 0.92;
  transform: translateX(-3px);
}
.return-source-btn:active {
  transform: scale(0.96);
}
.return-source-btn .back-arrow {
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 800;
}
.weak-mode-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--apple-blue);
  background: var(--apple-blue-bg);
  padding: 6px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
}

/* ==========================================================================
   隨堂測驗：例句拼字填空區專屬樣式
   ========================================================================== */
.quiz-spell-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  animation: fadeIn 0.3s ease-out;
}
.spell-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  position: relative;
}
.spell-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.spell-mode-tag {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--apple-blue);
  background: var(--apple-blue-bg);
  padding: 4px 10px;
  border-radius: 12px;
}
.spell-sentence-box {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 16px;
}
.spell-blank-highlight {
  display: inline-block;
  padding: 2px 10px;
  margin: 0 4px;
  border-bottom: 2.5px solid var(--apple-blue);
  color: var(--apple-blue);
  font-weight: 700;
  letter-spacing: 2px;
  background: var(--apple-blue-bg);
  border-radius: 4px 4px 0 0;
  transition: all 0.2s;
}
.spell-chinese-prompt {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--border-color);
}
.spell-chinese-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.spell-chinese-meaning {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.spell-hint-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.spell-interaction-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}
.spell-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.spell-input-wrapper {
  position: relative;
  width: 100%;
}
.spell-text-input {
  width: 100%;
  height: 52px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-align: center;
  padding: 0 36px 0 16px;
  border: 2px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.spell-text-input:focus {
  border-color: var(--apple-blue);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px var(--apple-blue-bg);
}
.spell-text-input.correct {
  border-color: #22c55e !important;
  background-color: rgba(34, 197, 94, 0.1) !important;
  color: #15803d !important;
}
.spell-text-input.wrong {
  border-color: #ef4444 !important;
  background-color: rgba(239, 68, 68, 0.1) !important;
  color: #b91c1c !important;
  animation: shake 0.4s ease-in-out;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.spell-input-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}
.spell-submit-btn {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: var(--apple-blue);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 119, 200, 0.28);
  transition: all 0.2s;
}
.spell-submit-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.spell-action-tools {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.spell-tool-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.spell-tool-btn:hover {
  background: var(--border-color);
  color: var(--text-primary);
}
.spell-feedback-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  text-align: center;
  animation: fadeIn 0.25s ease-out;
}
.spell-feedback-card.correct {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #15803d;
}
.spell-feedback-card.wrong {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #b91c1c;
}
.spell-feedback-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.spell-feedback-detail {
  font-size: 0.92rem;
  line-height: 1.5;
}




/* ==========================================================================
   搜尋單字功能專用樣式 (View: Search)
   ========================================================================== */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.search-icon-svg {
  position: absolute;
  left: 12px;
  width: 20px;
  height: 20px;
  fill: var(--text-muted);
  pointer-events: none;
}
.search-box-input {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 40px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-main);
  font-size: 0.98rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box-input:focus {
  border-color: var(--banner-blue);
  box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.15);
}
.search-clear-btn {
  position: absolute;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.search-filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.search-filter-chips::-webkit-scrollbar {
  display: none;
}
.search-chip {
  padding: 4px 11px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.12s;
}
.search-chip.active {
  background: var(--banner-blue);
  color: #ffffff;
  border-color: var(--banner-blue);
}
.search-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  background-color: var(--bg-page);
}
.search-result-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.08s, background-color 0.15s;
}
.search-result-card:active {
  transform: scale(0.99);
  background-color: var(--bg-secondary);
}
.search-res-left {
  flex: 1;
  padding-right: 10px;
}
.search-res-word-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.search-res-word {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}
.search-res-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: rgba(0, 119, 200, 0.1);
  color: var(--banner-blue);
}
.search-res-meaning {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.45;
}
.search-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

/* ==========================================================================
   全新功能 1：連續朗讀按鈕 & 懸浮播放列 & 展開設定面板
   ========================================================================== */
.continuous-play-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--banner-blue), #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 6px 13px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 119, 200, 0.25);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.continuous-play-trigger-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 119, 200, 0.35);
}
.continuous-play-trigger-btn:active {
  transform: scale(0.97);
}
.continuous-play-trigger-btn .headphone-icon {
  font-size: 1rem;
}

/* 懸浮迷你播放列 (Glassmorphism Floating Bar) */
.continuous-player-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 450px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 1500;
  animation: slideUpFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
body.dark-mode .continuous-player-bar {
  background: rgba(28, 28, 30, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.cp-info-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.cp-wave-icon {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 20px;
  padding: 2px;
  flex-shrink: 0;
}
.cp-wave-icon span {
  width: 3px;
  background-color: var(--banner-blue);
  border-radius: 2px;
  height: 6px;
  transition: height 0.2s;
}
.continuous-player-bar.is-playing .cp-wave-icon span:nth-child(1) {
  animation: soundWave 0.8s infinite alternate ease-in-out;
}
.continuous-player-bar.is-playing .cp-wave-icon span:nth-child(2) {
  animation: soundWave 1.1s infinite alternate ease-in-out 0.2s;
}
.continuous-player-bar.is-playing .cp-wave-icon span:nth-child(3) {
  animation: soundWave 0.9s infinite alternate ease-in-out 0.4s;
}
@keyframes soundWave {
  0% { height: 5px; }
  100% { height: 18px; }
}

.cp-text-group {
  flex: 1;
  min-width: 0;
}
.cp-word-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.cp-word {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.cp-pos {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.cp-index {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--banner-blue);
  margin-left: auto;
  flex-shrink: 0;
}
.cp-meaning {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.cp-controls-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cp-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
}
.cp-btn:hover {
  background-color: var(--bg-tertiary);
}
.cp-btn:active {
  transform: scale(0.92);
}
.cp-btn-play {
  background: var(--banner-blue);
  color: #ffffff;
  width: 42px;
  height: 42px;
  box-shadow: 0 4px 12px rgba(0, 119, 200, 0.3);
}
.cp-btn-play:hover {
  background: var(--banner-blue);
  transform: scale(1.05);
}
.cp-btn-close {
  font-size: 1.1rem;
  color: var(--text-muted);
  width: 30px;
  height: 30px;
}

/* ==========================================================================
   全螢幕遮罩 Modal (固定覆蓋層，預設隱藏)
   ========================================================================== */
.modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 99999 !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}
.modal-backdrop.active {
  display: flex !important;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 100000;
  animation: modalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px 20px;
  border-bottom: 1px solid var(--border-color);
}
.modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}
.modal-close-btn {
  background: var(--bg-secondary);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.15s;
}
.modal-close-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
}
.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}
.modal-footer {
  padding: 12px 20px 18px 20px;
  border-top: 1px solid var(--border-color);
}

/* 展開設定面板 Modal */
.continuous-modal-card {
  max-width: 480px;
}
.continuous-modal-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.cp-setting-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cp-setting-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cp-setting-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}
.cp-timer-countdown {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--banner-blue);
  background: var(--apple-blue-bg);
  padding: 2px 8px;
  border-radius: 6px;
}
.cp-mode-chips, .cp-timer-chips, .cp-speed-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.cp-timer-chips {
  grid-template-columns: repeat(3, 1fr);
}
.cp-mode-chip, .cp-timer-chip, .cp-speed-chip {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
}
.cp-mode-chip .chip-title {
  font-size: 0.92rem;
  font-weight: 700;
}
.cp-mode-chip .chip-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}
.cp-mode-chip.active, .cp-timer-chip.active, .cp-speed-chip.active {
  background: var(--apple-blue-bg);
  border-color: var(--banner-blue);
  color: var(--banner-blue);
  box-shadow: 0 2px 8px rgba(0, 119, 200, 0.15);
}
.cp-mode-chip.active .chip-desc {
  color: var(--banner-blue);
  font-weight: 600;
}
.cp-bg-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border-left: 3px solid var(--banner-blue);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.cp-bg-tip .tip-icon {
  font-size: 1rem;
}

/* ==========================================================================
   全新功能 2：SRS 遺忘曲線警報 Banner (首頁頂部)
   ========================================================================== */
.srs-alert-banner {
  margin: 6px 16px 2px 16px;
  background: linear-gradient(135deg, rgba(230, 0, 18, 0.08), rgba(243, 108, 61, 0.09));
  border: 1px solid rgba(230, 0, 18, 0.22);
  border-radius: 12px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 2px 6px rgba(230, 0, 18, 0.05);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}
.srs-alert-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(230, 0, 18, 0.12);
  border-color: rgba(230, 0, 18, 0.35);
}
.srs-alert-banner:active {
  transform: translateY(0);
}
body.dark-mode .srs-alert-banner {
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.16), rgba(255, 159, 10, 0.12));
  border-color: rgba(255, 69, 58, 0.35);
}
.srs-alert-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.srs-alert-icon {
  font-size: 1.05rem;
  line-height: 1;
  animation: pulseGlow 1.8s infinite ease-in-out;
  flex-shrink: 0;
}
@keyframes pulseGlow {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(230, 0, 18, 0)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 6px rgba(230, 0, 18, 0.6)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(230, 0, 18, 0)); }
}
.srs-alert-text {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.srs-alert-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--srs-hard);
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.srs-alert-title #srsAlertCount {
  font-weight: 900;
  text-decoration: underline;
  margin: 0 2px;
}
.srs-alert-action-btn {
  background: var(--srs-hard);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(230, 0, 18, 0.2);
  transition: all 0.15s ease;
}
.srs-alert-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(230, 0, 18, 0.3);
}
.srs-alert-action-btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   全新功能 3：多益考分預估儀表板 (Score Predictor Dashboard)
   ========================================================================== */
.toeic-predictor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.predictor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.predictor-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.predictor-icon {
  font-size: 1.3rem;
}
.predictor-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

/* 官方證書級別標籤 */
.predictor-cert-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}
.cert-orange {
  background: linear-gradient(135deg, #ff9f0a, #f36c3d);
  color: #ffffff;
}
.cert-green {
  background: linear-gradient(135deg, #30d158, #22b14c);
  color: #ffffff;
}
.cert-blue {
  background: linear-gradient(135deg, #0a84ff, #0077c8);
  color: #ffffff;
}
.cert-gold {
  background: linear-gradient(135deg, #ffd700, #d4af37, #b8860b);
  color: #2b1d00;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

.predictor-score-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 14px;
}
.predictor-score-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.score-label, .count-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.score-range {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.5px;
}
.predictor-vocab-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.count-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--srs-easy);
}
.count-unit {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.predictor-progress-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.progress-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.next-target-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.target-pct {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--banner-blue);
}
.predictor-progress-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.predictor-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--banner-blue), #10b981);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* 4 階段證書分級階梯卡片 */
.cert-ladder-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.ladder-item {
  border-radius: 10px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  opacity: 0.45;
  transition: all 0.2s ease;
  position: relative;
}
.ladder-item.current-cert {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.ladder-item.current-cert::after {
  content: "目前";
  position: absolute;
  top: -8px;
  background: var(--text-main);
  color: var(--bg-card);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}
.ladder-badge {
  font-size: 0.78rem;
  font-weight: 800;
}
.ladder-score {
  font-size: 0.68rem;
  font-weight: 700;
}
.ladder-vocab {
  font-size: 0.65rem;
  opacity: 0.9;
}

/* ==========================================================================
   選單第二區：睡眠/通勤連續朗讀專區 頁面佈局與樣式 (viewContinuous)
   ========================================================================== */
.continuous-view-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* 主播放器卡片 */
.cp-main-player-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 28px 20px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
}

body.dark-mode .cp-main-player-card {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* 狀態標籤 */
.cp-main-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--banner-blue);
  background: var(--apple-blue-bg);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 18px;
}

.cp-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
  transition: all 0.2s;
}

.cp-pulse-dot.active {
  background-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25);
  animation: pulseGreen 1.5s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* 單字與釋義呈現 */
.cp-main-word-wrap {
  margin-bottom: 20px;
  width: 100%;
}

.cp-main-word {
  font-size: 2.3rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin: 0 0 6px 0;
  line-height: 1.2;
}

.cp-main-phonetic {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-family: var(--font-family-mono, monospace);
  margin-bottom: 12px;
}

.cp-main-meaning {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--banner-blue);
  line-height: 1.4;
  padding: 0 8px;
}

/* 巨大波形動態條 */
.cp-large-wave-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 36px;
  margin-bottom: 24px;
}

.cp-large-wave-container span {
  width: 4px;
  background-color: var(--border-color);
  border-radius: 3px;
  height: 8px;
  transition: all 0.25s;
}

.cp-large-wave-container.is-playing span {
  background-color: var(--banner-blue);
}

.cp-large-wave-container.is-playing span:nth-child(1) { animation: largeWaveAnim 0.7s infinite alternate ease-in-out; }
.cp-large-wave-container.is-playing span:nth-child(2) { animation: largeWaveAnim 1.1s infinite alternate ease-in-out 0.2s; }
.cp-large-wave-container.is-playing span:nth-child(3) { animation: largeWaveAnim 0.85s infinite alternate ease-in-out 0.4s; }
.cp-large-wave-container.is-playing span:nth-child(4) { animation: largeWaveAnim 1.2s infinite alternate ease-in-out 0.1s; }
.cp-large-wave-container.is-playing span:nth-child(5) { animation: largeWaveAnim 0.95s infinite alternate ease-in-out 0.3s; }

@keyframes largeWaveAnim {
  0% { height: 6px; }
  100% { height: 32px; }
}

/* 主播放大按鈕組 */
.cp-main-action-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.cp-action-circle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.cp-action-circle-btn:active {
  transform: scale(0.92);
}

.cp-action-play-huge {
  background: var(--banner-blue);
  color: #ffffff;
  width: 68px;
  height: 68px;
  box-shadow: 0 6px 20px rgba(0, 119, 200, 0.35);
  border: none;
}

.cp-action-play-huge:hover {
  transform: scale(1.05);
}

.cp-action-play-huge:active {
  transform: scale(0.93);
}

/* 設定卡片 */
.cp-settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   多益單字卡管理：各層級單字進度統計樣式
   ========================================================================== */
.level-stats-summary-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border-subtle);
}
.summary-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.summary-ratio {
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.summary-pct {
  color: var(--banner-blue);
  font-size: 1.08rem;
  font-weight: 900;
}
.level-progress-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  overflow: hidden;
  margin: 6px 0;
}
body.dark-mode .level-progress-bar {
  background: rgba(255, 255, 255, 0.12);
}
.level-progress-fill {
  height: 100%;
  background: var(--banner-blue);
  border-radius: 6px;
  transition: width 0.3s ease;
}
.level-progress-fill.cert-orange { background: #ff7700; }
.level-progress-fill.cert-green { background: #00aa66; }
.level-progress-fill.cert-blue { background: #0077c8; }
.level-progress-fill.cert-gold { background: #d4a000; }
.summary-sub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.level-stats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.level-stat-row {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.level-stat-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.level-badge-and-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.level-pill {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  color: #fff;
  white-space: nowrap;
}
.level-pill.cert-orange { background: #ff7700; }
.level-pill.cert-green { background: #00aa66; }
.level-pill.cert-blue { background: #0077c8; }
.level-pill.cert-gold { background: #d4a000; }
.level-title-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}
.level-stat-counts {
  display: flex;
  align-items: center;
  gap: 8px;
}
.level-count-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.level-pct-badge {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--banner-blue);
  min-width: 38px;
  text-align: right;
}
.level-stat-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}


