/* 脑力小馆 · Web 版样式 */
:root {
  --bg: #f4f6fb;
  --bg-soft: #edf0fa;
  --card: #ffffff;
  --text: #1f2340;
  --sub: #7a809e;
  --muted: #a7acc4;
  --line: #ecedf7;
  --primary: #5b5be6;
  --primary-2: #7c6bff;
  --primary-soft: #eeeeff;
  --success: #1fa97c;
  --warn: #f0a03a;
  --danger: #ee5d6c;
  --shadow: 0 10px 24px rgba(38, 45, 90, .07);
  --radius: 16px;
  --radius-lg: 20px;
}

[data-theme="dark"] {
  --bg: #121420;
  --bg-soft: #191c2b;
  --card: #1d2031;
  --text: #f2f3fb;
  --sub: #a2a7c3;
  --muted: #6e7391;
  --line: #2a2e44;
  --primary: #8c8cff;
  --primary-2: #7c6bff;
  --primary-soft: #272b47;
  --success: #3ed1a0;
  --warn: #f3b45c;
  --danger: #ff7d89;
  --shadow: 0 10px 24px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px calc(28px + env(safe-area-inset-bottom));
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.flex1 { flex: 1; min-width: 0; }
.muted { color: var(--sub); }

/* 顶部 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 2px 10px;
  background: linear-gradient(var(--bg), var(--bg) 82%, transparent);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-size: 22px;
  box-shadow: 0 8px 18px rgba(91,91,230,.28);
}
.brand-title { font-size: 19px; font-weight: 800; letter-spacing: .5px; }
.brand-sub { font-size: 12px; color: var(--sub); margin-top: 2px; }

.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 19px;
}
.icon-btn:active { transform: scale(.94); }

/* 通用按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  border-radius: 14px;
  font-size: 15px; font-weight: 700;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.98); opacity: .9; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 20px rgba(91,91,230,.24);
}
.btn-ghost { color: var(--primary); background: var(--primary-soft); }
.btn-line { color: var(--text); background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.btn-danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 13px; }

/* 每日挑战 */
.daily {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: var(--radius-lg);
  color: #fff;
  background: linear-gradient(135deg, #5b5be6, #7b66ff 55%, #9a7bff);
  box-shadow: 0 14px 30px rgba(91,91,230,.26);
  margin-bottom: 14px;
}
.daily::after {
  content: "";
  position: absolute; right: -50px; top: -70px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.14);
}
.daily-label { font-size: 12px; font-weight: 700; opacity: .9; letter-spacing: 1px; }
.daily-streak { font-size: 12px; background: rgba(255,255,255,.18); padding: 3px 10px; border-radius: 999px; }
.daily-main { display: flex; align-items: center; gap: 12px; margin-top: 12px; position: relative; }
.daily-icon {
  width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 14px; background: rgba(255,255,255,.2); font-size: 24px;
}
.daily-name { font-size: 18px; font-weight: 800; }
.daily-diff { font-size: 12px; opacity: .85; margin-top: 3px; }
.daily-btn {
  margin-left: auto;
  min-width: 84px; height: 38px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: #fff; color: #5b5be6;
  font-size: 13px; font-weight: 800;
}
.daily-btn.done { background: rgba(255,255,255,.18); color: #fff; }

/* 搜索 / 分类 */
.search {
  display: flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 12px;
  background: var(--card); border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.search-clear { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--bg-soft); color: var(--sub); }

.chips {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 6px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  min-height: 38px; padding: 0 16px;
  display: inline-flex; align-items: center;
  border-radius: 999px;
  background: var(--card); color: var(--sub);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow);
}
.chip.active { background: var(--primary); color: #fff; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 2px 10px; }
.section-title { font-size: 17px; font-weight: 800; }
.section-sub { font-size: 12px; color: var(--muted); }

/* 游戏卡片 */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.game-card {
  display: flex; flex-direction: column;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  min-height: 168px;
}
.game-card:active { transform: scale(.985); }
.game-top { display: flex; justify-content: space-between; align-items: flex-start; }
.game-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; font-size: 22px; }
.status { font-size: 10px; padding: 3px 8px; border-radius: 999px; }
.status.online { color: var(--success); background: rgba(31,169,124,.12); }
.status.coming { color: var(--warn); background: rgba(240,160,58,.14); }
.game-name { margin-top: 10px; font-size: 15px; font-weight: 800; }
.game-tags { margin-top: 3px; font-size: 11px; color: var(--sub); }
.game-best { margin-top: 8px; font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.game-best.has { color: var(--text); }
.best-key { padding: 2px 6px; border-radius: 6px; background: var(--bg-soft); color: var(--sub); font-size: 10px; }
.game-start {
  margin-top: auto;
  height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 13px; font-weight: 800;
}
.game-start.coming { color: var(--muted); background: var(--bg-soft); }

.empty { padding: 48px 0; text-align: center; color: var(--muted); font-size: 13px; }
.empty-icon { font-size: 36px; display: block; margin-bottom: 8px; }

.mine-strip {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
}
.mine-strip-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--primary-soft); font-size: 19px; }
.strip-arrow { color: var(--muted); font-size: 22px; }

.disclaimer { margin-top: 18px; text-align: center; font-size: 11px; color: var(--muted); line-height: 1.6; }

/* 详情页 */
.back-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font-size: 20px; }
.hero { display: flex; gap: 14px; padding: 16px; }
.hero-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; font-size: 32px; flex: 0 0 auto; }
.hero-name { font-size: 20px; font-weight: 800; }
.hero-cat { margin-top: 4px; font-size: 12px; color: var(--primary); }
.hero-desc { margin-top: 8px; font-size: 13px; line-height: 1.6; color: var(--sub); }

.info-card { padding: 16px; margin-top: 12px; }
.block-title { font-size: 16px; font-weight: 800; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; }
.block-note { font-size: 11px; color: var(--muted); }

.rule-item { display: flex; gap: 10px; margin-top: 10px; }
.rule-index {
  flex: 0 0 auto; width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  font-size: 11px; font-weight: 800; margin-top: 2px;
}
.rule-text { font-size: 13px; line-height: 1.65; color: var(--sub); }

.diff-item {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}
.diff-item.active { border-color: var(--primary); background: var(--primary-soft); }
.diff-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; flex: 0 0 auto; }
.diff-item.active .diff-radio { border-color: var(--primary); }
.diff-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.diff-name { font-size: 14px; font-weight: 700; }
.diff-desc { font-size: 11px; color: var(--sub); margin-top: 2px; }
.diff-best { margin-left: auto; text-align: right; font-size: 12px; }
.diff-best-meta { font-size: 10px; color: var(--warn); margin-top: 2px; }

.best-card { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 14px 16px; }
.best-crown { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: #fff6e4; font-size: 19px; }
.best-value { font-size: 17px; font-weight: 800; color: var(--primary); }
.best-meta { font-size: 11px; color: var(--muted); margin-top: 2px; text-align: right; }

.detail-bottom {
  position: sticky; bottom: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 30%);
}

/* 游戏页 */
.game-topbar { display: flex; align-items: center; gap: 10px; padding: 12px 0 8px; }
.game-title { font-size: 17px; font-weight: 800; line-height: 1.2; }
.game-sub { font-size: 11px; color: var(--sub); margin-top: 2px; }
.hud {
  display: flex; gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.hud-item { flex: 1; min-width: 0; }
.hud-label { font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.hud-value { font-size: 15px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.game-body { min-height: 300px; }
.game-tip { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tip-text { font-size: 12px; color: var(--sub); }
.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--bg-soft); color: var(--sub); }
.pill.on { background: rgba(255,185,61,.18); color: #d9901a; }
.pill.primary { background: var(--primary-soft); color: var(--primary); }

.board {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}

/* 记忆翻牌 */
.mem-cell { position: relative; width: 100%; aspect-ratio: 1; perspective: 600px; }
.mem-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .18s ease; }
.mem-cell.flipped .mem-inner, .mem-cell.matched .mem-inner { transform: rotateY(180deg); }
.mem-face {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border-radius: 10px;
  backface-visibility: hidden;
  font-size: clamp(18px, 6vw, 30px);
}
.mem-back { background: linear-gradient(145deg, #6a68ee, #8b7bff); color: rgba(255,255,255,.9); font-weight: 800; }
.mem-front { background: var(--bg-soft); transform: rotateY(180deg); }
.mem-cell.matched .mem-front { background: rgba(31,169,124,.14); box-shadow: inset 0 0 0 2px rgba(31,169,124,.35); }
.board-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11px; color: var(--muted); }

/* 舒尔特 / 华容道 */
.num-cell {
  aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--bg-soft);
  font-weight: 800;
  font-size: clamp(15px, 5vw, 26px);
  transition: transform .12s ease, opacity .15s ease;
}
.num-cell:active { transform: scale(.94); }
.num-cell.done { opacity: .2; transform: scale(.94); }
.num-cell.wrong { background: var(--danger); color: #fff; }
.num-cell.blank { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }

/* 2048 */
.tile {
  aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 10px;
  font-weight: 800;
  font-size: clamp(16px, 6vw, 28px);
  background: var(--bg-soft); color: var(--text);
}
.tile.v2 { background: #f6f2ea; color: #6b6557; }
.tile.v4 { background: #f0e6d2; color: #6b6557; }
.tile.v8 { background: #f5b27a; color: #fff; }
.tile.v16 { background: #f5945c; color: #fff; }
.tile.v32 { background: #f5795c; color: #fff; }
.tile.v64 { background: #f55b45; color: #fff; }
.tile.v128 { background: #f0cf5c; color: #fff; }
.tile.v256 { background: #f0c44a; color: #fff; }
.tile.v512 { background: #efb83a; color: #fff; }
.tile.v1024 { background: #efac2b; color: #fff; }
.tile.v2048 { background: linear-gradient(135deg, #efac2b, #f58a3a); color: #fff; }
.tile.vbig { background: linear-gradient(135deg, #5b5be6, #7c6bff); color: #fff; }
.tile.pop { animation: pop .18s ease; }
@keyframes pop { from { transform: scale(.7); } to { transform: scale(1); } }

/* 24 点 */
.cards24 { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.card24 {
  width: 62px; height: 84px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--card); box-shadow: var(--shadow);
  font-size: 24px; font-weight: 800;
}
.expr-input {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--card); color: var(--text);
  font-size: 16px; font-weight: 700;
  outline: none;
}
.expr-input:focus { border-color: var(--primary); }
.keypad { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.key {
  min-height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--card); box-shadow: var(--shadow);
  font-weight: 700; font-size: 15px;
}
.key:active { transform: scale(.95); }
.key.wide { grid-column: span 2; }
.hint-line { margin-top: 10px; font-size: 12px; color: var(--primary); background: var(--primary-soft); padding: 8px 10px; border-radius: 10px; }

/* 色词 */
.stroop-word {
  height: 180px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--card); box-shadow: var(--shadow);
  font-size: 52px; font-weight: 900;
  margin-bottom: 12px;
}
.stroop-btns { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.stroop-btn {
  min-height: 56px;
  display: grid; place-items: center;
  border-radius: 14px;
  font-weight: 800; font-size: 16px;
  color: #fff;
  box-shadow: var(--shadow);
}
.stroop-btn:active { transform: scale(.97); }

/* 大号显示区（数字记忆 / 速算冲刺共用） */
.big-display {
  height: 150px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--card); box-shadow: var(--shadow);
  font-size: 40px; font-weight: 900;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  white-space: nowrap;
}
.big-display.dim { color: var(--muted); }

/* 点阵记忆 */
.pat-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--bg-soft);
  transition: background .12s ease, box-shadow .12s ease;
}
.pat-cell.lit {
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 91, 230, .25);
}
.pat-cell.picked { background: rgba(31, 169, 124, .55); }
.pat-cell.wrong { background: var(--danger); }

/* 找不同 */
.spot-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  transition: transform .1s ease, box-shadow .1s ease;
}
.spot-cell:active { transform: scale(.93); }

/* 速算冲刺对错按钮 */
.answer-btns { display: flex; gap: 10px; }
.answer-btn {
  flex: 1;
  min-height: 64px;
  display: grid; place-items: center;
  border-radius: 14px;
  font-size: 18px; font-weight: 800;
  color: #fff;
  box-shadow: var(--shadow);
}
.answer-btn.yes { background: linear-gradient(135deg, #1fa97c, #35c193); }
.answer-btn.no { background: linear-gradient(135deg, #ee5d6c, #f97e8a); }
.answer-btn:active { transform: scale(.97); }

/* 占位预览 */
.preview-hero { padding: 22px 16px; text-align: center; }
.preview-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; font-size: 32px; margin: 0 auto; }
.preview-tag { display: inline-flex; margin-top: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(240,160,58,.14); color: var(--warn); font-size: 11px; }
.preview-title { margin-top: 8px; font-size: 20px; font-weight: 800; }
.preview-desc { margin-top: 6px; font-size: 13px; color: var(--sub); line-height: 1.6; }

/* 我的 */
.profile {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  color: #fff;
  background: linear-gradient(135deg, #5b5be6, #7b66ff 60%, #977dff);
  box-shadow: 0 14px 30px rgba(91,91,230,.24);
}
.profile-avatar { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; background: rgba(255,255,255,.2); font-size: 26px; }
.profile-name { font-size: 18px; font-weight: 800; }
.profile-sub { font-size: 12px; opacity: .85; margin-top: 3px; }
.profile-streak { margin-left: auto; text-align: center; padding: 8px 12px; border-radius: 14px; background: rgba(255,255,255,.16); }
.streak-num { font-size: 15px; font-weight: 800; }
.streak-label { font-size: 10px; opacity: .8; }

.stat-card { display: flex; margin-top: 12px; padding: 14px 0; }
.stat-item { flex: 1; text-align: center; position: relative; }
.stat-item + .stat-item::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.stat-num { font-size: 18px; font-weight: 800; color: var(--primary); }
.stat-name { font-size: 11px; color: var(--sub); margin-top: 2px; }

.badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.badge-card { padding: 12px 8px; text-align: center; }
.badge-card.locked { opacity: .55; }
.badge-icon { font-size: 22px; }
.badge-name { margin-top: 6px; font-size: 12px; font-weight: 800; }
.badge-desc { margin-top: 4px; font-size: 10px; line-height: 1.5; color: var(--sub); min-height: 30px; }

.record-list { padding: 4px 12px; }
.record-row { display: flex; align-items: center; gap: 10px; min-height: 54px; border-bottom: 1px solid var(--line); cursor: pointer; }
.record-row:last-child { border-bottom: 0; }
.record-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; font-size: 18px; flex: 0 0 auto; }
.record-name { font-size: 14px; font-weight: 700; }
.record-meta { font-size: 11px; color: var(--sub); margin-top: 2px; }
.record-best { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.record-best.has { color: var(--primary); font-weight: 800; }

.menu-card { padding: 4px 12px; }
.menu-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; border-bottom: 1px solid var(--line); text-align: left; }
.menu-row:last-child { border-bottom: 0; }
.menu-icon { width: 26px; text-align: center; font-size: 16px; }
.menu-label { flex: 1; font-size: 14px; font-weight: 600; }
.menu-hint { font-size: 11px; color: var(--muted); }

/* 设置 */
.setting-card { padding: 4px 14px; }
.setting-row { display: flex; align-items: center; gap: 12px; min-height: 58px; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-icon { width: 28px; text-align: center; font-size: 17px; }
.setting-name { font-size: 14px; font-weight: 700; }
.setting-desc { font-size: 11px; color: var(--sub); margin-top: 2px; }

.switch { position: relative; width: 46px; height: 28px; border-radius: 999px; background: var(--line); transition: background .15s ease; flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .15s ease; }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }

.theme-row { display: flex; gap: 10px; padding: 12px 0; }
.theme-option { flex: 1; padding: 10px; border: 2px solid var(--line); border-radius: 14px; position: relative; }
.theme-option.active { border-color: var(--primary); background: var(--primary-soft); }
.theme-preview { height: 64px; border-radius: 10px; padding: 8px; }
.theme-preview.light { background: #f4f6fb; }
.theme-preview.dark { background: #121420; }
.tp-bar { width: 24px; height: 8px; border-radius: 4px; }
.theme-preview.light .tp-bar { background: #5b5be6; }
.theme-preview.dark .tp-bar { background: #8c8cff; }
.tp-line { height: 6px; border-radius: 3px; margin-top: 6px; background: rgba(127,127,160,.25); }
.theme-name { margin-top: 8px; text-align: center; font-size: 12px; font-weight: 700; }

.danger-text { color: var(--danger); }

/* 引导 */
.guide { min-height: 100vh; display: flex; flex-direction: column; }
.guide-swiper { flex: 1; position: relative; overflow: hidden; }
.guide-slide {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px 28px;
}
.guide-slide.active { display: flex; }
.guide-art { position: relative; width: 150px; height: 150px; display: grid; place-items: center; margin-bottom: 22px; }
.guide-ring { position: absolute; width: 140px; height: 140px; border-radius: 50%; border: 2px dashed rgba(91,91,230,.3); background: linear-gradient(135deg, rgba(91,91,230,.12), rgba(124,107,255,.04)); }
.guide-icon { position: relative; width: 96px; height: 96px; display: grid; place-items: center; border-radius: 30px; background: var(--card); box-shadow: var(--shadow); font-size: 48px; }
.guide-badge { position: absolute; right: -4px; bottom: 8px; padding: 3px 10px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; }
.guide-title { font-size: 23px; font-weight: 800; }
.guide-desc { margin-top: 10px; max-width: 300px; font-size: 13px; line-height: 1.7; color: var(--sub); }
.guide-points { margin-top: 18px; padding: 12px 18px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); text-align: left; }
.guide-point { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--sub); padding: 4px 0; }
.guide-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.guide-foot { padding: 8px 0 calc(20px + env(safe-area-inset-bottom)); }
.dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.dot { width: 7px; height: 7px; border-radius: 4px; background: var(--line); transition: all .2s ease; }
.dot.active { width: 22px; background: var(--primary); }
.guide-skip { display: grid; place-items: center; min-height: 44px; margin-top: 4px; font-size: 13px; color: var(--muted); }

/* 弹窗 */
.mask {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(16,18,32,.58);
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 340px;
  max-height: 86vh; overflow-y: auto;
  background: var(--card); color: var(--text);
  border-radius: 22px;
  padding: 22px 18px 14px;
  box-shadow: 0 30px 80px rgba(10,12,30,.28);
  animation: modalIn .24s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.modal-center { text-align: center; }
.modal-badge { font-size: 30px; }
.modal-title { margin-top: 6px; font-size: 20px; font-weight: 800; }
.modal-sub { margin-top: 6px; font-size: 12px; color: var(--sub); }
.stars { display: flex; justify-content: center; gap: 4px; margin: 10px 0 4px; }
.star { font-size: 30px; color: #e4e6f1; }
.star.on { color: #ffb93d; text-shadow: 0 6px 14px rgba(255,185,61,.3); }
.score-num { font-size: 40px; font-weight: 900; color: var(--primary); line-height: 1.1; }
.score-label { font-size: 11px; color: var(--sub); letter-spacing: 2px; }
.stat-grid { display: flex; margin-top: 12px; padding: 12px 0; border-radius: 14px; background: var(--bg-soft); }
.stat-grid .stat-item + .stat-item::before { background: var(--line); }
.best-line { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--sub); }
.best-tag { padding: 2px 8px; border-radius: 999px; font-size: 10px; color: var(--primary); background: rgba(91,91,230,.1); }
.best-tag.new { color: #fff; background: linear-gradient(135deg, #ffb93d, #ff8a4c); }
.achieve-box { margin-top: 12px; padding: 10px 12px; border: 2px dashed rgba(91,91,230,.25); border-radius: 14px; text-align: left; }
.achieve-title { font-size: 11px; font-weight: 700; color: var(--primary); }
.achieve-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.achieve-check { margin-left: auto; color: var(--success); font-weight: 800; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions .btn { flex: 1; }
.share-line { display: grid; place-items: center; width: 100%; min-height: 44px; margin-top: 6px; font-size: 12px; color: var(--sub); }

.toast {
  position: fixed; left: 50%; bottom: 90px;
  transform: translateX(-50%);
  z-index: 200;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(20,22,38,.86);
  color: #fff; font-size: 13px;
  animation: fadeIn .18s ease;
  pointer-events: none;
}
