/* ===== 日语四级在线刷题 - 主样式 ===== */

:root {
  /* 主色：Indigo 紫蓝（参考 fjfh1126.top） */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  /* 辅色 */
  --accent: #8b5cf6;        /* 紫 */
  --accent-2: #06b6d4;      /* 青蓝 */
  --accent-3: #f59e0b;      /* 暖橙强调 */
  /* 渐变 */
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-soft: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  /* 中性 */
  --bg: #f8fafc;
  --bg-2: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e5e7eb;
  --border-light: #f1f5f9;
  /* 状态 */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  /* 形状 */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 12px rgba(99, 102, 241, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(99, 102, 241, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  --shadow-primary: 0 8px 20px rgba(99, 102, 241, 0.25);
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== 导航栏（默认紫蓝渐变 + 白底变体） ===== */
.navbar,
.sticky-nav {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* 白底导航变体（清爽风，激活态紫蓝胶囊） */
.navbar-light,
.topbar-light {
  background: #ffffff !important;
  color: #1e293b !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06) !important;
  border-bottom: 1px solid #f1f5f9;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
}

.navbar-brand span { font-size: 1.5rem; }

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.navbar-menu a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.navbar-menu a:hover,
.navbar-menu a.active {
  color: white;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
}

/* ===== Hero 区域（红→紫红渐变，对比 fjfh 风格） ===== */
.hero {
  background: linear-gradient(135deg, #d32f2f 0%, #c2185b 50%, #7b1fa2 100%);
  color: white;
  padding: 4rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 30px 30px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  position: relative;
}

.hero p {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2rem;
  position: relative;
}

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-accent {
  background: var(--accent);
  color: var(--text);
}

.btn-accent:hover { background: var(--accent-dark); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover { background: var(--border); }

.btn-sm { padding: 0.375rem 1rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }

.btn-white {
  background: white;
  color: var(--primary);
}

.btn-white:hover {
  background: #f5f5f5;
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(211,47,47,0.1);
}

/* ===== 答题界面 ===== */
.question-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.question-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.question-type-badge {
  padding: 0.25rem 0.625rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-vocab { background: #e3f2fd; color: #1565c0; }
.badge-grammar { background: #fce4ec; color: #c62828; }
.badge-reading { background: #e8f5e9; color: #2e7d32; }
.badge-listening { background: #fff3e0; color: #e65100; }
.badge-easy { background: #e8f5e9; color: #2e7d32; }
.badge-medium { background: #fff3e0; color: #e65100; }
.badge-hard { background: #fce4ec; color: #c62828; }

.question-content {
  font-size: 1.125rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.question-passage {
  background: #f8f9fa;
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: 0 8px 8px 0;
  line-height: 1.8;
  font-size: 0.9375rem;
}
.question-passage b, .question-passage strong { color: #1a1a2e; }
.question-passage u { text-decoration: underline; }
.question-passage em, .question-passage i { font-style: italic; }

/* 富文本passage样式（清理Word粘贴的HTML） */
.passage-content {
  font-size: 0.9375rem;
  line-height: 1.8;
  word-break: break-word;
}
.passage-content p { margin: 0.5em 0; }
/* 兜底默认字体/颜色，但不要 !important 锁住 font-size — 否则后台设置的 inline 字号会被强制 inherit 覆盖 */
.passage-content span { font-family: inherit; color: inherit; }
.passage-content .MsoNormal { margin: 0.25em 0; font-family: inherit; }
.passage-content b, .passage-content strong { color: #1a1a2e; font-weight: 600; }
.passage-content u { text-decoration: underline; }
.passage-content em, .passage-content i { font-style: italic; }
.passage-content ul, .passage-content ol { margin: 0.5em 0; padding-left: 1.5em; }

/* 阅读文章划线/高亮：可点击跳转对应题目 */
.passage-content u.reading-u,
.passage-content .reading-hl {
  text-decoration: underline;
  text-decoration-color: #e53e3e;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: background 0.15s;
}
.passage-content .reading-hl {
  color: #c53030;
  font-weight: 600;
}
.passage-content u.reading-u:hover,
.passage-content .reading-hl:hover {
  background: #fed7d7;
  border-radius: 2px;
}

/* 单题阅读：点击划线后题目区闪烁反馈 */
.reading-jump-flash {
  animation: readingFlash 1.2s ease;
}
@keyframes readingFlash {
  0% { background-color: #fef3c7; }
  100% { background-color: transparent; }
}

/* ========== 阅读理解页面美化（参考风格） ========== */

/* 随机/章节刷题模式 */
.practice-quiz-mode {
  background: transparent;
  min-height: calc(100vh - 200px);
  border-radius: 16px;
  padding: 24px 16px 60px;
  margin-top: 8px;
}

/* 阅读文章纸张卡片 */
.reading-paper {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  position: relative;
}
.reading-paper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ef4444, #f97316);
}
.reading-paper-head {
  display: flex;
  align-items: center;
  padding: 6px 12px;          /* 紧凑 */
  border-bottom: 1px solid #f3f4f6;
  background: #ffffff;
}
.reading-paper-body {
  padding: 10px 14px 12px;    /* 紧凑 */
  overflow-x: hidden;
  /* 桌面端：固定高度 + 滚动（用户反馈文章太长） */
  max-height: 480px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.2) transparent;
}
.reading-paper-body::-webkit-scrollbar { width: 6px; }
.reading-paper-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 3px; }
.reading-paper-body::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.32); }
.reading-paper-body.collapsed {
  max-height: 0;
  padding: 0 14px;
  overflow: hidden;
}
.reading-paper-body p {
  margin: 0.35em 0;           /* 紧凑：原 0.5em */
  line-height: 1.7;           /* 紧凑：原 1.8 */
  text-indent: 0;
  font-size: 0.875rem;        /* 紧凑：原 0.9375rem */
  color: #3f3f46;
}
.reading-paper-body p + p { margin-top: 0; }
/* 尊重后台写进来的 inline style（行距/字号/颜色等） */
.reading-paper-body p[style] {
  font-size: inherit;
}
.reading-paper-body p:first-child { margin-top: 0; }
.reading-paper-body p:last-child { margin-bottom: 0; }

/* 阅读题号导航条（题目卡片下方） */
.reading-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #e5e7eb;
}

/* 收起/展开按钮 */
.reading-toggle {
  background: #fff;
  border: 1px solid #e7d9b8;
  color: #92400e;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.reading-toggle:hover {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}

/* 手机端：去掉阅读文章卡片的边框/阴影/圆角，让文字铺满两边 */
@media (max-width: 640px) {
  .reading-paper {
    border: none;
    box-shadow: none;
    border-radius: 0;
    background: #fafafa;
  }
  .reading-paper::before { height: 2px; }
  .reading-paper-head { padding: 5px 10px; }
  .reading-paper-body { padding: 6px 10px 10px; max-height: 340px; }
  .reading-paper-body.collapsed { padding: 0 10px; }
  .reading-paper-body p {
    margin: 0.25em 0;
    line-height: 1.6;
    text-indent: 1em;
    font-size: 0.8125rem;
  }
  .reading-nav { gap: 4px; margin-top: 10px; padding-top: 8px; }
}

/* 选项卡 */
.reading-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 34px;              /* 纯数字序号按钮 */
  padding: 6px 10px;            /* 紧凑：原 8px 18px */
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.reading-tab:hover {
  border-color: #fca5a5;
  color: #dc2626;
  background: #fff5f5;
}
.reading-tab.active {
  background: #fff;
  border-color: #ef4444;
  color: #dc2626;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.18);
  position: relative;
}
.reading-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 50%;
  transform: translateX(-50%);
  width: 60%; height: 3px;
  background: #ef4444;
  border-radius: 3px 3px 0 0;
}
.reading-tab.done {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

/* 题目卡片 */
.reading-q-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px 12px;          /* 紧凑：原 22px 24px，再压到 12px */
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}
.reading-q-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;                  /* 紧凑：原 32px */
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* 阅读选项：独立卡片纵排 */
.reading-option {
  display: flex;
  align-items: center;
  gap: 10px;                    /* 紧凑：原 14px */
  padding: 10px 14px;           /* 紧凑：原 14px 18px */
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s;
  background: #fff;
  margin-bottom: 8px;           /* 紧凑：原 12px */
}
.reading-option:last-child { margin-bottom: 0; }
.reading-option:hover {
  border-color: #93c5fd;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.reading-option-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.reading-option-letter {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  color: #6b7280;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.18s;
}
.reading-option-text {
  font-size: 0.9375rem;
  color: #374151;
  line-height: 1.6;
  flex: 1;
}
.reading-option.sel {
  border-color: #ef4444;
  background: #fef2f2;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}
.reading-option.sel .reading-option-letter {
  border-color: #ef4444;
  background: #ef4444;
  color: #fff;
}
.reading-option.correct {
  border-color: #10b981;
  background: #ecfdf5;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}
.reading-option.correct .reading-option-letter {
  border-color: #10b981;
  background: #10b981;
  color: #fff;
}
.reading-option.wrong {
  border-color: #ef4444;
  background: #fef2f2;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}
.reading-option.wrong .reading-option-letter {
  border-color: #ef4444;
  background: #ef4444;
  color: #fff;
}
.reading-option.dim {
  opacity: 0.45;
  cursor: default;
  background: #fafafa;
}

/* 阅读解析卡片 */
.reading-expl {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid;
  font-size: 0.9375rem;
  line-height: 1.7;
}
.reading-expl.ok { background: #ecfdf5; border-color: #a7f3d0; }
.reading-expl.no { background: #fef2f2; border-color: #fecaca; }

/* 划线 / 高亮：黄色背景（参考图风格） */
.passage-content u.reading-u,
.passage-content .reading-hl {
  text-decoration: underline;
  text-decoration-color: #d97706;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  background: #fef3c7;
  padding: 1px 4px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}
.passage-content .reading-hl {
  color: #92400e;
  font-weight: 600;
}
.passage-content u.reading-u:hover,
.passage-content .reading-hl:hover {
  background: #fde68a;
  box-shadow: 0 0 0 2px #fbbf24;
}

/* 选项 */
.options-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  margin-bottom: 0.5rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.option-item:hover {
  border-color: var(--primary-light);
  background: #fff5f5;
}

.option-item.selected {
  border-color: var(--primary);
  background: #ffebee;
}

.option-item.correct {
  border-color: var(--success);
  background: #ecfdf5;
}

.option-item.wrong {
  border-color: var(--danger);
  background: #fef2f2;
}

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  background: #f3f4f6;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.option-item.selected .option-letter {
  background: var(--primary);
  color: white;
}

.option-item.correct .option-letter {
  background: var(--success);
  color: white;
}

.option-item.wrong .option-letter {
  background: var(--danger);
  color: white;
}

/* 解析 */
.explanation-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.explanation-box .label {
  color: #0369a1;
  font-weight: 700;
  margin-right: 0.5rem;
}

/* ===== 考试计时器 ===== */
.exam-timer {
  position: fixed;
  top: 64px;
  right: 1rem;
  z-index: 90;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--primary);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.exam-timer .time {
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.exam-timer.warning .time { color: var(--danger); }

.exam-timer .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ===== 进度条 ===== */
.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.progress-bar-fill.green {
  background: linear-gradient(90deg, #10b981, #34d399);
}

/* ===== 统计卡片 ===== */
.stat-card {
  text-align: center;
  padding: 1.5rem;
}

.stat-card .value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat-card .label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.375rem;
}

/* ===== 排名 ===== */
.rank-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
}

.rank-item:last-child { border-bottom: none; }

.rank-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.rank-1 { background: #fef3c7; color: #92400e; }
.rank-2 { background: #e5e7eb; color: #374151; }
.rank-3 { background: #fde8d8; color: #9a3412; }
.rank-default { background: #f3f4f6; color: #6b7280; }

/* ===== 页脚 ===== */
.footer {
  background: #1a1a2e;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 2rem 1.5rem;
  margin-top: 4rem;
  font-size: 0.8125rem;
}

.footer a { color: rgba(255,255,255,0.8); text-decoration: none; }
.footer a:hover { color: white; }

/* ===== Toast 通知 ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast-success { background: #065f46; color: white; }
.toast-error { background: #991b1b; color: white; }
.toast-warning { background: #92400e; color: white; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== VIP 标识 ===== */
.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }
  .navbar-menu { display: none; }
  .mobile-menu-btn { display: block; }
  .card-grid { grid-template-columns: 1fr; }
  .question-card { padding: 1.25rem; }
  .exam-timer { top: auto; bottom: 1rem; right: 1rem; left: 1rem; justify-content: center; }
  /* 微信/移动端触摸优化 */
  body { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
  .option-item { min-height: 48px; padding: 1rem; }
  .btn { min-height: 44px; }
  a, button { touch-action: manipulation; }
  /* 移动端表格优化 */
  table { font-size: 0.8125rem; }
  td, th { padding: 0.5rem !important; }
  /* 移动端底部安全区域 */
  .safe-bottom { padding-bottom: env(safe-area-inset-bottom, 20px); }
}

@media (max-width: 480px) {
  .hero { padding: 2.5rem 1rem; }
  .hero h1 { font-size: 1.5rem; }
  .stat-card .value { font-size: 1.75rem; }
}

/* ===== 微信内置浏览器适配 ===== */
/* 微信中input获取焦点时页面放大问题 */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  input[type="text"], input[type="email"], input[type="password"], input[type="search"],
  input[type="tel"], input[type="url"], textarea, select {
    font-size: 16px !important;
  }
}

/* 微信中禁止长按弹出菜单 */
.no-select {
  -webkit-user-select: none;
  user-select: none;
}

/* ===== 移动端菜单 ===== */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  background: var(--primary-dark);
  padding: 1rem;
}

.mobile-nav.open { display: block; }

.mobile-nav a {
  display: block;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  background: rgba(255,255,255,0.1);
  color: white;
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: block; }
}

/* ===== 错题标记 ===== */
.mistake-icon { color: var(--danger); }
.correct-icon { color: var(--success); }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-secondary);
}

.empty-state .icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state p {
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

/* ===== 分类图标 ===== */
.category-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.cat-vocab { background: #e3f2fd; }
.cat-grammar { background: #fce4ec; }
.cat-reading { background: #e8f5e9; }
.cat-listening { background: #fff3e0; }

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #f3f4f6;
  color: var(--text-secondary);
}

/* ===== 加载动画 ===== */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

/* ===== 答题进度指示器 ===== */
.progress-indicator {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 1.5rem;
}

.progress-dot {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.progress-dot:hover { border-color: var(--primary-light); }
.progress-dot.current { border-color: var(--primary); background: var(--primary); color: white; }
.progress-dot.answered { border-color: var(--success); background: #ecfdf5; color: var(--success); }
.progress-dot.flagged { border-color: var(--warning); }

/* ========== 听力练习页面 ========== */
.listen-q-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}
.listen-q-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}
.listen-audio {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fdf6e7;
  border: 1px solid #f0dfc0;
  border-radius: 10px;
  padding: 10px 16px;
}
.listen-audio audio {
  flex: 1;
  height: 36px;
  min-width: 0;
}
.listen-replay {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #e7d9b8;
  background: #fff;
  color: #92400e;
  border-radius: 8px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s;
}
.listen-replay:hover {
  background: #fef3c7;
  border-color: #f59e0b;
}

/* 応答問題：A/B/C/D 无文字大按钮 */
.listen-opt-blank {
  padding: 26px 0;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  color: #374151;
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}
.listen-opt-blank:hover {
  border-color: #93c5fd;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.listen-opt-blank.sel {
  border-color: #ef4444;
  background: #fef2f2;
  color: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}
.listen-opt-blank.correct {
  border-color: #10b981;
  background: #ecfdf5;
  color: #047857;
}
.listen-opt-blank.wrong {
  border-color: #ef4444;
  background: #fef2f2;
  color: #dc2626;
}
.listen-opt-blank.dim {
  opacity: 0.4;
  cursor: default;
}

/* 会話問題：选项卡片（支持图片/表格 HTML） */
.listen-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s;
  background: #fff;
}
.listen-option:hover {
  border-color: #93c5fd;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.listen-option-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.listen-option-letter {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  color: #6b7280;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.18s;
}
.listen-option-text {
  font-size: 0.9375rem;
  color: #374151;
  line-height: 1.6;
  flex: 1;
  min-width: 0;
}
.listen-option.sel {
  border-color: #ef4444;
  background: #fef2f2;
}
.listen-option.sel .listen-option-letter {
  border-color: #ef4444;
  background: #ef4444;
  color: #fff;
}
.listen-option.correct {
  border-color: #10b981;
  background: #ecfdf5;
}
.listen-option.correct .listen-option-letter {
  border-color: #10b981;
  background: #10b981;
  color: #fff;
}
.listen-option.wrong {
  border-color: #ef4444;
  background: #fef2f2;
}
.listen-option.wrong .listen-option-letter {
  border-color: #ef4444;
  background: #ef4444;
  color: #fff;
}
.listen-option.dim {
  opacity: 0.45;
  cursor: default;
}

/* 听力选项图片 */
.listen-opt-img {
  max-height: 90px;
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid #eee;
  display: inline-block;
  vertical-align: middle;
}

/* 题13 日历表格 */
.listen-cal {
  border-collapse: collapse;
  font-size: 0.8125rem;
  display: inline-block;
}
.listen-cal caption {
  font-weight: 700;
  color: #dc2626;
  padding: 2px 8px;
  font-size: 0.875rem;
}
.listen-cal th {
  background: #fdf6e7;
  color: #92400e;
  padding: 3px 7px;
  border: 1px solid #e7d9b8;
  font-weight: 600;
}
.listen-cal td {
  padding: 3px 7px;
  border: 1px solid #f0e6d0;
  text-align: center;
  color: #374151;
}
.listen-cal td.cal-hl {
  background: #ef4444;
  color: #fff;
  font-weight: 700;
  border-radius: 3px;
}

/* 解析卡片 */
.listen-expl {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid;
  line-height: 1.7;
}
.listen-expl.ok { background: #ecfdf5; border-color: #a7f3d0; }
.listen-expl.no { background: #fef2f2; border-color: #fecaca; }

/* 汇总跳转按钮 */
.summary-jump {
  cursor: pointer;
  transition: all 0.15s;
}
.summary-jump:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ========== 听力练习页（紫色主题 v2） ========== */

/* 列表卡片（淡紫边框 + 左侧图标 + 右侧播放按钮） */
.listen-list-card { transition: transform 0.2s; }
.listen-list-card:hover { transform: translateY(-1px); }

/* 题号导航按钮 */
.nav-btn { user-select: none; }
.nav-btn.active,
.nav-btn.bg-indigo-500 { box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3); }

/* 紫色播放区进度条 hover */
#player-progress-wrap:hover #player-progress { background: rgba(255, 255, 255, 0.95); }
#player-progress-wrap { transition: background 0.2s; }

/* 紫色大圆形播放按钮 */
#player-toggle { transition: transform 0.2s, box-shadow 0.2s; }
#player-toggle:hover { transform: scale(1.08); }

/* 第一段 A/B/C/D 无文字大按钮（紫色主题） */
.exam-opt-blank {
  padding: 26px 0;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  color: #374151;
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}
.exam-opt-blank:hover {
  border-color: #818cf8;
  background: #f5f3ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}
.exam-opt-blank.sel {
  border-color: #6366f1;
  background: #eef2ff;
  color: #4338ca;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}
.exam-opt-blank.correct {
  border-color: #10b981;
  background: #ecfdf5;
  color: #047857;
}
.exam-opt-blank.wrong {
  border-color: #f43f5e;
  background: #fff1f2;
  color: #be123c;
}
.exam-opt-blank.dim {
  opacity: 0.4;
  cursor: default;
}

/* 第二段 选项卡片（紫色主题） */
.exam-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s;
  background: #fff;
}
.exam-option:hover {
  border-color: #818cf8;
  background: #f5f3ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}
.exam-option.sel {
  border-color: #6366f1;
  background: #eef2ff;
}
.exam-opt-letter {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  color: #6b7280;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.18s;
}
.exam-option.sel .exam-opt-letter {
  border-color: #6366f1;
  background: #6366f1;
  color: #fff;
}
.exam-opt-text {
  font-size: 0.9375rem;
  color: #374151;
  line-height: 1.6;
  flex: 1;
  min-width: 0;
}
.exam-option.correct {
  border-color: #10b981;
  background: #ecfdf5;
}
.exam-option.correct .exam-opt-letter {
  border-color: #10b981;
  background: #10b981;
  color: #fff;
}
.exam-option.wrong {
  border-color: #f43f5e;
  background: #fff1f2;
}
.exam-option.wrong .exam-opt-letter {
  border-color: #f43f5e;
  background: #f43f5e;
  color: #fff;
}
.exam-option.dim {
  opacity: 0.45;
  cursor: default;
}

/* 听力选项图片（图片题） */
.exam-opt-text img,
.exam-option img,
.listen-opt-img {
  max-height: 90px;
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid #eee;
  display: inline-block;
  vertical-align: middle;
}

/* 听力 ABCD 选项大图（整张裁剪图） */
.listen-option-image-wrap {
  position: relative;
  margin-bottom: 1.25rem;
  text-align: center;
  /* 极端情况下（图片比容器还宽且无法缩放）才允许横向滚动兜底 */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.listen-option-image-wrap::after {
  content: "点击图片可放大查看";
  display: block;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
  white-space: nowrap;
}
/* 默认：缩放到容器宽度，手机/电脑各自适配屏幕尺寸 */
.listen-option-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  cursor: zoom-in;
  background: #f9fafb;
  transition: transform 0.2s ease;
}
/* 桌面端：内容列较宽，限制最大宽度避免超大图；限制高度避免超长图占满整屏 */
@media (min-width: 768px) {
  .listen-option-image {
    max-width: 760px;
    max-height: 78vh;
    object-fit: contain;
  }
}
/* 移动端：占满可用宽度；超长图限制高度并保证完整显示（不拉伸变形） */
@media (max-width: 767px) {
  .listen-option-image {
    max-height: 62vh;
    object-fit: contain;
  }
}
.listen-option-image:active {
  transform: scale(0.99);
}
/* 选项大图点击放大灯箱 */
.optimg-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  display: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  cursor: zoom-out;
}
.optimg-lightbox img {
  display: block;
  margin: 0 auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: none;
}

/* 题13 日历表格 */
.exam-opt-text table.listen-cal,
table.listen-cal {
  border-collapse: collapse;
  font-size: 0.8125rem;
  display: inline-block;
}
table.listen-cal caption {
  font-weight: 700;
  color: #6366f1;
  padding: 2px 8px;
  font-size: 0.875rem;
}
table.listen-cal th {
  background: #eef2ff;
  color: #4338ca;
  padding: 3px 7px;
  border: 1px solid #c7d2fe;
  font-weight: 600;
}
table.listen-cal td {
  padding: 3px 7px;
  border: 1px solid #e0e7ff;
  text-align: center;
  color: #374151;
}
table.listen-cal td.cal-hl {
  background: #6366f1;
  color: #fff;
  font-weight: 700;
  border-radius: 3px;
}

/* 解析卡片（紫色主题） */
.exam-expl {
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid;
  line-height: 1.7;
}
.exam-expl.ok { background: #ecfdf5; border-color: #a7f3d0; }
.exam-expl.no { background: #fff1f2; border-color: #fecaca; }

/* 汇总跳转按钮 */
.summary-jump {
  cursor: pointer;
  transition: all 0.15s;
}
.summary-jump:hover { transform: scale(1.08); }
/* ================================================ */
/* ========== 紫蓝主题：按钮/卡片/链接修饰 ========== */
/* ================================================ */

/* 主操作按钮（紫色渐变） */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #5568d4 0%, #653a8a 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* 白色胶囊按钮（导航下拉背景） */
.pill-white {
  background: white;
  color: var(--primary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s;
}
.pill-white:hover {
  background: var(--primary-50);
}

/* 主链接色 */
a.nav-hover-primary:hover { color: var(--primary); }

/* 主题色文本工具类（Tailwind 风格快捷） */
.text-theme { color: var(--primary); }
.bg-theme { background: var(--primary); }
.bg-theme-soft { background: var(--primary-50); }
.bg-gradient-theme { background: var(--gradient); }
.bg-gradient-soft { background: var(--gradient-soft); }

/* 圆形图标块（首页快捷入口） */
.icon-circle {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  font-size: 24px;
  transition: transform 0.2s;
}
.icon-circle:hover { transform: scale(1.05); }

/* ================================================ */
/* ========== 导航：更多练习下拉菜单 ========== */
/* ================================================ */

.topbar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0 1.25rem;
  height: 64px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.25);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.topbar-menu {
  margin-left: 1.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.topbar-link {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}
.topbar-link:hover,
.topbar-link.active {
  color: #fff;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
}
.topbar-link.is-primary {
  background: rgba(255,255,255,0.18);
}
.topbar-link.is-vip {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}
.topbar-link.is-vip:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* 白底导航内的链接（清爽风，贴近 fjfh1126.top） */
.topbar-light .topbar-brand .brand-text {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.topbar-light .topbar-link {
  color: #475569;
}
.topbar-light .topbar-link:hover {
  color: #4f46e5;
  background: #eef2ff;
}
.topbar-light .topbar-link.active {
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.topbar-light .topbar-link.is-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.topbar-light .topbar-link.is-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #fff;
}
.topbar-light .topbar-link.is-vip {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
}
.topbar-light .topbar-burger {
  color: #475569;
}
.topbar-burger {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  margin-left: auto;
}
.topbar-burger:hover { background: #f1f5f9; }

/* 移动端菜单（白底+浅灰，激活紫蓝） */
.mobile-menu {
  display: none;
  background: white;
  border-bottom: 1px solid #f1f5f9;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.mobile-menu.open { display: block; }
.mobile-menu-item {
  display: block;
  padding: 12px 16px;
  border-radius: 10px;
  color: #1e293b;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.15s;
}
.mobile-menu-item:hover {
  background: #eef2ff;
  color: #4f46e5;
}
.mobile-menu-item.sub {
  font-size: 14px;
  font-weight: 400;
  color: #64748b;
  padding-left: 28px;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* 更多下拉 */
.topbar-dd {
  position: relative;
}
.topbar-dd-trigger {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}
.topbar-dd-trigger .fa-chevron-down { transition: transform 0.2s; font-size: 10px; }
.topbar-dd.open .topbar-dd-trigger .fa-chevron-down { transform: rotate(180deg); }
.topbar-dd-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 210px;
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.06);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 70;
  border: 1px solid #f1f5f9;
}
.topbar-dd.open .topbar-dd-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.topbar-dd-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #334155;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.topbar-dd-menu a:hover {
  background: #f8fafc;
  color: #1e293b;
  transform: translateX(2px);
}
.topbar-dd-menu a i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  color: var(--primary);
}
/* 下拉项彩色图标（贴近参考图） */
.topbar-dd-menu a .fa-headphones { color: #06b6d4; }
.topbar-dd-menu a .fa-volume-up { color: #10b981; }
.topbar-dd-menu a .fa-book { color: #8b5cf6; }
.topbar-dd-menu a .fa-book-open { color: #f59e0b; }
.topbar-dd-menu a .fa-pen-fancy { color: #ef4444; }
.topbar-dd-menu a .fa-folder-open { color: #ec4899; }
.topbar-dd-menu a .fa-chart-line { color: #6366f1; }

/* ================================================ */
/* ========== 移动端底部 Tab Bar（手机专属） ========== */
/* ================================================ */

.mobile-tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
  z-index: 50;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.mobile-tabbar-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  transition: color 0.15s;
  position: relative;
}
.mobile-tab i { font-size: 20px; }
.mobile-tab.active,
.mobile-tab:hover { color: var(--primary); }
.mobile-tab.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}

/* ================================================ */
/* ========== 移动端响应式（基础） ========== */
/* ================================================ */

@media (max-width: 768px) {
  .topbar-menu, .nav-menu { display: none !important; }
  .topbar-burger { display: inline-flex !important; }
  .mobile-tabbar { display: block; }
  body { padding-bottom: 64px; }
  .container, .max-w-4xl, .max-w-7xl, .max-w-3xl, .max-w-5xl, .max-w-6xl {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}

@media (min-width: 769px) {
  .topbar-burger, .mobile-tabbar { display: none !important; }
  body { padding-bottom: 0; }
}

/* 后台切片参数面板 */
.split-params {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}
.split-params-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.split-params label {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: #475569;
  font-weight: 500;
}
.split-params input[type="number"],
.split-params input[type="text"] {
  margin-top: 2px;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  background: white;
  transition: border-color 0.15s;
}
.split-params input[type="number"]:focus,
.split-params input[type="text"]:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.split-params input[type="checkbox"] {
  width: auto;
  margin-right: 4px;
}
.split-params-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.split-params-title {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.split-params-title i { color: #6366f1; }

/* 自定义播放器进度条（分秒气泡） */
.fullplay-track {
  position: relative;
  height: 16px;
  background: #e2e8f0;
  border-radius: 999px;
  cursor: pointer;
  touch-action: none;
  flex: 1;
  min-width: 60px;
}
.fullplay-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 999px;
  pointer-events: none;
}
.fullplay-tip {
  position: absolute;
  top: -26px;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  font-size: 11px;
  font-family: monospace;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  left: 0%;
  opacity: 0;
  transition: opacity 0.15s;
}
.fullplay-track:hover .fullplay-tip,
.fullplay-track.dragging .fullplay-tip {
  opacity: 1;
}
.fullplay-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 2px solid #6366f1;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  pointer-events: none;
  z-index: 2;
}
/* 时间输入框非法值红框提示 */
.seg-time-error {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

/* 移动端通用：卡片/按钮/表单/表格适配 */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }
  .hero { padding: 2.5rem 1rem; }
  .card-grid { grid-template-columns: 1fr !important; }
  body { font-size: 15px; }
  .btn-lg { padding: 12px 18px; font-size: 15px; }
  .btn { width: 100%; }
  .btn + .btn { margin-top: 8px; }
  .btn-sm { width: auto; }
  .form-input, .form-select, textarea {
    font-size: 16px;
    padding: 0.75rem 0.875rem;
  }
  .question-card { padding: 1.25rem; }
  .card { padding: 1.25rem; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  .reading-tab { padding: 8px 12px; font-size: 13px; }
  .reading-paper { padding: 1.25rem; }
  .table-responsive table, .table-responsive thead, .table-responsive tbody,
  .table-responsive tr, .table-responsive td, .table-responsive th {
    display: block;
  }
  .table-responsive thead { display: none; }
  .table-responsive tr {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    padding: 10px;
  }
  .table-responsive td {
    padding: 4px 0;
    border: none;
  }
  .table-responsive td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 8px;
  }
}

/* 小屏手机额外收紧（<= 380px） */
@media (max-width: 380px) {
  .topbar { padding: 0 0.75rem; }
  .topbar-brand { font-size: 1rem; }
  .mobile-tab i { font-size: 18px; }
  .mobile-tab { font-size: 10px; }
}

/* ================================================ */
/* ========== 通用样式补强（紫蓝主题视觉升级） ========== */
/* ================================================ */

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

::selection {
  background: var(--primary-light);
  color: white;
}

/* ================================================ */
/* ========== 首页学习模块 9 宫格 ========== */
/* ================================================ */
.module-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius);
  padding: 14px 8px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.module-card:hover {
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.1);
}
.module-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 8px;
}
.module-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 2px;
}
.module-sub {
  font-size: 11px;
  color: #94a3b8;
}

/* ================================================ */
/* ========== 桌面端菜单：平铺 / 折叠切换 ========== */
/* 默认（769-1199px 中屏）：平铺项隐藏，用「更多练习」下拉 */
.topbar-menu .dd-item {
  display: none !important;
}
/* 大屏（>=1200px）：全部平铺，隐藏「更多练习」下拉 */
@media (min-width: 1200px) {
  .topbar-menu .dd-item {
    display: inline-flex !important;
  }
  #morePracticeDD {
    display: none !important;
  }
  /* 紧凑导航项，让 1200-1440px 屏幕都能装下 12+ 项 */
  .topbar-menu .topbar-link {
    padding: 5px 9px;
    font-size: 12.5px;
  }
  .topbar-menu { gap: 4px; }
}

/* ================================================ */
/* ========== 手机端顶部横向导航 ========== */
/* ================================================ */.mobile-topbar-nav {
  display: none;
  flex: 1;
  margin-left: 0.75rem;
  margin-right: 0.5rem;
  min-width: 0;
  position: relative;
}
.mobile-topbar-nav::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 28px;
  background: linear-gradient(to right, transparent, #ffffff);
  pointer-events: none;
}
.mobile-topbar-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 18px;
}
.mobile-topbar-scroll::-webkit-scrollbar { display: none; }
.mobile-topbar-scroll a,
.mobile-topbar-more {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  transition: all 0.15s;
  white-space: nowrap;
}
.mobile-topbar-scroll a.active,
.mobile-topbar-scroll a:hover {
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}
.mobile-topbar-more {
  cursor: pointer;
  color: #6366f1;
  background: #eef2ff;
  border-color: #e0e7ff;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.mobile-topbar-more i { font-size: 10px; transition: transform 0.2s; }
.mobile-topbar-more.open i { transform: rotate(180deg); }

/* 折叠下拉面板（手机顶部「更多」） */
.mobile-topbar-dd {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(15, 23, 42, 0.06);
  padding: 8px;
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.mobile-topbar-dd.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.mobile-topbar-dd a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #334155;
  text-decoration: none;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.15s;
}
.mobile-topbar-dd a:hover {
  background: #eef2ff;
  color: #4f46e5;
}
.mobile-topbar-dd a i {
  width: 18px;
  text-align: center;
  color: #6366f1;
}

@media (max-width: 768px) {
  .mobile-topbar-nav { display: flex; }
}
@media (min-width: 769px) {
  .mobile-topbar-nav { display: none !important; }
}

/* ================================================ */
/* ========== 新版统一页面组件（全站风格一致） ========== */
/* 与首页 Hero 同源：红粉渐变；与 header.php tailwind 主题色一致 */
/* ================================================ */

/* 统一内容容器 */
.container-page {
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .container-page { padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* 渐变页面头（与首页 Hero 同色系：from-red-700 via-red-600 to-pink-600） */
.page-hero {
  background: linear-gradient(135deg, #dc2626 0%, #e11d48 55%, #db2777 100%);
  color: #fff;
  padding: 1.5rem 0 1.75rem;
}
@media (min-width: 640px) {
  .page-hero { padding: 2.5rem 0 2.75rem; }
}
.page-hero-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .page-hero-inner { padding-left: 1.5rem; padding-right: 1.5rem; }
}
.page-hero h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}
@media (min-width: 640px) {
  .page-hero h1 { font-size: 1.875rem; }
}
.page-hero p {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.9);
}
@media (min-width: 640px) {
  .page-hero p { font-size: 1rem; }
}
/* 页面头内右上操作按钮 */
.page-hero-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.page-hero-actions .ph-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: background 0.15s;
}
.page-hero-actions .ph-btn:hover { background: rgba(255, 255, 255, 0.3); }
.page-hero-actions .ph-btn-solid {
  background: #fff;
  color: #dc2626;
  border-color: #fff;
}

/* 区块标题（图标 + 加粗标题） */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
}
.section-title .st-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.55rem;
  background: var(--primary-50);
  color: var(--primary);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.section-title .st-more {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}

/* 真题题型卡（7 类），复用首页模块卡视觉 */
.type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .type-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.type-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0.85rem 0.9rem;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}
.type-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.type-card .tc-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.type-card .tc-body { min-width: 0; }
.type-card .tc-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.type-card .tc-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ================================================ */
/* ========== 首页「考试题型·一键速刷」红框容器 ========== */
/* 设计：白底+红边框+左红条+分组+红描边卡 */
/* ================================================ */

.exam-type-section {
  background: #fff;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: var(--radius);
  padding: 1rem 1rem 1.15rem;
}
.exam-type-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.exam-type-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #dc2626;
  line-height: 1.3;
}
.exam-type-sub {
  font-size: 0.8125rem;
  color: #94a3b8;
}

/* 分组 */
.exam-type-group + .exam-type-group { margin-top: 0.85rem; }
.exam-type-group-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #dc2626;
}
.exam-type-group-title::before {
  content: '\25B6';
  font-size: 0.65rem;
  color: #dc2626;
}
.exam-type-group-title .egt-tag {
  font-weight: 500;
  color: #94a3b8;
  margin-left: 0.25rem;
  font-size: 0.75rem;
}

/* 题型网格 */
.exam-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}
@media (min-width: 640px) {
  .exam-type-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 题型卡 */
.exam-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 4.5rem;
  padding: 0.7rem 0.5rem;
  background: #fff;
  border: 1.5px solid #fca5a5;
  border-radius: 0.7rem;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}
.exam-type-card:hover {
  background: #dc2626;
  border-color: #dc2626;
  transform: translateY(-1px);
}
.exam-type-card .etc-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #dc2626;
  line-height: 1.3;
}
.exam-type-card .etc-code {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: #94a3b8;
  letter-spacing: 0.04em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.exam-type-card .etc-count {
  margin-top: 0.15rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: #94a3b8;
}
.exam-type-card:hover .etc-name,
.exam-type-card:hover .etc-code,
.exam-type-card:hover .etc-count {
  color: #fff;
}

/* +更多题型 占位（虚线灰卡） */
.exam-type-card.etc-more {
  border-style: dashed;
  border-color: #cbd5e1;
  background: #f8fafc;
}
.exam-type-card.etc-more:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: none;
}
.exam-type-card.etc-more .etc-name {
  color: #64748b;
  font-weight: 600;
  font-size: 0.95rem;
}
.exam-type-card.etc-more .etc-code,
.exam-type-card.etc-more .etc-count { color: #cbd5e1; }
.exam-type-card.etc-more:hover .etc-name { color: #475569; }
.exam-type-card.etc-more:hover .etc-count { color: #94a3b8; }
