/* 日语学习助手 - 样式表 */
:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: #EEF2FF;
  --sakura: #F43F5E;
  --sakura-light: #FFF1F2;
  --accent: #0EA5E9;
  --accent-light: #F0F9FF;
  --success: #10B981;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --danger: #EF4444;
  --danger-light: #FEF2F2;

  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --card-bg: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --border-color: #E2E8F0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部导航与品牌 */
.app-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-main);
  text-decoration: none;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--sakura), #FB7185);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.35);
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-main);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, background 0.2s ease;
}

@keyframes pointBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); background: #FEF3C7; border-color: #F59E0B; }
  100% { transform: scale(1); }
}

.points-bump {
  animation: pointBump 0.35s ease-out;
}

/* 导航栏 Tabs */
/* 导航栏 Tabs 外层包裹与左右滚动控制 */
.nav-tabs-wrapper {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.nav-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: white;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  z-index: 10;
  transition: all 0.2s ease;
  opacity: 0.9;
}

.nav-scroll-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--bg-main);
  opacity: 1;
}

.nav-scroll-left {
  left: 4px;
}

.nav-scroll-right {
  right: 4px;
}

.nav-tabs {
  width: 100%;
  padding: 8px 36px 8px 36px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.nav-tabs::-webkit-scrollbar {
  display: none;
}
.nav-tabs::after {
  content: '';
  display: block;
  min-width: 20px;
  height: 1px;
  flex-shrink: 0;
}

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.nav-tab-btn .tab-icon {
  font-size: 1.15rem;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  min-width: 1.2rem;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

.nav-tab-btn.active {
  color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.15);
}

/* 主内容容器 */
.main-content {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
}

/* 视图切换 */
.view-panel {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}
.view-panel.active {
  display: block;
}

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

/* 筛选工具栏 */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.level-filters {
  display: flex;
  background: white;
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
}

/* 闪卡容器与 3D 翻转 */
.card-scene {
  perspective: 1200px;
  width: 100%;
  max-width: 480px;
  height: clamp(340px, 48vh, 390px);
  margin: 0 auto 16px;
  -webkit-user-select: none;
  user-select: none;
}

.flashcard {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border-radius: var(--radius-lg);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.flashcard.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-face-back {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFAFF 100%);
}

.card-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.level-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}
.badge-n5 { background: #E0E7FF; color: #4338CA; }
.badge-n4 { background: #FEF3C7; color: #B45309; }
.badge-custom { background: #FCE7F3; color: #BE185D; }

.audio-btn {
  background: var(--bg-main);
  border: 1px solid var(--border);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.2s;
}
.audio-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: scale(1.05);
}

.card-center {
  text-align: center;
  margin: auto 0;
}

.card-kanji {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-main);
  line-height: 1.2;
}

.card-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 14px;
}

.card-furigana {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.card-romaji {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-meaning {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
}

.card-example-box {
  background: var(--bg-main);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: left;
  border-left: 3px solid var(--primary);
  font-size: 0.9rem;
}
.card-example-jp {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}
.card-example-cn {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* 评级操作栏 */
.srs-action-bar {
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.rating-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.rating-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-again {
  background: var(--danger-light);
  color: var(--danger);
  border-color: #FECACA;
}
.btn-hard {
  background: var(--warning-light);
  color: var(--warning);
  border-color: #FDE68A;
}
.btn-good {
  background: var(--success-light);
  color: var(--success);
  border-color: #A7F3D0;
}
.btn-easy {
  background: var(--accent-light);
  color: var(--accent);
  border-color: #BAE6FD;
}

.shortcut-hint {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 3px;
}

/* 进度与打卡卡片 */
.progress-card {
  max-width: 480px;
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 配对游戏样式 */
.game-header {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.game-stat-box {
  text-align: center;
}
.game-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
}
.game-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.game-tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (min-width: 640px) {
  .game-tiles-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.game-tile {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  min-height: 84px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  outline: none;
}
.game-tile:hover {
  transform: translateY(-2px);
  border-color: #CBD5E1;
  box-shadow: var(--shadow-md);
}

.game-tile.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.03);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

.game-tile.matched {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  transition: all 0.3s ease-out;
}

.game-tile.mismatch {
  border-color: var(--danger);
  background: var(--danger-light);
  animation: shake 0.35s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

/* 词汇手册列表 */
.vocab-search-box {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  margin-bottom: 16px;
  background: white;
  outline: none;
}
.vocab-search-box:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.vocab-list {
  display: grid;
  gap: 10px;
}

.vocab-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s;
}
.vocab-item:hover {
  border-color: #CBD5E1;
  box-shadow: var(--shadow-sm);
}

.vocab-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.vocab-kanji {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}
.vocab-furigana {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 600;
}
.vocab-meaning {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* 弹窗与表单 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: white;
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xl);
  animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  gap: 6px;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-secondary {
  background: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: #E2E8F0;
}

/* 辅助类 */
.hidden { display: none !important; }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-sakura { color: var(--sakura); }
.text-danger { color: var(--danger); }
.text-subtle { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.text-xl { font-size: 1.25rem; }
.text-xs { font-size: 0.75rem; }
.flex-col { display: flex; flex-direction: column; }

/* 语法专区样式 */
.grammar-sub-tabs {
  display: flex;
  background: white;
  border: 1px solid var(--border);
  padding: 6px;
  border-radius: var(--radius-md);
  gap: 8px;
  margin-bottom: 16px;
  overflow: visible;
}

.grammar-sub-tab {
  flex: 1;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 8px 14px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  overflow: visible;
}

.grammar-sub-tab .subtab-icon {
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.grammar-sub-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
}

.grammar-cards-list {
  display: grid;
  gap: 16px;
}

.grammar-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.grammar-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

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

.grammar-category-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-main);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  border: 1px solid var(--border);
}

.grammar-pattern-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.grammar-meaning-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.grammar-connection-box {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.88rem;
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grammar-explanation-text {
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.6;
  margin-bottom: 16px;
}

.grammar-examples-box {
  background: var(--bg-main);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.grammar-example-item {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.grammar-example-item:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.grammar-example-jp {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
}
.grammar-example-cn {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 语法刷题样式 */
.quiz-container-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  max-width: 600px;
  margin: 0 auto;
}

.quiz-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 18px;
}

.quiz-question-box {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  line-height: 1.5;
  text-align: center;
}

.quiz-options-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.quiz-option-btn {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-main);
  outline: none;
}
.quiz-option-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(3px);
}

.quiz-option-btn.correct {
  background: var(--success-light);
  border-color: var(--success);
  color: #065F46;
  font-weight: 700;
}

.quiz-option-btn.wrong {
  background: var(--danger-light);
  border-color: var(--danger);
  color: #991B1B;
}

.quiz-explanation-box {
  background: var(--bg-main);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 18px;
  animation: fadeIn 0.25s ease-in;
}

/* 变形体验机与助词图解专属样式 */
.conj-matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 640px) {
  .conj-matrix-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.conj-matrix-item {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s;
}
.conj-matrix-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.conj-matrix-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.conj-matrix-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.2;
}

.mnemonic-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.rhyme-box {
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 10px;
}

.rhyme-text {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1E293B;
  line-height: 1.7;
  white-space: pre-line;
  margin: 6px 0;
  padding: 8px 12px;
  background: #FFFBEB;
  border-left: 3px solid #F59E0B;
  border-radius: 4px;
}

.highlight-accent {
  color: var(--sakura);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ==========================================================================
   全新升级：三国语言切换器、汉字假名注音、极速学习法视频馆与忍者文法游戏样式
   ========================================================================== */

/* 1. 语言切换选择器 */
.lang-selector-container {
  display: flex;
  align-items: center;
  gap: 4px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px 8px;
  box-shadow: var(--shadow-sm);
}

.lang-selector-select {
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  padding: 2px 4px;
}

/* 2. 闪卡正面假名注音增强样式 */
.card-furigana-hint-badge {
  display: inline-flex;
  align-items: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  border: 1px solid #C7D2FE;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.1);
  letter-spacing: 0.05em;
}

ruby {
  ruby-align: center;
}

rt {
  font-size: 0.55em;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.05em;
  user-select: none;
}

/* 3. 极速学习法与视频精选样式 */
.fast-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 14px;
}

.fast-video-card {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.fast-video-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.fast-sub-tabs {
  display: flex;
  gap: 8px;
  background: #E2E8F0;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow-x: auto;
}

.fast-sub-tab {
  flex: 1;
  padding: 8px 14px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.fast-sub-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* 4. 助词与文法忍者大作战游戏样式 */
.ninja-game-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-md);
  max-width: 640px;
  margin: 0 auto;
}

.ninja-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.ninja-lives-bar {
  font-size: 1.25rem;
  letter-spacing: 2px;
}

.ninja-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.ninja-mode-btn {
  padding: 8px 14px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.ninja-mode-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.ninja-question-panel {
  background: linear-gradient(135deg, #EEF2FF 0%, #F8FAFC 100%);
  border: 2px solid #C7D2FE;
  border-radius: var(--radius-md);
  padding: 24px 18px;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.ninja-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .ninja-options-grid {
    grid-template-columns: 1fr;
  }
}

/* 日历日期与特殊量词增强样式 */
.special-day-card {
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.day-playing-highlight {
  border: 2px solid #4F46E5 !important;
  background: #EEF2FF !important;
  transform: scale(1.03);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3) !important;
}

/* 姓氏卡片与分类按钮动效 */
.surname-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.surname-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.video-cat-btn.active, .info-cat-btn.active {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}

/* 麦克风录音与智能发音评测动效 */
@keyframes micPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.mic-recording {
  animation: micPulse 1.2s infinite ease-in-out !important;
  background: #FEE2E2 !important;
  border-color: #EF4444 !important;
  color: #B91C1C !important;
}

.speech-eval-banner-perfect {
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  border: 1px solid #6EE7B7;
  color: #065F46;
}

.speech-eval-banner-great {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border: 1px solid #93C5FD;
  color: #1E40AF;
}

.speech-eval-banner-needs-work {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1px solid #FCD34D;
  color: #92400E;
}

.speech-eval-banner-try-again {
  background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
  border: 1px solid #FCA5A5;
  color: #991B1B;
}

/* =========================================
   大家的日语: 会话气泡与避坑要点卡片样式
   ========================================= */
.minna-dialogue-header {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.minna-dialogue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.minna-dialogue-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.minna-dialogue-card.speaking-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #F8FAFF;
}

.minna-speaker-badge {
  color: white;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.minna-tips-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.minna-tip-card {
  background: white;
  border: 1px solid var(--border);
  border-left-width: 5px;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.minna-tip-card.tip-trap {
  border-left-color: #EF4444;
  background: #FEF2F2;
}

.minna-tip-card.tip-culture {
  border-left-color: #10B981;
  background: #ECFDF5;
}

.minna-tip-card.tip-grammar {
  border-left-color: #3B82F6;
  background: #EFF6FF;
}

.minna-tip-card.tip-vocab {
  border-left-color: #F59E0B;
  background: #FFFBEB;
}
