/* ==========================================================
   Shenzhen English Talk Show - Mobile App Stylesheet
   Modern, App-like, Immersive & Educational Experience
   ========================================================== */

:root {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #10b981;
  --primary-subtle: #ecfdf5;
  --primary-border: #a7f3d0;
  
  --secondary: #0284c7;
  --secondary-subtle: #f0f9ff;
  
  --accent-amber: #f59e0b;
  --accent-amber-subtle: #fffbeb;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;
  
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;
  
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;
  
  --safe-bottom: env(safe-area-inset-bottom, 16px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Modal open: lock background scroll on parent container */
html.modal-open {
  overflow: hidden !important;
}

body.modal-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden !important;
  overscroll-behavior: contain;
}

/* App container adapts to all screen sizes: Mobile, Tablet, PC */
#app-root {
  width: 100%;
  min-height: 100vh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: calc(76px + var(--safe-bottom));
}

/* ==========================================================
   Top Header Bar
   ========================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: calc(10px + var(--safe-top)) 16px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .app-header {
    padding: calc(14px + var(--safe-top)) 36px 14px 36px;
  }
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-title-box {
  display: flex;
  flex-direction: column;
}

.header-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

@media (min-width: 768px) {
  .header-title {
    font-size: 20px;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
}

.icon-btn:active {
  transform: scale(0.92);
  background: var(--bg-subtle);
}

.grade-pill-select {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--primary-subtle);
  color: var(--primary-dark);
  border-radius: var(--radius-full);
  border: 1px solid var(--primary-border);
  cursor: pointer;
}

/* ==========================================================
   Content Views & Tab Navigation
   ========================================================== */
.view-container {
  display: none;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  animation: fadeIn 0.25s ease-out;
}

@media (min-width: 768px) {
  .view-container {
    padding: 24px 32px;
  }
}

.view-container.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   VIEW 1: EXPLORE / HOME
   ========================================================== */
.home-hero-card {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 45%, #0d9488 100%);
  border-radius: var(--radius-xl);
  padding: 24px 20px 20px 20px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 28px -6px rgba(5, 150, 105, 0.35);
  margin-bottom: 20px;
}

.hero-glow {
  position: absolute;
  top: -30%;
  right: -20%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.hero-super-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-main-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.hero-english-sub {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
  line-height: 1.4;
  margin-bottom: 16px;
}

/* Homepage Feature Tags (TAS) */
.hero-tas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

@media (min-width: 640px) {
  .hero-tas-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

@media (min-width: 1024px) {
  .hero-tas-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.tas-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(4px);
}

.tas-pill .tas-icon {
  font-size: 13px;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 20px 0 12px 0;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* 5 Topic Portal Cards */
.topics-portal-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (min-width: 640px) {
  .topics-portal-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .topic-portal-card {
    height: 225px;
  }
}

@media (min-width: 1024px) {
  .topics-portal-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .topic-portal-card {
    height: 245px;
  }
}

.topic-portal-card {
  position: relative;
  height: 200px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 20px 16px;
}

.topic-portal-card:active {
  transform: scale(0.98);
}

.topic-portal-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: transform 0.4s ease;
}

.topic-portal-card:hover .topic-portal-bg {
  transform: scale(1.05);
}

.topic-portal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.42) 50%, rgba(15, 23, 42, 0.92) 100%);
}

.topic-portal-content {
  position: relative;
  z-index: 3;
  color: #ffffff;
}

.topic-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.topic-num-badge {
  font-size: 11px;
  font-weight: 800;
  background: var(--primary);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.topic-portal-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
}

.topic-portal-en {
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0.9;
  margin-top: 2px;
}

.topic-portal-desc {
  font-size: 11.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
  margin-top: 10px;
  margin-bottom: 6px;
  font-style: italic;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topic-portal-meta {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 11.5px;
  opacity: 0.85;
}

/* ==========================================================
   Topic Detail Modal / View
   ========================================================== */
.topic-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: flex-end;
}

.topic-detail-overlay.active {
  display: flex;
}

.topic-detail-sheet {
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 28px 28px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
  .topic-detail-overlay {
    align-items: center;
    padding: 24px;
  }
  .topic-detail-sheet {
    max-width: 840px;
    max-height: 86vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: zoomModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.detail-header-hero {
  position: relative;
  min-height: 165px;
  background: #0f172a;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  color: #ffffff;
}

.detail-header-hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.5) 45%, rgba(15, 23, 42, 0.9) 100%);
  z-index: 1;
  pointer-events: none;
}

.detail-topic-quote {
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.95);
  margin-top: 6px;
  margin-bottom: 2px;
  font-style: italic;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  max-width: 90%;
}

.detail-hero-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}

.detail-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  font-size: 16px;
}

.detail-nav-tabs {
  display: flex;
  background: var(--bg-subtle);
  padding: 4px;
  overflow-x: auto;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-color);
  gap: 4px;
}

.detail-nav-btn {
  flex: 1;
  min-width: 72px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
}

.detail-nav-btn.active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.detail-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* ==========================================================
   VIEW 2: FLASHCARDS (背词卡与词汇全览)
   ========================================================== */
.fc-filter-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

/* Mode Switcher Bar in Vocabulary (闪卡 vs 列表) */
.fc-top-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 10px;
  flex-wrap: wrap;
}

.fc-view-mode-toggle {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.fc-vmode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.fc-vmode-btn.active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.fc-cards-counter-row {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

/* ==========================================================
   Classic Word List Mode (原版结构化词表模式)
   ========================================================== */
.fc-classic-list-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto 30px auto;
}

.orig-grp {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  margin-bottom: 16px;
}

.orig-grp-h {
  position: sticky;
  top: calc(52px + var(--safe-top, 0px));
  z-index: 20;
  background: rgba(248, 250, 252, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

@media (min-width: 768px) {
  .orig-grp-h {
    top: calc(58px + var(--safe-top, 0px));
  }
}

.orig-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  display: block;
}

.orig-grp-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.orig-grp-count {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.orig-words-list {
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.orig-w-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: background 0.15s;
  border-bottom: 1px solid #f1f5f9;
}

.orig-w-card:last-child {
  border-bottom: none;
}

.orig-w-card:hover {
  background: #f8fafc;
}

.orig-spk-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  color: var(--primary-dark);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s;
}

.orig-spk-btn:active {
  transform: scale(0.9);
}

.orig-spk-btn.playing {
  background: var(--primary);
  color: #ffffff;
  animation: audioPulse 1s infinite alternate;
}

.orig-word-main {
  flex: 1;
  min-width: 0;
}

.orig-word-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.orig-en {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  transition: color 0.15s;
}

.orig-en:hover {
  color: var(--primary);
}

.orig-ipa {
  font-size: 12.5px;
  color: var(--text-muted);
  font-family: "Lucida Sans Unicode", "Segoe UI", sans-serif;
}

.orig-cn {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary-dark);
}

.orig-ex {
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
  margin-top: 3px;
}

.orig-ex b {
  color: var(--primary-dark);
  font-weight: 700;
}

.orig-star-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #cbd5e1;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.orig-star-btn:active {
  transform: scale(1.2);
}

.orig-star-btn.starred {
  color: #f59e0b;
}

@media (min-width: 768px) {
  .orig-w-card {
    padding: 12px 16px;
    align-items: center;
  }
  .orig-en {
    font-size: 16.5px;
    min-width: 140px;
  }
  .orig-ipa {
    font-size: 13.5px;
    min-width: 100px;
  }
  .orig-cn {
    font-size: 14px;
    min-width: 90px;
  }
  .orig-ex {
    margin-top: 0;
  }
}

.topic-selector-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.topic-selector-tabs::-webkit-scrollbar {
  display: none;
}

.t-select-btn {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: #ffffff;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
}

.t-select-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Group selection pills */
.group-selector-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.group-selector-scroll::-webkit-scrollbar {
  display: none;
}

.grp-pill {
  padding: 4px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
}

.grp-pill.active {
  background: var(--primary-subtle);
  color: var(--primary-dark);
  border-color: var(--primary-border);
}

/* Flashcard Progress Bar & Counter */
.fc-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.fc-counter-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.1);
  transition: transform 0.15s ease, background 0.15s, box-shadow 0.15s;
}

.fc-counter-badge:hover {
  background: #d1fae5;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.2);
  transform: translateY(-1px);
}

.fc-counter-badge:active,
.fc-counter-badge.pressing {
  transform: scale(0.92);
  background: #a7f3d0;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.25);
}

.fc-counter-scrub-icon {
  font-size: 11px;
  color: var(--accent-amber);
}

.fc-mode-toggles {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fc-mode-btn {
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #fff;
  cursor: pointer;
}

.fc-mode-btn.active {
  background: var(--accent-amber-subtle);
  border-color: var(--accent-amber);
  color: #b45309;
}

/* 3D Flip Card Container */
.fc-card-stage {
  perspective: 1200px;
  width: 100%;
  height: 380px;
  margin-bottom: 16px;
}

.fc-card-flipper {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.fc-card-flipper.flipped {
  transform: rotateY(180deg);
}

.fc-card-front, .fc-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-xl);
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.fc-card-back {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* Pure Typography Flashcard Layout (专注大字纯净卡，杜绝乱图干扰) */
.fc-pure-card {
  padding: 22px 20px;
  border-radius: 24px;
  box-shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.06), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
  border: 1.5px solid #f1f5f9;
  background: #ffffff;
}

.fc-card-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 8px;
  z-index: 5;
}

.fc-group-tag {
  font-size: 12px;
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid #a7f3d0;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-star-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: #94a3b8;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}

.fc-star-btn:active {
  transform: scale(0.92);
}

.fc-star-btn.starred {
  color: #eab308;
  background: #fefce8;
  border-color: #fde047;
  transform: scale(1.05);
}

/* Front Card Hero Layout */
.fc-hero-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 0;
}

.fc-word-text {
  font-size: 34px;
  font-weight: 850;
  color: #0f172a;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin: 0 0 10px 0;
  word-break: break-word;
  text-wrap: balance;
  cursor: pointer;
  transition: color 0.2s, transform 0.15s;
}

.fc-word-text:hover,
.fc-word-text:active {
  color: #059669;
  transform: scale(0.98);
}

.fc-ipa-wrap {
  margin-bottom: 22px;
}

.fc-ipa-text {
  font-size: 16px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-family: "Lucida Sans Unicode", "Segoe UI", sans-serif;
  letter-spacing: 0.5px;
}

.fc-audio-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border: none;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.28);
  transition: all 0.2s;
}

.fc-audio-pill:active {
  transform: scale(0.96);
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.2);
}

.fc-audio-pill.playing {
  animation: audioPulse 1s infinite alternate;
  background: #047857;
}

@keyframes audioPulse {
  from { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5); }
  to { box-shadow: 0 0 0 12px rgba(5, 150, 105, 0); }
}

.fc-tap-prompt {
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  margin-top: auto;
}

/* Back Card Layout */
.fc-back-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 0;
}

.fc-meaning-section {
  text-align: center;
  margin-bottom: 18px;
}

.fc-meaning-en-hint {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.fc-back-meaning {
  font-size: 30px;
  font-weight: 850;
  color: #0f172a;
  line-height: 1.2;
  margin: 0;
}

.fc-back-example-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  text-align: left;
}

.fc-ex-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.fc-ex-tag {
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fc-ex-play-link {
  font-size: 11.5px;
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}

.fc-ex-play-link:active {
  background: #059669;
  color: #ffffff;
}

.fc-back-ex-en {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.5;
  margin-bottom: 4px;
}

.fc-back-ex-cn {
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

/* Card Control Buttons */
.fc-controls-row {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 10px;
}

.fc-ctrl-btn {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #ffffff;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

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

.fc-ctrl-btn.primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

/* ==========================================================
   VIEW 3: SHADOWING (跟读范文)
   ========================================================== */
.speech-select-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 14px;
}

.speech-picker-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.speech-chip {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.speech-chip.active {
  background: var(--secondary);
  color: #ffffff;
  border-color: var(--secondary);
}

/* Shadowing Player Modal / Immersive Box */
.shadow-player-box {
  position: sticky;
  top: 56px;
  z-index: 30;
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  color: #ffffff;
  margin-bottom: 16px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.shadow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.shadow-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.shadow-title-text {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.95;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.shadow-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.shadow-btn-zh {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.shadow-btn-zh:hover {
  background: rgba(255, 255, 255, 0.25);
}

.shadow-btn-zh.active {
  background: #10b981;
  border-color: #059669;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.shadow-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
}

.shadow-text-area {
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.shadow-current-text {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 4px;
  min-height: 48px;
  color: #ffffff;
  transition: opacity 0.18s ease;
}

.shadow-current-cn {
  font-size: 13px;
  color: #93c5fd;
  line-height: 1.4;
  min-height: 30px;
  transition: opacity 0.18s ease;
}

.shadow-current-cn.hidden {
  display: none;
}

/* Reserved fixed-height slot for repeat countdown so layout never jumps */
.shadow-indicator-slot {
  height: 34px;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.shadow-repeat-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.3);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.shadow-repeat-indicator.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  animation: glowPulse 1.2s infinite alternate;
}

@keyframes glowPulse {
  from { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4); }
  to { box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
}

.shadow-player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: 8px;
  flex-wrap: wrap;
}

.shadow-ctrl-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shadow-ctrl-btn {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.shadow-ctrl-btn.full-btn {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

.shadow-ctrl-btn.full-btn:hover {
  filter: brightness(1.1);
}

.shadow-ctrl-btn.shadow-btn {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.shadow-ctrl-btn.shadow-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.shadow-ctrl-btn.playing {
  background: #f59e0b !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5) !important;
}

/* Full Chinese Translation Card */
.speech-full-zh-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
}

.speech-full-zh-card.hidden {
  display: none;
}

.speech-full-zh-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 6px;
}

.speech-full-zh-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.speech-full-zh-hint {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.speech-full-zh-content {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-main);
  text-align: justify;
}

.speed-toggle-btn {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  cursor: pointer;
}

.shadow-play-master-btn {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Sentence List */
.sentence-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sentence-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all 0.2s;
}

.sentence-card.active {
  border-color: var(--secondary);
  background: var(--secondary-subtle);
}

.sentence-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  margin-top: 2px;
  min-width: 18px;
}

.sentence-content {
  flex: 1;
}

.sentence-en {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 4px;
}

.sentence-cn {
  font-size: 12.5px;
  color: var(--text-muted);
}

.sentence-audio-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--secondary);
}

.sentence-audio-btn.playing {
  background: var(--secondary);
  color: #ffffff;
}

/* ==========================================================
   VIEW 4: TOOLBOX (工具箱)
   ========================================================== */
.toolbox-tabs {
  display: flex;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.toolbox-tab-btn {
  flex: 1;
  text-align: center;
  padding: 8px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.toolbox-tab-btn.active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.search-input-box {
  position: relative;
  margin-bottom: 14px;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 14px;
  outline: none;
  background: #ffffff;
}

.search-input:focus {
  border-color: var(--primary);
}

.search-icon-inside {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 15px;
}

.proper-nouns-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.proper-noun-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
}

.proper-noun-en {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.proper-noun-cn {
  font-size: 12px;
  color: var(--text-muted);
}

.pitfall-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
}

.pitfall-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-rose);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pitfall-wrong {
  color: #dc2626;
  font-size: 13px;
  margin-bottom: 4px;
}

.pitfall-right {
  color: #16a34a;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.pitfall-tip {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================
   VIEW 5: CHECK-IN & RUBRIC (打卡)
   ========================================================== */
.streak-hero-card {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: var(--radius-lg);
  padding: 18px;
  color: #ffffff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.streak-count {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.checkin-btn {
  padding: 8px 18px;
  background: #ffffff;
  color: #b45309;
  border: none;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.checkin-btn.checked {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.timeline-step-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.step-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.step-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
}

.step-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  border-radius: 4px;
  cursor: pointer;
}

/* ==========================================================
   Toolbox & Check-in Shared Component Styles
   ========================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.card h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card .tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

ul.clean {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

ul.clean li {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-main);
  padding-left: 14px;
  position: relative;
}

ul.clean li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

ul.clean li em {
  font-style: normal;
  color: var(--secondary);
  font-weight: 600;
  background: var(--secondary-subtle);
  padding: 1px 4px;
  border-radius: 4px;
}

.tb {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 10px;
}

.tb th, .tb td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  vertical-align: top;
}

.tb th {
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-muted);
  font-size: 12px;
}

.tb td.en {
  font-family: inherit;
  font-weight: 600;
  color: var(--primary-dark);
}

.tip {
  background: var(--accent-amber-subtle);
  border: 1px solid #fef3c7;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 12.5px;
  color: #92400e;
  line-height: 1.5;
  margin-top: 14px;
}

/* Check-in Checklist Styling */
.chk {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.weekhead {
  font-size: 14px;
  font-weight: 800;
  color: var(--secondary);
  margin: 16px 0 6px 0;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--secondary-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chk label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-main);
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  transition: background 0.15s;
}

.chk label:hover {
  background: #e2e8f0;
}

.chk label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

.chk label span {
  flex: 1;
  line-height: 1.4;
}

/* Bottom Navigation Bar */
.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  padding: 6px 8px calc(6px + var(--safe-bottom)) 8px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 90;
  transition: all 0.25s ease;
}

@media (min-width: 768px) {
  .app-bottom-nav {
    max-width: 680px;
    bottom: 20px;
    border-radius: var(--radius-full);
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
    padding: 8px 24px calc(8px + env(safe-area-inset-bottom, 0px)) 24px;
  }
  .nav-tab-item {
    flex-direction: row;
    gap: 8px;
    padding: 8px 18px;
  }
  .nav-tab-item .nav-icon {
    font-size: 19px;
  }
  .nav-tab-item .nav-label {
    font-size: 13.5px;
    font-weight: 700;
  }
}

.nav-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.18s;
  flex: 1;
}

.nav-tab-item .nav-icon {
  font-size: 20px;
  line-height: 1;
}

.nav-tab-item .nav-label {
  font-size: 11px;
  font-weight: 600;
}

.nav-tab-item.active {
  color: var(--primary);
}

.nav-tab-item.active .nav-icon {
  transform: scale(1.1);
}

/* ==========================================================
   Home Guide Banner (备赛必读入口)
   ========================================================== */
.home-guide-banner {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #fde68a;
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.12);
  transition: transform 0.18s, box-shadow 0.18s;
}

.home-guide-banner:active {
  transform: scale(0.98);
}

.guide-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-banner-icon {
  font-size: 24px;
}

.guide-banner-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 6px;
}

.guide-banner-badge {
  font-size: 10px;
  font-weight: 700;
  background: #f59e0b;
  color: #fff;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.guide-banner-sub {
  font-size: 11.5px;
  color: #b45309;
  margin-top: 1px;
}

.guide-banner-arrow {
  color: #d97706;
  font-weight: bold;
  font-size: 14px;
}

/* ==========================================================
   Guide Modal Styles
   ========================================================== */
.guide-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: flex-end;
}

.guide-modal-overlay.active {
  display: flex;
}

.guide-modal-sheet {
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  background: #ffffff;
  border-radius: 26px 26px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
  .guide-modal-overlay {
    align-items: center;
    padding: 24px;
  }
  .guide-modal-sheet {
    max-width: 820px;
    max-height: 85vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: zoomModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

.guide-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
}

.guide-tab-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
}

.guide-tab-nav::-webkit-scrollbar {
  display: none;
}

.guide-tab-btn {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
}

.guide-tab-btn.active {
  background: #f59e0b;
  color: #ffffff;
  border-color: #f59e0b;
}

.guide-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* ==========================================================
   Global Search Modal Styles
   ========================================================== */
.search-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  z-index: 150;
  display: none;
  justify-content: center;
}

.search-modal-overlay.active {
  display: flex;
}

.search-modal-sheet {
  width: 100%;
  max-width: 600px;
  height: 100vh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.2s ease-out;
}

@media (min-width: 768px) {
  .search-modal-overlay {
    align-items: center;
    padding: 24px;
  }
  .search-modal-sheet {
    max-width: 740px;
    height: auto;
    max-height: 85vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    animation: zoomModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

.search-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px 16px;
  background: #ffffff;
}

.search-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  gap: 8px;
  border: 1.5px solid transparent;
  transition: border-color 0.2s;
}

.search-bar-wrap:focus-within {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.search-lens-icon {
  font-size: 15px;
  color: var(--text-light);
}

.search-bar-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  outline: none;
  color: var(--text-main);
}

.search-clear-btn {
  background: #cbd5e1;
  border: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-cancel-btn {
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
  cursor: pointer;
  white-space: nowrap;
}

.search-filter-row {
  display: flex;
  gap: 6px;
  padding: 0 16px 10px 16px;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
}

.search-filter-chip {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.search-filter-chip.active {
  background: var(--primary-subtle);
  color: var(--primary-dark);
  border-color: var(--primary-border);
}

.search-results-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-empty-state {
  text-align: center;
  padding: 60px 20px;
}

.search-result-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.search-result-card:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

.res-tag-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 3px;
  display: inline-block;
}

.res-tag-badge.badge-word {
  background: var(--primary-subtle);
  color: var(--primary-dark);
}

.res-tag-badge.badge-speech {
  background: var(--secondary-subtle);
  color: var(--secondary);
}

.res-tag-badge.badge-proper {
  background: #fff7ed;
  color: #ea580c;
}

.search-hl {
  background: #fef08a;
  color: #854d0e;
  font-weight: 700;
  padding: 0 2px;
  border-radius: 2px;
}

/* ==========================================================
   Header Speed Pill & Modal
   ========================================================== */
.header-speed-pill {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.header-speed-pill:active {
  transform: scale(0.95);
  background: #d1fae5;
}

.speed-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 120;
  display: none;
  justify-content: center;
  align-items: flex-end;
}

.speed-modal-overlay.active {
  display: flex;
}

.speed-modal-sheet {
  width: 100%;
  max-width: 500px;
  background: #ffffff;
  border-radius: 26px 26px 0 0;
  overflow: hidden;
  padding-bottom: calc(20px + var(--safe-bottom));
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
  .speed-modal-overlay {
    align-items: center;
    padding: 24px;
  }
  .speed-modal-sheet {
    max-width: 560px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: zoomModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

.speed-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.speed-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 20px;
}

.speed-opt-btn {
  background: var(--bg-subtle);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.speed-opt-btn:active {
  transform: scale(0.97);
}

.speed-opt-btn.active {
  background: var(--primary-subtle);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
}

.speed-opt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.speed-opt-emoji {
  font-size: 24px;
}

.speed-opt-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.speed-opt-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 2px;
}

.speed-opt-tip {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Toast Message */
.toast-msg {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================
   Multi-Device Responsive System (Phone, iPad/Tablet, PC)
   不限制主体宽度，全面自适应桌面、平板与手机
   ========================================================== */

@keyframes zoomModal {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Tablet & Desktop Layout (≥768px) */
@media (min-width: 768px) {
  /* View 2: Flashcards centering & sizing */
  .fc-filter-panel {
    max-width: 720px;
    margin: 0 auto 20px auto;
  }

  .fc-card-stage {
    max-width: 600px;
    height: 420px;
    margin: 0 auto 24px auto;
  }

  .fc-pure-card {
    padding: 28px 24px;
    border-radius: 28px;
  }

  .fc-word-text {
    font-size: 40px;
  }

  .fc-back-meaning {
    font-size: 34px;
  }

  .fc-controls-row {
    max-width: 600px;
    margin: 0 auto;
    gap: 16px;
  }

  .fc-ctrl-btn {
    padding: 14px;
    font-size: 15px;
  }

  /* View 4: Toolbox - Single column on Tablet to prevent cramped layout */
  #view-toolbox {
    max-width: 820px;
    margin: 0 auto;
  }

  #toolbox-content-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  /* View 5: Check-in - Single column on Tablet for uncompressed checklists & rubric table */
  #view-checkin {
    max-width: 820px;
    margin: 0 auto;
  }

  #checkin-checklist-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
}

/* Large Tablet & Desktop Layout (≥900px) */
@media (min-width: 900px) {
  /* View 3: Shadowing Split-Screen Layout (Sticky Player + Sentence List) */
  #view-shadowing {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 32px;
    align-items: start;
  }

  #view-shadowing > .speech-select-card {
    grid-column: 1 / -1;
  }

  #view-shadowing > .shadow-player-box {
    position: sticky;
    top: 90px;
    margin-bottom: 0;
    box-shadow: 0 10px 30px rgba(5, 150, 105, 0.22);
  }

  #view-shadowing > .section-header {
    grid-column: 2;
    margin-top: 0;
  }

  #view-shadowing > #shadow-sentences-list {
    grid-column: 2;
  }
}

/* Wide Desktop Displays (≥1200px) */
@media (min-width: 1200px) {
  #view-toolbox {
    max-width: 1160px;
  }
  #toolbox-content-area {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    align-items: start;
  }
  #proper-noun-table-wrap,
  .search-input-box {
    grid-column: 1 / -1;
  }
}

/* ==========================================================
   Quick Scroll / Fast Jump Modal (背词长按快速定位)
   ========================================================== */
.quick-scroll-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 120;
  display: none;
  justify-content: center;
  align-items: flex-end;
  overscroll-behavior: contain;
}

.quick-scroll-overlay.active {
  display: flex;
}

@media (min-width: 640px) {
  .quick-scroll-overlay {
    align-items: center;
    padding: 24px;
  }
}

.quick-scroll-sheet {
  width: 100%;
  max-width: 500px;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  overflow: hidden;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .quick-scroll-sheet {
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: zoomModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

.quick-scroll-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.quick-scroll-body {
  padding: 18px 20px 24px;
  max-height: 80vh;
  overflow-y: auto;
}

.quick-preview-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
  margin-bottom: 18px;
}

.quick-preview-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.quick-preview-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary-dark);
  background: rgba(5, 150, 105, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.quick-preview-group {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.quick-preview-main {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin-bottom: 4px;
}

.quick-preview-word {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

.quick-preview-ipa {
  font-size: 13.5px;
  color: var(--primary-dark);
  font-family: var(--font-mono, monospace);
}

.quick-preview-cn {
  font-size: 14.5px;
  font-weight: 700;
  color: #334155;
}

.quick-slider-section {
  margin-bottom: 20px;
}

.quick-slider-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
}

.quick-slider-cur-bubble {
  color: var(--primary-dark);
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
}

.quick-range-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.quick-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.4);
  cursor: grab;
  transition: transform 0.1s;
}

.quick-range-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.2);
}

.quick-groups-heading {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.quick-groups-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.quick-group-chip {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.quick-group-chip:hover,
.quick-group-chip.active {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.quick-confirm-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
  transition: transform 0.15s, background-color 0.15s;
}

.quick-confirm-btn:active {
  transform: scale(0.98);
  background: var(--primary-dark);
}

/* Topic Detail Modal words tab sticky group header */
.modal-word-group {
  background: #f8fafc;
  border-radius: 12px;
  margin-bottom: 14px;
  border: 1px solid #e2e8f0;
}

.modal-word-group-h {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(248, 250, 252, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 10px 12px;
  border-radius: 12px 12px 0 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
