/* ============ 基础重置 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  color: #2d3142;
  background: #fef6e4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul, li { list-style: none; }
:root {
  --primary: #f582ae;
  --primary-dark: #e5679a;
  --accent: #8bd3dd;
  --warm: #ffd803;
  --bg: #fef6e4;
  --card: #ffffff;
  --text: #2d3142;
  --text-light: #8d99ae;
  --success: #06d6a0;
  --danger: #ef476f;
  --shadow: 0 4px 14px rgba(45,49,66,.08);
  --shadow-lg: 0 8px 24px rgba(45,49,66,.12);
  --radius: 16px;
}

/* ============ 应用容器 ============ */
#app {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 30px rgba(0,0,0,.04);
}

/* ============ 顶部状态栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 2px 10px rgba(245,130,174,.3);
}
.topbar-left { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.topbar-left .logo { font-size: 22px; }
.topbar-left .title { font-size: 17px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.level-badge {
  background: rgba(255,255,255,.25);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}
.star-count {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,.25);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}
.star-icon { animation: twinkle 1.6s infinite; }
@keyframes twinkle { 0%,100%{transform:scale(1)} 50%{transform:scale(1.2)} }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

/* ============ 主视图 ============ */
#view {
  flex: 1;
  padding: 16px;
  padding-bottom: 80px;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

/* ============ 底部导航 ============ */
.tabbar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: #fff;
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  z-index: 50;
  padding: 6px 0;
  padding-bottom: env(safe-area-inset-bottom, 6px);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  color: var(--text-light);
  transition: all .2s;
}
.tab.active { color: var(--primary); }
.tab.active .tab-icon { transform: scale(1.15); }
.tab-icon { font-size: 22px; transition: transform .2s; }
.tab-label { font-size: 11px; font-weight: 600; }

/* ============ 登录页 ============ */
.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #ffd6e0 0%, #c5fad5 50%, #c2e3ff 100%);
  text-align: center;
}
.login-mascot {
  font-size: 80px;
  margin-bottom: 12px;
  animation: bounce 2s infinite;
}
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
.login-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.login-sub {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 28px;
}
.login-card {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.login-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #eee;
  border-radius: 12px;
  font-size: 16px;
  margin-bottom: 14px;
  transition: border-color .2s;
}
.login-input:focus { border-color: var(--primary); outline: none; }
.login-input::placeholder { color: #ccc; }
.grade-pick {
  display: flex; gap: 8px; margin-bottom: 18px;
}
.grade-pick button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  background: #f5f5f5;
  color: var(--text-light);
  font-weight: 600;
  font-size: 14px;
  transition: all .2s;
}
.grade-pick button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(245,130,174,.4);
}
.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(245,130,174,.4);
  transition: transform .15s;
}
.btn-primary:active { transform: scale(.97); }

/* ============ 首页 ============ */
.hero {
  background: linear-gradient(135deg, #f582ae, #8bd3dd);
  border-radius: 20px;
  padding: 20px;
  color: #fff;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
}
.hero-greet { font-size: 13px; opacity: .9; }
.hero-name { font-size: 22px; font-weight: 800; margin: 4px 0 10px; }
.hero-stats { display: flex; gap: 12px; }
.hero-stat {
  background: rgba(255,255,255,.2);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  backdrop-filter: blur(4px);
}
.hero-stat b { font-size: 18px; display: block; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
}
.section-title h3 { font-size: 17px; font-weight: 700; }
.section-title .more { font-size: 13px; color: var(--text-light); }

.subject-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.subject-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform .15s;
}
.subject-card:active { transform: scale(.97); }
.subject-card .sc-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin-bottom: 10px;
}
.subject-card .sc-name { font-size: 16px; font-weight: 700; }
.subject-card .sc-progress { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.progress-bar {
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
.progress-bar > span {
  display: block;
  height: 100%;
  border-radius: 3px;
  transition: width .4s;
}

/* ============ 学科详情页 ============ */
.subject-header {
  border-radius: 18px;
  padding: 18px;
  color: #fff;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.sh-title { font-size: 20px; font-weight: 800; }
.sh-desc { font-size: 13px; opacity: .9; margin-top: 4px; }
.sh-big { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 60px; opacity: .3; }

.book-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.book-tab {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  background: #fff;
  color: var(--text-light);
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow);
  transition: all .2s;
}
.book-tab.active { background: var(--text); color: #fff; }

.unit-list { display: flex; flex-direction: column; gap: 10px; }
.unit-item {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform .15s;
}
.unit-item:active { transform: scale(.98); }
.unit-item.locked { opacity: .55; }
.unit-num {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.unit-info { flex: 1; min-width: 0; }
.unit-name { font-size: 15px; font-weight: 700; }
.unit-lessons { font-size: 12px; color: var(--text-light); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit-stars { display: flex; gap: 2px; font-size: 14px; }
.unit-stars .s-on { color: var(--warm); }
.unit-stars .s-off { color: #ddd; }
.lock-icon { font-size: 18px; color: var(--text-light); }

/* ============ 单元学习页 ============ */
.unit-banner {
  border-radius: 16px;
  padding: 16px;
  color: #fff;
  margin-bottom: 14px;
}
.ub-title { font-size: 18px; font-weight: 800; }
.ub-lessons { font-size: 12px; opacity: .9; margin-top: 4px; }

.lessons-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  padding: 6px 12px;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  font-weight: 600;
}
.chip.lesson-chip {
  cursor: pointer;
  position: relative;
  padding-right: 26px;
  transition: transform .15s, box-shadow .15s;
}
.chip.lesson-chip::after {
  content: "📖";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: .6;
}
.chip.lesson-chip:active { transform: scale(.96); box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.chip.lesson-chip.active { background: var(--primary); color: #fff; box-shadow: 0 3px 10px rgba(245,130,174,.4); }
.chip.lesson-chip.active::after { opacity: .9; }

/* ============ 课文原文模态层 ============ */
#lessonModal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
#lessonModal .lm-mask {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
}
#lessonModal .lm-box {
  position: relative;
  width: 100%; max-width: 480px; max-height: 80vh;
  background: #fff;
  border-radius: 16px;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  animation: lmIn .25s ease;
}
@keyframes lmIn { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#lessonModal .lm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
#lessonModal .lm-title { font-size: 16px; font-weight: 800; color: var(--text); }
#lessonModal .lm-actions { display: flex; align-items: center; gap: 8px; }
#lessonModal .lm-play, #lessonModal .lm-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: #f5f5f5; color: #2d3142;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; cursor: pointer;
  transition: background .15s, transform .12s;
}
#lessonModal .lm-play { background: #fff0f5; color: var(--primary); }
#lessonModal .lm-play.playing { background: var(--primary); color: #fff; animation: lmPulse 1.2s ease-in-out infinite; }
#lessonModal .lm-play:active, #lessonModal .lm-close:active { transform: scale(.92); }
#lessonModal .lm-close { background: #f5f5f5; color: #8d99ae; font-size: 14px; }
#lessonModal .lm-close:active { background: #e8e8e8; }
@keyframes lmPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(245,130,174,.4); } 50% { box-shadow: 0 0 0 6px rgba(245,130,174,0); } }
#lessonModal .lm-body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  font-size: 15px; line-height: 1.8; color: #2d3142;
  white-space: pre-wrap;
}
#lessonModal .lm-body p { margin-bottom: 10px; }
#lessonModal .lm-body .lm-author { color: #8d99ae; font-size: 13px; margin-bottom: 12px; }

.knowledge-box {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.knowledge-box h4 { font-size: 15px; margin-bottom: 8px; color: var(--primary); }
.knowledge-box p { font-size: 13px; line-height: 1.7; color: var(--text); }
.knowledge-box ul { margin-top: 6px; }
.knowledge-box li { font-size: 13px; line-height: 1.8; padding-left: 16px; position: relative; }
.knowledge-box li::before { content: '•'; position: absolute; left: 4px; color: var(--primary); }

.action-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--success), #04b386);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(6,214,160,.35);
  margin-top: 6px;
  transition: transform .15s;
}
.action-btn:active { transform: scale(.97); }
.action-btn.secondary {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
}

/* ============ 测试页 ============ */
.test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}
.test-progress { font-size: 13px; color: var(--text-light); flex-shrink: 0; }
.test-timer { font-size: 13px; color: var(--primary); font-weight: 700; flex-shrink: 0; }
.test-autospeak {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.test-autospeak .tas-label { font-size: 12px; color: var(--text-light); }
/* 测试页用小一号的开关 */
.test-autospeak .switch { width: 36px; height: 20px; border-radius: 10px; }
.test-autospeak .switch-knob { width: 16px; height: 16px; }
.test-autospeak .switch.on .switch-knob { left: 18px; }
.test-bar {
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}
.test-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .3s;
}
.question-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.q-type {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}
.q-type.single { background: #ffe0ec; color: var(--primary); }
.q-type.judge { background: #e0f7fa; color: #00838f; }
.q-type.fill { background: #fff3cd; color: #b8860b; }
.q-type.voice { background: #e8f5e9; color: #2e7d32; }
.q-stem { font-size: 16px; font-weight: 700; line-height: 1.6; margin-bottom: 14px; }
.q-stem .speak-btn {
  display: inline-block;
  margin-left: 6px;
  font-size: 20px;
  vertical-align: middle;
  cursor: pointer;
}
.q-options { display: flex; flex-direction: column; gap: 8px; }
.q-option {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8f9fb;
  border: 2px solid transparent;
  font-size: 15px;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.q-option .opt-key {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  color: var(--text-light);
  flex-shrink: 0;
}
.q-option.selected { border-color: var(--primary); background: #ffeef4; }
.q-option.selected .opt-key { background: var(--primary); color: #fff; }
.q-option.correct { border-color: var(--success); background: #e6fff7; }
.q-option.correct .opt-key { background: var(--success); color: #fff; }
.q-option.wrong { border-color: var(--danger); background: #ffeef0; }
.q-option.wrong .opt-key { background: var(--danger); color: #fff; }

.fill-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #eee;
  border-radius: 10px;
  font-size: 15px;
}
.fill-input:focus { border-color: var(--primary); outline: none; }

.voice-question {
  text-align: center;
  padding: 10px 0;
}
.voice-play {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #5fb3b8);
  color: #fff;
  font-size: 36px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 6px 16px rgba(139,211,221,.5);
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
.voice-hint { font-size: 13px; color: var(--text-light); }

.explain-box {
  background: #fff8e1;
  border-left: 4px solid var(--warm);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  margin-top: 12px;
  color: #6d5800;
}

/* ============ 测试结果 ============ */
.result-screen {
  text-align: center;
  padding: 30px 16px;
}
.result-medal {
  font-size: 80px;
  margin-bottom: 12px;
  animation: bounce 2s infinite;
}
.result-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.result-score {
  font-size: 48px;
  font-weight: 800;
  color: var(--primary);
  margin: 12px 0;
}
.result-stars { font-size: 32px; margin-bottom: 16px; }
.result-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 18px 0;
  flex-wrap: wrap;
}
.result-stat {
  background: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text-light);
}
.result-stat b { font-size: 20px; color: var(--text); display: block; }
.result-actions { display: flex; gap: 10px; margin-top: 16px; }
.result-actions button { flex: 1; }

/* ============ 升级动画 ============ */
.levelup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  animation: fadeIn .3s;
}
.levelup-card {
  background: linear-gradient(135deg, #fff, #fff8e1);
  border-radius: 24px;
  padding: 30px 36px;
  text-align: center;
  box-shadow: 0 0 50px rgba(255,216,3,.5);
  animation: popIn .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes popIn { from{transform:scale(.5);opacity:0} to{transform:scale(1);opacity:1} }
.levelup-card .crown { font-size: 70px; animation: bounce 1s infinite; }
.levelup-card h2 { font-size: 24px; margin: 10px 0; color: var(--text); }
.levelup-card p { font-size: 14px; color: var(--text-light); }

/* ============ 成就页 ============ */
.achv-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.achv-icon {
  width: 50px; height: 50px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.achv-info { flex: 1; }
.achv-name { font-size: 15px; font-weight: 700; }
.achv-desc { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.achv-status { font-size: 18px; }
.achv-status.done { color: var(--success); }
.achv-status.lock { opacity: .3; }

.level-info {
  background: linear-gradient(135deg, var(--warm), #ff9e00);
  border-radius: 18px;
  padding: 20px;
  color: #fff;
  text-align: center;
  margin-bottom: 16px;
}
.level-info .lv-num { font-size: 40px; font-weight: 800; }
.level-info .lv-name { font-size: 16px; margin-top: 4px; }
.level-info .lv-bar {
  height: 10px;
  background: rgba(255,255,255,.3);
  border-radius: 5px;
  margin: 12px 0 6px;
  overflow: hidden;
}
.level-info .lv-bar > span { display: block; height: 100%; background: #fff; border-radius: 5px; transition: width .5s; }
.level-info .lv-tip { font-size: 12px; opacity: .9; }

/* ============ 我的页 ============ */
.profile-card {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 18px;
  padding: 20px;
  color: #fff;
  text-align: center;
  margin-bottom: 16px;
}
.profile-avatar { font-size: 60px; margin-bottom: 8px; }
.profile-name { font-size: 20px; font-weight: 800; }
.profile-grade { font-size: 13px; opacity: .9; margin-top: 2px; }

.stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 16px; }
.stat-cell {
  background: #fff;
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-cell .num { font-size: 22px; font-weight: 800; color: var(--primary); }
.stat-cell .label { font-size: 12px; color: var(--text-light); margin-top: 2px; }

.menu-list { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.menu-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 15px;
  cursor: pointer;
}
.menu-item:last-child { border-bottom: none; }
.menu-item .mi-icon { margin-right: 12px; font-size: 20px; }
.menu-item .mi-text { flex: 1; }
.menu-item .mi-arrow { color: #ccc; }

/* ============ 语音浮窗 ============ */
.speech-panel {
  position: fixed;
  bottom: 90px; left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 80;
  overflow: hidden;
  animation: slideUp .3s;
}
@keyframes slideUp { from{transform:translate(-50%,20px);opacity:0} to{transform:translate(-50%,0);opacity:1} }
.speech-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: #f0f7ff;
  font-size: 13px;
  font-weight: 700;
  color: #1976d2;
}
.speech-close { cursor: pointer; font-size: 16px; color: #999; }
.speech-body { padding: 14px; font-size: 16px; line-height: 1.7; min-height: 40px; }
.speech-ctrl { display: flex; gap: 8px; padding: 0 14px 12px; }
.btn-mini {
  padding: 6px 14px;
  border-radius: 8px;
  background: #e3f2fd;
  color: #1976d2;
  font-size: 13px;
  font-weight: 600;
}

/* ============ 通用 ============ */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}
.empty .emoji { font-size: 48px; display: block; margin-bottom: 8px; }
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,.25);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}
.divider { height: 1px; background: #eee; margin: 12px 0; }
.toast {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.8);
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 200;
  animation: fadeIn .2s;
}
.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

/* 滚动条美化 */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 2px; }

/* ============ 开关（switch） ============ */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #ccc;
  transition: background .2s;
  flex-shrink: 0;
  margin-left: auto;
}
.switch.on { background: var(--success); }
.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: left .2s;
}
.switch.on .switch-knob { left: 22px; }
