/* 英玩 · 跨端自适应（微信 / iOS / 安卓 / Mac / Windows） */

:root {
  --ink: #071018;
  --panel: #101a28;
  --line: rgba(220, 235, 255, 0.14);
  --foam: #e8f1ff;
  --muted: rgba(232, 241, 255, 0.62);
  --sky: #4da3ff;
  --mint: #3dffb0;
  --gold: #ffd166;
  --warn: #ff6b57;
  /* 系统字体优先：微信/国内网络下 Google Fonts 常不可用 */
  --f-display: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --f-body: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --nav-h: 56px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --app-vh: 1vh;
  --app-height: 100vh;
  --page-pad-x: clamp(14px, 4vw, 48px);
}

@supports (height: 100dvh) {
  :root {
    --app-height: 100dvh;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: var(--app-height);
  color: var(--foam);
  font-family: var(--f-body);
  font-size: 16px; /* 避免 iOS 输入框聚焦自动放大 */
  line-height: 1.5;
  background:
    radial-gradient(1100px 640px at 12% -12%, rgba(77, 163, 255, 0.18), transparent 55%),
    radial-gradient(800px 520px at 95% 0%, rgba(61, 255, 176, 0.1), transparent 50%),
    linear-gradient(180deg, #050b14 0%, var(--ink) 42%, #050910 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  touch-action: manipulation;
  padding-left: var(--sal);
  padding-right: var(--sar);
}

/* 窄屏 / 触控：背景固定在部分移动端会卡顿 */
html.is-narrow body,
html.is-mobile body,
html.is-touch body,
body.is-narrow,
body.is-mobile,
body.is-touch {
  background-attachment: scroll;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

img, video, iframe, canvas, svg {
  max-width: 100%;
}

button, input, textarea, select {
  font: inherit;
  font-size: 16px;
}

button, a, [role='button'] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: calc(var(--nav-h) + var(--sat));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: var(--sat) var(--page-pad-x) 0;
  height: auto;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 16, 24, 0.78);
  border-bottom: 1px solid var(--line);
}

.site-nav .brand-row,
.site-nav .brand,
.site-nav .nav-links {
  min-height: var(--nav-h);
  display: inline-flex;
  align-items: center;
}

.brand-row {
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  flex-shrink: 1;
}

.brand {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 3.5vw, 1.4rem);
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.brand span {
  color: var(--sky);
}

.brand-mastered {
  color: var(--mint);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(61, 255, 176, 0.28);
  background: rgba(61, 255, 176, 0.08);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.nav-links a {
  padding: 8px 10px;
  color: var(--muted);
  border-radius: 999px;
  white-space: nowrap;
  font-size: 0.92rem;
}

.nav-links a:hover,
.nav-links a[aria-current='page'] {
  color: var(--foam);
  background: rgba(255, 255, 255, 0.04);
}

.nav-links a.nav-login {
  color: var(--sky);
  border: 1px solid rgba(77, 163, 255, 0.35);
  background: rgba(77, 163, 255, 0.1);
  font-weight: 600;
}

.nav-links a.nav-login:hover {
  color: #6bb4ff;
  background: rgba(77, 163, 255, 0.18);
}

.nav-links a.nav-user {
  color: var(--mint);
  font-weight: 700;
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-links a.nav-user:hover,
.nav-links a.nav-user[aria-current='page'] {
  color: var(--mint);
  background: rgba(61, 255, 176, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
  user-select: none;
  -webkit-user-select: none;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn-sky {
  background: rgba(77, 163, 255, 0.18);
  color: var(--sky);
  border-color: rgba(77, 163, 255, 0.45);
}
.btn-sky:hover {
  background: rgba(77, 163, 255, 0.28);
}
.btn-primary {
  background: var(--sky);
  color: #041018;
  box-shadow: 0 10px 28px rgba(77, 163, 255, 0.22);
}

.btn-primary:hover {
  background: #6bb4ff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--foam);
}

.hero {
  position: relative;
  min-height: calc(var(--app-height) - var(--nav-h) - var(--sat));
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-visual {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 40%, rgba(77, 163, 255, 0.22), transparent 38%),
    radial-gradient(circle at 70% 65%, rgba(61, 255, 176, 0.14), transparent 40%),
    repeating-linear-gradient(-18deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 16px),
    #0a1422;
}

.hero-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 16, 24, 0.2), rgba(7, 16, 24, 0.88));
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  padding: clamp(24px, 6vw, 72px) var(--page-pad-x) clamp(36px, 7vw, 80px);
  animation: rise 0.85s var(--ease) both;
}

.hero-brand {
  margin: 0 0 12px;
  font-family: var(--f-display);
  font-size: clamp(3rem, 14vw, 7rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.hero-brand em {
  font-style: normal;
  color: var(--sky);
}

.hero-line {
  margin: 0 0 26px;
  max-width: 36ch;
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  line-height: 1.55;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section {
  padding: clamp(40px, 8vw, 88px) var(--page-pad-x);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.game-search-row {
  margin: 0 0 18px;
}

.game-search {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--foam);
  outline: none;
  font: inherit;
  font-size: 16px;
}

.game-search::placeholder {
  color: rgba(232, 241, 255, 0.42);
}

.game-search:focus {
  border-color: rgba(77, 163, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.14);
}

.game-search-hint {
  margin-top: 8px;
  min-height: 1.2em;
  font-size: 0.88rem;
  color: var(--muted);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 24px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(1.55rem, 4.5vw, 2.5rem);
  letter-spacing: -0.03em;
  font-weight: 700;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 42ch;
}

.playing-section {
  margin-bottom: 28px;
}

.playing-section .section-head {
  margin-bottom: 14px;
}

.playing-grid .game-tile {
  min-height: 148px;
}

.playing-grid .game-tile .meta h3 {
  font-size: 1rem;
}

.playing-badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--mint);
  border: 1px solid rgba(61, 255, 176, 0.28);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(61, 255, 176, 0.08);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 14px;
}

.game-tile-wrap {
  position: relative;
}

.game-tile {
  display: block;
  min-height: 180px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
  animation: rise 0.7s var(--ease) both;
}

.lb-chip {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  border: 1px solid rgba(255, 209, 102, 0.4);
  background: rgba(7, 16, 24, 0.82);
  color: var(--gold);
  border-radius: 999px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .game-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(77, 163, 255, 0.4);
  }
}

.game-tile .thumb {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, rgba(77, 163, 255, 0.18), transparent 45%),
    linear-gradient(220deg, rgba(61, 255, 176, 0.1), transparent 40%),
    #0c1624;
}

.game-tile .meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 16px 16px;
  background: linear-gradient(180deg, transparent, rgba(5, 10, 18, 0.92) 55%);
}

.game-tile h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  line-height: 1.3;
}

.game-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  font-size: 0.7rem;
  color: var(--mint);
  border: 1px solid rgba(61, 255, 176, 0.28);
  padding: 3px 8px;
  border-radius: 999px;
}

.empty {
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  padding: 24px var(--page-pad-x) calc(28px + var(--sab));
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 0.9rem;
}

.site-footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.site-footer strong {
  color: var(--foam);
  font-family: var(--f-display);
}

.site-disclaimer {
  margin: 0;
  max-width: 920px;
  font-size: 12px;
  line-height: 1.65;
  color: #999;
  text-align: left;
}

.site-disclaimer strong {
  color: #999;
  font-family: inherit;
  font-weight: 600;
}

.site-disclaimer a {
  color: #999;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-disclaimer a:hover {
  color: #bbb;
}

.page-shell {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) var(--page-pad-x) calc(56px + var(--sab));
}

.page-shell h1 {
  margin: 0 0 10px;
  font-family: var(--f-display);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
}

.lead {
  margin: 0 0 24px;
  color: var(--muted);
  max-width: 48ch;
  line-height: 1.6;
}

/* —— 微信提示条 —— */
.yw-wechat-tip {
  position: fixed;
  left: max(12px, var(--sal));
  right: max(12px, var(--sar));
  bottom: max(12px, var(--sab));
  z-index: 90;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(12, 22, 36, 0.96);
  border: 1px solid rgba(77, 163, 255, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  color: var(--foam);
  font-size: 13px;
  line-height: 1.45;
  animation: rise 0.35s var(--ease);
}

.yw-wechat-tip__text {
  flex: 1;
  min-width: 0;
  color: var(--muted);
}

.yw-wechat-tip__text b {
  color: var(--gold);
  font-weight: 700;
}

.yw-wechat-tip__close {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  min-height: 36px;
  padding: 0 12px;
  background: var(--sky);
  color: #041018;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* —— 游玩壳（英玩） —— */
.play-body {
  margin: 0;
  background: #000;
  overflow: hidden;
  height: var(--app-height);
  width: 100%;
  position: fixed;
  inset: 0;
  padding: 0;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

.play-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: calc(48px + var(--sat));
  padding: var(--sat) max(10px, var(--sar)) 0 max(10px, var(--sal));
  background: rgba(7, 16, 24, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateY(0);
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.play-bar > div {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.play-bar.is-hidden {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

.play-bar .title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
  max-width: min(46vw, 280px);
}

.play-bar .btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.play-frame {
  position: fixed;
  top: calc(48px + var(--sat));
  left: 0;
  right: 0;
  bottom: 0;
  border: 0;
  width: 100%;
  /* 多层回退，避免 --app-height 异常时变成黑屏 */
  height: calc(100vh - 48px - var(--sat));
  height: calc(100dvh - 48px - var(--sat));
  height: calc(var(--app-height) - 48px - var(--sat));
  min-height: 240px;
  background: #050b14;
  /* iOS iframe 滚动 */
  -webkit-overflow-scrolling: touch;
}

.play-frame.is-immersive {
  top: 0;
  height: 100vh;
  height: 100dvh;
  height: var(--app-height);
  min-height: 240px;
}

.play-fallback {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: rgba(5, 11, 20, 0.96);
  text-align: center;
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— 手机 / 窄屏 —— */
@media (max-width: 720px) {
  .site-nav {
    flex-wrap: wrap;
    row-gap: 4px;
    padding-bottom: 8px;
  }

  .site-nav .brand-row {
    width: 100%;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 0;
    padding-bottom: 2px;
  }

  .nav-links a {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    font-size: 0.85rem;
    min-height: 36px;
  }

  .nav-links .btn {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.85rem;
  }

  .nav-links a.nav-user {
    max-width: 7.5em;
  }

  .hero-brand {
    font-size: clamp(2.8rem, 18vw, 4.8rem);
  }

  .section-head .btn {
    width: 100%;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  @media (min-width: 380px) {
    .game-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }
}

/* —— 平板 —— */
@media (min-width: 721px) and (max-width: 1024px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* —— 桌面大屏 —— */
@media (min-width: 1100px) {
  :root {
    --nav-h: 64px;
  }

  .game-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-copy {
    padding-bottom: 96px;
  }
}

@media (min-width: 1400px) {
  .game-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 微信内：略收紧，减少底栏遮挡 */
.is-wechat .site-footer,
html.is-wechat .site-footer {
  padding-bottom: calc(36px + var(--sab));
}

.is-wechat .play-frame,
html.is-wechat .play-frame {
  /* 微信工具栏变化时依赖 --app-height */
  height: calc(var(--app-height) - 48px - var(--sat));
}

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

/* 横屏手机：压缩导航与页头 */
@media (max-height: 480px) and (orientation: landscape) {
  .hero {
    min-height: auto;
  }
  .hero-brand {
    font-size: clamp(2rem, 10vw, 3rem);
  }
  .hero-copy {
    padding-top: 20px;
    padding-bottom: 24px;
  }
}

/* —— 分类页 —— */
.cat-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: var(--muted);
}

.cat-breadcrumb a {
  color: var(--accent, #4da3ff);
  text-decoration: none;
}

.cat-breadcrumb a:hover {
  text-decoration: underline;
}

.cat-sep {
  opacity: 0.45;
}

.cat-current {
  color: var(--text, #e8eef7);
  font-weight: 600;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 12px;
}

.cat-card {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(155deg, rgba(77, 163, 255, 0.12), transparent 50%),
    var(--panel);
  padding: 16px 16px 14px;
  color: inherit;
  font: inherit;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
  animation: rise 0.6s var(--ease) both;
}

.cat-card-exam {
  background:
    linear-gradient(155deg, rgba(61, 255, 176, 0.08), transparent 48%),
    var(--panel);
}

@media (hover: hover) and (pointer: fine) {
  .cat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(77, 163, 255, 0.45);
  }
}

.cat-card:active {
  transform: translateY(0);
}

.cat-card-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.cat-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
}

.cat-card-meta {
  font-size: 0.86rem;
  color: var(--muted);
}

.cat-more {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

/* —— 拼拼乐 —— */
.spell-page { min-height: 50vh; }
.spell-back { margin-bottom: 10px; }
.spell-bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 10px;
}
.spell-bank-card {
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  font: inherit;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.spell-bank-card:hover { border-color: rgba(61, 255, 176, .4); transform: translateY(-2px); }
.spell-bank-card strong { font-size: 0.98rem; line-height: 1.35; }
.spell-bank-card span { font-size: 0.82rem; color: var(--muted); }
.spell-bank-btns,
.spell-level-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.spell-btn-study,
.spell-btn-play {
  flex: 1;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  color: inherit;
  background: rgba(0, 0, 0, .22);
  transition: transform .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.spell-btn-study:active,
.spell-btn-play:active { transform: scale(.96); }
.spell-btn-study {
  border-color: rgba(61, 255, 176, .4);
  color: var(--mint);
  background: rgba(61, 255, 176, .1);
}
.spell-btn-play {
  border-color: rgba(77, 163, 255, .45);
  color: var(--accent, #4da3ff);
  background: rgba(77, 163, 255, .12);
}
.spell-level-meta { color: var(--muted); font-size: 0.9rem; margin: 0 0 10px; }
.spell-level-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.spell-level-grid { display: grid; gap: 8px; }
.spell-level-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(16, 26, 40, .78);
  color: inherit;
  font: inherit;
}
.spell-level-card:hover { border-color: rgba(77, 163, 255, .45); }
.spell-level-idx {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid rgba(77, 163, 255, .35);
  color: var(--accent, #4da3ff); font-weight: 700;
  background: rgba(77, 163, 255, .08);
}
.spell-level-name { font-weight: 700; font-size: 0.95rem; }
.spell-level-sub { font-size: 0.82rem; margin-top: 4px; color: var(--gold, #ffd166); }

/* 学 · 自然拼读 overlay */
.spell-study-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: none; align-items: center; justify-content: center;
  padding: 20px; background: rgba(0, 0, 0, .72);
}
.spell-study-overlay.show { display: flex; }
.spell-study-box {
  width: min(440px, 100%);
  background: #101a28;
  border: 1px solid rgba(220, 235, 255, .14);
  border-radius: 18px;
  padding: 18px;
  color: #e8f1ff;
}
.spell-study-box h3 { margin: 0 0 6px; font-size: 1.1rem; }
.spell-study-sub { color: rgba(232, 241, 255, .62); font-size: 13px; margin-bottom: 12px; line-height: 1.45; }
.spell-study-en {
  font-size: clamp(1.45rem, 6vw, 1.9rem);
  font-weight: 700; color: #cfe4ff;
  margin: 8px 0 6px; word-break: break-word; text-align: center;
}
.spell-study-zh {
  font-size: 1.05rem; color: #d8ffe8; min-height: 1.4em;
  margin-bottom: 12px; word-break: break-word; text-align: center;
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center;
}
.spell-study-zh-chip {
  border: 1px solid rgba(61, 255, 176, .35);
  background: rgba(61, 255, 176, .08);
  color: #d8ffe8; border-radius: 10px;
  padding: 4px 10px; font: inherit; font-size: 0.98rem;
  cursor: pointer; line-height: 1.35;
}
.spell-study-zh-chip.on {
  border-color: var(--gold, #ffd166);
  background: rgba(255, 209, 102, .16);
  color: var(--gold, #ffd166);
}
.spell-study-syl {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  align-items: center; min-height: 40px; margin-bottom: 12px;
}
.spell-study-syl .spell-g {
  min-width: 40px; min-height: 36px; padding: 6px 10px;
  border-radius: 10px; border: 1px solid rgba(77, 163, 255, .35);
  background: rgba(77, 163, 255, .1); color: #cfe4ff;
  font: inherit; font-weight: 700; cursor: pointer;
}
.spell-study-syl .spell-g.on {
  border-color: var(--mint); background: rgba(61, 255, 176, .18); color: var(--mint);
}
.spell-study-syl .spell-g.whole {
  border-color: var(--gold, #ffd166); background: rgba(255, 209, 102, .16); color: var(--gold, #ffd166);
}
.spell-study-syl .spell-g-sep { color: var(--muted); font-weight: 700; }
.spell-study-bar {
  height: 6px; border-radius: 999px; background: #1a2538; overflow: hidden; margin: 8px 0 14px;
}
.spell-study-bar > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #4da3ff, #3dffb0);
  transition: width .2s;
}
.spell-study-acts {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}

.spell-game { max-width: 720px; margin: 0 auto; }
.spell-ghead { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.spell-gtitle { font-size: 1.15rem; font-weight: 700; }
.spell-gsub { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.spell-gstats { display: flex; gap: 16px; text-align: right; }
.spell-gstats span { display: block; font-size: 11px; color: var(--muted); }
.spell-gstats b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.spell-pbar { height: 4px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; margin-bottom: 16px; }
.spell-pbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent, #4da3ff), var(--mint, #3dffb0)); width: 0; transition: width .3s ease; }
.spell-rtag {
  display: inline-block; font-size: 12px; letter-spacing: .04em;
  color: var(--mint, #3dffb0); border: 1px solid rgba(61,255,176,.35);
  border-radius: 999px; padding: 3px 10px; margin-bottom: 12px;
}
.spell-tip { font-size: 0.85rem; color: var(--muted); margin-top: 14px; text-align: center; }
.spell-game-foot { margin-top: 18px; display: flex; justify-content: center; }

.spell-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spell-pcol { display: grid; gap: 8px; align-content: start; min-width: 0; }
.spell-chip {
  text-align: left; cursor: pointer; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); padding: 10px 12px; min-height: 52px; color: inherit; font: inherit;
  display: grid; gap: 2px; align-content: center; overflow: visible;
}
.spell-chip .en { font-size: 1.05rem; font-weight: 650; overflow-wrap: anywhere; word-break: break-word; }
.spell-chip .zh {
  font-size: 0.95rem; color: #d8ffe8; line-height: 1.35;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}
.spell-chip.sel { border-color: var(--accent, #4da3ff); box-shadow: 0 0 0 2px rgba(77,163,255,.2); }
.spell-chip.ok { border-color: var(--mint, #3dffb0); background: rgba(61,255,176,.08); }
.spell-chip.bad { border-color: #ff6b57; animation: shake .32s; }
.spell-chip.done { visibility: hidden; }
@keyframes shake {
  0%,100%{transform:translateX(0)}20%{transform:translateX(-5px)}40%{transform:translateX(4px)}60%{transform:translateX(-3px)}80%{transform:translateX(2px)}
}

.spell-ask { text-align: center; margin: 4px 0 12px; }
.spell-ask .zh {
  font-size: 1.35rem; font-weight: 700; line-height: 1.4;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; max-width: 100%; margin: 0 auto;
}
.spell-ask .meta { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }

.spell-phonics {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  margin: 0 auto 16px; max-width: 520px; position: relative; padding-bottom: 22px;
}
.spell-g {
  min-width: 36px; min-height: 36px; padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(0,0,0,.28);
  display: inline-grid; place-items: center; font-size: 1.05rem; font-weight: 700;
  letter-spacing: .02em; transition: background .15s, border-color .15s, color .15s;
  color: inherit; cursor: pointer; font: inherit; font-size: 1.05rem; font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}
.spell-g-sep { color: var(--muted); opacity: .7; padding: 0 2px; font-weight: 700; align-self: center; }
.spell-g.on { border-color: var(--mint, #3dffb0); color: var(--mint, #3dffb0); background: rgba(61,255,176,.12); }
.spell-g.whole { border-color: var(--accent, #4da3ff); color: #cfe4ff; background: rgba(77,163,255,.12); }
.spell-phonics-tip {
  position: absolute; left: 0; right: 0; bottom: 0;
  text-align: center; font-size: 11.5px; color: var(--muted);
  pointer-events: none;
}

.spell-answer {
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(61, 255, 176, .28);
  background: rgba(61, 255, 176, .06);
  text-align: center;
}
.spell-answer-badge {
  display: inline-block;
  font-size: 12px;
  color: #ffb4a8;
  border: 1px solid rgba(255, 107, 87, .4);
  background: rgba(255, 107, 87, .1);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 8px;
}
.spell-answer-label {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.spell-answer-word {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(77, 163, 255, .45);
  background: rgba(77, 163, 255, .12);
  color: #cfe4ff;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.spell-answer-word:hover { border-color: rgba(77, 163, 255, .7); }
.spell-answer-word::after {
  content: '🔊';
  font-size: 0.85rem;
  opacity: .85;
}
.spell-answer-zh {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.spell-wrong-item .wm {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.4;
}
.spell-answer .spell-phonics {
  margin-top: 14px;
  margin-bottom: 8px;
}
.spell-answer-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.spell-toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(12px);
  background: rgba(12, 22, 36, .95);
  border: 1px solid rgba(255, 107, 87, .45);
  color: #ffd4ce;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  z-index: 50;
}
.spell-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.spell-slots { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0 16px; align-items: center; }
.spell-slot {
  min-width: 42px; height: 46px; border-radius: 10px; border: 1px dashed var(--line);
  background: rgba(0,0,0,.2); display: grid; place-items: center; font-size: 1.25rem; font-weight: 700;
  color: inherit; font: inherit; font-size: 1.15rem; font-weight: 700; padding: 0 8px; cursor: default;
  -webkit-tap-highlight-color: transparent;
}
.spell-slot-syl {
  min-width: 56px; min-height: 48px; height: auto; padding: 8px 12px;
  font-size: 1.05rem; letter-spacing: .02em;
}
.spell-slot:disabled { opacity: 1; }
.spell-slot.on { border-style: solid; background: var(--panel); cursor: pointer; }
.spell-slot.cursor {
  border-style: solid;
  border-color: rgba(77, 163, 255, .65);
  box-shadow: 0 0 0 2px rgba(77, 163, 255, .18);
  background: rgba(77, 163, 255, .08);
  color: rgba(207, 228, 255, .55);
}
.spell-slot.locked {
  border-color: var(--mint, #3dffb0);
  color: var(--mint, #3dffb0);
  background: rgba(61,255,176,.12);
  cursor: default;
}
.spell-slot.ok { border-color: var(--mint, #3dffb0); color: var(--mint, #3dffb0); background: rgba(61,255,176,.1); }
.spell-slot.bad { border-color: #ff6b57; background: rgba(255,107,87,.1); }
.spell-tray { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; position: relative; z-index: 2; }
.spell-lt {
  min-width: 44px; min-height: 44px; padding: 0 8px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); font-size: 1.15rem; font-weight: 700;
  cursor: pointer; color: inherit; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.spell-lt-syl {
  min-width: 58px; min-height: 48px; padding: 0 14px; font-size: 1.05rem; border-radius: 12px;
}
.spell-lt:disabled { cursor: default; }
.spell-lt.used { visibility: hidden; pointer-events: none; }
.spell-opts { display: grid; gap: 9px; max-width: 480px; margin: 0 auto; }
.spell-opt {
  text-align: left; padding: 12px 14px; min-height: 48px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer;
  font: inherit; font-size: 1.05rem; font-weight: 650; color: inherit;
}
.spell-opt.ok { border-color: var(--mint, #3dffb0); background: rgba(61,255,176,.1); }
.spell-opt.bad { border-color: #ff6b57; background: rgba(255,107,87,.1); animation: shake .32s; }

.spell-veil {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  padding: 16px; background: rgba(5, 11, 20, .72);
}
.spell-veil[hidden] { display: none; }
.spell-card {
  width: 100%; max-width: 420px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  box-shadow: 0 30px 70px -30px rgba(0,0,0,.7);
}
.spell-card h3 { margin: 0 0 10px; font-size: 1.25rem; }
.spell-stars { color: var(--gold, #ffd166); font-size: 1.4rem; letter-spacing: 4px; margin-bottom: 12px; }
.spell-rows { display: grid; gap: 8px; margin: 12px 0 16px; }
.spell-row {
  display: flex; justify-content: space-between; font-size: 0.95rem;
  border-bottom: 1px dotted var(--line); padding-bottom: 6px;
}
.spell-row b { font-variant-numeric: tabular-nums; }
.spell-acts { display: flex; gap: 10px; flex-wrap: wrap; }

.spell-wrong-list { display: grid; gap: 8px; margin-top: 14px; }
.spell-wrong-item {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 10px 12px;
}
.spell-wrong-item .wk { display: flex; justify-content: space-between; gap: 10px; }
.spell-wrong-item .ww { font-weight: 700; font-size: 1.05rem; }
.spell-wrong-item .wc { color: var(--muted); font-size: 0.8rem; }
.spell-wrong-item .wm { color: var(--muted); margin-top: 4px; font-size: 0.9rem; }

@media (max-width: 520px) {
  .spell-pair { gap: 8px; }
  .spell-chip { min-height: 52px; padding: 8px 10px; }
  .spell-ask .zh { font-size: 1.2rem; }
}
