/* =========================================================
   國中會考英文單字自學互動系統 - 活力多巴胺風 (Dopamine Style)
   設計核心：繽紛明亮多巴胺色彩、字體超清晰高對比、微互動動態、激發學習動力
   ========================================================= */

:root {
  /* 多巴胺能量主色系 */
  --dp-pink: #ff3366;
  --dp-coral: #ff5e7e;
  --dp-orange: #ff8c00;
  --dp-yellow: #ffb703;
  --dp-yellow-light: #fff8d6;
  --dp-mint: #00c48c;
  --dp-mint-light: #e6faf2;
  --dp-cyan: #00b4d8;
  --dp-blue: #3a86ff;
  --dp-blue-light: #edf4ff;
  --dp-purple: #8338ec;
  --dp-purple-light: #f5eaff;
  
  /* 底色與文字 */
  --bg-main: #f5f8ff;
  --bg-card: #ffffff;
  --text-main: #141a29;
  --text-title: #0f172a;
  --text-muted: #576574;
  --border-subtle: #e2e8f5;
  --border-card: #e5edff;
  
  /* 圓角與陰影 */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(30, 41, 59, 0.04);
  --shadow-md: 0 8px 20px -3px rgba(58, 134, 255, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 16px 36px -6px rgba(255, 51, 102, 0.12), 0 6px 14px -3px rgba(0, 0, 0, 0.05);
  --shadow-pop: 0 10px 24px -4px rgba(58, 134, 255, 0.25);
  
  --bounce-transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth-transition: all 0.2s ease;
}

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

body {
  font-family: 'Outfit', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(255, 94, 126, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 90% 25%, rgba(58, 134, 255, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(0, 196, 140, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(255, 183, 3, 0.07) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================================
   1. 頂部導航列 (Navbar) - 活力漸層與玻璃感
   ========================================================= */
.navbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(226, 232, 245, 0.8);
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 4px 20px rgba(58, 134, 255, 0.06);
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  font-size: 1.9rem;
  background: linear-gradient(135deg, #ff3366 0%, #ff8c00 100%);
  color: white;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: 0 6px 16px rgba(255, 51, 102, 0.32);
  transform: rotate(-3deg);
  transition: var(--bounce-transition);
}

.brand-icon:hover {
  transform: rotate(6deg) scale(1.1);
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #1e1b4b;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #1e1b4b 0%, #3a86ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* 單字庫切換 Tabs (500 vs 960) */
.tab-group {
  display: flex;
  background: #eef2ff;
  padding: 5px;
  border-radius: var(--radius-pill);
  gap: 6px;
  border: 2px solid #dfe7ff;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 0.55rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: #4b5563;
  transition: var(--bounce-transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: #1e1b4b;
  transform: translateY(-1px);
}

.tab-btn.active {
  background: linear-gradient(135deg, #ff3366 0%, #ff5e7e 100%);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(255, 51, 102, 0.35);
}

#tab-960.tab-btn.active {
  background: linear-gradient(135deg, #3a86ff 0%, #00c48c 100%);
  box-shadow: 0 6px 16px rgba(58, 134, 255, 0.35);
}

.tab-btn .badge-count {
  font-size: 0.72rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: #dfe7ff;
  color: #3b82f6;
  letter-spacing: 0.03em;
}

.tab-btn.active .badge-count {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

/* =========================================================
   2. 主內容容器與控制面板 (Control Card)
   ========================================================= */
.main-wrapper {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
  flex: 1;
}

.control-card {
  background: var(--bg-card);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  position: relative;
  overflow: hidden;
}

.control-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #ff3366, #ff8c00, #ffb703, #00c48c, #3a86ff, #8338ec);
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

/* 回次快速選擇器 */
.round-selector-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.round-btn-nav {
  background: #f0f4ff;
  border: 2px solid #dbe4ff;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.9rem;
  color: #3a86ff;
  transition: var(--bounce-transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.round-btn-nav:hover:not(:disabled) {
  background: #3a86ff;
  color: #ffffff;
  border-color: #3a86ff;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 4px 12px rgba(58, 134, 255, 0.25);
}

.round-btn-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.round-select {
  padding: 0.5rem 1rem;
  border: 2px solid #dbe4ff;
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  font-weight: 800;
  background-color: #ffffff;
  color: #1e1b4b;
  outline: none;
  cursor: pointer;
  min-width: 165px;
  transition: var(--smooth-transition);
  font-family: inherit;
}

.round-select:focus {
  border-color: #3a86ff;
  box-shadow: 0 0 0 4px rgba(58, 134, 255, 0.15);
}

/* 搜尋框 */
.search-box {
  position: relative;
  flex: 1;
  min-width: 230px;
  max-width: 380px;
}

.search-input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  border: 2px solid #e2e8f5;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e293b;
  outline: none;
  background: #fcfdff;
  transition: var(--smooth-transition);
  font-family: inherit;
}

.search-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.search-input:focus {
  border-color: #ff3366;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 51, 102, 0.12);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
}

/* 學習模式切換按鈕組 */
.mode-switch-group {
  display: flex;
  background: #f1f4fc;
  border: 2px solid #e0e7f8;
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
  flex-wrap: wrap;
}

.mode-btn {
  border: none;
  background: transparent;
  padding: 0.45rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 800;
  border-radius: 10px;
  cursor: pointer;
  color: #475569;
  transition: var(--bounce-transition);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.mode-btn:hover {
  color: #1e1b4b;
  background: rgba(255, 255, 255, 0.7);
}

.mode-btn.active {
  background: #ffffff;
  color: #ff3366;
  box-shadow: 0 4px 12px rgba(255, 51, 102, 0.15);
  transform: scale(1.02);
}

/* 快捷操作按鈕組 */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.action-btn {
  background: #ffffff;
  border: 2px solid #e2e8f5;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--bounce-transition);
  font-family: inherit;
}

.action-btn:hover {
  background: #f8faff;
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.action-btn:active {
  transform: scale(0.96);
}

#toggle-blanks-btn {
  border-color: #ffd166;
  background: #fffdf5;
  color: #b45309;
}

#toggle-blanks-btn:hover {
  background: #fef08a;
  border-color: #eab308;
  color: #713f12;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.25);
}

.action-btn.btn-primary {
  background: linear-gradient(135deg, #ff3366 0%, #ff5e7e 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(255, 51, 102, 0.3);
}

.action-btn.btn-primary:hover {
  background: linear-gradient(135deg, #e11d48 0%, #ff3366 100%);
  box-shadow: 0 6px 18px rgba(255, 51, 102, 0.4);
}

.action-btn.btn-cruise {
  background: linear-gradient(135deg, #00c48c 0%, #00b4d8 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(0, 196, 140, 0.28);
}

.action-btn.btn-cruise:hover {
  box-shadow: 0 6px 18px rgba(0, 196, 140, 0.38);
}

.action-btn.btn-cruise.playing {
  background: linear-gradient(135deg, #ff3366, #ff8c00);
  border-color: transparent;
  animation: dopamine-pulse 1.4s infinite;
}

@keyframes dopamine-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.45); }
  50% { box-shadow: 0 0 0 10px rgba(255, 51, 102, 0); }
}

.rate-select {
  padding: 0.48rem 0.75rem;
  border: 2px solid #e2e8f5;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 800;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: var(--smooth-transition);
}

.rate-select:focus {
  border-color: #3a86ff;
}

/* 學習進度條 (彩虹多巴胺能量條) */
.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.88rem;
  font-weight: 800;
  color: #475569;
  width: 100%;
  padding-top: 0.25rem;
}

.progress-track {
  flex: 1;
  height: 12px;
  background: #e9efff;
  border-radius: var(--radius-pill);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
  border: 1px solid #dce5ff;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff3366 0%, #ff8c00 25%, #ffb703 50%, #00c48c 75%, #3a86ff 100%);
  background-size: 200% 100%;
  width: 0%;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: rainbow-shift 3s ease infinite;
}

@keyframes rainbow-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#progress-text {
  background: #eef2ff;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  color: #3a86ff;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* =========================================================
   3. 名言佳句 (Quote Banner) - 多巴胺陽光風
   ========================================================= */
.quote-banner {
  background: linear-gradient(135deg, #fffbeb 0%, #fff1f2 100%);
  border: 2px solid #fed7aa;
  border-radius: var(--radius-md);
  padding: 1.15rem 1.4rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: 0 6px 18px rgba(255, 140, 0, 0.08);
}

.quote-content {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.quote-icon {
  font-size: 1.8rem;
  line-height: 1;
  background: #ffedd5;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid #fdba74;
}

.quote-en {
  font-size: 1.05rem;
  font-weight: 800;
  color: #9a3412;
  letter-spacing: -0.01em;
}

.quote-zh {
  font-size: 0.9rem;
  color: #c2410c;
  font-weight: 600;
  margin-top: 3px;
}

.quote-speak-btn {
  background: #ffffff;
  border: 2px solid #fdba74;
  color: #c2410c;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--bounce-transition);
  font-family: inherit;
  white-space: nowrap;
}

.quote-speak-btn:hover {
  background: #ffedd5;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(253, 186, 116, 0.35);
}

/* =========================================================
   4. 單字網格與卡片設計 (Vocab Card - Ultra Clear & Playful)
   ========================================================= */
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 1.4rem;
}

@media (max-width: 680px) {
  .vocab-grid {
    grid-template-columns: 1fr;
  }
}

.word-card {
  background: var(--bg-card);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  transition: var(--bounce-transition);
  position: relative;
  overflow: hidden;
}

.word-card:hover {
  transform: translateY(-4px) scale(1.008);
  box-shadow: var(--shadow-lg);
  border-color: #c7d7fe;
}

.word-card.speaking {
  border-color: #3a86ff;
  box-shadow: 0 0 0 4px rgba(58, 134, 255, 0.2), var(--shadow-pop);
  background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
}

.word-card.mastered {
  border-color: #86efac;
  background: linear-gradient(180deg, #fafffc 0%, #ffffff 100%);
}

.word-card.mastered::after {
  content: "MASTERED ✓";
  position: absolute;
  top: 8px;
  right: -32px;
  background: #10b981;
  color: white;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 2px 30px;
  transform: rotate(45deg);
  letter-spacing: 0.05em;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

/* 卡片頂部欄 */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 0.65rem;
}

.card-index {
  font-size: 0.8rem;
  font-weight: 900;
  color: #6366f1;
  background: #eef2ff;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
  border: 1px solid #e0e7ff;
}

.card-actions-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  font-size: 1.15rem;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--bounce-transition);
}

.icon-btn:hover {
  background: #f1f5f9;
  transform: scale(1.15);
  color: #1e293b;
}

.icon-btn.star-btn.active {
  background: #fffbeb;
  border-color: #fde68a;
  color: #f59e0b;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.icon-btn.check-btn.active {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #10b981;
  font-weight: 900;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* 單字標題主要行 (超清晰字體) */
.word-main-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.word-spelling {
  font-size: 1.7rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

/* 音節拆分與重音視覺標記 (Syllable Breakdown Styles) */
.s-stress {
  color: #ef4444; /* 重音一律紅色標記，刺激大腦視覺 */
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2.5px;
}

.s-normal {
  color: #2563eb; /* 其餘音節活力藍，對比清晰 */
  font-weight: 800;
}

.s-single {
  color: #0f172a; /* 單音節單字深墨黑，清晰易讀 */
  font-weight: 900;
}

.s-dot {
  color: #cbd5e1;
  font-weight: 700;
  margin: 0 1.5px;
  user-select: none;
}

.word-phonetic {
  font-family: 'Outfit', 'Lucida Sans Unicode', sans-serif;
  color: #64748b;
  font-size: 1.05rem;
  font-weight: 600;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
}

/* 多巴胺糖果詞性標籤 (POS Candy Badges) */
.pos-tag {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
}

.pos-tag.pos-動 {
  background: #ffe4ec;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

.pos-tag.pos-名 {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.pos-tag.pos-形 {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.pos-tag.pos-副 {
  background: #f3e8ff;
  color: #9333ea;
  border: 1px solid #e9d5ff;
}

.pos-tag.pos-介 {
  background: #e6faf2;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.pos-tag.pos-連 {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.pos-tag.pos-代 {
  background: #fdf2f8;
  color: #db2777;
  border: 1px solid #fbcfe8;
}

/* 發音小按鈕 */
.speak-btn {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #2563eb;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--bounce-transition);
  font-family: inherit;
}

.speak-btn:hover {
  background: #3a86ff;
  color: white;
  border-color: #3a86ff;
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 10px rgba(58, 134, 255, 0.25);
}

.speak-btn:active {
  transform: scale(0.95);
}

/* 中文釋義 (大字高對比清晰) */
.word-chinese {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e293b;
  margin-top: -2px;
  line-height: 1.4;
}

.word-inflection {
  font-size: 0.82rem;
  color: #db2777;
  font-weight: 800;
  background: #fff1f5;
  border: 1px solid #ffd0de;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 例句卡片區塊 */
.example-box {
  background: #f8faff;
  border-left: 4px solid #3a86ff;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border-top: 1px solid #edf2f7;
  border-right: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
}

.example-en-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.example-en {
  font-size: 1.02rem;
  color: #1e293b;
  line-height: 1.55;
  flex: 1;
  font-weight: 600;
}

.example-zh {
  font-size: 0.9rem;
  color: #475569;
  font-weight: 500;
  line-height: 1.4;
}

.ex-speak-btn {
  padding: 3px 8px;
  font-size: 0.85rem;
  border-radius: 8px;
}

/* =========================================================
   5. 多巴胺互動空格 (Blank Slots - 超可愛彈跳特效)
   ========================================================= */
.blank-slot {
  display: inline-block;
  min-width: 58px;
  padding: 2px 10px;
  margin: 0 3px;
  border-radius: var(--radius-xs);
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  transition: var(--bounce-transition);
  position: relative;
  user-select: none;
  font-family: inherit;
}

/* 隱藏/遮蔽狀態：亮黃色虛線多巴胺糖果盒 */
.blank-slot.hidden-slot {
  background-color: #fff8cc;
  color: transparent;
  border: 2px dashed #f59e0b;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}

.blank-slot.hidden-slot::after {
  content: "❓ 點我";
  color: #b45309;
  font-size: 0.85rem;
  font-weight: 800;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.blank-slot.hidden-slot:hover {
  background-color: #ffea79;
  border-color: #d97706;
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.3);
}

/* 揭曉/顯示狀態：草莓甜心糖果特效 */
.blank-slot.revealed-slot {
  background-color: #ffe4ec;
  color: #be123c;
  border: 2px solid #f43f5e;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.22);
  animation: pop-bounce 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.blank-slot.revealed-slot:hover {
  transform: scale(1.04);
}

@keyframes pop-bounce {
  0% { transform: scale(0.85); opacity: 0.7; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* 延伸相關字 */
.related-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-top: 2px dashed #e2e8f0;
  padding-top: 0.65rem;
  font-size: 0.85rem;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #475569;
  flex-wrap: wrap;
}

.related-star {
  color: #ff3366;
  font-weight: 900;
}

.related-word-text {
  font-weight: 800;
  color: #1e1b4b;
  cursor: pointer;
  transition: var(--smooth-transition);
}

.related-word-text:hover {
  color: #ff3366;
  text-decoration: underline;
}

/* =========================================================
   6. 自我測驗 Modal 彈窗 (Arcade Quiz Game Style)
   ========================================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modal-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 3px solid #e0e7ff;
}

@keyframes modal-pop {
  0% { transform: scale(0.88) translateY(30px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  background: linear-gradient(135deg, #ff3366 0%, #ff8c00 100%);
  padding: 1.15rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--smooth-transition);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: rotate(90deg);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.quiz-question-box {
  background: #f5f8ff;
  border: 2px solid #dbe4ff;
  border-radius: var(--radius-md);
  padding: 1.4rem;
  text-align: center;
}

.quiz-q-type {
  font-size: 0.84rem;
  color: #6366f1;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.quiz-q-word {
  font-size: 2rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.quiz-q-phonetic {
  color: #64748b;
  font-size: 1.05rem;
  margin-top: 3px;
  font-weight: 600;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-opt-btn {
  background: #ffffff;
  border: 2.5px solid #e2e8f5;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  text-align: left;
  cursor: pointer;
  transition: var(--bounce-transition);
  font-family: inherit;
}

.quiz-opt-btn:hover {
  border-color: #3a86ff;
  background: #f0f5ff;
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 4px 12px rgba(58, 134, 255, 0.15);
}

.quiz-opt-btn.correct {
  border-color: #00c48c;
  background: #e6faf2;
  color: #065f46;
  box-shadow: 0 4px 14px rgba(0, 196, 140, 0.25);
  animation: pop-bounce 0.3s;
}

.quiz-opt-btn.wrong {
  border-color: #ff3366;
  background: #fff0f3;
  color: #9f1239;
  animation: shake 0.35s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.quiz-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.5rem;
}

/* =========================================================
   7. 減法自學秘笈專區 (Guide Section - Dopamine Style)
   ========================================================= */
.btn-guide-tab.active {
  background: linear-gradient(135deg, #8338ec 0%, #ff3366 100%);
  box-shadow: 0 6px 16px rgba(131, 56, 236, 0.35);
}

.guide-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 2rem;
  animation: modal-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 精神 Hero Banner */
.guide-hero-banner {
  background: linear-gradient(135deg, #ffffff 0%, #fff8eb 60%, #fff0f5 100%);
  border: 3px solid #ffd6a5;
  border-radius: var(--radius-lg);
  padding: 2.2rem 2rem;
  box-shadow: 0 12px 32px rgba(255, 140, 0, 0.12);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.guide-hero-banner::after {
  content: "💡";
  position: absolute;
  right: 20px;
  bottom: -15px;
  font-size: 8rem;
  opacity: 0.12;
  pointer-events: none;
  transform: rotate(-15deg);
}

.guide-hero-badge {
  background: #ffeed9;
  border: 1.5px solid #fdba74;
  color: #ea580c;
  font-size: 0.88rem;
  font-weight: 900;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
}

.guide-hero-title {
  font-size: 1.85rem;
  font-weight: 900;
  color: #1e1b4b;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.guide-hero-desc {
  font-size: 1.05rem;
  color: #475569;
  font-weight: 600;
  line-height: 1.65;
  max-width: 900px;
}

.guide-hero-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* 四大模組網格 */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
}

.guide-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.7rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border: 2.5px solid var(--border-card);
  transition: var(--bounce-transition);
  position: relative;
}

.guide-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.guide-card.card-pink {
  border-color: #ffd0de;
  background: linear-gradient(180deg, #fff9fb 0%, #ffffff 100%);
}

.guide-card.card-blue {
  border-color: #cce3fe;
  background: linear-gradient(180deg, #f7faff 0%, #ffffff 100%);
}

.guide-card.card-yellow {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffef5 0%, #ffffff 100%);
}

.guide-card.card-mint {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f6fdf9 0%, #ffffff 100%);
}

.guide-card-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  border-bottom: 2px dashed #f1f5f9;
  padding-bottom: 0.9rem;
}

.guide-card-icon {
  font-size: 2rem;
  background: #f8fafc;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.guide-pill {
  font-size: 0.76rem;
  font-weight: 900;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  display: inline-block;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.pill-pink { background: #ffe4ec; color: #e11d48; }
.pill-blue { background: #e0f2fe; color: #0284c7; }
.pill-yellow { background: #fef3c7; color: #d97706; }
.pill-mint { background: #e6faf2; color: #059669; }

.guide-card-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: #1e1b4b;
}

.guide-card-body {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.guide-point {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.point-icon {
  font-size: 1.35rem;
  line-height: 1.2;
  flex-shrink: 0;
  margin-top: 2px;
}

.point-content h4 {
  font-size: 1.02rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 3px;
}

.point-content p {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.55;
  font-weight: 600;
}

.point-content code {
  background: #f1f5f9;
  color: #db2777;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 800;
}

/* 分級進度標籤 */
.level-badge-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.level-badge {
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
}

.level-a {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1.5px solid #d8b4fe;
}

.level-c {
  background: #fef3c7;
  color: #92400e;
  border: 1.5px solid #fcd34d;
}

.level-c-minus {
  background: #ffe4e6;
  color: #9f1239;
  border: 1.5px solid #fda4af;
}

/* 便利貼線上模擬體驗區 */
.sticky-demo-section {
  background: #ffffff;
  border: 3px solid #fed7aa;
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sticky-demo-header h3 {
  font-size: 1.35rem;
  font-weight: 900;
  color: #1e1b4b;
  margin-top: 4px;
}

.sticky-demo-header p {
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 2px;
}

.sticky-demo-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.sticky-note-card {
  position: relative;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  min-height: 160px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sticky-note-content {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.demo-q-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #6366f1;
}

.demo-spelling {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.syllable-red {
  color: #ef4444;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.syllable-blue {
  color: #3b82f6;
}

.demo-meta {
  font-size: 0.92rem;
  color: #475569;
  font-weight: 700;
}

.demo-sentence {
  font-size: 0.95rem;
  color: #1e293b;
  font-weight: 600;
  margin-top: 4px;
}

/* 便利貼紙張 (可點擊翻開) */
.sticky-paper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #fff59d 0%, #ffeb3b 100%);
  box-shadow: 0 8px 20px rgba(234, 179, 8, 0.35);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  user-select: none;
  transform-origin: top left;
  z-index: 10;
}

.sticky-paper:hover {
  transform: rotate(-1deg) scale(1.02);
}

.sticky-paper.flipped {
  transform: translateY(-85%) rotate(-8deg) scale(0.92);
  opacity: 0.25;
}

.sticky-tape {
  position: absolute;
  top: -6px;
  width: 70px;
  height: 20px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transform: rotate(-3deg);
}

.sticky-text {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #78350f;
  font-size: 0.95rem;
}

.sticky-icon {
  font-size: 1.5rem;
}

/* 底部 CTA 橫幅 */
.guide-cta-bar {
  background: linear-gradient(135deg, #1e1b4b 0%, #3a86ff 100%);
  border-radius: var(--radius-lg);
  padding: 1.8rem 2rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  box-shadow: 0 12px 30px rgba(58, 134, 255, 0.25);
}

.cta-text h4 {
  font-size: 1.35rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.cta-text p {
  font-size: 0.95rem;
  color: #e0e7ff;
  font-weight: 600;
}

.cta-btns {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* =========================================================
   8. 頁尾 (Footer)
   ========================================================= */
.footer {
  margin-top: auto;
  background: #ffffff;
  border-top: 2px solid var(--border-subtle);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.footer a {
  color: #ff3366;
  text-decoration: none;
  font-weight: 800;
}
