/* ===================================================================
 * 全局主题样式 - 对齐 landing.html 配色体系
 * 创建日期：2026-04-07
 * 配色方案：清新科技风（主蓝靛+紫+橙）
 * 用途：所有前端页面统一引用，保证视觉审美统一
 * =================================================================== */

:root {
  /* ========== 品牌色（v2.6: 统一为Indigo方案，与landing/promo一致） ========== */
  --primary: #6366F1;
  --primary-light: #818CF8;
  --primary-dark: #4F46E5;
  --accent: #F59E0B;
  --accent-light: #FBBF24;
  --accent-dark: #D97706;
  --success: #10B981;
  --sky: #0EA5E9;
  --rose: #F43F5E;
  --purple: #A855F7;

  /* ========== 灰度 ========== */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --font-fun: 'ZCOOL KuaiLe', 'Noto Sans SC', cursive;

  /* ========== 背景色 ========== */
  --bg-primary: #F2F7FF;
  --bg-card: #ffffff;
  --bg-soft: #F2F7FF;
  --bg-hover: #f1f5f9;

  /* ========== 文字色 ========== */
  --text-primary: #2A2A2A;
  --text-secondary: #2A2A2A;
  --text-muted: #666666;

  /* ========== 功能色映射 ========== */
  --success-soft: #E8F9F0;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --warning-soft: #FEF3C7;
  --accent-soft: #E8F3FF;

  /* ========== 阴影 ========== */
  --shadow-soft: 0 2px 10px rgba(0, 30, 80, 0.06);
  --shadow-card: 0 2px 10px rgba(0, 30, 80, 0.06);
  --shadow-data: 0 2px 10px rgba(0, 30, 80, 0.06);
  --shadow: 0 2px 10px rgba(0, 30, 80, 0.06);
  --shadow-small: 0 2px 8px rgba(0, 30, 80, 0.05);
  --shadow-medium: 0 2px 10px rgba(0, 30, 80, 0.06);

  /* ========== 统一卡片样式（v2.8 UI优化） ========== */
  --card-radius: 16px;
  --card-padding: 16px;
  --card-bg: #ffffff;
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  --card-hover-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);

  /* ========== 渐变（统一浅蓝） ========== */
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-light));
  --gradient-primary-h: linear-gradient(90deg, var(--primary), var(--primary-light));
  --gradient-success: linear-gradient(135deg, var(--success), #2cb578);
  --gradient-danger: linear-gradient(135deg, var(--danger), #dc2626);
  --gradient-accent: linear-gradient(135deg, var(--accent), var(--accent-light));
}

/* ========== Reset ========== */
*, *::before, *::after { box-sizing: border-box; }

/* ========== 通用字体 ========== */
body {
  background: var(--bg-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'Noto Sans CJK SC', sans-serif;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  padding-top: 50px; /* 为 sticky 导航栏预留空间 */
}

/* ========== 页面主容器（v2.7: 统一宽度680px） ========== */
.main-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 14px;
  padding-bottom: 80px;
}


/* ========== 顶部导航栏 ========== */
.app-nav {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky !important;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(100, 167, 255, 0.25);
  /* 刘海屏安全区域 */
  padding-top: max(12px, env(safe-area-inset-top));
}
.app-nav .nav-back {
  cursor: pointer;
  font-size: 0.95rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.2);
}
.app-nav .nav-title {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ========== Toast 通知 ========== */
#toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.toast-item {
  background: rgba(15,23,42,0.92);
  color: #fff;
  padding: 14px 28px;
  border-radius: 16px;
  font-size: 0.9rem;
  animation: toastIn 0.35s ease;
  max-width: 88vw;
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  white-space: normal;
  line-height: 1.5;
}
.toast-item.success { background: rgba(16,185,129,0.95); }
.toast-item.error { background: rgba(244,63,94,0.95); }
.toast-item.warning { background: rgba(245,158,11,0.95); color: var(--text-primary); }
.toast-item.info { background: rgba(99,102,241,0.9); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ========== Loading 遮罩 ========== */
#loading-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.75);
  z-index: 9998;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}
#loading-mask.show { display: flex; }
.loading-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 进度条（统一） ========== */
.progress-bar-bg,
.progress-bar-wrap > .progress-bar,
.progress-bar-wrap.progress-bar-bg,
#page-question .progress-bar-wrap,
.dictation-wrap .progress-bar-wrap,
.import-card .progress-bar {
  background: #F3F4F6;
  border-radius: 14px;
  height: 8px;
}
.progress-fill,
.progress-bar-fill {
  background: var(--primary);
  border-radius: 14px;
  transition: width 0.4s ease;
}
.progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

/* ========== 面板卡片 ========== */
.panel {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.panel-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ========== Tab 切换按钮 ========== */
.tab-btn {
  border: none;
  background: var(--bg-soft);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
}
.tab-btn:active {
  transform: scale(0.97);
}

/* ========== 模式切换按钮 ========== */
.mode-tab {
  border: none;
  border-radius: 14px;
  padding: 12px 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-soft);
  color: var(--text-muted);
  text-align: center;
}
.mode-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-small);
}
.mode-tab:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.mode-tab:active {
  transform: scale(0.97);
}

/* ========== 选择卡片（年级/教材/单元） ========== */
.select-card,
.semester-item,
.textbook-item,
.unit-item {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.15s;
  font-weight: 600;
  color: var(--text-secondary);
}
.select-card:hover,
.semester-item:hover,
.textbook-item:hover,
.unit-item:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.02);
}
.select-card.selected {
  border: 2px solid var(--primary);
}
.select-card:active,
.semester-item:active,
.textbook-item:active,
.unit-item:active {
  transform: scale(0.97);
}

/* ========== 提交按钮（主色） ========== */
.btn-submit-mobile {
  width: 100%;
  max-width: 300px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  margin: 12px auto 0;
  display: block;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(100, 167, 255, 0.3);
}
.btn-submit-mobile:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}
.btn-submit-mobile:active {
  transform: scale(0.97);
}
.btn-submit-mobile.correct {
  background: var(--success);
}
.btn-submit-mobile.wrong {
  background: var(--danger);
}
.btn-submit-mobile:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== 确认弹窗 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  line-height: 1;
}
.modal-body { padding: 16px 20px 20px; }

/* ========== 微信风格确认弹窗 ========== */
.confirm-modal {
  background: var(--bg-card);
  border-radius: 16px;
  width: 100%;
  max-width: 320px;
  padding: 24px 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  animation: modalIn 0.25s ease;
  text-align: center;
}
.confirm-icon { font-size: 3rem; margin-bottom: 12px; }
.confirm-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.confirm-content {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}
.confirm-btn.cancel {
  background: #F3F4F6;
  color: var(--text-secondary);
}
.confirm-btn.cancel:hover { background: var(--bg-hover); }
.confirm-btn.confirm {
  background: var(--primary);
  color: #fff;
}
.confirm-btn.confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(100, 167, 255, 0.3);
}
.confirm-btn:active {
  transform: scale(0.97);
}

/* ========== 专项真题级别选择 ========== */
#exam-level-modal {
  z-index: 10001 !important;
}

/* ========== 学习步骤指示器 ========== */
.exam-level-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}
.exam-level-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--gray-200);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.exam-level-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: var(--primary);
}
.exam-level-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.exam-level-icon.zhongkao {
  background: var(--primary);
  color: #fff;
}
.exam-level-icon.gaokao {
  background: var(--primary);
  color: #fff;
}
.exam-level-info {
  flex: 1;
}
.exam-level-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.exam-level-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.exam-level-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
}

/* ========== 学习步骤指示器 ========== */
.learn-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  padding: 10px 0;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.step-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.step-item.active .step-num {
  background: var(--primary);
  color: #fff;
}
.step-item.active .step-text {
  color: var(--primary);
  font-weight: 600;
}
.step-item.completed .step-num {
  background: var(--success);
  color: #fff;
}
.step-item.completed .step-text { color: var(--success); }
.step-line {
  width: 40px;
  height: 2px;
  background: var(--gray-200);
  margin: 0 8px;
  margin-bottom: 18px;
}
.step-item.completed + .step-line { background: var(--success); }
.learn-content { min-height: 120px; }

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

/* ========== 左右箭头导航 ========== */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  transition: all 0.2s;
}
.nav-arrow:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
  transform: translateY(-50%) scale(1.05);
}
.nav-arrow:active { transform: translateY(-50%) scale(0.95); }
.nav-arrow.prev { left: 8px; }
.nav-arrow.next { right: 8px; }
.nav-arrow svg {
  width: 24px;
  height: 24px;
  stroke: var(--primary);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-arrow.disabled { opacity: 0.3; pointer-events: none; }

/* ========== 拼写测试卡片 ========== */
.spell-test-wrap {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: var(--shadow-medium);
  text-align: center;
  margin-bottom: 16px;
}
.spell-input {
  width: 100%;
  max-width: 300px;
  border: 3px solid var(--bg-soft);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 1.4rem;
  text-align: center;
  font-weight: 600;
  letter-spacing: 2px;
  transition: all 0.2s;
  margin-bottom: 16px;
}
.spell-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}
.spell-input.correct {
  border-color: var(--success);
  background: var(--success-soft);
}
.spell-input.wrong {
  border-color: var(--danger);
  background: var(--danger-light);
}
.spell-hint {
  font-size: 1.2rem;
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 20px;
}
.spell-result {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  display: none;
}
.spell-result.show { display: block; animation: resultPop 0.3s ease; }
.spell-result.success { background: var(--success-soft); color: var(--success); }
.spell-result.error { background: var(--danger-light); color: var(--danger); }
@keyframes resultPop { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* ========== 单词图片容器 ========== */
.word-img-wrap {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: var(--bg-soft);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-small);
}
.word-img-wrap img {
  width: 72px;
  height: 72px;
  object-fit: cover;
}

/* ========== 困难星级 ========== */
.difficulty-stars {
  display: flex;
  gap: 2px;
}
.difficulty-stars .star { font-size: 0.9rem; color: var(--accent); }
.difficulty-stars .star.empty { color: var(--text-muted); }

/* ========== 艾宾浩斯复习卡片 ========== */
.ebbinghaus-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  border-left: 4px solid var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.ebbinghaus-card:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 24px rgba(100, 167, 255, 0.15);
}
.ebbinghaus-card.level-0 { border-left-color: var(--danger); background: var(--danger-light); }
.ebbinghaus-card.level-1 { border-left-color: var(--accent); background: #E8F3FF; }
.ebbinghaus-card.level-2 { border-left-color: var(--primary); background: #E8F3FF; }
.ebbinghaus-card.level-3 { border-left-color: var(--success); background: var(--success-soft); }
.ebbinghaus-card.level-4 { border-left-color: var(--primary); background: #E8F3FF; }
.eb-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.eb-level-badge {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; color: #fff;
}
.eb-level-badge.level-0 { background: var(--danger); }
.eb-level-badge.level-1 { background: var(--primary); color: #fff; }
.eb-level-badge.level-2 { background: var(--primary); }
.eb-level-badge.level-3 { background: var(--success); }
.eb-level-badge.level-4 { background: var(--primary); }
.eb-word { flex: 1; font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }
.eb-meaning { font-size: 1rem; color: var(--text-secondary); margin-bottom: 6px; }
.eb-info { display: flex; gap: 16px; font-size: 0.78rem; color: var(--text-muted); }
.eb-info-item { display: flex; align-items: center; gap: 4px; }
.eb-next-review { color: var(--primary); font-weight: 600; }

/* ========== 底部导航栏（移动端） ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 998;
}
.nav-item {
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  flex: 1;
  padding: 4px 0;
  position: relative;
}
.nav-item.active { color: var(--primary); }
.nav-item .ni-icon { font-size: 1.3rem; }
.nav-item .ni-text { font-size: 0.65rem; margin-top: 2px; }

/* ========== 年级徽章（激活年级显示） ========== */
.grade-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #E8F3FF;
  color: var(--primary);
  border: 1px solid rgba(100, 167, 255, 0.2);
  white-space: nowrap;
}

/* ========== 连续打卡 ========== */
.streak-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0;
}
.streak-day {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  background: #F3F4F6;
  color: var(--text-muted);
  flex-shrink: 0;
}
.streak-day.done { background: var(--success); color: #fff; }
.streak-day.today { background: var(--primary); color: #fff; }
.streak-day.done.today { background: var(--success); color: #fff; }
.streak-day .sd-num { font-size: 0.9rem; font-weight: 700; }

/* ========== 面板关闭按钮 ========== */
.panel-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.15s;
}
.panel-close:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

/* ========== 排行榜列表 ========== */
.rank-list {
  max-height: none !important;
  overflow-y: visible !important;
  padding: 4px 0;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg-soft);
}
.rank-item:last-child { border-bottom: none; }
.rank-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.rank-num.top3 { background: transparent; font-size: 1rem; }
.rank-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}
.rank-info { flex: 1; }
.rank-name { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.rank-sub { font-size: 0.7rem; color: var(--text-muted); }
.rank-score { font-size: 0.9rem; font-weight: 700; color: var(--primary); }

/* ========== 结束检测按钮 ========== */
.btn-end-test {
  width: 100%;
  background: linear-gradient(135deg, var(--bg-soft), var(--gray-300));
  color: var(--primary);
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  height: 48px;
  box-shadow: var(--shadow-small);
}
.btn-end-test:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* ========== 补充变量（兼容旧页面） ========== */
:root {
  --bg-light: var(--bg-primary);
  --card-radius: 14px;
  --orange: var(--accent);
}

/* ========== 表单输入统一 ========== */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
}

/* ========== 页面级基础容器（兼容未用.main-wrap的页面） ========== */
.page-wrap,
.study-wrap,
.quiz-wrap,
.dictation-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 14px;
  padding-bottom: 80px;
}

/* ========== 列表/菜单统一 ========== */
.list-group-item,
.dropdown-item {
  border-radius: 10px !important;
  margin-bottom: 4px;
  border: none;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 500;
}
.list-group-item:hover,
.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

/* ========== 防止横向滚动 ========== */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .app-nav { padding: 12px 12px; }
  .spell-test-wrap { padding: 20px 16px; }
  .main-wrap,
  .page-wrap,
  .study-wrap,
  .quiz-wrap,
  .dictation-wrap {
    padding: 10px;
    padding-bottom: 80px;
  }
  .panel {
    padding: 12px 14px;
    border-radius: 12px;
  }
  .btn-submit-mobile {
    max-width: 100%;
    padding: 12px;
    font-size: 1rem;
  }
  input, textarea, select {
    padding: 10px 12px;
    font-size: 16px; /* 防止iOS缩放 */
  }
}

/* ========== 统一卡片样式（v2.8 UI优化） ========== */
.card-unified {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
}
.card-unified:hover {
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}

/* 空状态统一样式 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.6;
}
.empty-state-text {
  font-size: 0.9rem;
}

/* 骨架屏加载动画 */
@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--gray-100) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 8px;
}
