/* 本地内嵌西里尔手写字体（Marck Script，无需外网） */
@font-face {
  font-family: "Marck Script";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/MarckScript-Cyrillic.woff2") format("woff2");
  unicode-range: U+0400-045F, U+0301;
}

:root {
  --bg: #f4f7fc;
  --panel: #ffffff;
  --ink: #1f2a37;
  --muted: #6a7a8c;
  --accent: #2f6fb3;      /* 蓝色主色 */
  --accent-dark: #1e4e86;
  --gold: #8ab4e0;
  --border: #dee7f1;
  --shadow: 0 6px 20px rgba(20,50,90,.08);
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "思源宋体 CN", "Noto Serif SC", "Source Han Serif CN", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(135deg, #18355e, #2f6fb3);
  color: #fff;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 2px 14px rgba(12, 32, 66, .16);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  font-size: 1.7rem;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, #f5d27a, #e7b14a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  border-radius: 12px;
  padding: 3px 10px;
  box-shadow: inset 0 0 0 1.5px rgba(245, 210, 122, .55);
}
.brand h1 { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: .3px; }

nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-btn {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.08);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 500;
  transition: background .18s, transform .12s;
}
.nav-btn:hover { background: rgba(255,255,255,.24); transform: translateY(-1px); }
.nav-btn.active { background: #fff; color: var(--accent-dark); font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.14); }

main { max-width: 1000px; margin: 0 auto; padding: 28px 22px 72px; }

/* 进入视图的淡入 */
.view { display: none; animation: viewIn .35s ease; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h2 {
  margin: 4px 0 20px;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
h2::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-card .num { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-card .label { color: var(--muted); font-size: .9rem; margin-top: 4px; }

.panel {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 8px; }

/* 闪卡 */
#flashcardWrap { max-width: 520px; margin: 0 auto; text-align: center; }
.flashcard {
  position: relative;
  height: 300px;
  perspective: 1200px;
  margin-bottom: 20px;
}
.fc-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  transition: transform .4s ease;
}
.fc-back { transform: rotateY(180deg); }
.flashcard.flipped .fc-front { transform: rotateY(180deg); }
.flashcard.flipped .fc-back { transform: rotateY(0deg); }

.fc-word { font-size: 2.6rem; font-weight: 700; }
.fc-translit { color: var(--muted); font-style: italic; }
.fc-hint { color: var(--gold); font-size: .85rem; }
.fc-meaning { font-size: 1.5rem; font-weight: 600; color: var(--accent-dark); }
.fc-example { color: var(--muted); max-width: 90%; }
.audio-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.1rem;
}
.audio-btn:active { transform: scale(.92); }

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
}
.btn:hover { background: var(--accent-dark); }

.grade-row { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.grade {
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-size: .95rem;
  color: #fff;
}
.g0 { background: #c05353; }
.g1 { background: #d19a3d; }
.g2 { background: #4f9e62; }
.g3 { background: #3a7bd5; }
.grade:hover { filter: brightness(1.08); }
.grade.recommended { outline: 3px solid var(--gold); outline-offset: 1px; }

/* 辨词（选择题） */
.quiz-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  max-width: 640px;
  margin: 0 auto;
}
.quiz-wordbar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.quiz-wordbar .audio-btn { position: static; flex-shrink: 0; }
.quiz-wordbar .fc-hint { margin-left: auto; }
.quiz-prompt { color: var(--muted); margin: 6px 0 16px; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .quiz-options { grid-template-columns: 1fr; } }
.quiz-option {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1.05rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .05s;
}
.quiz-option:hover:not(:disabled) { border-color: var(--accent); background: #eef4fb; }
.quiz-option:active:not(:disabled) { transform: scale(.99); }
.quiz-option:disabled { cursor: default; }
.quiz-option.correct { border-color: #4f9e62; background: #e9f6ec; font-weight: 600; }
.quiz-option.wrong { border-color: #c05353; background: #fbecec; }
.quiz-feedback {
  margin-top: 18px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.quiz-answer { font-size: 1.15rem; font-weight: 600; color: var(--accent-dark); }
.quiz-feedback .fc-example { margin-top: 6px; }
#quizGradeRow { margin-top: 18px; text-align: center; }

/* 字母表 */
.letter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.letter-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.letter-card:hover { border-color: var(--accent); }
.letter-forms {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--accent-dark);
}
.letter-row { display: flex; gap: 16px; align-items: baseline; font-size: 1.75rem; line-height: 1; }
.letter-row .print { font-weight: 700; }
.cursive { font-family: "Marck Script", cursive; font-weight: 400; color: #34446b; }
.cursive-row { font-size: 2.1rem; }
.letter-meta { font-size: .82rem; color: var(--ink); margin: 2px 0; }
.letter-meta b { color: var(--accent-dark); }
.letter-example { font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.letter-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.letter-btns .audio-btn {
  position: static;
  width: auto;
  height: auto;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: .78rem;
  background: #fff;
}
.letter-btns .audio-btn:hover { background: var(--bg); border-color: var(--accent); }

/* 词汇列表 */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar select, .toolbar input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .95rem;
  background: var(--panel);
}
.toolbar input { flex: 1; min-width: 200px; }
.word-list { display: flex; flex-direction: column; gap: 10px; }
.word-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
}
.word-row1 { display: flex; align-items: center; gap: 10px; }
.word-row1 .wru { font-size: 1.25rem; font-weight: 700; }
.word-row1 .wtags { font-size: .8rem; color: var(--muted); }
.word-meaning { margin-top: 4px; color: var(--accent-dark); }
.word-example { margin-top: 6px; color: var(--muted); font-size: .92rem; }

/* 语音训练：音组拼读 */
.ph-letterbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.ph-letter-btn {
  width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel); font-size: 1.15rem; font-weight: 600; color: var(--ink);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.ph-letter-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.ph-letter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.phonetics-body { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .phonetics-body { grid-template-columns: 1fr; } }
.ph-main, .ph-quiz {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); min-width: 0;
}
.ph-letter-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ph-letter-big { font-size: 2.3rem; font-weight: 700; color: var(--accent-dark); }
.ph-letter-name { font-size: 1.1rem; }
.ph-letter-sound { font-size: .85rem; color: var(--muted); }
.ph-caption { color: var(--muted); font-size: .9rem; margin: 6px 0; }
.ph-syllables { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.ph-group { display: flex; flex-wrap: wrap; gap: 10px; }
.ph-group-label { flex-basis: 100%; font-size: .78rem; font-weight: 600; color: var(--accent-dark); margin-bottom: 2px; }
.ph-syllable.corrected { border-color: #d19a3d; background: #fdf6e8; position: relative; }
.ph-note-mark { position: absolute; top: 2px; right: 5px; font-size: .72rem; color: #b07a2a; }
.ph-note-legend { font-size: .78rem; color: #b07a2a; margin-bottom: 10px; }
.ph-syllable {
  background: #fff; border: 2px solid var(--border); border-radius: 10px;
  padding: 10px 16px; font-size: 1.15rem; cursor: pointer; transition: border-color .15s, background .15s;
}
.ph-syllable:hover { border-color: var(--accent); background: #eef4fb; }
.ph-quiz h3 { margin: 0 0 8px; }
.ph-quiz .ph-quiz-controls { margin-bottom: 12px; }
.ph-quiz .quiz-options { margin-top: 4px; }

/* B 站发音视频 */
.bili-video { margin-top: 26px; }
.bili-video h3 { margin: 0 0 12px; }
.bili-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;  /* 16:9 */
  background: #0b0f14;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.bili-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 卡片悬停微抬升 */
.stat-card, .panel, .letter-card, .quiz-card, .ph-main, .ph-quiz, .word-item {
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover, .panel:hover, .letter-card:hover, .quiz-card:hover, .ph-main:hover, .ph-quiz:hover, .word-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(18, 48, 88, .11);
}

/* 开屏动画 */
.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #18355e, #2f6fb3);
  transition: opacity .6s ease;
}
.splash-exit { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; color: #fff; padding: 0 20px; }
.splash-logo {
  font-size: 4.2rem;
  line-height: 1;
  background: linear-gradient(135deg, #f8d98a, #e7b14a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: splashPop .7s ease, splashFloat 2.2s ease-in-out .7s infinite;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,.22));
  display: inline-block;
}
.splash-title { font-size: 1.6rem; font-weight: 700; margin-top: 14px; letter-spacing: .5px; animation: splashFade 1s ease .2s both; }
.splash-sub { opacity: .8; font-size: .95rem; margin-top: 6px; animation: splashFade 1s ease .5s both; }
.splash-enter {
  margin-top: 28px;
  padding: 13px 34px;
  font-size: 1.08rem;
  font-weight: 700;
  color: #18355e;
  background: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.16);
  transition: transform .15s, box-shadow .15s;
  animation: splashFade 1s ease .8s both;
}
.splash-enter:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.22); }
.splash-enter:active { transform: translateY(0); }
.splash-bar {
  width: 180px; height: 5px; margin: 24px auto 0; border-radius: 999px;
  background: rgba(255,255,255,.24); overflow: hidden;
}
.splash-bar span { display: block; height: 100%; width: 40%; border-radius: 999px; background: #fff; animation: splashLoad 1.1s ease-in-out infinite; }
@keyframes splashPop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes splashFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes splashFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes splashLoad { 0% { transform: translateX(-120%); } 100% { transform: translateX(360%); } }

/* 响应式 */
@media (max-width: 640px) {
  header { padding: 12px 16px; }
  main { padding: 22px 14px 60px; }
  .brand h1 { font-size: 1.08rem; }
  .quiz-card, .ph-main, .ph-quiz { padding: 18px 16px; }
  .splash-logo { font-size: 3.4rem; }
}

/* 门厅 */
.hall-tip { color: var(--muted); font-size: .92rem; margin-bottom: 16px; }
.hall-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 22px; }
.hall-card {
  display: flex; gap: 14px; align-items: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.hall-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 26px rgba(18,48,88,.11); }
.hall-icon { font-size: 2rem; flex-shrink: 0; }
.hall-body { min-width: 0; flex: 1; }
.hall-title { font-weight: 700; font-size: 1.02rem; }
.hall-desc { color: var(--muted); font-size: .84rem; margin-top: 4px; line-height: 1.4; }
.hall-go { margin-top: 6px; font-weight: 600; font-size: .85rem; color: var(--accent); }

/* 打卡按钮 & 每日单词卡片 */
.checkin-btn { margin-top: 14px; }

/* 今日打卡面板：任意风景图背景 + 深色覆盖 + 白字 */
.checkin-panel {
  position: relative;
  color: #fff;
  border: none;
  overflow: hidden;
  background: url("https://picsum.photos/seed/raidho/1600/700") center/cover no-repeat;
}
.checkin-panel::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,22,42,.32), rgba(10,22,42,.8));
}
.checkin-panel > * { position: relative; z-index: 1; }
.checkin-panel h3 { color: #fff; }
.checkin-panel #streakText { color: #f3f6fb; }
.checkin-panel .checkin-btn { box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.word-card-overlay {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 20, 38, .55); padding: 20px;
}
.word-card {
  position: relative;
  width: min(420px, 100%);
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
  background:
    url("https://commons.wikimedia.org/wiki/Special:FilePath/Sant%20Vasily%20cathedral%20in%20Moscow.JPG?width=1200") center/cover no-repeat,
    linear-gradient(135deg, #18355e, #2f6fb3);
  animation: cardIn .4s ease;
}
.word-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,16,32,.22), rgba(8,16,32,.68));
}
.word-card-content {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #fff; padding: 24px;
}
.word-card-label { font-size: .78rem; letter-spacing: 3px; text-transform: uppercase; opacity: .85; }
.word-card-ru { font-size: 3rem; font-weight: 700; margin-top: 12px; text-shadow: 0 3px 10px rgba(0,0,0,.45); }
.word-card-translit { font-style: italic; opacity: .9; margin-top: 4px; text-shadow: 0 2px 6px rgba(0,0,0,.4); }
.word-card-meaning { font-size: 1.05rem; font-weight: 600; margin-top: 16px; background: rgba(0,0,0,.4); padding: 8px 18px; border-radius: 999px; }
.word-card-speak { position: relative; top: auto; right: auto; margin-top: 14px; }
.word-card-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.92); color: #18355e; font-size: 1.25rem; line-height: 1;
}
@keyframes cardIn { from { transform: translateY(16px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* 单词详情 */
.word-item.clickable { cursor: pointer; }
.word-item.clickable:hover { border-color: var(--accent); }
.wd-overlay {
  position: fixed; inset: 0; z-index: 950;
  display: flex; align-items: flex-start; justify-content: center;
  background: rgba(10, 20, 38, .55); padding: 32px 16px; overflow-y: auto;
}
.word-detail {
  position: relative;
  width: min(680px, 100%);
  background: var(--panel);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
  padding: 26px 28px 30px;
  animation: cardIn .3s ease;
}
.wd-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--bg); color: var(--ink); font-size: 1.2rem; line-height: 1;
}
.wd-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-right: 42px; }
.wd-ru { font-size: 2rem; font-weight: 700; color: var(--accent-dark); }
.wd-speak { position: static; }
.wd-tags { color: var(--muted); font-size: .85rem; }
.wd-section { margin-top: 20px; }
.wd-section h4 {
  margin: 0 0 8px; font-size: .95rem; color: var(--accent);
  border-left: 3px solid var(--accent); padding-left: 8px;
}
#wdMeaning { font-size: 1.05rem; color: var(--accent-dark); }
#wdUsage { white-space: pre-wrap; color: var(--muted); }
.wd-table-title { font-size: .85rem; font-weight: 600; color: var(--muted); margin: 12px 0 4px; }
.wd-table { border-collapse: collapse; width: 100%; font-size: .9rem; margin-bottom: 10px; }
.wd-table td { border: 1px solid var(--border); padding: 6px 10px; }
.wd-table tr td:first-child { color: var(--muted); width: 108px; }
.wd-ex { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.wd-ex:last-child { border-bottom: none; }
.wd-ex-ru { display: block; font-weight: 600; }
.wd-ex-en { display: block; color: var(--muted); font-size: .88rem; }

/* 语法 */
.grammar-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.grammar-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.grammar-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 26px rgba(18,48,88,.11); }
.grammar-title { font-weight: 700; font-size: 1.05rem; color: var(--accent-dark); }
.grammar-sub { color: var(--muted); font-size: .84rem; margin-top: 4px; }
.grammar-detail {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 26px; box-shadow: var(--shadow);
}
.grammar-back { margin-bottom: 16px; }
.grammar-h3 { margin: 0 0 12px; font-size: 1.3rem; color: var(--accent-dark); }
.grammar-intro { color: var(--ink); line-height: 1.7; }
.grammar-sec { margin-top: 20px; }
.grammar-sec h4 {
  margin: 0 0 8px; font-size: .98rem; color: var(--accent);
  border-left: 3px solid var(--accent); padding-left: 8px;
}
.grammar-sec p { margin: 6px 0; color: var(--ink); }
.grammar-sec ul { margin: 6px 0; padding-left: 20px; color: var(--ink); }
.grammar-sec li { margin: 4px 0; }
.grammar-detail .wd-table { margin-top: 8px; }
.grammar-detail .wd-table th {
  background: var(--bg); border: 1px solid var(--border); padding: 6px 10px;
  text-align: left; font-size: .85rem; color: var(--muted);
}
.grammar-detail .wd-table td:first-child { width: auto; }

/* ================= 视觉增强：渐变 / 动效 / 字体 ================= */
body {
  background:
    radial-gradient(1200px 600px at 8% -12%, #e6efff 0%, transparent 60%),
    radial-gradient(1000px 520px at 102% -4%, #e6f7ff 0%, transparent 55%),
    var(--bg);
}

/* 头部：静态渐变 + GPU 光泽扫过（原 background-position 动画会持续重绘，改为 transform） */
header {
  background: linear-gradient(120deg, #16305a, #2f6fb3 55%, #2a5f9e);
  overflow: hidden;
}
header::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, .16) 50%, transparent 68%);
  transform: translateX(-100%);
  animation: headerShine 8s ease-in-out infinite;
  will-change: transform;
}
@keyframes headerShine {
  0%, 55% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* 站名渐变流光 */
.brand h1 {
  background: linear-gradient(90deg, #ffffff, #ffe9a8, #ffffff);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: brandShine 7s linear infinite;
}
@keyframes brandShine { to { background-position: 200% 0; } }

/* 主按钮渐变 */
.btn {
  background: linear-gradient(135deg, #2f6fb3, #4a9be0);
  box-shadow: 0 6px 16px rgba(47, 111, 179, .28);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn:hover { filter: brightness(1.06); box-shadow: 0 9px 22px rgba(47, 111, 179, .34); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-ghost { background: #fff; color: var(--accent-dark); border: 1px solid var(--border); box-shadow: none; }

/* 卡片微渐变 */
.stat-card, .panel, .letter-card, .quiz-card, .ph-main, .ph-quiz, .word-item, .grammar-card, .hall-card {
  background-image: linear-gradient(180deg, #ffffff, #fbfdff);
}

/* 视图入场 */
.view.active { animation: viewIn .38s cubic-bezier(.2, .8, .2, 1); }

/* 标题分隔线渐变 */
h2::after { background: linear-gradient(90deg, var(--border), transparent); }

/* 正确 / 错误反馈动效 */
.quiz-option.correct { animation: pulseGreen .45s ease; }
.quiz-option.wrong { animation: shakeX .4s ease; }
@keyframes pulseGreen { 0% { transform: scale(1); } 50% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes shakeX { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ================= 闯关 ================= */
.ch-hud { display: flex; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.ch-hud-item {
  background: linear-gradient(135deg, #16305a, #2f6fb3);
  color: #fff; border-radius: 16px; padding: 12px 22px;
  display: flex; flex-direction: column; align-items: center; min-width: 100px;
  box-shadow: 0 10px 24px rgba(22, 48, 90, .26);
}
.ch-hud-num { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.ch-hud-label { font-size: .78rem; opacity: .85; }

/* 闯关路线图（线性地图） */
.ch-route { position: relative; max-width: 660px; margin: 0 auto; padding: 6px 0 22px; }
.ch-route::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0;
  width: 4px; transform: translateX(-50%); border-radius: 999px;
  background: repeating-linear-gradient(180deg, rgba(86, 168, 232, .55) 0 10px, rgba(86, 168, 232, .13) 10px 22px);
  box-shadow: 0 0 14px rgba(86, 168, 232, .38);
}
.ch-node { position: relative; height: 78px; cursor: pointer; }
.ch-node-dot {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 48px; border-radius: 50%; z-index: 2;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.05rem; color: #fff;
  background: linear-gradient(135deg, #2f6fb3, #4a9be0);
  box-shadow: 0 0 0 4px #fff, 0 0 16px rgba(86, 168, 232, .55);
  transition: transform .2s, box-shadow .2s;
}
.ch-node-card {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 39%; padding: 10px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: 0 8px 22px rgba(18, 48, 88, .10);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.ch-node:nth-child(odd) .ch-node-card { right: 58%; text-align: right; }
.ch-node:nth-child(even) .ch-node-card { left: 58%; }
.ch-node-title { font-weight: 700; font-size: .95rem; }
.ch-node-status { font-size: .8rem; color: var(--muted); margin-top: 3px; }

.ch-node.open .ch-node-dot { animation: nodePulse 2s ease-in-out infinite; }
.ch-node.done .ch-node-dot { background: linear-gradient(135deg, #4f9e62, #7fc79a); }
.ch-node.locked .ch-node-dot { background: #b9c3cf; box-shadow: 0 0 0 4px #fff; }
.ch-node.locked { cursor: not-allowed; opacity: .6; }
.ch-node.done .ch-node-card {
  background: linear-gradient(135deg, rgba(234, 246, 238, .92), rgba(247, 253, 249, .92));
  border-color: #7fc79a;
}
.ch-node.open .ch-node-card { border-color: rgba(86, 168, 232, .6); }
.ch-node:hover .ch-node-card {
  transform: translateY(-50%) scale(1.02);
  box-shadow: 0 12px 28px rgba(47, 111, 179, .22);
}
@keyframes nodePulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.08); }
}

.challenge-back { margin-bottom: 16px; }
.ch-play-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.ch-play-title { font-weight: 700; font-size: 1.1rem; color: var(--accent-dark); }
.ch-play-progress { color: var(--muted); font-size: .9rem; }
.ch-bar { height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; margin-bottom: 18px; }
.ch-bar span {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #2f6fb3, #4a9be0, #7fc79a);
  transition: width .35s ease;
}
.ch-card { max-width: 640px; margin: 0 auto; }
.ch-result { margin-top: 22px; text-align: center; }
.ch-badge {
  display: inline-block; padding: 10px 30px; border-radius: 999px;
  font-size: 1.25rem; font-weight: 800; letter-spacing: 1px;
  animation: badgePop .5s cubic-bezier(.2, .9, .3, 1.4);
}
.ch-badge.ok { color: #fff; background: linear-gradient(135deg, #4f9e62, #7fc79a); box-shadow: 0 0 26px rgba(79, 158, 98, .5); }
.ch-badge.no { color: #fff; background: linear-gradient(135deg, #c05353, #e07a7a); box-shadow: 0 0 26px rgba(192, 83, 83, .45); }
@keyframes badgePop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.ch-result-text { margin: 12px 0 18px; font-size: 1.05rem; font-weight: 600; }
.ch-result-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ================= 科技风 ================= */
/* 粒子画布 */
#bgCanvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* 科技网格背景 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(47, 111, 179, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 111, 179, .07) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
}

/* 卡片（半透明浅底，不用 backdrop-filter 以免大量重绘导致卡顿） */
.stat-card, .panel, .quiz-card, .ph-main, .ph-quiz, .letter-card,
.hall-card, .grammar-card, .ch-node-card, .word-item, .grammar-detail, .word-detail {
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 10px 30px rgba(18, 48, 88, .09);
}

/* 霓虹描边（悬停） */
.ch-node:hover .ch-node-card, .hall-card:hover, .grammar-card:hover, .letter-card:hover, .word-item.clickable:hover {
  border-color: rgba(86, 168, 232, .95);
  box-shadow: 0 0 0 1px rgba(86, 168, 232, .55), 0 14px 34px rgba(47, 111, 179, .20), 0 0 26px rgba(86, 168, 232, .32);
}

/* HUD 四角角标 */
.hall-card, .stat-card { position: relative; overflow: hidden; }
.hall-card::after, .stat-card::after {
  content: ""; position: absolute; inset: 6px; pointer-events: none; opacity: .35;
  transition: opacity .2s;
  background:
    linear-gradient(var(--accent), var(--accent)) left top / 10px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left top / 1.5px 10px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 10px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 1.5px 10px no-repeat;
}
.hall-card:hover::after, .stat-card:hover::after { opacity: .9; }

/* 等宽数字 / 标签（科技感） */
.ch-hud-num, .stat-card .num {
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  letter-spacing: .5px;
}
.ch-hud-label, .wtags, .fc-translit {
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

/* 标题左侧科技竖条 */
h2 { position: relative; padding-left: 15px; }
h2::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 5px; height: 1.05em; border-radius: 3px;
  background: linear-gradient(180deg, #56a8e8, #2f6fb3);
  box-shadow: 0 0 10px rgba(86, 168, 232, .75);
}

/* 普通按钮霓虹 hover */
.btn:hover { box-shadow: 0 9px 22px rgba(47, 111, 179, .34), 0 0 20px rgba(86, 168, 232, .45); }

/* 导航按钮悬停发光 */
.nav-btn:hover { box-shadow: 0 0 14px rgba(140, 200, 255, .55); }

/* 开屏科技感 */
.splash { background-image: linear-gradient(135deg, #0f2a4d, #1f4e86 45%, #2f6fb3); }
.splash::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 200, 255, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 200, 255, .09) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 72%);
  mask-image: radial-gradient(circle at 50% 50%, #000, transparent 72%);
}
.splash-enter { box-shadow: 0 0 24px rgba(140, 200, 255, .45), 0 6px 18px rgba(0, 0, 0, .2); }

/* 特效开关（右下角浮动按钮） */
.fx-toggle {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 1.2rem; color: #fff;
  background: linear-gradient(135deg, #2f6fb3, #4a9be0);
  box-shadow: 0 8px 22px rgba(47, 111, 179, .35);
  transition: transform .15s, box-shadow .15s, background .2s;
}
.fx-toggle:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 10px 26px rgba(47, 111, 179, .45); }
.fx-toggle.off { background: #b9c3cf; box-shadow: 0 6px 16px rgba(90, 100, 115, .25); }
