:root {
  --bg: #0f1218;
  --bg-elev: #171b24;
  --bg-card: #1e2330;
  --border: #2a3040;
  --fg: #e6e8ec;
  --fg-dim: #9aa0ad;
  --fg-faint: #5c6270;
  --accent: #6aa7ff;
  --accent-strong: #4a8aff;
  --ok: #4cd07d;
  --warn: #f2b94a;
  --err: #ff6a6a;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --gap: 16px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7fa;
    --bg-elev: #ffffff;
    --bg-card: #ffffff;
    --border: #e3e6ec;
    --fg: #1a1d24;
    --fg-dim: #5c6270;
    --fg-faint: #a3a8b3;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

button {
  font: inherit;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
button:hover { border-color: var(--accent); }
button:active { transform: translateY(1px); }
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
button.primary:hover { background: var(--accent-strong); }
button.ghost { background: transparent; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

input, select, textarea {
  font: inherit;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

/* === topbar === */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--fg);
  letter-spacing: 0.5px;
}
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--fg-dim);
  font-size: 14px;
}
.nav a:hover { background: var(--bg-card); color: var(--fg); }
.nav a.active { background: var(--accent); color: #fff; }

/* === main === */
.app {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

.footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  color: var(--fg-faint);
  font-size: 12px;
  text-align: center;
}

/* === cards / sections === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: var(--gap); }

.section-title {
  font-size: 13px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px;
}

.grid {
  display: grid;
  gap: var(--gap);
}
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* === stat blocks === */
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stat .label { font-size: 12px; color: var(--fg-dim); letter-spacing: 1px; text-transform: uppercase; }
.stat .value { font-size: 28px; font-weight: 600; margin-top: 4px; }
.stat .sub { font-size: 12px; color: var(--fg-faint); margin-top: 4px; }

/* === progress bar === */
.progress {
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}
.progress > .bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s ease;
}

/* === mode page === */
.mode-host {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  min-height: 420px;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}
.question-card .prompt {
  font-size: 36px;
  font-weight: 600;
  margin-bottom: 8px;
  word-break: break-word;
}
.question-card .phonetic {
  color: var(--fg-dim);
  font-size: 16px;
  margin-bottom: 16px;
}
.question-card .pos {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg-dim);
  font-size: 12px;
  margin-right: 8px;
}

.options {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 540px) {
  .options { grid-template-columns: 1fr; }
}
.option {
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.12s;
}
.option:hover { border-color: var(--accent); }
.option.correct { border-color: var(--ok); background: rgba(76, 208, 125, 0.12); }
.option.wrong { border-color: var(--err); background: rgba(255, 106, 106, 0.12); }
.option:disabled { cursor: default; }

.feedback {
  text-align: center;
  padding: 12px;
  border-radius: var(--radius);
}
.feedback.ok { color: var(--ok); }
.feedback.warn { color: var(--warn); }
.feedback.err { color: var(--err); }

/* === item shop / item bar === */
.item-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}
.item-bar-title {
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.tool-btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.tool-count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg-dim);
  font-size: 12px;
  text-align: center;
}
.item-feedback {
  font-size: 12px;
  color: var(--fg-dim);
}
.item-feedback.ok { color: var(--ok); }
.item-feedback.err { color: var(--err); }
.shop-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.shop-icon {
  width: 44px;
  font-size: 34px;
  line-height: 1;
  text-align: center;
}
.shop-main {
  flex: 1;
  min-width: 0;
}
.rule-list {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--fg-dim);
  line-height: 1.8;
}
@media (max-width: 540px) {
  .shop-card { flex-direction: column; }
}

/* === empty / hints === */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--fg-dim);
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--fg-dim);
}
.pill.ok { color: var(--ok); border-color: rgba(76, 208, 125, 0.5); }
.pill.warn { color: var(--warn); border-color: rgba(242, 185, 74, 0.5); }
.pill.err { color: var(--err); border-color: rgba(255, 106, 106, 0.5); }

/* === puzzle mode === */
.puzzle-answer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 18px 0 14px;
}
.puzzle-slot,
.puzzle-letter {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-transform: uppercase;
}
.puzzle-slot {
  border-style: dashed;
  background: var(--bg);
}
.puzzle-slot.filled {
  border-style: solid;
  background: var(--bg-card);
  border-color: var(--accent);
}
.puzzle-letters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.puzzle-letter:disabled {
  opacity: 0.25;
}

/* === match page === */
.match-wrap {
  position: relative;
}
.match-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.match-line {
  stroke: var(--ok);
  stroke-width: 0.7;
  stroke-linecap: round;
  opacity: 0.72;
}
.match-board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.match-column {
  display: grid;
  gap: 8px;
}
.match-tile {
  min-height: 54px;
  width: 100%;
  text-align: left;
  background: var(--bg);
  word-break: break-word;
}
.match-tile.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}
.match-tile.done {
  border-color: rgba(76, 208, 125, 0.45);
  color: var(--ok);
  opacity: 0.68;
}

/* === exam hub === */
.exam-type-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.12s;
}
.exam-type-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.exam-type-title {
  font-size: 20px;
  font-weight: 800;
}
.exam-mini {
  padding: 10px;
  box-shadow: none;
}
.exam-mini .value {
  font-size: 18px;
}
.exam-attempt-list {
  display: grid;
  gap: 10px;
}
.exam-attempt-row {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.exam-attempt-pill {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--fg-dim);
  font-size: 12px;
}

/* === rapid page === */
.rapid-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
}
.rapid-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.rapid-time {
  margin: 8px 0 2px;
  font-size: 36px;
  font-weight: 800;
}
.rapid-card button {
  margin-top: 14px;
  width: 100%;
}

/* === browse page === */
.browse-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, auto) auto;
  gap: 10px;
  align-items: center;
}
.browse-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: var(--gap);
  margin-top: 16px;
  align-items: start;
}
.browse-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding-right: 4px;
}
.browse-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  border-radius: var(--radius);
  background: var(--bg-card);
  content-visibility: auto;
  contain-intrinsic-size: 74px;
}
.browse-row.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}
.browse-word {
  font-size: 18px;
  font-weight: 700;
}
.browse-row-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.browse-detail {
  position: sticky;
  top: 84px;
}
.browse-detail-card {
  min-height: 420px;
}
.browse-detail-word {
  font-size: 36px;
  font-weight: 800;
  word-break: break-word;
}
.browse-phonetic {
  margin-top: 8px;
  color: var(--accent);
  font-size: 18px;
}
.browse-section {
  margin-top: 18px;
}
.browse-mini {
  padding: 12px;
  box-shadow: none;
}
.browse-mini .value {
  font-size: 18px;
}
.example-list {
  display: grid;
  gap: 10px;
}
.example {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

/* === stats page === */
.stats-heatmap {
  display: grid;
  grid-template-columns: repeat(10, minmax(18px, 1fr));
  gap: 6px;
}
.heat-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.heat-cell.level-1 { background: rgba(106, 167, 255, 0.22); }
.heat-cell.level-2 { background: rgba(106, 167, 255, 0.42); }
.heat-cell.level-3 { background: rgba(76, 208, 125, 0.52); }
.heat-cell.level-4 { background: rgba(76, 208, 125, 0.82); }
.stats-chart {
  width: 100%;
  height: 220px;
  margin-top: 14px;
  display: block;
}
.stats-rank-chart {
  width: 100%;
  height: 120px;
  margin-top: 8px;
  display: block;
}
.stats-grid-line {
  stroke: var(--border);
  stroke-width: 1;
}
.stats-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stats-dot {
  fill: var(--bg-card);
  stroke: var(--accent);
  stroke-width: 2;
}
.stats-dot.rank-loss { stroke: var(--err); }
.stats-donut-wrap {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
}
.stats-donut {
  width: 180px;
  height: 180px;
  transform: rotate(-90deg);
}
.stats-donut-bg,
.stats-donut-seg {
  fill: none;
  stroke-width: 18;
}
.stats-donut-bg { stroke: var(--bg); }
.stats-donut-seg {
  stroke-linecap: butt;
  transform-origin: 90px 90px;
}
.stats-donut-seg.seg-0 { stroke: var(--fg-faint); }
.stats-donut-seg.seg-1 { stroke: var(--warn); }
.stats-donut-seg.seg-2 { stroke: var(--accent); }
.stats-donut-seg.seg-3 { stroke: var(--ok); }
.stats-donut-seg.seg-4 { stroke: var(--accent-strong); }
.stats-donut-text,
.stats-donut-sub {
  transform: rotate(90deg);
  transform-origin: 90px 90px;
  fill: var(--fg);
  text-anchor: middle;
}
.stats-donut-text {
  font-size: 28px;
  font-weight: 700;
}
.stats-donut-sub {
  fill: var(--fg-dim);
  font-size: 13px;
}
.stats-legend {
  display: grid;
  gap: 8px;
}
.stats-mini-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.stats-small-stat {
  padding: 10px;
  box-shadow: none;
}
.stats-small-stat .value {
  font-size: 20px;
}
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.achievement-card {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  opacity: 0.58;
}
.achievement-card.unlocked {
  background: var(--bg-card);
  opacity: 1;
  border-color: rgba(76, 208, 125, 0.45);
}
.achievement-title {
  margin-top: 12px;
  font-size: 17px;
  font-weight: 700;
}
.achievement-mark {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--fg-dim);
}
.achievement-card.unlocked .achievement-mark {
  color: var(--ok);
  border-color: rgba(76, 208, 125, 0.55);
}
.achievement-notice {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(76, 208, 125, 0.45);
  border-radius: var(--radius);
  background: rgba(76, 208, 125, 0.08);
  text-align: left;
}
.achievement-pop {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
}
@media (max-width: 540px) {
  .match-board { grid-template-columns: 1fr; }
  .browse-toolbar { grid-template-columns: 1fr; }
  .browse-layout { grid-template-columns: 1fr; }
  .browse-list { max-height: none; overflow: visible; padding-right: 0; }
  .browse-detail { position: static; }
  .stats-heatmap { grid-template-columns: repeat(6, minmax(18px, 1fr)); }
  .stats-donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .stats-legend { width: 100%; }
  .achievement-grid { grid-template-columns: 1fr; }
}
@media (min-width: 541px) and (max-width: 900px) {
  .browse-toolbar { grid-template-columns: 1fr 1fr; }
  .browse-layout { grid-template-columns: 1fr; }
  .browse-list { max-height: 520px; }
  .browse-detail { position: static; }
  .achievement-grid { grid-template-columns: repeat(2, 1fr); }
}

.coming-soon {
  text-align: center;
  padding: 60px 20px;
  color: var(--fg-dim);
}
.coming-soon .icon { font-size: 48px; opacity: 0.6; }
.coming-soon .title { font-size: 20px; margin-top: 12px; color: var(--fg); }
.coming-soon .desc { margin-top: 8px; }

/* ── AI 助手侧边栏 ─────────────────────────────────────────── */
.ai-toggle {
  position: fixed;
  right: 20px;
  bottom: 28px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-strong);
  color: #fff;
  font-size: 22px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(74,138,255,0.45);
  transition: transform .15s, box-shadow .15s;
  display: flex; align-items: center; justify-content: center;
}
.ai-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(74,138,255,0.55); }
.ai-toggle--active { background: var(--fg-faint); }

.ai-sidebar {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: 360px;
  z-index: 999;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .22s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 24px rgba(0,0,0,.3);
}
.ai-sidebar--open { transform: translateX(0); }

.ai-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ai-title { font-weight: 600; color: var(--accent); font-size: 15px; }
.ai-header-actions { display: flex; gap: 6px; }
.ai-btn-icon {
  background: none; border: none; color: var(--fg-dim);
  font-size: 16px; cursor: pointer; padding: 4px 6px;
  border-radius: 6px; line-height: 1;
}
.ai-btn-icon:hover { background: var(--bg-card); color: var(--fg); }

.ai-messages {
  flex: 1; overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-messages::-webkit-scrollbar { width: 4px; }
.ai-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.ai-msg { display: flex; }
.ai-msg-user { justify-content: flex-end; }
.ai-msg-assistant { justify-content: flex-start; }

.ai-bubble {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}
.ai-msg-user .ai-bubble {
  background: var(--accent-strong);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-msg-assistant .ai-bubble {
  background: var(--bg-card);
  color: var(--fg);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

.ai-input-area {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
  flex-shrink: 0;
}
.ai-input {
  width: 100%; resize: none;
  background: var(--bg-card); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 12px; font: inherit; font-size: 14px;
  outline: none; transition: border-color .15s;
}
.ai-input:focus { border-color: var(--accent); }
.ai-send-btn {
  align-self: flex-end;
  background: var(--accent-strong); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 8px 20px; font: inherit; font-size: 14px;
  cursor: pointer; transition: opacity .15s;
}
.ai-send-btn:hover { opacity: .88; }
.ai-send-btn:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 520px) {
  .ai-sidebar { width: 100%; }
}

/* ── 欢迎弹窗 ──────────────────────────────────────────────── */
.wl-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
  animation: wl-in .2s ease;
}
.wl-overlay--out { animation: wl-out .25s ease forwards; }

@keyframes wl-in  { from { opacity:0 } to { opacity:1 } }
@keyframes wl-out { from { opacity:1 } to { opacity:0 } }

.wl-modal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: min(560px, 94vw);
  max-height: 88vh;
  display: flex; flex-direction: column;
  animation: wl-slide .22s ease;
}
@keyframes wl-slide { from { transform:translateY(18px); opacity:0 } to { transform:none; opacity:1 } }

.wl-header {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.wl-logo { font-size: 20px; font-weight: 700; color: var(--accent); }
.wl-badge {
  font-size: 12px; padding: 2px 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; color: var(--fg-dim);
}

.wl-body {
  padding: 18px 22px;
  overflow-y: auto; flex: 1;
}
.wl-body::-webkit-scrollbar { width: 4px; }
.wl-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.wl-intro { margin: 0 0 16px; color: var(--fg-dim); font-size: 14px; }

.wl-section { margin-bottom: 16px; }
.wl-section-title {
  font-weight: 600; font-size: 14px;
  margin-bottom: 6px; color: var(--fg);
}
.wl-section ul {
  margin: 0; padding-left: 18px;
  color: var(--fg-dim); font-size: 13.5px; line-height: 1.7;
}
.wl-section ul b { color: var(--fg); }

.wl-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.wl-check-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--fg-dim); cursor: pointer;
}
.wl-start-btn {
  background: var(--accent-strong); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 9px 24px; font: inherit; font-size: 14px;
  cursor: pointer; transition: opacity .15s;
}
.wl-start-btn:hover { opacity: .88; }
.wl-gh-link {
  margin-left: auto;
  color: var(--fg-dim);
  display: flex; align-items: center;
  transition: color .15s;
}
.wl-gh-link:hover { color: var(--fg); }

/* ── 使用说明浮动按钮 ───────────────────────────────────────── */
.wl-help-btn {
  position: fixed;
  right: 76px;
  bottom: 28px;
  z-index: 1000;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transition: color .15s, border-color .15s;
  display: flex; align-items: center; justify-content: center;
}
.wl-help-btn:hover { color: var(--fg); border-color: var(--accent); }

.wl-footer { flex-wrap: wrap; gap: 8px; }
.wl-footer-link {
  font-size: 12px; color: var(--fg-faint);
  text-decoration: none; transition: color .15s;
}
.wl-footer-link:hover { color: var(--accent); }
.wl-footer-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.wl-inline-link { font-size: 13px; color: var(--accent); }
.wl-inline-link:hover { color: var(--accent-strong); }

/* ═══════════════════════════════════════════════════════════
   手机端响应式适配 (≤ 640px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  body { font-size: 14px; }
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 14px;
  }
  .topbar .logo { font-size: 18px; align-self: flex-start; }
  .nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 2px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a {
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .app { padding: 14px 12px; max-width: 100%; }
  .card { padding: 14px; border-radius: var(--radius); }
  .card + .card { margin-top: 12px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; gap: 12px; }
  button { padding: 10px 16px; font-size: 14px; }
  button.primary { padding: 10px 18px; }
  input, select, textarea { padding: 9px 12px; font-size: 16px; }
  .footer { padding: 10px 14px; font-size: 11px; }
  .wl-header { padding: 14px 16px; }
  .wl-header h2 { font-size: 18px; }
  .wl-footer { padding: 10px 14px; }
  .wl-start-btn { padding: 8px 18px; font-size: 13px; }
  .wl-help-btn { right: 16px; bottom: 70px; width: 32px; height: 32px; }
  .stat-value { font-size: 24px !important; }
  .stat-label { font-size: 11px; }
  .map-node, .rank-tier { padding: 10px 12px; }
}
@media (max-width: 380px) {
  .app { padding: 10px 8px; }
  .card { padding: 12px; }
  .nav a { padding: 5px 8px; font-size: 12px; }
}
