/* =========================================================
   高考俄语 · 背单词  样式
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

/* 让 hidden 属性优先于 display:flex / inline-flex */
[hidden] { display: none !important; }

:root {
  --bg: #080b15;
  --bg-2: #0c1122;
  --panel: rgba(255, 255, 255, .045);
  --panel-2: rgba(255, 255, 255, .075);
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --txt: #ecf1ff;
  --muted: #98a4c4;
  --dim: #6b7796;
  --blue: #5b8cff;
  --red: #ff5470;
  --green: #35d39a;
  --amber: #ffc857;
  --shadow: 0 30px 70px -30px rgba(0, 0, 0, .9);
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 11px;
  /* 注意：Georgia 对西里尔字母的组合重音符号支持不佳，俄文一律优先 Times New Roman */
  --serif: "Times New Roman", "PT Serif", "Songti SC", Georgia, serif;
}

[data-theme="light"] {
  --bg: #f3f5fb;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f1f4fc;
  --line: rgba(18, 28, 56, .10);
  --line-2: rgba(18, 28, 56, .18);
  --txt: #111a30;
  --muted: #5c6a8a;
  --dim: #8b96b0;
  --blue: #2f6bff;
  --red: #e83b5c;
  --green: #0f9e6e;
  --amber: #b47800;
  --shadow: 0 24px 60px -32px rgba(20, 32, 70, .35);
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(91, 140, 255, .20), transparent 62%),
    radial-gradient(760px 440px at 92% 0%, rgba(255, 84, 112, .14), transparent 62%),
    radial-gradient(700px 700px at 50% 118%, rgba(255, 200, 87, .06), transparent 62%);
}

[data-theme="light"] body::before {
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(91, 140, 255, .18), transparent 62%),
    radial-gradient(760px 440px at 92% 0%, rgba(255, 84, 112, .12), transparent 62%);
}

.shell {
  width: min(980px, 100% - 2rem);
  margin-inline: auto;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(8, 11, 21, .78);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  color: inherit;
  flex: none;
}

.mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-family: var(--serif);
  font-size: 22px;
  color: #fff;
  background: linear-gradient(140deg, var(--blue), var(--red));
  box-shadow: 0 8px 22px -8px rgba(91, 140, 255, .9);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--serif); font-size: 1.02rem; letter-spacing: .02em; }
.brand-text small { font-size: .68rem; color: var(--muted); letter-spacing: .06em; }

.nav {
  display: flex;
  gap: .25rem;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  position: relative;
  padding: .45rem .85rem;
  border-radius: 999px;
  font-size: .9rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: .18s;
}

.nav a:hover { color: var(--txt); background: var(--panel); }

.nav a.active {
  color: var(--txt);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--txt);
  font-size: 1rem;
  cursor: pointer;
  transition: .18s;
  flex: none;
}
.icon-btn:hover { background: var(--panel-2); border-color: var(--line-2); }

/* ---------------- 通用按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.4rem;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--txt);
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: .18s;
  text-decoration: none;
}
.btn:hover { background: var(--panel-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn.primary {
  background: linear-gradient(135deg, var(--blue), #7a6bff);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 14px 30px -14px rgba(91, 140, 255, .95);
}
.btn.primary:hover { filter: brightness(1.07); }

.btn.ghost { background: transparent; }

kbd {
  font-family: inherit;
  font-size: .72rem;
  padding: .12em .45em;
  border-radius: 6px;
  border: 1px solid currentColor;
  opacity: .55;
}

/* ---------------- 背单词页 ---------------- */
.learn { padding: 1.6rem 0 3rem; max-width: 720px; margin-inline: auto; }

.learn-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.today {
  font-size: .84rem;
  color: var(--muted);
  white-space: nowrap;
}
.today b { color: var(--txt); font-size: 1rem; }

.pbar {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
}
.pbar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--red));
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}

.round {
  font-size: .8rem;
  color: var(--dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 2rem 2rem 1.9rem;
  min-height: 360px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, var(--panel-2), transparent 55%),
    var(--bg-2);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 140, 255, .16), transparent 65%);
  pointer-events: none;
}

.card-top {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.1rem;
}

.pill {
  font-size: .74rem;
  letter-spacing: .04em;
  padding: .22em .7em;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(91, 140, 255, .14);
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  border: 1px solid rgba(91, 140, 255, .30);
  border-color: color-mix(in srgb, var(--blue) 30%, transparent);
}

.card-theme {
  font-size: .74rem;
  color: var(--dim);
  margin-right: auto;
}

.word {
  font-family: var(--serif);
  font-size: clamp(2.3rem, 7vw, 3.6rem);
  line-height: 1.15;
  margin: 0;
  letter-spacing: .01em;
  word-break: break-word;
}

.tr {
  margin: .1rem 0 0;
  font-size: .92rem;
  color: var(--dim);
  font-style: italic;
  letter-spacing: .02em;
}

.reveal-area {
  margin-top: 1.4rem;
  padding-top: 1.3rem;
  border-top: 1px dashed var(--line-2);
  flex: 1;
}

.hint { color: var(--dim); font-size: .88rem; margin: .5rem 0; }

.zh {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 .6rem;
  letter-spacing: .02em;
}

.note {
  font-size: .85rem;
  color: var(--muted);
  margin: 0 0 1rem;
  padding: .55rem .8rem;
  border-left: 3px solid var(--amber);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 200, 87, .09);
  background: color-mix(in srgb, var(--amber) 9%, transparent);
}

.ex {
  margin-top: .9rem;
  padding: 1rem 1.1rem;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--line);
}

.ex-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .74rem;
  letter-spacing: .12em;
  color: var(--dim);
  margin-bottom: .5rem;
}
.ex-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.ex-ru {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin: 0 0 .3rem;
  line-height: 1.5;
}

.ex-zh { margin: 0; font-size: .86rem; color: var(--muted); }

.speak {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--txt);
  font-size: .85rem;
  cursor: pointer;
  transition: .18s;
  flex: none;
}
.speak:hover { background: var(--panel-2); border-color: var(--line-2); transform: scale(1.06); }
.speak.big { width: 38px; height: 38px; border-radius: 11px; font-size: 1rem; }

.card-actions { margin-top: 1.1rem; }
.card-actions .btn { width: 100%; padding: 1rem; font-size: 1rem; }

.kbd-hint {
  margin: .9rem 0 0;
  text-align: center;
  font-size: .74rem;
  color: var(--dim);
  letter-spacing: .02em;
}
@media (hover: none) { .kbd-hint { display: none; } }

.grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }

.grade {
  padding: .95rem .6rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--txt);
  font-family: inherit;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: .16s;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.grade small { font-size: .7rem; font-weight: 400; color: var(--dim); }
.grade:hover { transform: translateY(-2px); }
.grade.bad { border-color: rgba(255, 84, 112, .55); border-color: color-mix(in srgb, var(--red) 55%, transparent); color: var(--red); }
.grade.bad:hover { background: rgba(255, 84, 112, .12); background: color-mix(in srgb, var(--red) 12%, transparent); }
.grade.mid { border-color: rgba(255, 200, 87, .55); border-color: color-mix(in srgb, var(--amber) 55%, transparent); color: var(--amber); }
.grade.mid:hover { background: rgba(255, 200, 87, .12); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.grade.good { border-color: rgba(53, 211, 154, .55); border-color: color-mix(in srgb, var(--green) 55%, transparent); color: var(--green); }
.grade.good:hover { background: rgba(53, 211, 154, .12); background: color-mix(in srgb, var(--green) 12%, transparent); }

/* 本轮结束 */
.done {
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--bg-2);
  box-shadow: var(--shadow);
}
.done .big-emoji { font-size: 3rem; line-height: 1; }
.done h2 { margin: .8rem 0 .4rem; font-size: 1.5rem; }
.done p { color: var(--muted); margin: 0 0 1.4rem; }
.done-stats {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  margin: 1.2rem 0 1.8rem;
}
.done-stats div { display: flex; flex-direction: column; }
.done-stats b { font-size: 1.5rem; }
.done-stats span { font-size: .76rem; color: var(--dim); }
.done-actions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }

/* ---------------- 默写 ---------------- */
.write-card { gap: .2rem; }

.write-zh {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  margin: .3rem 0 .2rem;
  letter-spacing: .02em;
}

.write-hint { color: var(--dim); font-size: .8rem; margin: 0 0 1rem; }

.write-input {
  width: 100%;
  padding: .85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--txt);
  font-family: var(--serif);
  font-size: 1.25rem;
  outline: none;
  transition: .18s;
}
.write-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(91, 140, 255, .18); }
.write-input:disabled { opacity: .7; }

.write-result { min-height: 1.7rem; margin-top: .7rem; font-size: .95rem; }
.write-result.ok { color: var(--green); }
.write-result.no { color: var(--red); }

.wr-word {
  font-family: var(--serif);
  font-size: 1.32rem;
  cursor: pointer;
  border-bottom: 1px dashed currentColor;
}
.wr-your { color: var(--dim); font-size: .8rem; margin-left: .35rem; }
.wr-zh { color: var(--muted); font-size: .85rem; margin-left: .45rem; }

.listen-btn {
  width: 68px;
  height: 68px;
  margin: .2rem 0 .9rem;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--txt);
  font-size: 1.7rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: .16s;
  -webkit-tap-highlight-color: transparent;
}
.listen-btn:hover { border-color: var(--blue); }
.listen-btn:active { background: var(--blue); color: #fff; transform: scale(.96); }

.write-actions { display: flex; gap: .6rem; margin-top: .6rem; flex-wrap: wrap; }
.write-actions .btn { padding: .7rem 1.25rem; font-size: .9rem; }

.kb-wrap { margin-top: 1rem; border-top: 1px dashed var(--line); padding-top: .7rem; }
.kb-toggle {
  background: none;
  border: 0;
  color: var(--dim);
  font-size: .8rem;
  cursor: pointer;
  padding: .1rem 0;
  font-family: inherit;
}
.kb-toggle:hover { color: var(--txt); }

.kb { display: flex; flex-direction: column; gap: .35rem; margin-top: .6rem; }
.kb-row { display: flex; gap: .3rem; justify-content: center; }

.kb-row button {
  flex: 1 1 0;
  max-width: 48px;
  height: 42px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--txt);
  font-family: var(--serif);
  font-size: 1.05rem;
  cursor: pointer;
  transition: .12s;
  -webkit-tap-highlight-color: transparent;
}
.kb-row button:active { background: var(--blue); color: #fff; transform: translateY(1px); }
.kb-row button.wide { max-width: 150px; font-family: inherit; font-size: .82rem; }

.wrong-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .5rem;
  margin-top: 1rem;
  text-align: left;
}
.wrong-item {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .6rem .8rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.wrong-item:hover { border-color: var(--line-2); background: var(--panel-2); }
.wi-ru { font-family: var(--serif); font-size: 1.05rem; }
.wi-zh { font-size: .78rem; color: var(--muted); }

/* ---------------- 词表页 ---------------- */
.page { padding: 1.8rem 0 3.5rem; }

.page-head { margin-bottom: 1.2rem; }
.page-head h1 { margin: 0 0 .2rem; font-size: 1.5rem; letter-spacing: .01em; }
.page-head p { margin: 0; color: var(--muted); font-size: .88rem; }

.toolbar { display: flex; gap: .7rem; margin-bottom: .9rem; flex-wrap: wrap; }

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.search-wrap input {
  width: 100%;
  padding: .75rem 1rem .75rem 2.4rem;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--txt);
  font-family: inherit;
  font-size: .92rem;
  outline: none;
  transition: .18s;
}
.search-wrap input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(91, 140, 255, .18); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.search-wrap::before {
  content: "🔍";
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .85rem;
  opacity: .6;
  pointer-events: none;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .9rem;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: .85rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: .18s;
}
.toggle input { accent-color: var(--blue); margin: 0; }
.toggle.on,
.toggle:has(input:checked) { color: var(--txt); border-color: rgba(91, 140, 255, .45); border-color: color-mix(in srgb, var(--blue) 45%, transparent); background: rgba(91, 140, 255, .12); background: color-mix(in srgb, var(--blue) 12%, transparent); }

.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: 1rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.chip {
  padding: .35rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: .8rem;
  white-space: nowrap;
  cursor: pointer;
  transition: .16s;
}
.chip:hover { color: var(--txt); border-color: var(--line-2); }
.chip.on {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #7a6bff);
  border-color: transparent;
}

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

.item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .85rem .95rem .8rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: .16s;
}
.item:hover { transform: translateY(-2px); border-color: var(--line-2); background: var(--panel-2); }
.item:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.item-ru { font-family: var(--serif); font-size: 1.18rem; line-height: 1.35; }
.item-zh { font-size: .82rem; color: var(--muted); }
.item-meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .35rem;
  font-size: .68rem;
  color: var(--dim);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; }
.dot.l1 { background: var(--dim); }
.dot.l2 { background: var(--amber); }
.dot.l3 { background: #ffa53b; }
.dot.l4 { background: var(--green); }
.dot.l5 { background: var(--green); box-shadow: 0 0 0 3px rgba(53, 211, 154, .20); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }

.item .fav-mark { position: absolute; top: .6rem; right: .7rem; font-size: .72rem; color: var(--amber); }

.empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--dim);
  font-size: .9rem;
}

.load-more { display: flex; justify-content: center; padding: 1.1rem 0 .3rem; }
.load-more .btn { padding: .7rem 1.4rem; font-size: .88rem; }

/* ---------------- 进度页 ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .7rem;
  margin-bottom: 1.4rem;
}

.stat {
  padding: 1rem 1.1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel);
}
.stat b { display: block; font-size: 1.85rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--muted); }

.panel {
  padding: 1.3rem 1.4rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel);
  margin-bottom: 1rem;
}
.panel h3 { margin: 0 0 .9rem; font-size: .95rem; letter-spacing: .02em; }

.chart { display: flex; align-items: flex-end; gap: .5rem; height: 150px; padding-top: .5rem; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .4rem; height: 100%; justify-content: flex-end; }
.chart .bar {
  width: 100%;
  max-width: 42px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--blue), rgba(91, 140, 255, .45));
  background: linear-gradient(180deg, var(--blue), color-mix(in srgb, var(--blue) 45%, transparent));
  min-height: 4px;
  transition: height .5s cubic-bezier(.4, 0, .2, 1);
  position: relative;
}
.chart .bar.today { background: linear-gradient(180deg, var(--red), rgba(255, 84, 112, .45)); background: linear-gradient(180deg, var(--red), color-mix(in srgb, var(--red) 45%, transparent)); }
.chart .num { font-size: .68rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.chart .day { font-size: .7rem; color: var(--muted); }

.bars { display: flex; flex-direction: column; gap: .55rem; }
.brow { display: flex; align-items: center; gap: .7rem; font-size: .8rem; color: var(--muted); }
.brow .lab { width: 74px; flex: none; }
.brow .track { flex: 1; height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.brow .track i { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.brow .val { width: 42px; text-align: right; font-variant-numeric: tabular-nums; color: var(--dim); }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: .88rem;
}
.setting-row:last-of-type { border-bottom: 0; }
.setting-row small { display: block; color: var(--dim); font-size: .75rem; }

.switch { position: relative; width: 44px; height: 25px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  transition: .2s;
  pointer-events: none;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--muted);
  transition: .2s;
}
.switch input:checked + i { background: rgba(91, 140, 255, .55); background: color-mix(in srgb, var(--blue) 55%, transparent); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(19px); background: #fff; }

.danger { color: var(--red); border-color: rgba(255, 84, 112, .45); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.danger:hover { background: rgba(255, 84, 112, .10); background: color-mix(in srgb, var(--red) 10%, transparent); }

/* ---------------- 弹层 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(4, 7, 16, .62);
  backdrop-filter: blur(6px);
  animation: fade .18s ease;
}
.modal[hidden] { display: none; }

.modal-card {
  width: min(520px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 1.5rem;
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  box-shadow: var(--shadow);
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.2);
}

.modal-card .modal-word {
  font-family: var(--serif);
  font-size: 2rem;
  margin: .2rem 0 0;
  line-height: 1.25;
}
.modal-close { position: absolute; }

.modal-foot { display: flex; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.modal-foot .btn { padding: .65rem 1.1rem; font-size: .88rem; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* ---------------- 提示条 ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.6rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 90;
  max-width: min(440px, calc(100% - 2rem));
  padding: .7rem 1.1rem;
  border-radius: 13px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--txt);
  font-size: .84rem;
  box-shadow: var(--shadow);
  animation: toastIn .22s ease;
}
.toast[hidden] { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------------- 微信内提示条 ---------------- */
.wx-hint {
  width: min(980px, calc(100% - 2rem));
  margin: .8rem auto 0;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .6rem .55rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(12, 17, 34, .95);
  color: var(--txt);
  font-size: .8rem;
  line-height: 1.45;
  box-shadow: var(--shadow);
}
.wx-hint button {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: .72rem;
  cursor: pointer;
}

/* ---------------- 页脚 ---------------- */
.foot {
  padding: 2rem 0 3rem;
  text-align: center;
  font-size: .75rem;
  color: var(--dim);
}

@media (max-width: 560px) {
  .topbar-inner { height: 58px; gap: .5rem; }
  .brand-text small { display: none; }
  .learn { padding-top: 1rem; }
  .card { padding: 1.4rem 1.2rem 1.3rem; min-height: 320px; }
  .zh { font-size: 1.3rem; }
  .grades { gap: .5rem; }
  .grade { padding: .8rem .3rem; font-size: .84rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .word { font-size: 2rem; }
  .zh { font-size: 1.2rem; }
  .grades { gap: .4rem; }
  .grade { padding: .75rem .2rem; font-size: .82rem; }
  .grade small { font-size: .65rem; }
  .ex { padding: .8rem .85rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
