* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #f0f2f5;
  color: #1f2937;
  overscroll-behavior: none;
  line-height: 1.6;
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
}

.direction-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}

.dir-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #9ca3af;
  transition: color 0.3s;
  cursor: pointer;
}

.dir-label.active {
  color: var(--primary);
  font-weight: 600;
}

.dir-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.dir-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dir-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 24px;
  transition: background 0.3s;
}

.dir-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.dir-switch input:checked + .dir-slider {
  background: var(--primary);
}

.dir-switch input:checked + .dir-slider::before {
  transform: translateX(20px);
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--card);
  box-shadow: var(--shadow);
  z-index: 100;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sidebar.folded {
  transform: translateX(-100%);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
  display: none;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.sidebar-nav {
  list-style: none;
  padding: 12px;
  flex: 1;
}

.nav-item {
  display: block;
  padding: 12px 20px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 4px;
}

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

.home-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

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

.unit-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.unit-status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}

.status_complete { background: #d1fae5; color: #065f46; }
.status-progress { background: #dbeafe; color: #1e40af; }
.status-new { background: #f3f4f6; color: #6b7280; }

.unit-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.progress-bar-container {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.stat-words, .stat-pct {
  font-size: 0.8rem;
  color: var(--text-light);
}

.stat-pct { margin-left: auto; }

.settings-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.stat-row:last-child { border-bottom: none; }

.btn-settings {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.btn-export {
  background: #eff6ff;
  color: #1e40af;
}

.btn-import {
  background: #f0fdf4;
  color: #166534;
}

.btn-reset {
  background: #fef2f2;
  color: #dc2626;
}

.review-page, .settings-page, .stats-page {
  max-width: 600px;
  margin: 0 auto;
}

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

.review-count {
  font-size: 0.9rem;
  color: var(--text-light);
}

.review-actions {
  margin-top: 16px;
  text-align: center;
}

.btn-primary {
  padding: 12px 28px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}

.review-empty, .review-complete {
  text-align: center;
  padding: 40px 20px;
}

.review-empty-icon, .review-complete-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.flashcard-page {
  max-width: 500px;
  margin: 0 auto;
}

.flashcard-progress {
  text-align: center;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.flashcard {
  background: var(--card);
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.flashcard-word {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.flashcard-phonetic {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.btn-speak {
  background: #eff6ff;
  border: 1px solid #c7d2fe;
  color: var(--primary);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
}

.flashcard-meaning {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.flashcard-example {
  font-size: 0.9rem;
  color: var(--text-light);
  font-style: italic;
}

.flashcard-actions {
  text-align: center;
  margin-top: 20px;
}

.btn-flip {
  padding: 10px 24px;
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.flashcard-rating {
  margin-top: 24px;
}

.rating-label {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.rating-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-rating {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-again { background: #fef2f2; color: #dc2626; }
.btn-hard { background: #fffbeb; color: #f59e0b; }
.btn-good { background: #eff6ff; color: #1e40af; }
.btn-easy { background: #d1fae5; color: #065f46; }

.stats-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.stats-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

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

.stat-grid.mt-lg {
  margin-top: 12px;
}

.stat-card {
  background: #f8fafc;
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
}

.session-list {
  max-height: 300px;
  overflow-y: auto;
}

.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.session-info {
  display: flex;
  gap: 8px;
  align-items: center;
}

.session-unit {
  font-weight: 600;
  font-size: 0.95rem;
}

.session-dir {
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: #f3f4f6;
  color: var(--text-light);
}

.session-time {
  font-size: 0.8rem;
  color: var(--text-light);
}

.home-page {
  max-width: 700px;
  margin: 0 auto;
}

.nav-item:hover {
  background: #f3f4f6;
}

.nav-item.active {
  background: var(--primary);
  color: #ffffff;
}

.main-content {
  margin-left: 280px;
  padding: 1.5rem;
  transition: margin-left 0.3s ease;
  flex: 1;
  min-width: 0;
}

.main-content.sidebar-folded {
  margin-left: 0;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.top-bar-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.module-content {
  padding: 0;
  min-height: 60vh;
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.unit-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.25s ease;
  border-left: 4px solid transparent;
}

.unit-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.unit-card.complete {
  border-left-color: var(--success);
}

.unit-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.unit-card-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.unit-stats {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 8px;
}

.review-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: #fef2f2;
  color: #dc2626;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.sidebar-fold-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  left: 280px;
  width: 24px;
  height: 48px;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-left: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  z-index: 101;
  transition: left 0.3s ease;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.875rem;
}

.settings-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.settings-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
  background: var(--primary);
  color: #ffffff;
}

.settings-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.settings-btn.danger {
  background: var(--danger);
}

.review-list {
  list-style: none;
}

.review-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

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

.review-word {
  font-weight: 700;
  color: var(--text);
}

.btn-review {
  padding: 6px 14px;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-review:hover {
  background: var(--primary);
  color: #ffffff;
}

@keyframes fcCorrect {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

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

@keyframes fcArrow {
  0% { opacity: 0; transform: translateX(-10px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes fcPop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes vizPulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 0 20px 8px rgba(99, 102, 241, 0.15); transform: scale(1.01); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); transform: scale(1); }
}

@keyframes vizBarShimmer {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.4); }
  100% { filter: brightness(1); }
}

@keyframes vizNumPop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .main-content.sidebar-folded {
    margin-left: 0;
  }

  .unit-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar-fold-btn {
    left: 0;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 75vw;
    max-width: 300px;
  }

  .sidebar-fold-btn {
    left: 0;
  }

  .unit-grid {
    grid-template-columns: 1fr;
  }

  .top-bar {
    padding: 12px 16px;
  }

  .top-bar-title {
    font-size: 1rem;
  }

  .main-content {
    padding: 1rem;
  }

  .unit-card {
    padding: 16px;
    border-radius: 12px;
  }

  .unit-card-title {
    font-size: 1rem;
  }

  .top-bar {
    border-radius: 8px;
  }

  .settings-section {
    padding: 16px;
    border-radius: 8px;
  }

  .nav-item {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}

.top-bar-user {
  font-size: 0.85rem;
  color: #6366f1;
  font-weight: 600;
  margin-left: auto;
  padding: 4px 12px;
  background: #eef2ff;
  border-radius: 20px;
  white-space: nowrap;
}

.loading-text {
  text-align: center;
  color: #9ca3af;
  padding: 40px 0;
  font-size: 0.95rem;
}

/* ===== 错题本 ===== */
.mistake-page { padding: 20px; max-width: 900px; margin: 0 auto; }
.mistake-header { text-align: center; margin-bottom: 20px; }
.mistake-title { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.mistake-subtitle { font-size: 0.85rem; color: var(--text-light); }

.mistake-stats { margin-bottom: 16px; }
.mistake-stat-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.mistake-stat-card { background: #fff; border-radius: 12px; padding: 12px 20px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.08); min-width: 80px; }
.mistake-stat-num { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.mistake-stat-label { font-size: 0.75rem; color: var(--text-light); margin-top: 2px; }

.mistake-stat-sub { font-size: 0.8rem; font-weight: 600; color: var(--text-light); }

.mistake-actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 16px; }

.mistake-sections { display: flex; flex-direction: column; gap: 20px; }
.mistake-section { background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.mistake-section-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.mistake-section-count { font-size: 0.8rem; font-weight: 600; background: #eff6ff; color: #1e40af; padding: 2px 8px; border-radius: 10px; }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: 8px; }

.mistake-list { min-height: 200px; }
.mistake-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mistake-card { background: #fff; border-radius: 10px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border-left: 3px solid var(--primary); cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; }
.mistake-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.12); transform: translateY(-1px); }
.mistake-card-word { font-weight: 600; font-size: 1rem; color: var(--text); }
.mistake-card-meta { font-size: 0.7rem; color: #94a3b8; margin-top: 6px; }

.mistake-group-label { font-size: 0.75rem; font-weight: 600; color: var(--text-light); margin: 12px 0 8px; }
.mistake-group-label:first-child { margin-top: 0; }
.mistake-progress { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.mistake-dot { width: 8px; height: 8px; border-radius: 50%; background: #e2e8f0; display: inline-block; }
.mistake-dot.on { background: var(--primary); }
.mistake-next { font-size: 0.65rem; color: #64748b; margin-left: 2px; }
.mistake-strength { font-size: 0.65rem; color: #a16207; margin-top: 4px; }

.mistake-empty { text-align: center; padding: 40px; color: var(--text-light); font-size: 0.9rem; }

/* ===== 单元内选词范围页 ===== */
.range-page { max-width: 640px; margin: 0 auto; }
.range-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.range-title { font-size: 1.05rem; color: var(--text); }
.range-hint { font-size: 0.82rem; color: var(--text-light); line-height: 1.6; margin-bottom: 12px; }
.range-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.range-preset {
  padding: 6px 14px; background: #eef2ff; color: #4f46e5;
  border: 1px solid #c7d2fe; border-radius: 999px;
  font-size: 0.8rem; cursor: pointer; transition: background 0.15s;
}
.range-preset:hover { background: #e0e7ff; }
.range-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; background: #f8fafc; border-radius: 10px; margin-bottom: 10px;
}
.range-bar #rangeText { font-size: 0.85rem; color: var(--text); font-weight: 600; }
.range-bar .btn-primary { padding: 8px 18px; font-size: 0.85rem; }
.range-list { max-height: 52vh; overflow-y: auto; border: 1px solid #e5e7eb; border-radius: 10px; }
.range-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: background 0.12s;
}
.range-row:last-child { border-bottom: none; }
.range-row:hover { background: #f8fafc; }
.range-row.on { background: #eef2ff; }
.range-no {
  min-width: 26px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  background: #f1f5f9; color: #64748b; border-radius: 6px; font-size: 0.72rem; font-weight: 700;
}
.range-row.on .range-no { background: var(--primary); color: #fff; }
.range-word { flex: 1; font-size: 0.92rem; color: var(--text); font-weight: 600; }
.range-lv { font-size: 0.72rem; white-space: nowrap; }
.btn-back {
  padding: 6px 12px; background: #f1f5f9; color: #475569;
  border: 1px solid #e2e8f0; border-radius: 8px; font-size: 0.8rem; cursor: pointer;
}
.btn-back:hover { background: #e2e8f0; }

.btn-secondary {
  padding: 12px 28px;
  background: #f1f5f9;
  color: var(--text);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}
.btn-secondary:hover { background: #e2e8f0; }

/* ===== 学习恢复弹窗 ===== */
.restore-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}
.restore-dialog {
  background: white;
  border-radius: 20px;
  width: 90%; max-width: 420px;
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.restore-dialog h3 {
  font-size: 1.3rem;
  color: #1f2937;
  margin: 0 0 12px 0;
  text-align: center;
}
.restore-dialog p {
  font-size: 0.95rem;
  color: #6b7280;
  margin: 0 0 24px 0;
  text-align: center;
  line-height: 1.6;
}
.restore-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.restore-btn {
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.restore-btn-exit {
  background: #f3f4f6;
  color: #6b7280;
}
.restore-btn-exit:hover {
  background: #e5e7eb;
}
.restore-btn-continue {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.restore-btn-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}
@media (max-width: 768px) {
  .restore-dialog { width: 95%; max-width: none; padding: 28px 24px; }
  .restore-buttons { flex-direction: column; }
  .restore-btn { width: 100%; }
}

/* ===== 班级版：首页打卡统计条 & 排行榜 ===== */
.home-stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
  font-size: 0.9rem;
  color: #92400e;
}

.home-stats-bar strong {
  font-weight: 700;
  color: #b45309;
}

.leaderboard-page {
  max-width: 720px;
  margin: 0 auto;
}

.lb-title {
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lb-table th,
.lb-table td {
  padding: 10px 12px;
  text-align: center;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.lb-table th {
  background: #f9fafb;
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.82rem;
}

.lb-table tbody tr:last-child td {
  border-bottom: none;
}

.lb-rank {
  font-weight: 600;
}

.lb-name {
  font-weight: 600;
  color: var(--text);
}

/* 当前用户行高亮 */
.lb-row-me td {
  background: #eef2ff;
}

.lb-row-me .lb-name {
  color: var(--primary);
}

/* 当前用户不在前 20 名时的分隔行 */
.lb-gap-row td {
  background: #f9fafb;
  color: var(--text-light);
  padding: 4px;
  letter-spacing: 2px;
}

.lb-empty {
  color: var(--text-light);
  padding: 30px 0 !important;
}

.lb-my-rank {
  margin-top: 14px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
}

.lb-my-stats {
  margin-top: 10px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}

@media (max-width: 480px) {
  .lb-table th,
  .lb-table td {
    padding: 8px 6px;
    font-size: 0.82rem;
  }
}
