/* ============================================================
 * style.css - 英语单词小达人 全局样式
 * 马卡龙配色 · 圆角大按钮 · 适配电脑浏览器与 iPad 触摸屏
 * ============================================================ */

/* ---------- 变量与基础 ---------- */
:root {
  --bg1: #FFF6E9;
  --bg2: #FFE9F2;
  --card: #FFFFFF;
  --primary: #FF9FB2;
  --primary-dark: #F47A93;
  --secondary: #8FD9C5;
  --secondary-dark: #5FBFA5;
  --accent: #FFD166;
  --purple: #B8A7E6;
  --blue: #A8D8F0;
  --ink: #5B4B5A;
  --ink-light: #9A8698;
  --danger: #F78CA2;
  --radius: 22px;
  --shadow: 0 6px 18px rgba(180, 140, 170, 0.18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Comic Sans MS", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  font-size: 18px;
}

body { padding-bottom: 40px; touch-action: manipulation; }

.hidden { display: none !important; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(180, 140, 170, 0.12);
}
.back-btn {
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: var(--bg1);
  font-size: 26px;
  cursor: pointer;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.back-btn:active { transform: scale(0.92); }
.top-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-stats { display: flex; gap: 8px; flex-shrink: 0; }
.top-badge {
  background: linear-gradient(135deg, #FFF3C4, #FFE0A3);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 17px;
  font-weight: 700;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

/* ---------- 视图容器 ---------- */
.view { display: none; max-width: 720px; margin: 0 auto; padding: 18px 16px; }
.view.active { display: block; animation: viewIn 0.35s ease; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 首页 ---------- */
.hero { text-align: center; padding: 20px 0 10px; }
.hero-emoji { font-size: 76px; animation: floatY 3s ease-in-out infinite; }
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.hero-title { margin: 6px 0 2px; font-size: 32px; font-weight: 900; color: var(--primary-dark); letter-spacing: 2px; }
.hero-sub { margin: 0; color: var(--ink-light); font-size: 18px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0;
}
.stat-card {
  background: var(--card);
  border-radius: 18px;
  padding: 14px 6px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-num { font-size: 24px; font-weight: 900; }
.stat-label { font-size: 14px; color: var(--ink-light); margin-top: 4px; }

.today-line {
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 16px;
  color: var(--ink-light);
}
.today-time { margin-left: 8px; font-weight: 700; color: var(--secondary-dark); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 20px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  min-height: 52px;
  color: #fff;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  box-shadow: var(--shadow);
  user-select: none;
}
.btn:active { transform: scale(0.95); }
.btn.small { padding: 10px 18px; font-size: 16px; min-height: 44px; }
.btn-big { width: 100%; padding: 20px 26px; font-size: 24px; margin: 10px 0; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.btn-secondary { background: linear-gradient(135deg, var(--secondary), var(--secondary-dark)); }
.btn-ghost { background: #fff; color: var(--ink); border: 2px solid #F0DFE8; box-shadow: none; }
.btn-danger { background: linear-gradient(135deg, #FFA8B8, var(--danger)); }
.btn-tool { background: linear-gradient(135deg, var(--blue), #8FC4E8); padding: 12px 20px; font-size: 18px; min-height: 48px; flex: 1; }

/* ---------- 功能卡片 ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 8px; }
.feature-card {
  background: var(--card);
  border: none;
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-family: inherit;
}
.feature-card:active { transform: scale(0.96); }
.feature-icon { font-size: 42px; }
.feature-name { font-size: 20px; font-weight: 800; margin-top: 6px; }
.feature-desc { font-size: 14px; color: var(--ink-light); margin-top: 2px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}
.card-title { margin: 0 0 12px; font-size: 21px; font-weight: 800; }
.card-tip { margin: 0 0 14px; font-size: 15px; color: var(--ink-light); line-height: 1.6; }

/* ---------- 设置页 ---------- */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-card {
  background: #FFF6FA;
  border: 3px solid #F3DCE7;
  border-radius: 18px;
  padding: 16px 12px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.mode-card.active { border-color: var(--primary); background: #FFF0F5; }
.mode-arrow { font-size: 22px; font-weight: 900; }
.mode-desc { font-size: 14px; color: var(--ink-light); margin-top: 6px; line-height: 1.5; }

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  background: #F6EFF3;
  color: var(--ink);
  cursor: pointer;
  min-height: 46px;
}
.chip.active { background: linear-gradient(135deg, var(--accent), #F5B942); color: #fff; box-shadow: var(--shadow); }
.chip.small { padding: 8px 14px; font-size: 15px; min-height: 40px; }
.chip-row.wrap { margin-top: 6px; }

.setup-info {
  text-align: center;
  background: #FFF7E6;
  border-radius: 16px;
  padding: 14px;
  margin: 14px 0;
  font-size: 17px;
  line-height: 1.6;
}

/* ---------- 默写页 ---------- */
.dict-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.round-badge {
  background: linear-gradient(135deg, var(--purple), #9C87D6);
  color: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 800;
}
.word-index { font-size: 16px; color: var(--ink-light); font-weight: 700; }
.dict-points { font-size: 18px; font-weight: 900; }

.progress-track {
  height: 16px;
  border-radius: 999px;
  background: #F3E3EC;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  background-size: 200% 100%;
  animation: slideBg 2.5s linear infinite;
  transition: width 0.4s ease;
}
@keyframes slideBg { from { background-position: 0 0; } to { background-position: 200% 0; } }
.progress-text { text-align: center; font-size: 15px; color: var(--ink-light); margin: 6px 0 12px; }

.dict-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  box-shadow: var(--shadow);
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.dict-question { font-size: 44px; font-weight: 900; line-height: 1.3; word-break: break-word; }
.dict-question.zh-question { color: var(--primary-dark); }
.dict-question.en-question { color: #6A8FC7; letter-spacing: 2px; }
.dict-extra-hint { margin-top: 8px; font-size: 16px; color: var(--ink-light); }

/* 字母填空 */
.letter-pattern { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 20px 0 8px; }
.letter-box {
  width: 48px;
  height: 56px;
  border-radius: 14px;
  border: 3px solid #F0C6D8;
  background: #FFF;
  text-align: center;
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  font-family: inherit;
  outline: none;
  caret-color: var(--primary);
}
.letter-box:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 159, 178, 0.25); }
.letter-given {
  border-color: transparent;
  background: #FFF0F5;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 中文输入 */
.dict-input-wrap { width: 100%; max-width: 420px; margin: 18px auto 6px; }
.dict-input {
  width: 100%;
  border: 3px solid #F0C6D8;
  border-radius: 18px;
  padding: 16px;
  font-size: 24px;
  font-family: inherit;
  text-align: center;
  outline: none;
  min-height: 60px;
}
.dict-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 159, 178, 0.25); }
.match-pct { margin-top: 8px; font-size: 16px; font-weight: 700; color: var(--ink-light); min-height: 20px; }
.match-pct.good { color: var(--secondary-dark); }

.dict-feedback { min-height: 28px; font-size: 18px; font-weight: 700; margin-top: 10px; }
.dict-feedback.wrong { color: var(--danger); animation: shake 0.4s ease; }

.combo-wrap { position: relative; height: 0; text-align: center; }
.combo-badge {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #FF9A3D, #FF5E62);
  color: #fff;
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 20px;
  font-weight: 900;
  box-shadow: var(--shadow);
  white-space: nowrap;
  z-index: 5;
}
@keyframes comboPop {
  0% { transform: translateX(-50%) scale(0.3); opacity: 0; }
  40% { transform: translateX(-50%) scale(1.25); opacity: 1; }
  100% { transform: translateX(-50%) scale(1) translateY(-20px); opacity: 0; }
}

.dict-actions { margin-top: 16px; }
.dict-tools { display: flex; gap: 12px; margin-top: 12px; }

/* ---------- 结果页 ---------- */
.result-hero { text-align: center; padding: 24px 0 6px; }
.result-stars { font-size: 40px; letter-spacing: 6px; }
.result-title { font-size: 30px; font-weight: 900; color: var(--primary-dark); margin: 8px 0; }
.result-rate-big {
  width: 140px;
  height: 140px;
  margin: 10px auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFF3C4, #FFE0A3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.result-rate-big span { font-size: 40px; font-weight: 900; color: #E08A00; }
.result-rate-label { font-size: 14px; color: #B5780A; }
.result-points { font-size: 24px; font-weight: 900; color: var(--secondary-dark); margin-top: 10px; }
.result-time { font-size: 16px; color: var(--ink-light); margin-top: 4px; }

.result-subtitle { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.wrong-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed #F0DFE8;
}
.wrong-en { font-size: 20px; font-weight: 800; min-width: 100px; }
.wrong-zh { flex: 1; color: var(--ink-light); font-size: 16px; }
.wrong-count { font-size: 13px; color: #C9A9B8; }

.result-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

/* ---------- 单词库 ---------- */
.search-input {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 15px 22px;
  font-size: 19px;
  font-family: inherit;
  box-shadow: var(--shadow);
  outline: none;
  background: #fff;
}
.wl-list { margin-top: 14px; }
.wl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 16px;
  padding: 12px 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.wl-check { position: relative; flex-shrink: 0; width: 30px; height: 30px; }
.wl-check input { opacity: 0; width: 0; height: 0; }
.checkmark {
  position: absolute;
  top: 0; left: 0;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: #F6EFF3;
  border: 2px solid #E3CBD8;
}
.wl-check input:checked + .checkmark { background: var(--secondary); border-color: var(--secondary-dark); }
.wl-check input:checked + .checkmark::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}
.wl-info { flex: 1; min-width: 0; }
.wl-en { font-size: 21px; font-weight: 800; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.wl-phonetic { font-size: 14px; color: var(--ink-light); font-weight: 400; }
.wl-group-tag {
  background: #DFF5E8;
  color: #2E9E6B;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.wl-zh { font-size: 15px; color: var(--ink-light); margin-top: 2px; }
.wl-level {
  background: #F0EBFF;
  color: #8A74D0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.wl-summary { text-align: center; font-size: 15px; color: var(--ink-light); margin: 12px 0; }
.wl-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.mastery-badge {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}
.st-new { background: #EFEFEF; color: #888; }
.st-learning { background: #FFF3C4; color: #B5780A; }
.st-mastered { background: #CFF3E8; color: #1E8A6A; }
.st-proficient { background: #CDE7FF; color: #1B6FBD; }

.icon-btn {
  border: none;
  background: #F6EFF3;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  font-size: 19px;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn:active { transform: scale(0.9); }

/* 发音喇叭按钮（音标旁） */
.speak-btn {
  border: none;
  background: linear-gradient(135deg, var(--blue), #8FC4E8);
  color: #fff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.speak-btn:hover { filter: brightness(1.06); }
.speak-btn:active { transform: scale(0.85); }

/* ---------- 导入页 ---------- */
.tabs { display: flex; gap: 8px; background: #fff; border-radius: 999px; padding: 6px; box-shadow: var(--shadow); margin-bottom: 14px; }
.tab {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 12px 8px;
  font-size: 17px;
  font-weight: 800;
  font-family: inherit;
  background: transparent;
  color: var(--ink-light);
  cursor: pointer;
}
.tab.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }

.import-panel { animation: viewIn 0.3s ease; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; opacity: 0; width: 0; height: 0; }

.preview-wrap { margin-top: 12px; }
.preview-row {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.preview-en, .preview-zh {
  flex: 1;
  border: 2px solid #F0DFE8;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 17px;
  font-family: inherit;
  outline: none;
  min-width: 0;
}
.preview-en:focus, .preview-zh:focus { border-color: var(--primary); }

.ocr-progress { margin: 14px 0; text-align: center; }
.ocr-progress-track { height: 14px; border-radius: 999px; background: #F3E3EC; overflow: hidden; }
.ocr-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--secondary), var(--blue));
  transition: width 0.3s ease;
}
.ocr-progress-text { font-size: 15px; color: var(--ink-light); margin-top: 8px; }

.form-label { display: block; font-size: 15px; font-weight: 700; color: var(--ink-light); margin: 12px 0 6px; }
.form-input {
  width: 100%;
  border: 2px solid #F0DFE8;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 18px;
  font-family: inherit;
  outline: none;
  background: #fff;
}
.form-input:focus { border-color: var(--primary); }

/* ---------- 家长报告 ---------- */
.pin-panel { max-width: 420px; margin: 30px auto; text-align: center; }
.pin-input {
  width: 100%;
  border: 3px solid #F0C6D8;
  border-radius: 18px;
  padding: 16px;
  font-size: 30px;
  font-family: inherit;
  text-align: center;
  letter-spacing: 14px;
  outline: none;
  margin-bottom: 10px;
}
.pin-input:focus { border-color: var(--primary); }
.pin-input.small { font-size: 22px; letter-spacing: 6px; max-width: 200px; display: inline-block; padding: 10px; }
.pin-msg { color: var(--danger); font-size: 15px; min-height: 22px; margin-bottom: 6px; }
.report-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 6px; }
.pin-change { display: flex; gap: 8px; align-items: center; }

/* 7 天柱状图 */
.chart7 { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 190px; padding-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart-val { font-size: 12px; color: var(--ink-light); margin-bottom: 4px; }
.chart-bar {
  width: 100%;
  max-width: 44px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, var(--primary), #F7A9BD);
  min-height: 4px;
  transition: height 0.5s ease;
}
.chart-bar.today { background: linear-gradient(180deg, var(--accent), #F5B942); }
.chart-label { font-size: 13px; color: var(--ink-light); margin-top: 6px; font-weight: 700; }
.chart-label.today { color: #E08A00; }

/* 掌握度列表 */
.mastery-list { margin-top: 8px; }
.mastery-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed #F0DFE8;
  flex-wrap: wrap;
}
.mastery-en { font-size: 19px; font-weight: 800; min-width: 90px; }
.mastery-zh { font-size: 14px; color: var(--ink-light); flex: 1; min-width: 80px; }
.mastery-streak { font-size: 13px; color: #B5780A; background: #FFF7E6; border-radius: 999px; padding: 3px 10px; }
.mastery-time { font-size: 12px; color: #C9A9B8; }

/* 历史列表 */
.history-list { margin-top: 8px; }
.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed #F0DFE8;
  font-size: 15px;
  flex-wrap: wrap;
}
.history-time { min-width: 130px; font-weight: 700; }
.history-mode { color: #8A74D0; font-weight: 800; }
.history-count { color: var(--ink); }
.history-rate { font-weight: 900; color: var(--secondary-dark); }
.history-dur { color: var(--ink-light); margin-left: auto; }

.export-card { background: #FFFDF5; }
.export-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(91, 75, 90, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background: #fff;
  border-radius: 26px;
  padding: 22px;
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: modalIn 0.28s ease;
}
@keyframes modalIn {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-title { margin: 0; font-size: 22px; font-weight: 900; }
.modal-close {
  border: none;
  background: #F6EFF3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}
.modal-actions { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
.spacer { flex: 1; }

/* 拼读弹窗 */
.pm-content { line-height: 1.6; }
.pm-word { font-size: 34px; font-weight: 900; color: var(--primary-dark); text-align: center; }
.pm-phonetic { font-size: 20px; color: var(--ink-light); font-weight: 400; }
.pm-syllables { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0; }
.syllable-chip {
  background: #F0EBFF;
  border-radius: 14px;
  padding: 8px 14px;
  text-align: center;
}
.syl-text { font-size: 22px; font-weight: 900; color: #6A54B8; }
.syl-hint { font-size: 13px; color: #8A74D0; margin-top: 2px; max-width: 160px; }
.pm-mnemonic {
  background: #FFF7E6;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 17px;
}
.pm-patterns { margin-top: 6px; }
.pattern-item {
  border-left: 4px solid var(--secondary);
  background: #F4FBF8;
  border-radius: 0 12px 12px 0;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.pattern-key { display: inline-block; font-weight: 900; color: var(--secondary-dark); margin-right: 8px; font-size: 18px; }
.pattern-ph { color: #6A54B8; font-weight: 800; }
.pattern-tip { font-size: 15px; margin-top: 4px; }
.similar-title { font-size: 15px; font-weight: 800; color: var(--ink-light); margin: 12px 0 6px; }
.similar-words { display: flex; flex-wrap: wrap; gap: 8px; }
.similar-chip {
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 17px;
  font-weight: 800;
}

/* 跟读弹窗 */
.score-circle {
  width: 150px;
  height: 150px;
  margin: 12px auto;
  border-radius: 50%;
  background: #F6EFF3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: background 0.3s;
}
.score-circle span { font-size: 46px; font-weight: 900; color: var(--ink); }
.score-label { font-size: 14px; color: var(--ink-light); }
.score-circle.sgood { background: linear-gradient(135deg, #CFF3E8, #8FD9C5); }
.score-circle.smid { background: linear-gradient(135deg, #FFF3C4, #FFD166); }
.score-circle.sbad { background: linear-gradient(135deg, #FFE0E8, #F7A9BD); }
.sm-heard { text-align: center; font-size: 18px; font-weight: 700; margin: 8px 0; min-height: 26px; }
.sm-feedback { text-align: center; font-size: 17px; margin-bottom: 12px; min-height: 26px; }
.sm-feedback.good { color: var(--secondary-dark); font-weight: 800; }
.sm-feedback.mid { color: #C98A00; }
.sm-feedback.bad { color: var(--danger); }
.sm-feedback.listening { color: var(--primary-dark); font-weight: 800; animation: pulse 1s ease infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ---------- 庆祝遮罩 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 246, 233, 0.92);
  cursor: pointer;
}
.celebrate-title {
  font-size: 44px;
  font-weight: 900;
  color: var(--primary-dark);
  text-align: center;
  animation: bounceIn 0.6s ease;
  z-index: 2;
}
@keyframes bounceIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.celebrate-rain { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.rain-emoji {
  position: absolute;
  top: -60px;
  animation: rainFall linear infinite;
}
@keyframes rainFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0.6; }
}

/* ---------- 星星飞出 ---------- */
.star-fly {
  position: fixed;
  z-index: 150;
  font-size: 30px;
  pointer-events: none;
  animation: starFly ease-out forwards;
}
@keyframes starFly {
  0% { transform: translateY(0) scale(0.4); opacity: 1; }
  60% { transform: translateY(-46px) scale(1.15); opacity: 1; }
  100% { transform: translateY(-90px) scale(0.8); opacity: 0; }
}

/* ---------- 摇晃 ---------- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-5px); }
}
.shake { animation: shake 0.4s ease; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  background: rgba(91, 75, 90, 0.92);
  color: #fff;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 18px;
  font-weight: 700;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 88vw;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-round { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); font-size: 20px; padding: 16px 28px; }
.toast-standard { background: linear-gradient(135deg, var(--secondary), var(--secondary-dark)); }

/* ---------- 空状态 ---------- */
.empty-tip { text-align: center; color: var(--ink-light); font-size: 16px; padding: 26px 0; }

/* ---------- 响应式：小屏 / 平板 ---------- */
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .dict-question { font-size: 36px; }
  .letter-box { width: 40px; height: 50px; font-size: 26px; }
  .mode-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 27px; }
  .top-badge { padding: 6px 10px; font-size: 15px; }
}

/* iPad 横竖屏安全区 */
@supports (padding: max(0px)) {
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}

/* 打印友好 */
@media print {
  .topbar, .btn, .modal, .overlay, .toast { display: none !important; }
}
