/* ===== 单词跟读 · 妙蛙种子进化 ===== */
:root {
  --bg: #0e1a20;
  --bg2: #14262e;
  --card: rgba(255, 255, 255, 0.055);
  --card-brd: rgba(140, 235, 210, 0.16);
  --ink: #e8f6f2;
  --ink-dim: #9db8b4;
  --teal: #56e0bd;
  --teal-dark: #1f9d80;
  --gold: #ffd24a;
  --pink: #ff9ecd;
  --red: #ff6b6b;
  --blue: #6cc4ff;
  --orange: #ffab5c;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(1100px 620px at 12% -10%, #1d4a52 0%, transparent 60%),
    radial-gradient(900px 560px at 105% 0%, #23405c 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }

#app {
  max-width: 1500px;
  margin: 0 auto;
  padding: 16px 18px 28px;
}

/* ================= 顶栏 ================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border: 1px solid var(--card-brd);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { font-size: 34px; filter: drop-shadow(0 4px 10px rgba(86, 224, 189, .45)); }
.brand h1 { margin: 0; font-size: 19px; letter-spacing: .5px; }
.brand .sub { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-dim); }

.hud { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

.energy-box {
  display: flex; align-items: baseline; gap: 6px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(255, 210, 74, 0.12);
  border: 1px solid rgba(255, 210, 74, 0.35);
}
.energy-box .bolt { font-size: 16px; }
.energy-val { font-size: 24px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.energy-label { font-size: 12px; color: var(--ink-dim); }
.energy-val.pop { animation: pop .45s ease-out; }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.45); color: #fff; } 100% { transform: scale(1); } }

.progress-wrap { min-width: 240px; }
.progress {
  height: 12px; border-radius: 8px; overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--teal-dark), var(--teal) 60%, var(--gold));
  border-radius: 8px;
  transition: width .6s cubic-bezier(.2, .9, .25, 1);
}
.progress-hint { font-size: 12px; color: var(--ink-dim); margin-top: 6px; }

.hud-buttons { display: flex; gap: 8px; }

/* ================= 通用按钮 ================= */
.btn, .ghost {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  padding: 10px 15px;
  font-size: 14px;
  transition: transform .12s ease, background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover, .ghost:hover { background: rgba(255, 255, 255, 0.13); transform: translateY(-1px); }
.btn:active, .ghost:active { transform: translateY(0) scale(.98); }
.ghost { padding: 8px 12px; font-size: 13px; color: var(--ink-dim); }
.btn.primary {
  background: linear-gradient(180deg, #3fd0ac, #1f9d80);
  border-color: rgba(255, 255, 255, 0.28);
  color: #05201a; font-weight: 700;
  box-shadow: 0 8px 20px rgba(31, 157, 128, .35);
}
.btn.accent {
  background: linear-gradient(180deg, #ffd873, #f0a92c);
  border-color: rgba(255, 255, 255, 0.3);
  color: #3a2600; font-weight: 700;
  box-shadow: 0 8px 20px rgba(240, 169, 44, .3);
}
.btn.record {
  background: linear-gradient(180deg, #ff8fae, #e2568a);
  border-color: rgba(255, 255, 255, 0.3);
  color: #360415; font-weight: 700;
  box-shadow: 0 8px 20px rgba(226, 86, 138, .32);
}
.btn.record.live { animation: recPulse 1s infinite; }
@keyframes recPulse {
  0%, 100% { box-shadow: 0 8px 20px rgba(226, 86, 138, .32); }
  50% { box-shadow: 0 8px 30px rgba(255, 120, 160, .8); }
}
.btn.danger { background: rgba(255, 107, 107, .16); border-color: rgba(255, 107, 107, .5); color: #ffc2c2; }
.btn:disabled, .ghost:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ================= 布局 ================= */
.grid {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(400px, 1fr) minmax(300px, 360px);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}
@media (max-width: 1180px) { .grid { grid-template-columns: 1fr 1fr; } .card.score { grid-column: span 2; } }
@media (max-width: 780px) { .grid { grid-template-columns: 1fr; } .card.score { grid-column: auto; } }

.card {
  border: 1px solid var(--card-brd);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(4px);
}

/* ================= 精灵区 ================= */
.pet-head { display: flex; justify-content: space-between; align-items: center; }
.badge {
  font-size: 12px; padding: 4px 10px; border-radius: 20px;
  background: rgba(86, 224, 189, .16);
  border: 1px solid rgba(86, 224, 189, .4);
  color: #b6ffee;
}
.badge.dim { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); color: var(--ink-dim); }

.sprite-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 268px; margin: 6px 0 2px;
  position: relative;
}
.sprite { width: 100%; max-width: 264px; height: auto; overflow: visible; }
.sprite.locked { filter: brightness(0) opacity(.28); }

/* 自定义图片（art/ 目录）作为精灵时的样式 */
.sprite-img {
  width: 100%; max-width: 264px; height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  animation: bob 2.6s ease-in-out infinite;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .42));
}
.sprite-img.locked { filter: brightness(0) opacity(.28); animation: none; }
.sprite-img.glow-teal { filter: drop-shadow(0 0 18px rgba(86, 224, 189, .55)) drop-shadow(0 12px 22px rgba(0, 0, 0, .42)); }
.sprite-img.glow-pink { filter: drop-shadow(0 0 20px rgba(255, 158, 222, .6)) drop-shadow(0 12px 22px rgba(0, 0, 0, .42)); }
.sprite-img.glow-gold { filter: drop-shadow(0 0 26px rgba(255, 210, 74, .8)) drop-shadow(0 12px 22px rgba(0, 0, 0, .42)); }
.gal-card .sprite-img { max-width: 132px; margin: 0 auto; }
.evo-old .sprite-img, .evo-new .sprite-img { width: 240px; }

.pet h2 { margin: 4px 0 2px; font-size: 21px; text-align: center; }
.pet .desc { margin: 0 0 10px; font-size: 12.5px; color: var(--ink-dim); text-align: center; line-height: 1.55; min-height: 34px; }

.stage-dots { display: flex; gap: 7px; justify-content: center; margin: 10px 0 12px; }

/* 宠物切换（两条养成线，能量各自独立） */
.pet-switch { display: flex; gap: 8px; margin: 10px 0 0; }
.pet-chip {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 8px 10px; border-radius: 12px; text-align: left;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05);
  color: var(--ink-dim);
  transition: transform .12s, border-color .2s, background .2s;
}
.pet-chip:hover { transform: translateY(-1px); background: rgba(255, 255, 255, .1); }
.pet-chip.on {
  border-color: var(--teal);
  background: linear-gradient(180deg, rgba(86, 224, 189, .18), rgba(86, 224, 189, .06));
  color: #d9fff6;
}
.pet-chip .pc-line { font-size: 11px; opacity: .8; }
.pet-chip .pc-name { font-size: 13.5px; font-weight: 700; }
.pet-chip .pc-energy { font-size: 11px; color: var(--gold); font-variant-numeric: tabular-nums; }
.stage-dots i {
  width: 26px; height: 6px; border-radius: 4px;
  background: rgba(255, 255, 255, .13);
  transition: background .3s, transform .3s;
}
.stage-dots i.on { background: linear-gradient(90deg, var(--teal), var(--gold)); transform: scaleY(1.5); }

.pet-stats { display: flex; justify-content: space-around; margin: 0; padding: 10px 0 0; border-top: 1px dashed rgba(255, 255, 255, .12); }
.pet-stats div { text-align: center; }
.pet-stats dt { font-size: 11.5px; color: var(--ink-dim); }
.pet-stats dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- 精灵动画 ---- */
.sprite-body { animation: bob 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.sprite.floating .sprite-body { animation: floaty 3.4s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(-4px); } 50% { transform: translateY(-14px); } }

.aura { animation: auraPulse 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes auraPulse { 0%, 100% { opacity: .32; transform: scale(.96); } 50% { opacity: .68; transform: scale(1.06); } }
.aura-ring { animation: spin 18s linear infinite; transform-box: fill-box; transform-origin: center; }
.aura-ring.rev { animation: spin 12s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.sparkle { animation: twinkle 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes twinkle { 0%, 100% { opacity: .15; transform: scale(.6) rotate(0deg); } 50% { opacity: 1; transform: scale(1.15) rotate(45deg); } }

.wing { animation: flap 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom center; }
@keyframes flap { 0%, 100% { transform: rotate(-4deg) scaleY(.97); } 50% { transform: rotate(4deg) scaleY(1.03); } }

.sway { animation: sway 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: top center; }
.sway-rev { animation: sway 2.4s ease-in-out infinite reverse; transform-box: fill-box; transform-origin: top center; }
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg); } }

.eye-glow { animation: eyeGlow 1.6s ease-in-out infinite; }
@keyframes eyeGlow { 0%, 100% { opacity: .12; } 50% { opacity: .45; } }

/* ================= 练习区 ================= */
.word-head { text-align: center; padding: 4px 0 12px; }
.word-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.word {
  font-size: clamp(34px, 5.4vw, 58px);
  font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(180deg, #ffffff, #a8f0dd);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  word-break: break-word;
}
.tag {
  font-size: 12px; padding: 3px 9px; border-radius: 20px;
  background: rgba(108, 196, 255, .16); border: 1px solid rgba(108, 196, 255, .4); color: #cfeaff;
}
.ipa { margin-top: 6px; font-size: 17px; color: #9ff0dc; letter-spacing: .5px; font-family: "Segoe UI", var(--font); }
.zh { margin-top: 4px; font-size: 15px; color: var(--ink-dim); }

.controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 8px 0 12px; }

.status {
  text-align: center; font-size: 13.5px; color: #c7e7e0;
  min-height: 22px; padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  border: 1px dashed rgba(255, 255, 255, .12);
  transition: color .2s, background .2s;
}
.status.warn { color: #ffd9a8; background: rgba(255, 171, 92, .12); border-color: rgba(255, 171, 92, .4); }
.status.err { color: #ffc2c2; background: rgba(255, 107, 107, .12); border-color: rgba(255, 107, 107, .4); }
.status.ok { color: #b6ffee; }

.level-meter { height: 8px; margin: 10px 4px 0; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.level-meter i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--teal), var(--gold)); transition: width .08s linear; }

.meters { margin-top: 14px; }
#canvasCompare {
  width: 100%; height: auto; display: block;
  border-radius: 12px;
  background: rgba(4, 18, 22, .55);
  border: 1px solid rgba(255, 255, 255, .09);
}
.legend { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 8px 0 0; font-size: 11.5px; color: var(--ink-dim); }
.legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.legend .lg::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: currentColor; }
.legend .lg-ref { color: var(--blue); }
.legend .lg-usr { color: var(--orange); }
.legend .lg-note { color: var(--ink-dim); }
.legend .lg-note::before { display: none; }

.word-nav { display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-dim); cursor: pointer; }
.switch input { accent-color: var(--teal); width: 15px; height: 15px; }

/* ================= 评分区 ================= */
.score-top { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; border-bottom: 1px dashed rgba(255, 255, 255, .12); }
.score-num {
  font-size: 54px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
  min-width: 108px; text-align: center;
  background: linear-gradient(180deg, #fff, #8ef0d2);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.score-num.grade-S { background: linear-gradient(180deg, #fff6c9, #ffc93c); -webkit-background-clip: text; background-clip: text; }
.score-num.grade-A { background: linear-gradient(180deg, #e6fff4, #56e0bd); -webkit-background-clip: text; background-clip: text; }
.score-num.grade-B { background: linear-gradient(180deg, #e8f4ff, #6cc4ff); -webkit-background-clip: text; background-clip: text; }
.score-num.grade-C { background: linear-gradient(180deg, #fff0e0, #ffab5c); -webkit-background-clip: text; background-clip: text; }
.score-num.grade-D { background: linear-gradient(180deg, #ffe3e3, #ff8b8b); -webkit-background-clip: text; background-clip: text; }
.score-right { flex: 1; min-width: 0; }
.grade { font-size: 20px; font-weight: 700; }
.praise { font-size: 12.5px; color: var(--ink-dim); line-height: 1.5; margin-top: 4px; }

.parts { list-style: none; margin: 12px 0 0; padding: 0; }
.parts li { margin-bottom: 9px; }
.parts .p-row { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.parts .p-row b { font-variant-numeric: tabular-nums; color: #d8f5ee; }
.parts .p-bar { height: 7px; border-radius: 5px; background: rgba(255, 255, 255, .09); overflow: hidden; }
.parts .p-bar i { display: block; height: 100%; width: 0%; border-radius: 5px; transition: width .5s ease; }
.parts .p-art i { background: linear-gradient(90deg, #1f9d80, #56e0bd); }
.parts .p-rhy i { background: linear-gradient(90deg, #2f7fd0, #6cc4ff); }
.parts .p-int i { background: linear-gradient(90deg, #b464c8, #e79cf0); }
.parts .p-cla i { background: linear-gradient(90deg, #cf8a2c, #ffd24a); }
.parts .p-con i { background: linear-gradient(90deg, #cf4b72, #ff9ecd); }
.parts .p-none { color: var(--ink-dim); font-size: 12px; }

.energy-gain { min-height: 30px; margin-top: 10px; font-size: 15px; font-weight: 700; color: var(--gold); }
.energy-gain .fly { display: inline-block; animation: fly 1s ease-out; }
@keyframes fly { 0% { transform: translateY(10px) scale(.7); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(-8px) scale(1.05); opacity: 1; } }
.energy-gain .mult { font-size: 12px; color: var(--ink-dim); font-weight: 400; margin-left: 6px; }

.tips { list-style: none; margin: 8px 0 0; padding: 0; }
.tips li {
  font-size: 12.5px; color: #d4ece7; line-height: 1.5;
  padding: 7px 10px; margin-bottom: 6px;
  background: rgba(86, 224, 189, .08);
  border-left: 3px solid rgba(86, 224, 189, .5);
  border-radius: 8px;
}
.playback { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.asr-note { font-size: 11.5px; color: var(--ink-dim); }

/* ================= 底栏 ================= */
.bottombar {
  margin-top: 16px; padding: 12px 16px;
  border: 1px solid var(--card-brd); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
}
.ranges { display: flex; gap: 8px; flex-wrap: wrap; }
.range-chip {
  padding: 7px 14px; border-radius: 20px; font-size: 13px;
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .05); color: var(--ink-dim);
}
.range-chip.on { background: rgba(86, 224, 189, .18); border-color: var(--teal); color: #d6fff5; font-weight: 700; }
.history-wrap { flex: 1; min-width: 260px; display: flex; align-items: center; gap: 10px; }
.history-title { font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.history { display: flex; gap: 7px; list-style: none; margin: 0; padding: 0; overflow-x: auto; }
.history li {
  font-size: 11.5px; white-space: nowrap; padding: 4px 9px; border-radius: 8px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  color: var(--ink-dim);
}
.history li b { color: #e9fffa; }
.history li.g-S { border-color: rgba(255, 210, 74, .6); color: #ffe9a8; }
.history li.g-A { border-color: rgba(86, 224, 189, .55); }
.history li.g-D { opacity: .65; }

/* ================= 弹层 ================= */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(4, 12, 15, .78);
  backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.overlay[hidden] { display: none; }
.modal {
  width: min(680px, 100%); max-height: 88vh; overflow: auto;
  background: linear-gradient(180deg, #162a31, #101f25);
  border: 1px solid var(--card-brd); border-radius: 20px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
}
.modal.wide { width: min(1080px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 16px 20px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 14px 20px; border-top: 1px solid rgba(255, 255, 255, .1); flex-wrap: wrap; }
.close { background: none; border: none; color: var(--ink-dim); font-size: 18px; line-height: 1; padding: 6px; }
.close:hover { color: #fff; }

.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: 13.5px; }
.field.column { flex-direction: column; align-items: stretch; }
.field span { color: #d6f0ea; }
.field select, .field textarea {
  background: rgba(0, 0, 0, .3); color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 10px;
  padding: 8px 10px; font-size: 13.5px; font-family: inherit; min-width: 190px;
}
.field textarea { width: 100%; resize: vertical; line-height: 1.6; }
.hint { font-size: 12px; color: var(--ink-dim); line-height: 1.5; margin: 6px 0 0; }
.modal-body hr { border: none; border-top: 1px dashed rgba(255, 255, 255, .14); margin: 16px 0; }
.row-buttons { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* 设置里的精灵图片检查清单 */
.art-check { margin: 10px 0 12px; display: flex; flex-direction: column; gap: 10px; }
.art-row-title { font-size: 12.5px; color: #a8f0dd; margin-bottom: 5px; }
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 7px; }
.art-slot {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 9px; border-radius: 9px; font-size: 11.5px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  color: var(--ink-dim);
}
.art-slot .as-mark { font-weight: 700; font-size: 12px; }
.art-slot .as-name { color: #dcefe9; white-space: nowrap; }
.art-slot .as-file { margin-left: auto; opacity: .6; font-size: 10.5px; font-family: Consolas, monospace; }
.art-slot.ok { border-color: rgba(86, 224, 189, .5); background: rgba(86, 224, 189, .1); color: #b6ffee; }
.art-slot.ok .as-mark { color: var(--teal); }
.art-slot.miss { border-style: dashed; }
.art-slot.miss .as-mark { color: var(--ink-dim); }

.prose { font-size: 13.5px; line-height: 1.75; color: #dcefe9; }
.prose h3 { font-size: 14.5px; margin: 16px 0 6px; color: #a8f0dd; }
.prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 20px; margin: 6px 0; }
.prose li { margin-bottom: 4px; }
.prose kbd {
  font-family: inherit; font-size: 12px; padding: 1px 6px; border-radius: 5px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2);
}

/* 图鉴 */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; padding: 18px 20px; }
.gal-card {
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; padding: 10px;
  background: rgba(255, 255, 255, .04); text-align: center; position: relative;
  transition: transform .15s, border-color .2s;
}
.gal-card.on { border-color: var(--teal); box-shadow: 0 0 0 1px rgba(86, 224, 189, .35) inset; }
.gal-card:hover { transform: translateY(-2px); }
.gal-card .sprite { max-width: 132px; }
.gal-card .form { font-size: 11.5px; color: var(--teal); }
.gal-card .name { font-size: 14px; font-weight: 700; margin: 2px 0; }
.gal-card .req { font-size: 11.5px; color: var(--ink-dim); }
.gal-card.locked .form, .gal-card.locked .name { color: var(--ink-dim); }

/* 进化动画 */
.evolve-overlay { background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .22), rgba(0, 0, 0, .9) 65%); }
.evolve-stage { text-align: center; max-width: 620px; position: relative; }
.evolve-sprites { display: flex; align-items: center; justify-content: center; min-height: 300px; position: relative; }
.evo-old, .evo-new { width: 240px; }
.evo-old { animation: evoOut 1.1s ease-in forwards; position: absolute; }
.evo-new { animation: evoIn 1.1s .55s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes evoOut { 0% { transform: scale(1); opacity: 1; filter: brightness(1); } 70% { opacity: .25; filter: brightness(3.4); } 100% { transform: scale(1.3); opacity: 0; } }
@keyframes evoIn { 0% { transform: scale(.35); opacity: 0; filter: brightness(3); } 100% { transform: scale(1.12); opacity: 1; filter: brightness(1); } }
.flash {
  position: absolute; inset: -40% -10%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 240, 180, .35) 40%, transparent 70%);
  opacity: 0; animation: flash 1.4s .4s ease-out;
  pointer-events: none;
}
@keyframes flash { 0% { opacity: 0; transform: scale(.2); } 22% { opacity: .95; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } }
.evolve-stage h2 { font-size: 26px; margin: 8px 0 6px; background: linear-gradient(180deg, #fff, #ffd24a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.evolve-stage p { color: #e2f6f0; font-size: 14px; line-height: 1.7; margin: 0 0 18px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== 手机 / 触屏适配 ===== */
button, .btn, .ghost, .range-chip, .pet-chip {
  touch-action: manipulation;                 /* 去掉双击缩放带来的点击延迟 */
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 780px) {
  #app { padding: 10px 10px 22px; }
  .topbar { padding: 10px 12px; gap: 10px; }
  .brand h1 { font-size: 16px; }
  .brand .sub { display: none; }
  .hud { gap: 10px; width: 100%; justify-content: space-between; }
  .progress-wrap { min-width: 120px; flex: 1; }
  .energy-val { font-size: 20px; }
  .grid { gap: 12px; margin-top: 12px; }
  .card { padding: 12px; }
  .sprite-wrap { min-height: 210px; }
  .sprite, .sprite-img { max-width: 200px; }
  .word { font-size: 40px; }
  .controls { gap: 8px; }
  .controls .btn { flex: 1 1 44%; padding: 12px 10px; font-size: 14px; }
  .score-num { font-size: 44px; min-width: 84px; }
  .bottombar { padding: 10px 12px; gap: 12px; }
  .history-wrap { min-width: 100%; }
  .field { flex-direction: column; align-items: stretch; gap: 6px; }
  .field select { min-width: 0; width: 100%; }
  .modal { max-height: 92vh; }
}
@media (display-mode: standalone) {
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
  #app { padding-bottom: max(22px, env(safe-area-inset-bottom)); }
}
