/* 小游戏样式：复用站点调色板，只在游戏页引入 */

:root { --accent-hover: #1d4ed8; }

.game-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 18px 64px;
}

.game-head { text-align: center; margin-bottom: 18px; }
.game-head h1 { font-size: 26px; line-height: 1.3; margin: 0 0 8px; color: var(--ink); }
.game-head p { color: var(--muted); font-size: 15px; margin: 0; }

/* ---------- 设置条 ---------- */

.setup {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.setup label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.setup select {
  font: inherit;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-width: 132px;
}

.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 9px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background .15s ease;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--ghost { background: #fff; color: var(--accent); }
.btn--ghost:hover { background: #f0f5ff; }
.btn--danger { background: #fff; color: #b91c1c; border-color: #fecaca; }
.btn--danger:hover { background: #fef2f2; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--lg { font-size: 16px; padding: 12px 24px; }

/* ---------- 状态栏 ---------- */

.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--muted);
}
.hud b { color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.hud .hud__item { display: flex; align-items: baseline; gap: 6px; }
.hud .streak { color: #c2410c; }

.hud__sound {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.hud__sound[aria-pressed="true"] { color: var(--accent); border-color: #bfdbfe; }

/* ---------- 深链提示条（从 Play these words / 错题本进入时） ---------- */

.src-note {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid #bfdbfe;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: #f8fbff;
  color: #1e3a5f;
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- 消除配对（点中一对就爆掉消失） ---------- */

.pop-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 640px;
  margin: 0 auto;
}
.pop-grid[data-n="16"] { max-width: 700px; }

.tile {
  position: relative;
  aspect-ratio: 1 / .92;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  padding: 6px;
  line-height: 1.2;
  word-break: break-word;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.tile__hanzi { font-weight: 700; }
.tile--pinyin .tile__hanzi { font-weight: 400; }
.tile__def {
  font-size: 10.5px;
  font-weight: 500;
  color: #64748b;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
}
.tile:hover { transform: translateY(-2px); border-color: #bfdbfe; box-shadow: 0 6px 14px rgba(37, 99, 235, .10); }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile--hanzi { font-size: 28px; font-weight: 600; }
.tile--pinyin { font-size: 16px; color: #1d4ed8; background: #f8fbff; }

.tile.is-sel {
  border-color: var(--accent);
  background: #eff6ff;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}
.tile.is-wrong { border-color: #fca5a5; background: #fef2f2; animation: tileShake .34s ease; }
.tile.is-hint { border-color: #22c55e; animation: hintPulse .9s ease infinite alternate; }
.tile.is-pop { animation: tilePop .34s ease forwards; }
.tile.is-gone { visibility: hidden; pointer-events: none; }

@keyframes tileShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
@keyframes hintPulse {
  from { box-shadow: 0 0 0 2px #dcfce7; }
  to { box-shadow: 0 0 0 7px #dcfce7; }
}
@keyframes tilePop {
  0% { transform: scale(1); }
  45% { transform: scale(1.18) rotate(-2deg); }
  100% { transform: scale(.2) rotate(4deg); opacity: 0; }
}

.pairs-tip {
  max-width: 720px;
  margin: 16px auto 0;
  min-height: 22px;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.pairs-tip.is-ok { color: #15803d; font-weight: 500; }
.pairs-tip.is-bad { color: #b91c1c; font-weight: 500; }

/* 夸奖文字（配对成功时中间弹一下） */

.praise {
  position: fixed;
  left: 50%;
  top: 34%;
  transform: translate(-50%, 0) scale(.6);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #f59e0b;
  text-shadow: 0 2px 0 #fff, 0 8px 20px rgba(245, 158, 11, .35);
  opacity: 0;
  pointer-events: none;
  z-index: 60;
}
.praise.is-on { animation: praiseUp .8s ease forwards; }
@keyframes praiseUp {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(.6); }
  30% { opacity: 1; transform: translate(-50%, -6px) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(1); }
}

/* 结算星级 */

.stars { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
.stars span { font-size: 34px; color: #e5e7eb; transition: color .25s ease, transform .25s ease; }
.stars span.is-on { color: #fbbf24; transform: scale(1.12); }

/* 粒子与彩带层（game-core 的 sparkle / confetti 用） */

.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.fx-dot {
  position: fixed;
  width: 9px;
  height: 9px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  animation: fxBurst .62s cubic-bezier(.2, .7, .4, 1) forwards;
}
@keyframes fxBurst {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; }
}
.fx-confetti {
  position: absolute;
  top: -14px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  animation: fxFall 1.9s ease-in forwards;
}
@keyframes fxFall {
  from { transform: translateY(0) rotate(0deg); opacity: 1; }
  to { transform: translateY(105vh) rotate(var(--rot)); opacity: .9; }
}

@media (max-width: 560px) {
  .pop-grid { gap: 8px; grid-template-columns: repeat(3, 1fr); }
  .tile--hanzi { font-size: 23px; }
  .tile--pinyin { font-size: 13px; }
  .tile__def { font-size: 9px; margin-top: 2px; }
  .prompt-def { font-size: 12.5px; }
  .praise { font-size: 26px; }
  .stars span { font-size: 28px; }
}

/* ---------- 听音抓泡泡 ---------- */

.bubble-stage {
  position: relative;
  height: 300px;
  max-width: 640px;
  margin: 6px auto 0;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
}
.bubble {
  position: absolute;
  bottom: -18%;
  width: 108px;
  height: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  background: radial-gradient(circle at 30% 28%, #ffffff 0%, #bfdbfe 55%, #93c5fd 100%);
  box-shadow: inset -6px -8px 18px rgba(147, 197, 253, .55), 0 8px 16px rgba(30, 64, 175, .18);
  font: inherit;
  color: #1e3a5f;
  cursor: pointer;
  padding: 4px;
  word-break: break-word;
  line-height: 1.15;
  animation: bubbleRise var(--rise, 12s) linear infinite,
             bubbleSway var(--dur, 3s) ease-in-out infinite alternate;
  -webkit-tap-highlight-color: transparent;
}
.bubble__hanzi { font-size: 26px; font-weight: 600; }.bubble__def {
  font-size: 10.5px;
  font-weight: 500;
  color: #3b6ea5;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: .9;
}
.bubble--long .bubble__hanzi { font-size: 17px; }
.bubble--long .bubble__def { font-size: 9.5px; }
.bubble:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.bubble.is-hint {
  border-color: #22c55e;
  box-shadow: 0 0 0 4px #dcfce7, 0 0 22px rgba(34, 197, 94, .5);
  animation: bubbleRise var(--rise, 12s) linear infinite,
             bubbleSway var(--dur, 3s) ease-in-out infinite alternate,
             hintPulse .8s ease infinite alternate;
}
.bubble.is-deflated {
  background: radial-gradient(circle at 30% 28%, #f9fafb 0%, #e5e7eb 60%, #d1d5db 100%);
  color: #9ca3af;
  transform: scale(.9);
  animation-play-state: paused;
  opacity: .85;
}
.bubble.is-pop { animation: bubblePop .38s ease forwards; }
/* 泡泡从底部持续升起、接近顶部后循环，始终大体可见 */
@keyframes bubbleRise {
  from { bottom: -6%; }
  to   { bottom: 86%; }
}
/* 上升途中左右轻摆，像真的泡泡 */
@keyframes bubbleSway {
  from { transform: translateX(-9px); }
  to   { transform: translateX(9px); }
}
@keyframes bubblePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.22); }
  100% { transform: scale(.15); opacity: 0; }
}
@media (max-width: 560px) {
  .bubble-stage { height: 280px; }
  .bubble { width: 80px; height: 80px; }
  .bubble__hanzi { font-size: 19px; }
  .bubble__def { font-size: 9px; max-width: 68px; }
  .bubble--long .bubble__hanzi { font-size: 13px; }
  .bubble--long .bubble__def { font-size: 8.5px; max-width: 62px; }
}

/* ---------- 听音选字（旧版四选项，保留给未来变体） ---------- */

.quiz {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 20px 22px;
  text-align: center;
}
.quiz__prompt {
  font-size: 46px;
  font-weight: 500;
  line-height: 1.15;
  margin: 6px 0 4px;
  color: var(--ink);
  min-height: 54px;
}
.quiz__prompt--py { color: #1d4ed8; font-size: 42px; letter-spacing: .02em; }
.quiz__hint { color: var(--muted); font-size: 13px; margin: 0 0 18px; }

.quiz__speak {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font: inherit;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  margin-bottom: 16px;
}
.quiz__speak:hover { background: #dbeafe; }

.options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 6px;
}
.option {
  font: inherit;
  font-size: 30px;
  font-weight: 500;
  padding: 20px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.option:hover:not(:disabled) { border-color: #93c5fd; background: #f8fbff; }
.option.is-right { border-color: #22c55e; background: #f0fdf4; }
.option.is-wrong { border-color: #ef4444; background: #fef2f2; }
.option:disabled { cursor: default; }
.option--py { font-size: 22px; color: #1d4ed8; }

/* ---------- 声调闯关 ---------- */

.tone-hanzi { font-size: 76px; line-height: 1.25; }
.prompt-def {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.options--tone { grid-template-columns: repeat(2, 1fr); }
.option--tone-py {
  font-size: 28px; font-weight: 600; letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}
.tone-reveal {
  min-height: 24px; margin: 14px 0 0;
  font-size: 15px; color: var(--muted); text-align: center;
}

.quiz__timer {
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin: 4px 0 18px;
}
.quiz__timer span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left center;
  transition: transform .25s linear;
}
.quiz__timer.is-low span { background: #dc2626; }

/* ---------- 结算 ---------- */

.result {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
}
.result h2 { margin: 0 0 6px; font-size: 22px; color: var(--ink); }
.result__score { font-size: 40px; font-weight: 500; color: var(--accent); margin: 6px 0 2px; }
.result__meta { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.result__best {
  display: inline-block; margin: 0 0 18px;
  font-size: 13px; font-weight: 700; color: #92400e;
  background: #fef3c7; border: 1px solid #fde68a;
  padding: 5px 13px; border-radius: 999px;
}
.result__best.is-new { animation: bestPulse .85s ease-out 2; }
@keyframes bestPulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.55); }
  70%  { transform: scale(1.05); box-shadow: 0 0 0 11px rgba(251, 191, 36, 0); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}
.result__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.result__wrong { text-align: left; margin: 18px auto 0; max-width: 460px; }
.result__wrong h3 { font-size: 14px; margin: 0 0 8px; color: var(--ink); }
.result__wrong ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.result__wrong b { color: var(--ink); font-size: 17px; }

/* ---------- 错题本 ---------- */

.mistake-list { list-style: none; margin: 0; padding: 0; }
.mistake-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fff;
}
.mistake-item__w { font-size: 26px; font-weight: 500; color: var(--ink); text-align: center; }
.mistake-item__meta { font-size: 13px; color: var(--muted); line-height: 1.5; }
.mistake-item__meta b { color: #1d4ed8; font-weight: 500; font-size: 14px; }
.mistake-item__bar {
  height: 4px;
  border-radius: 999px;
  background: #fee2e2;
  margin-top: 6px;
  overflow: hidden;
}
.mistake-item__bar span { display: block; height: 100%; background: #ef4444; }
.mistake-item__x {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}
.mistake-item__x:hover { color: #b91c1c; border-color: #fecaca; }

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

/* ---------- 游戏中心卡片 ---------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 22px 0 8px;
}
.game-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.game-card:hover { border-color: #93c5fd; transform: translateY(-2px); }
.game-card strong { color: var(--ink); font-size: 16px; }
.game-card span { color: var(--muted); font-size: 13px; line-height: 1.55; }
.game-card em { font-style: normal; font-size: 12px; color: var(--accent); margin-top: auto; }

/* ---------- 通用 ---------- */

.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-foot {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.game-foot a { color: var(--accent); }

[hidden] { display: none !important; }

@media (max-width: 560px) {
  .game-shell { padding: 14px 12px 48px; }
  .game-head h1 { font-size: 21px; }
  .quiz__prompt { font-size: 36px; }
  .quiz__prompt--py { font-size: 32px; }
  .option { font-size: 24px; padding: 16px 8px; }
  .option--py { font-size: 18px; }
  .game-grid { grid-template-columns: 1fr; }
  .mistake-item { grid-template-columns: 44px 1fr auto; gap: 10px; padding: 10px; }
  .mistake-item__w { font-size: 22px; }
}

@media print {
  .game-shell, .hud, .setup { display: none !important; }
}

/* ========== 游戏中心 hub：比内页更生动 ========== */
.hub-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 44px 24px 40px;
  margin: -8px -8px 22px;
  border-radius: 18px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #a855f7 100%);
  color: #fff;
}
.hub-hero h1 { font-size: 34px; margin: 10px 0 12px; letter-spacing: -0.02em; color: #fff; }
.hub-hero .hub-sub { font-size: 16px; margin: 0 auto; max-width: 460px; color: #ede9fe; }
.hub-kicker {
  display: inline-block;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 5px 14px; border-radius: 999px; margin: 0;
}
/* 浮动的汉字气泡装饰 */
.hub-bubble {
  position: absolute;
  width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  animation: hubFloat 6s ease-in-out infinite;
  pointer-events: none;
}
.hub-bubble  { left: 4%;  bottom: 12%; }
.hub-bubble2 { right: 5%; bottom: 16%; animation-delay: -2s; font-size: 20px; }
.hub-bubble3 { left: 3%; top: 6%; animation-delay: -4s; width: 40px; height: 40px; font-size: 17px; }
@keyframes hubFloat {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-12px) rotate(5deg); }
}

/* 三张大彩卡：各自带主题色 */
.game-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px 18px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}
.gc-match  { border-top: 4px solid #7c3aed; }
.gc-listen { border-top: 4px solid #059669; }
.gc-tone   { border-top: 4px solid #0284c7; }
.gc-note   { border-top: 4px solid #ea580c; }
.gc-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  border-radius: 12px;
  margin-bottom: 2px;
}
.gc-match  .gc-icon { background: #f3e8ff; }
.gc-listen .gc-icon { background: #d1fae5; }
.gc-tone   .gc-icon { background: #e0f2fe; }
.gc-note   .gc-icon { background: #ffedd5; }
.game-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(17, 24, 39, 0.10); }
.gc-match:hover  { border-color: #7c3aed; }
.gc-listen:hover { border-color: #059669; }
.gc-tone:hover   { border-color: #0284c7; }
.gc-note:hover   { border-color: #ea580c; }
.gc-cta {
  font-style: normal; font-weight: 700; font-size: 13px; margin-top: auto;
}
.gc-match  .gc-cta { color: #7c3aed; }
.gc-listen .gc-cta { color: #059669; }
.gc-tone   .gc-cta { color: #0284c7; }
.gc-note   .gc-cta { color: #ea580c; }
.game-card { position: relative; }
.game-card .gc-best {
  position: absolute; top: 10px; right: 11px;
  font-size: 11px; font-weight: 700; line-height: 1.2; white-space: nowrap;
  color: #92400e; background: #fef3c7; border: 1px solid #fde68a;
  padding: 3px 8px; border-radius: 999px;
}

/* 闭环三步条 */
.hub-loop { margin-top: 26px; }
.hub-loop-title { text-align: center; font-size: 19px; margin: 0 0 14px; }
.hub-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.hub-steps li {
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--muted); line-height: 1.5;
}
.hub-steps strong { color: var(--ink); font-size: 14px; }
.hs-num {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #4f46e5; color: #fff;
  font-weight: 700; font-size: 13px;
}

@media (max-width: 720px) {
  .hub-hero { margin: -8px -4px 18px; padding: 32px 16px 30px; }
  .hub-hero h1 { font-size: 26px; }
  .hub-bubble { display: none; }
  .hub-steps { grid-template-columns: 1fr; }
}

/* ========== 两种词源：HSK 等级 / 自己导入 ========== */
.src-pick {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 0; padding: 0; border: 0;
}
.src-pick legend {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0; margin-bottom: 6px; float: left; width: 100%;
}
.src-pick label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink);
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; background: #fff;
}
.src-pick label:has(input:checked) {
  border-color: var(--accent); background: #eff6ff; color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.src-pick input { margin: 0; accent-color: var(--accent); }
.src-custom { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.src-custom textarea {
  width: 100%; box-sizing: border-box;
  font-family: inherit; font-size: 13px; line-height: 1.6;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); resize: vertical;
}
.src-custom textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }
.src-custom textarea.dragging { outline: 2px dashed var(--accent); border-color: var(--accent); background: #f0f6ff; }
.src-custom-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.my-words-hint { font-size: 12px; color: var(--muted); }

/* ---------- 笔顺点亮 ---------- */

.gc-stroke { border-top: 4px solid #db2777; }
.gc-stroke .gc-icon { background: #fce7f3; }
.gc-stroke:hover { border-color: #db2777; }
.gc-stroke .gc-cta { color: #db2777; }

.stroke-stage {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin: 4px 0 10px;
}
.stroke-word { margin: 0; font-size: 13px; color: var(--muted); letter-spacing: .06em; }
.stroke-canvas {
  width: min(290px, 60vw); height: min(290px, 60vw);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  display: block;
}
.stroke-def { margin: 0; font-size: 12.5px; color: #64748b; max-width: 34ch; text-align: center; }

.st-ghost { fill: #e8ebf0; }
.st-done  { fill: #1f2937; animation: inkIn .2s ease-out; }
.st-done.is-new { fill: #e11d48; }
@keyframes inkIn {
  from { opacity: 0; transform: scale(.94); transform-origin: 512px 512px; }
  to   { opacity: 1; transform: scale(1); }
}

.stroke-tip {
  text-align: center; font-size: 14px; font-weight: 600;
  margin: 0 0 10px; color: var(--ink); min-height: 20px;
}
.stroke-tip.is-bad { color: #b91c1c; }
.stroke-tip.is-ok  { color: #15803d; }

.stroke-palette {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-width: 560px;
  margin: 0 auto 6px;
}
.stroke-tile {
  position: relative;
  aspect-ratio: 1;
  padding: 2px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease, opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.stroke-tile svg { width: 100%; height: 100%; display: block; }
.st-tile-path { fill: #4b5563; }
.stroke-tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.stroke-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.stroke-tile.is-done {
  border-color: #bbf7d0; background: #f0fdf4;
  opacity: .38; cursor: default; transform: none;
}
.stroke-tile.is-hint {
  border-color: #22c55e;
  box-shadow: 0 0 0 4px #dcfce7, 0 0 18px rgba(34, 197, 94, .45);
  animation: hintPulse .7s ease infinite alternate;
}
.stroke-tile.is-wrong { border-color: #ef4444; animation: popShake .38s ease; }

@media (max-width: 560px) {
  .stroke-canvas { width: min(230px, 54vw); height: min(230px, 54vw); }
  .stroke-palette { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .stroke-tip { font-size: 13px; }
}
