:root {
  --cream: #fbf2e2;
  --cream-deep: #f2e4ce;
  --green: #7fa946;
  --green-dark: #2f6b4d;
  --green-deep: #235d4b;
  --ink: #64482a;
  --muted: #947962;
  --pink: #f77b91;
  --blue: #5eb7f7;
  --yellow: #fbc968;
  --purple: #c891fa;
  --card: #fff8ea;
  --shadow: rgba(53, 54, 31, .22);
}

* { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 游戏封面 */
.game-cover { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; overflow: hidden; padding: 24px; background: radial-gradient(circle at 50% 42%, rgba(255,248,218,.2), transparent 29%), linear-gradient(135deg, #5e994f 0%, #7fa946 48%, #3c7c55 100%); }
.game-cover.hidden { display: none; }
.game-cover::before { content: ""; position: absolute; inset: 0; opacity: .24; background-image: radial-gradient(circle at 18% 20%, rgba(255,255,255,.7) 0 2px, transparent 3px), radial-gradient(circle at 82% 72%, rgba(255,255,255,.42) 0 3px, transparent 4px), radial-gradient(circle at 52% 12%, rgba(35,93,75,.4) 0 2px, transparent 3px); background-size: 46px 46px, 63px 63px, 37px 37px; }
.cover-orbit { position: absolute; border: 2px solid rgba(255,248,218,.2); border-radius: 50%; transform: rotate(-18deg); }
.cover-orbit-left { width: 620px; height: 280px; left: -210px; bottom: -100px; }
.cover-orbit-right { width: 530px; height: 250px; right: -170px; top: -65px; transform: rotate(24deg); }
.cover-spark { position: absolute; color: #ffe28b; font-size: 28px; text-shadow: 0 3px 0 rgba(100,72,42,.15); animation: cover-float 3.2s ease-in-out infinite; }
.cover-spark-one { left: 15%; top: 22%; }
.cover-spark-two { right: 16%; bottom: 20%; animation-delay: -1.4s; font-size: 20px; }
.cover-card { position: relative; z-index: 1; width: min(570px, 100%); padding: clamp(27px, 5vw, 52px) clamp(22px, 7vw, 72px) 30px; border: 3px solid var(--ink); border-radius: 38px; background: rgba(255,248,234,.96); box-shadow: 0 16px 0 rgba(48,62,34,.24), 0 28px 70px rgba(35,73,43,.25); text-align: center; animation: cover-in .55s ease both; }
.cover-logo { position: relative; width: 104px; height: 88px; margin: 0 auto 13px; transform: rotate(-4deg); }
.cover-logo-card { position: absolute; display: grid; place-items: center; width: 64px; height: 72px; border: 3px solid var(--ink); border-radius: 13px 13px 17px 17px; color: #fff; font-size: 22px; font-weight: 950; box-shadow: 0 6px 0 rgba(76,52,28,.2); }
.cover-logo-card::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: 8px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.75); }
.cover-logo-card-back { left: 11px; top: 1px; background: var(--blue); transform: rotate(13deg); }
.cover-logo-card-front { left: 36px; top: 15px; background: var(--pink); transform: rotate(-8deg); }
.cover-logo-star { position: absolute; right: -1px; top: -9px; color: var(--yellow); font-size: 27px; text-shadow: 0 2px 0 var(--ink); }
.cover-card .eyebrow { margin: 0 0 7px; color: var(--green-deep); }
.cover-card h1 { margin: 0; color: var(--ink); font-size: clamp(34px, 6vw, 52px); letter-spacing: .04em; }
.cover-subtitle { margin: 10px 0 22px; color: var(--muted); font-size: 15px; font-weight: 800; }
.cover-preview-cards { display: flex; justify-content: center; gap: 10px; margin: 0 auto 27px; }
.cover-word-card { position: relative; display: flex; flex-direction: column; justify-content: center; width: 112px; height: 78px; padding: 7px; border: 3px solid var(--ink); border-radius: 15px; box-shadow: 0 5px 0 rgba(76,52,28,.18); color: #fff; font-size: 18px; font-weight: 950; line-height: 1.05; transform: rotate(-5deg); }
.cover-word-card:nth-child(2) { transform: translateY(8px) rotate(4deg); }
.cover-word-card:nth-child(3) { transform: rotate(-2deg); }
.cover-word-card span { margin-top: 6px; color: rgba(255,255,255,.9); font-size: 11px; }
.cover-word-pink { background: var(--pink); }
.cover-word-blue { background: var(--blue); }
.cover-word-yellow { background: var(--yellow); color: var(--ink); }
.cover-word-yellow span { color: rgba(100,72,42,.75); }
.start-game-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 15px 19px 15px 23px; border: 3px solid var(--ink); border-radius: 16px; background: var(--green-deep); color: #fff8ea; box-shadow: 0 6px 0 rgba(35,93,75,.28); cursor: pointer; font-size: 18px; font-weight: 950; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.start-game-btn:hover { background: #2b765d; transform: translateY(-3px); box-shadow: 0 9px 0 rgba(35,93,75,.25); }
.start-game-btn:active { transform: translateY(2px); box-shadow: 0 3px 0 rgba(35,93,75,.25); }
.start-game-btn strong { font-size: 28px; line-height: .7; }
.cover-tip { margin: 18px 0 0; color: var(--muted); font-size: 11px; font-weight: 900; }
.cover-audio-tip { margin: 9px 0 0; color: #8d58be; font-size: 10px; font-weight: 900; }
.cover-audio-tip span { font-size: 15px; vertical-align: -1px; }
@keyframes cover-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes cover-float { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-10px) rotate(7deg); } }

html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }

.app-shell { display: grid; grid-template-columns: minmax(0, 1.95fr) minmax(330px, 1fr); min-height: 100vh; }
.game-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  padding: clamp(18px, 3vw, 34px) clamp(18px, 4vw, 64px) 24px;
  overflow: hidden;
  background-color: var(--green);
  background-image:
    radial-gradient(circle at 16% 20%, rgba(255,255,255,.14) 0 2px, transparent 3px),
    radial-gradient(circle at 74% 68%, rgba(35,93,75,.11) 0 3px, transparent 4px),
    linear-gradient(135deg, rgba(255,255,255,.08), transparent 28%, rgba(34,86,61,.1) 75%, transparent);
  background-size: 34px 34px, 42px 42px, auto;
}
.game-stage::before, .game-stage::after { content: ""; position: absolute; pointer-events: none; border-radius: 50%; opacity: .16; }
.game-stage::before { width: 440px; height: 440px; left: -180px; bottom: -180px; background: var(--green-dark); }
.game-stage::after { width: 300px; height: 300px; right: -160px; top: -120px; background: #c3dc77; }

.stage-header { position: relative; z-index: 2; display: flex; align-items: center; gap: 14px; max-width: 900px; width: 100%; margin: 0 auto 16px; color: #fff7e9; }
.stage-status { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .92; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #fbe6a6; box-shadow: 0 0 0 5px rgba(251,230,166,.18); }
.combo-hud {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 5px;
  min-width: 124px;
  padding: 5px 10px 6px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 13px;
  background: rgba(31,79,64,.22);
  color: rgba(255,247,233,.84);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  line-height: 1;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.combo-label { font-size: 9px; font-weight: 950; letter-spacing: .11em; }
.combo-hud strong { color: #fff4bb; font-size: 22px; font-weight: 950; letter-spacing: -.04em; }
.combo-hint { grid-column: 1 / -1; margin-top: 3px; color: rgba(255,247,233,.78); font-size: 8px; font-weight: 750; white-space: nowrap; }
.combo-hud.is-active { border-color: rgba(255,211,91,.9); background: linear-gradient(135deg, rgba(255,186,73,.36), rgba(235,117,66,.32)); box-shadow: 0 0 0 3px rgba(255,214,102,.14), inset 0 1px 0 rgba(255,255,255,.28); color: #fffdf1; }
.combo-hud.is-active strong { text-shadow: 0 2px 0 rgba(144,63,30,.3); }
.combo-hud.is-break { animation: combo-hud-break .5s ease both; }
.stage-level { margin-left: auto; padding: 9px 15px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; background: rgba(35,93,75,.22); font-size: 13px; font-weight: 800; }
.stage-actions { display: flex; align-items: center; gap: 8px; }
.bgm-volume-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 13px;
  background: rgba(35,93,75,.32);
  color: #fff8eb;
  white-space: nowrap;
}
.bgm-volume-icon {
  color: #fbc968;
  font-size: 17px;
  line-height: 1;
}
.bgm-volume-control input[type="range"] {
  width: clamp(62px, 8vw, 100px);
  height: 4px;
  accent-color: #fbc968;
  cursor: pointer;
}
.bgm-volume-control output {
  min-width: 35px;
  color: rgba(255,248,235,.88);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  text-align: right;
}
.bgm-volume-control:focus-within {
  outline: 3px solid rgba(251,201,104,.95);
  outline-offset: 3px;
}
.sound-button .sound-off-icon { display: none; }
.sound-button.is-muted .sound-on-icon { display: none; }
.sound-button.is-muted .sound-off-icon { display: block; }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.28); border-radius: 13px; background: rgba(35,93,75,.32); color: #fff8eb; cursor: pointer; transition: transform .16s ease, background .16s ease; }
.icon-button:hover { transform: translateY(-2px); background: rgba(35,93,75,.58); }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }

.board-wrap { position: relative; z-index: 1; display: flex; justify-content: center; flex: 1 1 auto; padding: 0 4px; }
.board { position: relative; overflow: visible; border: 9px solid rgba(49, 101, 66, .52); border-radius: 28px; background: linear-gradient(145deg, rgba(255,255,255,.08), transparent 24%), rgba(49, 101, 66, .26); box-shadow: inset 0 0 0 2px rgba(255,255,255,.09), inset 0 14px 24px rgba(28,67,52,.12), 0 20px 35px rgba(35,73,43,.2); }
.board::before { content: ""; position: absolute; inset: 12px; border: 1px dashed rgba(255,255,255,.18); border-radius: 16px; pointer-events: none; }
.combo-float {
  position: absolute;
  z-index: 10000;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 178px;
  padding: 13px 18px 12px;
  border: 2px solid rgba(255,246,194,.9);
  border-radius: 20px;
  background: radial-gradient(circle at 50% 0, rgba(255,248,191,.98), rgba(255,181,75,.97) 48%, rgba(225,93,60,.96));
  color: #7b3327;
  box-shadow: 0 10px 0 rgba(116,56,35,.25), 0 18px 35px rgba(28,67,52,.34);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: combo-float-up 1.18s cubic-bezier(.16,.86,.28,1) both;
}
.combo-float::before, .combo-float::after { content: "✦"; position: absolute; color: #fff5b7; font-size: 20px; text-shadow: 0 2px 0 rgba(139,66,35,.2); }
.combo-float::before { top: -13px; left: -9px; }
.combo-float::after { right: -8px; bottom: -12px; font-size: 16px; }
.combo-float-title { font-size: 27px; font-weight: 950; letter-spacing: .02em; line-height: .95; text-shadow: 0 2px 0 rgba(255,248,214,.5); }
.combo-float-detail { margin-top: 5px; color: rgba(92,44,37,.88); font-size: 12px; font-weight: 900; letter-spacing: .07em; }
.combo-float.is-break { border-color: rgba(255,223,221,.9); background: radial-gradient(circle at 50% 0, #ffdfcb, #fa8d88 55%, #c94c66); color: #fff9ee; animation-duration: .98s; }
.combo-float.is-break .combo-float-title { font-size: 21px; text-shadow: 0 2px 0 rgba(124,42,62,.35); }
.combo-float.is-break .combo-float-detail { color: rgba(255,249,238,.9); }
@keyframes combo-float-up {
  0% { opacity: 0; transform: translate(-50%, -34%) scale(.55) rotate(-6deg); }
  18% { opacity: 1; transform: translate(-50%, -54%) scale(1.12) rotate(2deg); }
  42% { opacity: 1; transform: translate(-50%, -67%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -118%) scale(.88); }
}
@keyframes combo-hud-break {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
.card { position: absolute; display: flex; align-items: center; justify-content: center; width: var(--card-w); height: var(--card-h); border: 3px solid #64482a; border-radius: 13px 13px 16px 16px; background: var(--card); box-shadow: 0 7px 0 rgba(76,52,28,.24), 0 10px 18px rgba(49,54,29,.16); cursor: pointer; user-select: none; transition: transform .14s ease, box-shadow .14s ease, filter .14s ease; }
.card::before { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(255,255,255,.6); border-radius: 8px 8px 11px 11px; pointer-events: none; }
.card::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: 7px; height: 4px; border-radius: 99px; background: var(--tile-color, var(--pink)); opacity: .9; pointer-events: none; }
.card:not(.blocked):hover { transform: translateY(-7px) rotate(-1deg) scale(1.045); box-shadow: 0 12px 0 rgba(76,52,28,.22), 0 17px 22px rgba(49,54,29,.2); z-index: 5000; }
.card.blocked { cursor: default; filter: brightness(.78) saturate(.72); }
.card .accent { position: absolute; top: -3px; left: -3px; right: -3px; height: 12px; border-radius: 11px 11px 0 0; pointer-events: none; }
.card .badge { position: absolute; top: 10px; left: 9px; display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid rgba(100,72,42,.22); border-radius: 50%; color: #fff; font-size: 10px; font-weight: 900; pointer-events: none; }
.card .badge.zh { background: var(--pink); }
.card .badge.en { background: var(--blue); font-size: 9px; }
.card .word {
  position: relative;
  z-index: 1;
  display: block;
  width: calc(100% - 16px);
  max-width: calc(100% - 16px);
  margin: 13px 8px 8px;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  text-overflow: clip;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  pointer-events: none;
}
.card.en .word {
  color: #2773a0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: -.045em;
}
.card.zh .word { color: #a94c59; font-size: 20px; letter-spacing: 0; }
.card .pair-mark { position: absolute; right: 9px; top: 10px; width: 10px; height: 10px; border-radius: 50%; pointer-events: none; }

.slot-area { position: relative; z-index: 2; display: flex; justify-content: center; gap: 9px; width: min(900px, 100%); margin: 17px auto 0; padding: 11px 14px; border: 3px solid rgba(100,72,42,.8); border-radius: 19px; background: #64482a; box-shadow: 0 8px 0 rgba(48,62,34,.16), inset 0 2px 0 rgba(255,255,255,.12); }
.slot { position: relative; display: grid; place-items: center; width: var(--slot-w); height: var(--slot-h); overflow: hidden; border: 2px dashed rgba(255,242,214,.4); border-radius: 11px; background: rgba(40,73,46,.35); }
.slot.locked { background: rgba(255,245,216,.12); }
.slot.locked::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,244,215,.06) 8px 10px); }
.lock-icon { width: 18px; height: 18px; fill: none; stroke: rgba(255,244,215,.72); stroke-width: 2; stroke-linecap: round; }
.slot-card { position: absolute; inset: 2px; display: flex; align-items: center; justify-content: center; border: 2px solid #64482a; border-radius: 9px; background: var(--card); box-shadow: 0 3px 0 rgba(76,52,28,.22); animation: slot-in .2s ease both; }
.slot-card .badge { position: absolute; top: 4px; left: 4px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 8px; font-weight: 900; }
.slot-card .badge.zh { background: var(--pink); }
.slot-card .badge.en { background: var(--blue); font-size: 7px; }
.slot-card .word {
  display: block;
  width: calc(100% - 12px);
  max-width: calc(100% - 12px);
  margin: 10px 3px 2px;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  text-overflow: clip;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
.slot-card.en .word {
  color: #2773a0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 9px;
  letter-spacing: -.05em;
}
.slot-card.zh .word { color: #a94c59; font-size: 13px; letter-spacing: 0; }
.slot-card .pair-mark { position: absolute; right: 3px; bottom: 3px; width: 6px; height: 6px; border-radius: 50%; }
.slot-card.matched { animation: match-pop .32s ease both; }

.ad-row { position: relative; z-index: 2; display: flex; justify-content: center; margin: 12px auto 0; }
.ad-button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 2px solid rgba(255,248,232,.75); border-radius: 999px; background: rgba(255,248,232,.15); color: #fff8eb; font-size: 12px; font-weight: 900; cursor: pointer; transition: transform .16s ease, background .16s ease; }
.ad-button:hover { transform: translateY(-2px); background: rgba(255,248,232,.25); }
.ad-button svg { width: 14px; height: 14px; fill: currentColor; }

.side-panel { position: relative; display: flex; flex-direction: column; min-height: 100vh; padding: clamp(28px, 4vw, 58px) clamp(24px, 4vw, 58px) 24px; overflow: hidden; background: var(--cream); }
.side-panel::before { content: ""; position: absolute; right: -90px; top: 12%; width: 270px; height: 270px; border-radius: 50%; background: rgba(251,201,104,.16); }
.side-panel::after { content: ""; position: absolute; left: -80px; bottom: 8%; width: 220px; height: 220px; border-radius: 50%; background: rgba(94,183,247,.1); }
.brand-lockup, .stats-card, .guide-card, .tip-card, .level-link, .side-footer { position: relative; z-index: 1; }
.brand-lockup { display: flex; align-items: flex-start; gap: 14px; }
.logo-wrap { display: grid; place-items: center; width: 58px; height: 58px; flex: none; border: 3px solid var(--ink); border-radius: 18px; background: var(--yellow); box-shadow: 0 5px 0 rgba(100,72,42,.2); transform: rotate(-5deg); }
.logo { width: 45px; height: 45px; }
.eyebrow { margin: 2px 0 4px; color: var(--pink); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.brand-lockup h1 { margin: 0; font-size: clamp(24px, 3vw, 34px); line-height: 1; letter-spacing: -.05em; }
.brand-copy { margin: 8px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.5; }
.stats-card, .guide-card { margin-top: 30px; padding: 18px; border: 2px solid rgba(100,72,42,.78); border-radius: 20px; background: rgba(255,248,234,.66); box-shadow: 0 6px 0 rgba(100,72,42,.13); }
.card-heading { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 900; }
.sparkle { color: var(--yellow); font-size: 22px; line-height: 1; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 14px; }
.stat { min-width: 0; padding: 11px 4px 9px; border-radius: 13px; text-align: center; }
.stat span { display: block; font-size: 18px; font-weight: 950; line-height: 1; }
.stat small { display: block; margin-top: 6px; color: rgba(100,72,42,.72); font-size: 10px; font-weight: 800; white-space: nowrap; }
.stat-coral { background: rgba(247,123,145,.2); color: #b24e62; }
.stat-blue { background: rgba(94,183,247,.2); color: #2773a0; }
.stat-yellow { background: rgba(251,201,104,.3); color: #9c6e17; }
.progress-track { height: 9px; margin-top: 14px; overflow: hidden; border-radius: 99px; background: rgba(100,72,42,.12); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pink), var(--yellow)); transition: width .25s ease; }
.guide-card { margin-top: 16px; }
.guide-number { color: var(--pink); font-size: 11px; letter-spacing: .1em; }
.guide-step { display: flex; align-items: center; gap: 11px; margin-top: 14px; }
.guide-step p { margin: 0; color: rgba(100,72,42,.82); font-size: 12px; font-weight: 800; }
.step-icon { display: grid; place-items: center; width: 29px; height: 29px; flex: none; border-radius: 9px; color: #fff; font-size: 9px; font-weight: 900; box-shadow: 0 3px 0 rgba(100,72,42,.15); }
.step-pink { background: var(--pink); } .step-blue { background: var(--blue); } .step-green { background: #73b66f; font-size: 15px; }
.tip-card { display: flex; gap: 10px; margin-top: 16px; padding: 13px 14px; border-radius: 16px; background: rgba(200,145,250,.18); }
.tip-card p { margin: 0; color: rgba(100,72,42,.8); font-size: 11px; line-height: 1.5; }
.tip-card strong { color: #8d58be; }
.tip-icon { color: #ad70dc; font-size: 18px; }
.level-link { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: auto; padding: 13px 15px; border: 0; border-radius: 13px; background: var(--green-deep); color: #fff7e9; font-size: 12px; font-weight: 900; cursor: pointer; box-shadow: 0 5px 0 rgba(35,93,75,.2); transition: transform .16s ease, background .16s ease; }
.level-link:hover { transform: translateY(-2px); background: #2d755b; }
.side-footer { margin: 13px 0 0; color: var(--muted); font-size: 10px; font-weight: 800; text-align: center; }

.overlay { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(35,59,42,.56); backdrop-filter: blur(7px); }
.overlay.hidden { display: none; }
.overlay-card { width: min(430px, 100%); padding: 30px; border: 3px solid var(--ink); border-radius: 24px; background: var(--cream); box-shadow: 0 12px 0 rgba(58,43,27,.28); text-align: center; animation: overlay-in .24s ease both; }
.overlay-icon { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 14px; border: 3px solid var(--ink); border-radius: 50%; background: var(--yellow); font-size: 28px; font-weight: 900; }
.overlay-card h2 { margin: 0; font-size: 25px; } .overlay-card p { margin: 10px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.overlay-actions { display: flex; justify-content: center; gap: 10px; } .overlay-actions button { min-width: 126px; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 900; cursor: pointer; }
.primary-btn { border: 0; background: var(--green-deep); color: #fff; } .ghost-btn { border: 2px solid rgba(100,72,42,.35); background: transparent; color: var(--ink); }
.level-card { width: min(440px, 100%); } .level-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin: 20px 0; }
.level-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; padding: 8px 4px; border: 2px solid rgba(100,72,42,.28); border-radius: 13px; background: #fff8ea; color: var(--ink); font-weight: 900; cursor: pointer; }
.level-btn:hover { border-color: var(--pink); background: #fff2e5; } .level-btn:disabled { cursor: default; opacity: .42; } .level-btn.current { border-color: var(--green-deep); background: rgba(251,201,104,.35); box-shadow: 0 0 0 3px rgba(251,201,104,.35); }
.level-btn .level-num { font-size: 20px; line-height: 1; } .level-btn .level-meta { margin-top: 5px; color: var(--muted); font-size: 10px; }
.level-btn .lock { position: absolute; top: 7px; right: 8px; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.ad-card { width: min(720px, 100%); padding: 16px; } .ad-visual { display: block; width: 100%; border-radius: 12px; } .ad-progress { height: 9px; margin-top: 12px; overflow: hidden; border-radius: 99px; background: rgba(100,72,42,.14); } .ad-progress span { display: block; width: 0; height: 100%; background: var(--pink); }
@keyframes slot-in { from { opacity: 0; transform: translateY(7px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes match-pop { 50% { transform: scale(1.12) rotate(4deg); opacity: .75; } 100% { transform: scale(.1); opacity: 0; } }
@keyframes overlay-in { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }


.library-card { position: relative; z-index: 1; margin-top: 18px; padding: 16px 18px; border-radius: 20px; background: rgba(94,183,247,.13); border: 2px solid rgba(39,115,160,.22); }
.book-mark { color: var(--blue); font-size: 19px; line-height: 1; }
.select-label { display: block; margin: 12px 0 5px; color: var(--muted); font-size: 10px; font-weight: 900; }
.library-select { width: 100%; min-width: 0; padding: 9px 30px 9px 11px; border: 2px solid rgba(100,72,42,.2); border-radius: 11px; outline: none; background: rgba(255,248,234,.8); color: var(--ink); font-size: 12px; font-weight: 800; cursor: pointer; }
.library-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(94,183,247,.18); }
.library-meta { margin-top: 9px; color: var(--green-deep); font-size: 10px; font-weight: 900; line-height: 1.4; }
.dictionary-card { margin-top: 16px; padding: 16px 18px; border: 2px solid rgba(244,162,97,.4); border-radius: 20px; background: rgba(251,201,104,.14); }
.dictionary-mark { color: #d9784b; font-size: 20px; font-weight: 950; line-height: 1; }
.dictionary-intro { margin: 7px 0 10px; color: var(--muted); font-size: 10px; font-weight: 800; line-height: 1.5; }
.dictionary-search { display: flex; align-items: center; gap: 6px; padding: 4px 5px 4px 10px; border: 2px solid rgba(100,72,42,.2); border-radius: 12px; background: rgba(255,248,234,.86); transition: border-color .16s ease, box-shadow .16s ease; }
.dictionary-search:focus-within { border-color: #f4a261; box-shadow: 0 0 0 3px rgba(244,162,97,.16); }
.dictionary-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 12px; font-weight: 800; }
.dictionary-search input::placeholder { color: #b49b82; }
.dictionary-search button { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border: 0; border-radius: 8px; background: rgba(100,72,42,.1); color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.dictionary-search button:hover { background: rgba(247,123,145,.2); color: var(--ink); }
.dictionary-mode { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 9px; font-weight: 900; }
.dictionary-mode strong { padding: 4px 7px; border-radius: 99px; background: rgba(244,162,97,.22); color: #b75e36; font-size: 9px; }
.dictionary-content { min-height: 74px; margin-top: 8px; }
.dictionary-empty { display: grid; place-items: center; min-height: 66px; padding: 10px; border: 1px dashed rgba(100,72,42,.2); border-radius: 12px; color: var(--muted); font-size: 10px; font-weight: 800; line-height: 1.5; text-align: center; }
.dictionary-suggestion-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.dictionary-word-card { display: flex; min-width: 0; flex-direction: column; justify-content: center; min-height: 61px; padding: 8px 6px; border: 2px solid var(--word-color, #f4a261); border-radius: 12px; background: rgba(255,248,234,.83); color: var(--ink); box-shadow: 0 3px 0 rgba(100,72,42,.14); cursor: pointer; text-align: left; transition: transform .16s ease, background .16s ease; }
.dictionary-word-card:hover { transform: translateY(-2px); background: #fff8ea; }
.dictionary-word-en { overflow: hidden; color: #2773a0; font-size: 12px; font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }
.dictionary-word-zh { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.dictionary-section-label { margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 900; }
.dictionary-result-list, .dictionary-phrase-list { display: grid; gap: 6px; }
.dictionary-result-card, .dictionary-phrase-item, .dictionary-example { padding: 8px 9px; border: 2px solid rgba(100,72,42,.14); border-radius: 11px; background: rgba(255,248,234,.78); }
.dictionary-result-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dictionary-result-card strong { min-width: 0; overflow: hidden; color: #2773a0; font-size: 12px; font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }
.dictionary-result-card span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 800; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.dictionary-phrase-item { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dictionary-phrase-item strong { color: #2773a0; font-size: 11px; font-weight: 950; }
.dictionary-phrase-item span { min-width: 0; flex: 1; overflow-wrap: anywhere; color: var(--muted); font-size: 9px; font-weight: 800; line-height: 1.45; text-align: right; }
.dictionary-example strong { display: block; color: #2773a0; font-size: 11px; font-weight: 950; line-height: 1.4; }
.dictionary-example span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 800; line-height: 1.45; }
.rule-panel { margin-top: 8px; padding: 8px 9px; border-left: 4px solid #f4a261; border-radius: 0 10px 10px 0; background: rgba(244,162,97,.12); }
.rule-heading { display: flex; align-items: center; justify-content: space-between; color: #b75e36; font-size: 9px; font-weight: 950; }
.rule-heading span:last-child { color: #e99a62; font-size: 13px; }
.rule-panel p { margin: 4px 0 0; color: var(--muted); font-size: 9px; font-weight: 800; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.collection-card { position: relative; z-index: 1; margin-top: 16px; padding: 16px 18px; border: 2px solid rgba(200,145,250,.45); border-radius: 20px; background: rgba(200,145,250,.13); }
.latest-word-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 12px;
  padding: 10px;
  border: 2px solid rgba(141,88,190,.25);
  border-radius: 14px;
  background: rgba(255,248,234,.62);
}
.latest-word-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 2px solid rgba(141,88,190,.42);
  border-radius: 11px;
  background: #d8b3f7;
  color: #7446a1;
  font-size: 17px;
  font-weight: 950;
}
.latest-word-slot.is-complete .latest-word-icon {
  border-color: rgba(72,137,86,.42);
  background: #b9df9d;
  color: #2f6b4d;
}
.latest-word-slot-body { min-width: 0; flex: 1; }
.latest-word-heading,
.latest-word-name-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.latest-word-heading { color: var(--muted); font-size: 9px; font-weight: 900; }
.latest-word-heading strong { flex: none; color: #8d58be; font-size: 10px; }
.latest-word-slot.is-complete .latest-word-heading strong { color: var(--green-deep); }
.latest-word-name-row { margin-top: 3px; }
.latest-word-name-row > strong {
  min-width: 0;
  overflow: hidden;
  color: #2773a0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: -.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.latest-word-name-row > span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.latest-word-track { height: 5px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: rgba(100,72,42,.12); }
.latest-word-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #b077dc, #8d58be); transition: width .25s ease; }
.latest-word-slot.is-complete .latest-word-track span { background: linear-gradient(90deg, #78b978, #2f6b4d); }
.collection-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.collection-title-row p { margin: 7px 0 0; color: var(--muted); font-size: 10px; font-weight: 800; }
.collection-title-row p strong { color: #8d58be; font-size: 17px; }
.collection-badge { display: grid; place-items: center; width: 47px; height: 47px; flex: none; border: 2px solid #8d58be; border-radius: 15px; background: #d8b3f7; color: #6e419d; font-size: 17px; font-weight: 950; line-height: .7; transform: rotate(5deg); }
.collection-badge small { font-size: 9px; }
.collection-button, .import-button { width: 100%; border-radius: 11px; cursor: pointer; font-size: 11px; font-weight: 900; }
.collection-button { display: flex; justify-content: space-between; align-items: center; margin-top: 13px; padding: 10px 12px; border: 0; background: #8d58be; color: #fff8ef; box-shadow: 0 4px 0 rgba(110,65,157,.2); }
.collection-button:hover { background: #7f4aae; }
.import-button { margin-top: 8px; padding: 8px 10px; border: 1px dashed rgba(110,65,157,.42); background: transparent; color: #7f4aae; }
.import-button:hover { background: rgba(255,248,234,.45); }
.import-hint { margin: 8px 2px 0; color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1.5; }

.collection-modal { width: min(740px, 100%); max-height: min(760px, calc(100vh - 40px)); overflow: auto; text-align: left; }
.modal-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-topline h2 { margin-top: 1px; }
.modal-close { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid rgba(100,72,42,.25); border-radius: 50%; background: transparent; color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.modal-intro { margin: 8px 0 18px !important; }
.modal-intro strong { color: #8d58be; }
.collection-filter-row { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.collection-filter-row .library-select { flex: 1; }
.collection-filter-row > span { flex: none; color: var(--muted); font-size: 11px; font-weight: 900; }
.collection-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.collection-word { position: relative; min-height: 104px; padding: 14px 11px 10px; overflow: hidden; border: 2px solid rgba(100,72,42,.22); border-radius: 15px; background: #fff8ea; box-shadow: 0 4px 0 rgba(100,72,42,.1); }
.collection-word::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 7px; background: var(--word-color, var(--pink)); }
.collection-word h3 { margin: 4px 0 4px; color: #2773a0; font-size: 17px; line-height: 1.1; }
.collection-word p { margin: 0; color: #a94c59; font-size: 12px; font-weight: 900; }
.collection-word small { display: block; margin-top: 11px; color: var(--muted); font-size: 9px; font-weight: 800; }
.collection-word .learned-mark { position: absolute; right: 8px; top: 12px; color: #73b66f; font-size: 15px; }
.collection-empty { grid-column: 1 / -1; padding: 42px 20px; border: 2px dashed rgba(100,72,42,.25); border-radius: 16px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.7; }
.toast { position: fixed; z-index: 40; left: 50%; bottom: 28px; max-width: min(420px, calc(100% - 28px)); padding: 12px 17px; border: 2px solid var(--ink); border-radius: 999px; background: var(--yellow); color: var(--ink); box-shadow: 0 6px 0 rgba(100,72,42,.2); font-size: 12px; font-weight: 900; opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 680px) {
  .game-cover { padding: 14px; }
  .cover-card { border-radius: 28px; padding: 24px 18px 23px; }
  .cover-logo { transform: scale(.86) rotate(-4deg); margin-bottom: 3px; }
  .cover-card h1 { font-size: 35px; }
  .cover-subtitle { font-size: 13px; margin-bottom: 18px; }
  .cover-preview-cards { gap: 6px; margin-bottom: 22px; }
  .cover-word-card { width: 92px; height: 70px; font-size: 15px; }
  .cover-word-card span { font-size: 10px; }
  .cover-spark-one { left: 7%; top: 14%; }
  .cover-spark-two { right: 8%; bottom: 13%; }
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: minmax(0, 1.55fr) minmax(290px, .9fr); }
  .side-panel { padding-inline: 28px; }
  .brand-lockup h1 { font-size: 25px; }
}
@media (max-width: 680px) {
  body { background: var(--green); }
  .app-shell { display: block; }
  .game-stage { min-height: auto; padding: 16px 10px 18px; }
  .side-panel { min-height: auto; padding: 27px 18px 22px; }
  .stage-header { margin-bottom: 10px; }
  .stage-status { font-size: 10px; }
  .stage-level { padding: 8px 11px; font-size: 11px; }
  .icon-button { width: 38px; height: 38px; }
  .slot-area { gap: 5px; padding: 8px 7px; margin-top: 12px; }
  .ad-row { margin-top: 10px; }
  .side-panel::before { top: 2%; right: -120px; }
  .stats-card, .guide-card { margin-top: 24px; }
}


@media (max-width: 680px) {
  .library-card, .collection-card { margin-top: 13px; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collection-modal { padding: 22px 16px; }
}

/* 紧凑桌面布局：在 16:9 窗口内尽量一次显示完整界面 */
@media (min-width: 901px) {
  html, body { min-height: 100%; }
  body { height: 100svh; overflow: hidden; }
  .app-shell { grid-template-columns: minmax(0, 1.95fr) minmax(320px, .82fr); height: 100svh; min-height: 0; }
  .game-stage { min-height: 0; height: 100svh; padding: clamp(12px, 1.65vh, 22px) clamp(16px, 2.8vw, 48px) clamp(12px, 1.5vh, 20px); }
  .stage-header { max-width: 820px; margin-bottom: 10px; }
  .stage-status { font-size: 11px; }
  .live-dot { width: 8px; height: 8px; }
  .combo-hud { min-width: 112px; padding: 4px 8px 5px; }
  .combo-hud strong { font-size: 19px; }
  .combo-hint { font-size: 7px; }
  .stage-level { padding: 7px 12px; font-size: 12px; }
  .icon-button { width: 37px; height: 37px; border-radius: 11px; }
  .icon-button svg { width: 18px; height: 18px; }
  .board { border-width: 7px; border-radius: 23px; }
  .board::before { inset: 10px; border-radius: 13px; }
  .card { border-width: 2px; border-radius: 11px 11px 13px 13px; box-shadow: 0 5px 0 rgba(76,52,28,.2), 0 8px 14px rgba(49,54,29,.13); }
  .card::before { inset: 3px; }
  .card::after { bottom: 5px; height: 3px; }
  .card .accent { height: 9px; }
  .card .badge { top: 7px; left: 7px; width: 22px; height: 22px; font-size: 9px; }
  .card .word { margin: 11px 6px 6px; }
  .card.en .word { font-size: 13px; }
  .card.zh .word { font-size: 17px; }
  .card .pair-mark { right: 7px; top: 8px; width: 8px; height: 8px; }
  .slot-area { gap: 6px; margin-top: 10px; padding: 8px 9px; border-width: 2px; border-radius: 15px; }
  .slot { border-radius: 9px; }
  .slot-card { border-width: 2px; border-radius: 8px; }
  .slot-card .word { font-size: 12px; }
  .slot-card.zh .word { font-size: 15px; }
  .ad-row { margin-top: 9px; }
  .ad-button { padding: 7px 13px; font-size: 10px; }
  .ad-button svg { width: 15px; height: 15px; }
  .side-panel { min-height: 0; height: 100svh; overflow-y: auto; scrollbar-width: thin; padding: clamp(18px, 2.2vh, 30px) clamp(18px, 2.6vw, 42px) 15px; }
  .brand-lockup { gap: 10px; }
  .logo-wrap { width: 42px; height: 42px; }
  .brand-lockup h1 { font-size: clamp(22px, 1.7vw, 28px); }
  .brand-copy { margin-top: 5px; font-size: 10px; line-height: 1.35; }
  .library-card, .collection-card, .stats-card, .guide-card { margin-top: 10px; }
  .library-card, .collection-card, .stats-card { padding: 12px 14px; border-radius: 16px; }
  .card-heading { font-size: 12px; }
  .select-label { margin: 8px 0 4px; font-size: 9px; }
  .library-select { padding: 7px 26px 7px 9px; border-radius: 9px; font-size: 11px; }
  .library-meta { margin-top: 6px; font-size: 9px; }
  .collection-title-row p { margin-top: 5px; font-size: 9px; }
  .collection-title-row p strong { font-size: 15px; }
  .latest-word-slot { margin-top: 8px; padding: 8px; }
  .latest-word-icon { width: 30px; height: 30px; border-radius: 9px; font-size: 14px; }
  .latest-word-name-row > strong { font-size: 12px; }
  .latest-word-name-row > span { font-size: 9px; }
  .collection-badge { width: 39px; height: 39px; border-radius: 12px; font-size: 14px; }
  .collection-button { margin-top: 8px; padding: 8px 10px; font-size: 10px; }
  .import-button { margin-top: 5px; padding: 6px 8px; font-size: 10px; }
  .import-hint { margin-top: 5px; font-size: 8px; line-height: 1.35; }
  .stats { gap: 6px; margin-top: 9px; }
  .stat { padding: 8px 4px; border-radius: 10px; }
  .stat span { font-size: 16px; }
  .stat small { margin-top: 3px; font-size: 9px; }
  .progress-track { height: 7px; margin-top: 9px; }
  .guide-step { gap: 8px; margin-top: 8px; }
  .step-icon { width: 24px; height: 24px; border-radius: 7px; }
  .guide-step p { font-size: 10px; }
  .tip-card { gap: 8px; margin-top: 10px; padding: 9px 10px; }
  .tip-card p { font-size: 9px; }
  .tip-icon { font-size: 15px; }
  .level-link { margin-top: 10px; padding: 10px 12px; font-size: 10px; }
  .side-footer { margin-top: 8px; font-size: 9px; }
}

@media (min-width: 901px) and (max-height: 820px) {
  .side-panel { padding-top: 14px; }
  .library-card, .collection-card, .stats-card, .guide-card { margin-top: 7px; }
  .library-card, .collection-card, .stats-card { padding-block: 9px; }
  .guide-step { margin-top: 5px; }
  .tip-card { margin-top: 7px; }
  .level-link { margin-top: 7px; }
}

/* 平板与窄屏：棋盘和侧栏改为上下排列，避免两栏挤压内容。 */
@media (max-width: 900px) {
  body { overflow-x: hidden; overflow-y: auto; }
  .app-shell { display: block; min-height: 100svh; }
  .game-stage { min-height: 0; padding: 14px 12px 16px; }
  .stage-header { margin-bottom: 9px; }
  .stage-status { font-size: 10px; }
  .combo-hud { min-width: 108px; padding: 4px 8px 5px; }
  .combo-hud strong { font-size: 18px; }
  .combo-hint { font-size: 7px; }
  .stage-level { padding: 7px 10px; font-size: 11px; }
  .icon-button { width: 38px; height: 38px; }
  .board-wrap { flex: none; }
  .slot-area { margin-top: 10px; }
  .ad-row { margin-top: 9px; }
  .side-panel { min-height: 0; padding: 22px 20px 24px; }
  .library-card, .collection-card, .dictionary-card { margin-top: 12px; }
}

@media (max-width: 680px) {
  .game-stage { padding: 12px 8px 14px; }
  .stage-header { gap: 7px; }
  .stage-status { font-size: 9px; letter-spacing: .04em; }
  .combo-hud { min-width: 100px; padding: 4px 7px; border-radius: 11px; }
  .combo-label { font-size: 8px; }
  .combo-hud strong { font-size: 17px; }
  .combo-hint { margin-top: 2px; font-size: 6.5px; }
  .stage-level { padding: 6px 8px; font-size: 10px; }
  .stage-actions { gap: 5px; }
  .bgm-volume-control { min-height: 34px; gap: 4px; padding-inline: 7px; border-radius: 10px; }
  .bgm-volume-icon { font-size: 14px; }
  .bgm-volume-control input[type="range"] { width: 58px; }
  .bgm-volume-control output { min-width: 31px; font-size: 10px; }
  .icon-button { width: 34px; height: 34px; border-radius: 10px; }
  .icon-button svg { width: 17px; height: 17px; }
  .board { border-width: 6px; border-radius: 19px; }
  .board::before { inset: 8px; }
  .card { border-width: 2px; border-radius: 10px 10px 12px 12px; box-shadow: 0 4px 0 rgba(76,52,28,.2), 0 6px 11px rgba(49,54,29,.13); }
  .card .accent { height: 8px; }
  .card .badge { top: 6px; left: 6px; width: 20px; height: 20px; font-size: 8px; }
  .card .word { margin: 10px 5px 5px; }
  .card.en .word { font-size: 11px; }
  .card.zh .word { font-size: 15px; }
  .card .pair-mark { right: 6px; top: 7px; width: 7px; height: 7px; }
  .slot-area { gap: 4px; padding: 7px 6px; border-width: 2px; border-radius: 14px; }
  .dictionary-card { padding: 11px 12px; border-radius: 15px; }
  .dictionary-suggestion-grid { gap: 5px; }
  .dictionary-word-card { min-height: 55px; padding: 7px 5px; }
  .dictionary-word-en { font-size: 11px; }
  .dictionary-word-zh { font-size: 9px; }
  .slot-card .word { font-size: 10px; }
  .slot-card.zh .word { font-size: 12px; }
  .ad-button { padding: 7px 10px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .cover-card, .cover-spark { animation: none; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* 16:9 短屏再压缩一档，确保右侧信息卡片完整落在首屏内。 */
@media (min-width: 901px) {
  .side-panel { padding-top: 12px; padding-bottom: 10px; padding-inline: clamp(16px, 2.2vw, 32px); }
  .brand-lockup { gap: 8px; }
  .logo-wrap { width: 38px; height: 38px; border-width: 2px; border-radius: 13px; }
  .logo { width: 33px; height: 33px; }
  .brand-lockup h1 { font-size: clamp(20px, 1.55vw, 26px); }
  .brand-copy { margin-top: 4px; font-size: 9px; line-height: 1.3; }
  .library-card, .collection-card, .dictionary-card, .stats-card, .guide-card { margin-top: 7px; }
  .library-card, .collection-card, .dictionary-card, .stats-card, .guide-card { padding: 9px 12px; border-radius: 15px; }
  .library-card .select-label { margin-top: 6px; }
  .library-select { padding-top: 6px; padding-bottom: 6px; }
  .library-meta { margin-top: 5px; }
  .dictionary-intro { margin: 4px 0 6px; font-size: 8px; }
  .dictionary-search { padding-block: 3px; }
  .dictionary-search input { font-size: 10px; }
  .dictionary-mode { margin-top: 6px; font-size: 8px; }
  .dictionary-mode strong { padding: 3px 5px; font-size: 8px; }
  .dictionary-content { min-height: 57px; margin-top: 5px; }
  .dictionary-word-card { min-height: 48px; padding: 5px; border-radius: 9px; }
  .dictionary-word-en { font-size: 10px; }
  .dictionary-word-zh { margin-top: 2px; font-size: 8px; }
  .dictionary-result-card, .dictionary-phrase-item, .dictionary-example { padding: 6px 7px; }
  .rule-panel { margin-top: 5px; padding: 6px 7px; }
  .rule-panel p { margin-top: 3px; font-size: 8px; }
  .collection-title-row p { margin-top: 3px; }
  .latest-word-slot { gap: 7px; margin-top: 6px; padding: 7px; border-radius: 11px; }
  .latest-word-icon { width: 27px; height: 27px; border-radius: 8px; font-size: 13px; }
  .latest-word-heading { font-size: 8px; }
  .latest-word-heading strong { font-size: 9px; }
  .latest-word-name-row { margin-top: 2px; }
  .latest-word-name-row > strong { font-size: 11px; }
  .latest-word-name-row > span { font-size: 8px; }
  .latest-word-track { height: 4px; margin-top: 4px; }
  .collection-badge { width: 35px; height: 35px; border-radius: 10px; font-size: 13px; }
  .collection-button { margin-top: 6px; padding-top: 7px; padding-bottom: 7px; }
  .import-button { margin-top: 4px; padding-top: 5px; padding-bottom: 5px; }
  .import-hint { margin-top: 4px; font-size: 7px; }
  .stats { margin-top: 7px; }
  .stat { padding-top: 7px; padding-bottom: 7px; }
  .progress-track { margin-top: 7px; }
  .guide-card { padding-top: 9px; padding-bottom: 9px; }
  .guide-step { margin-top: 5px; }
  .tip-card { margin-top: 7px; padding-top: 7px; padding-bottom: 7px; }
  .level-link { margin-top: 7px; padding-top: 8px; padding-bottom: 8px; }
  .side-footer { margin-top: 5px; }
}

@media (min-width: 901px) and (max-height: 760px) {
  .import-hint { display: none; }
  .dictionary-intro { display: none; }
  .dictionary-card { padding-top: 7px; padding-bottom: 7px; }
  .dictionary-content { min-height: 48px; }
  .dictionary-word-card { min-height: 42px; }
  .rule-panel { padding-block: 5px; }
  .library-meta { margin-top: 3px; font-size: 8px; }
  .guide-card { padding-top: 7px; padding-bottom: 7px; }
  .guide-step { margin-top: 3px; }
  .tip-card { margin-top: 5px; padding-top: 6px; padding-bottom: 6px; }
  .level-link { margin-top: 5px; }
  .side-footer { margin-top: 3px; }
}

@media (min-width: 901px) and (max-height: 760px) {
  .side-panel { padding-bottom: 8px; }
}

/* 侧栏字幕大小：由“大 / 中 / 小”按钮切换，并覆盖紧凑桌面布局的字号。 */
.subtitle-size-control {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 2px solid rgba(94,183,247,.22);
  border-radius: 12px;
  background: rgba(94,183,247,.1);
}
.subtitle-size-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.subtitle-size-options {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255,248,234,.72);
}
.subtitle-size-btn {
  min-width: 28px;
  padding: 5px 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.subtitle-size-btn:hover {
  color: var(--ink);
  background: rgba(255,255,255,.75);
}
.subtitle-size-btn.is-selected {
  background: var(--green-deep);
  color: #fff8ea;
  box-shadow: 0 2px 0 rgba(35,93,75,.2);
}
.subtitle-size-btn:active { transform: translateY(1px); }
.subtitle-size-btn:focus-visible {
  outline: 3px solid rgba(94,183,247,.45);
  outline-offset: 2px;
}

/* 默认中号：在保持紧凑的同时，比原桌面侧栏更容易阅读。 */
.side-panel[data-subtitle-size="medium"] .brand-copy { font-size: 11px; }
.side-panel[data-subtitle-size="medium"] .card-heading { font-size: 13px; }
.side-panel[data-subtitle-size="medium"] .select-label { font-size: 10px; }
.side-panel[data-subtitle-size="medium"] .library-select { font-size: 12px; }
.side-panel[data-subtitle-size="medium"] .library-meta { font-size: 10px; }
.side-panel[data-subtitle-size="medium"] .dictionary-intro { font-size: 9px; }
.side-panel[data-subtitle-size="medium"] .dictionary-search input { font-size: 12px; }
.side-panel[data-subtitle-size="medium"] .dictionary-mode,
.side-panel[data-subtitle-size="medium"] .dictionary-mode strong { font-size: 9px; }
.side-panel[data-subtitle-size="medium"] .dictionary-word-en { font-size: 11px; }
.side-panel[data-subtitle-size="medium"] .dictionary-word-zh { font-size: 9px; }
.side-panel[data-subtitle-size="medium"] .dictionary-section-label { font-size: 10px; }
.side-panel[data-subtitle-size="medium"] .dictionary-result-card strong { font-size: 12px; }
.side-panel[data-subtitle-size="medium"] .dictionary-result-card span,
.side-panel[data-subtitle-size="medium"] .dictionary-phrase-item span,
.side-panel[data-subtitle-size="medium"] .dictionary-example span { font-size: 10px; }
.side-panel[data-subtitle-size="medium"] .dictionary-phrase-item strong,
.side-panel[data-subtitle-size="medium"] .dictionary-example strong { font-size: 11px; }
.side-panel[data-subtitle-size="medium"] .rule-heading { font-size: 10px; }
.side-panel[data-subtitle-size="medium"] .rule-panel p { font-size: 10px; }
.side-panel[data-subtitle-size="medium"] .collection-title-row p { font-size: 10px; }
.side-panel[data-subtitle-size="medium"] .latest-word-heading { font-size: 9px; }
.side-panel[data-subtitle-size="medium"] .latest-word-heading strong { font-size: 10px; }
.side-panel[data-subtitle-size="medium"] .latest-word-name-row > strong { font-size: 12px; }
.side-panel[data-subtitle-size="medium"] .latest-word-name-row > span { font-size: 10px; }
.side-panel[data-subtitle-size="medium"] .collection-button,
.side-panel[data-subtitle-size="medium"] .import-button { font-size: 11px; }
.side-panel[data-subtitle-size="medium"] .import-hint { font-size: 9px; }
.side-panel[data-subtitle-size="medium"] .stat small { font-size: 10px; }
.side-panel[data-subtitle-size="medium"] .guide-step p { font-size: 11px; }
.side-panel[data-subtitle-size="medium"] .tip-card p { font-size: 10px; }
.side-panel[data-subtitle-size="medium"] .level-link { font-size: 11px; }
.side-panel[data-subtitle-size="medium"] .side-footer { font-size: 10px; }

/* 大号：适合希望优先看清中文说明的玩家。 */
.side-panel[data-subtitle-size="large"] .brand-copy { font-size: 13px; }
.side-panel[data-subtitle-size="large"] .card-heading { font-size: 15px; }
.side-panel[data-subtitle-size="large"] .select-label { font-size: 11px; }
.side-panel[data-subtitle-size="large"] .library-select { font-size: 13px; }
.side-panel[data-subtitle-size="large"] .library-meta { font-size: 11px; }
.side-panel[data-subtitle-size="large"] .dictionary-intro { font-size: 11px; }
.side-panel[data-subtitle-size="large"] .dictionary-search input { font-size: 13px; }
.side-panel[data-subtitle-size="large"] .dictionary-mode,
.side-panel[data-subtitle-size="large"] .dictionary-mode strong { font-size: 10px; }
.side-panel[data-subtitle-size="large"] .dictionary-word-en { font-size: 13px; }
.side-panel[data-subtitle-size="large"] .dictionary-word-zh { font-size: 11px; }
.side-panel[data-subtitle-size="large"] .dictionary-section-label { font-size: 11px; }
.side-panel[data-subtitle-size="large"] .dictionary-result-card strong { font-size: 13px; }
.side-panel[data-subtitle-size="large"] .dictionary-result-card span,
.side-panel[data-subtitle-size="large"] .dictionary-phrase-item span,
.side-panel[data-subtitle-size="large"] .dictionary-example span { font-size: 11px; }
.side-panel[data-subtitle-size="large"] .dictionary-phrase-item strong,
.side-panel[data-subtitle-size="large"] .dictionary-example strong { font-size: 12px; }
.side-panel[data-subtitle-size="large"] .rule-heading { font-size: 11px; }
.side-panel[data-subtitle-size="large"] .rule-panel p { font-size: 11px; }
.side-panel[data-subtitle-size="large"] .collection-title-row p { font-size: 11px; }
.side-panel[data-subtitle-size="large"] .latest-word-heading { font-size: 10px; }
.side-panel[data-subtitle-size="large"] .latest-word-heading strong { font-size: 11px; }
.side-panel[data-subtitle-size="large"] .latest-word-name-row > strong { font-size: 14px; }
.side-panel[data-subtitle-size="large"] .latest-word-name-row > span { font-size: 11px; }
.side-panel[data-subtitle-size="large"] .collection-button,
.side-panel[data-subtitle-size="large"] .import-button { font-size: 12px; }
.side-panel[data-subtitle-size="large"] .import-hint { font-size: 10px; }
.side-panel[data-subtitle-size="large"] .stat small { font-size: 11px; }
.side-panel[data-subtitle-size="large"] .guide-step p { font-size: 12px; }
.side-panel[data-subtitle-size="large"] .tip-card p { font-size: 11px; }
.side-panel[data-subtitle-size="large"] .level-link { font-size: 12px; }
.side-panel[data-subtitle-size="large"] .side-footer { font-size: 11px; }

/* 小号：给 16:9 短屏和希望一次显示更多内容的玩家。 */
.side-panel[data-subtitle-size="small"] .brand-copy { font-size: 9px; }
.side-panel[data-subtitle-size="small"] .card-heading { font-size: 11px; }
.side-panel[data-subtitle-size="small"] .select-label { font-size: 8px; }
.side-panel[data-subtitle-size="small"] .library-select { font-size: 10px; }
.side-panel[data-subtitle-size="small"] .library-meta { font-size: 8px; }
.side-panel[data-subtitle-size="small"] .dictionary-intro { font-size: 8px; }
.side-panel[data-subtitle-size="small"] .dictionary-search input { font-size: 10px; }
.side-panel[data-subtitle-size="small"] .dictionary-mode,
.side-panel[data-subtitle-size="small"] .dictionary-mode strong { font-size: 8px; }
.side-panel[data-subtitle-size="small"] .dictionary-word-en { font-size: 10px; }
.side-panel[data-subtitle-size="small"] .dictionary-word-zh { font-size: 8px; }
.side-panel[data-subtitle-size="small"] .dictionary-section-label { font-size: 8px; }
.side-panel[data-subtitle-size="small"] .dictionary-result-card strong { font-size: 10px; }
.side-panel[data-subtitle-size="small"] .dictionary-result-card span,
.side-panel[data-subtitle-size="small"] .dictionary-phrase-item span,
.side-panel[data-subtitle-size="small"] .dictionary-example span { font-size: 8px; }
.side-panel[data-subtitle-size="small"] .dictionary-phrase-item strong,
.side-panel[data-subtitle-size="small"] .dictionary-example strong { font-size: 9px; }
.side-panel[data-subtitle-size="small"] .rule-heading { font-size: 8px; }
.side-panel[data-subtitle-size="small"] .rule-panel p { font-size: 8px; }
.side-panel[data-subtitle-size="small"] .collection-title-row p { font-size: 9px; }
.side-panel[data-subtitle-size="small"] .latest-word-heading { font-size: 8px; }
.side-panel[data-subtitle-size="small"] .latest-word-heading strong { font-size: 9px; }
.side-panel[data-subtitle-size="small"] .latest-word-name-row > strong { font-size: 11px; }
.side-panel[data-subtitle-size="small"] .latest-word-name-row > span { font-size: 8px; }
.side-panel[data-subtitle-size="small"] .collection-button,
.side-panel[data-subtitle-size="small"] .import-button { font-size: 10px; }
.side-panel[data-subtitle-size="small"] .import-hint { font-size: 8px; }
.side-panel[data-subtitle-size="small"] .stat small { font-size: 9px; }
.side-panel[data-subtitle-size="small"] .guide-step p { font-size: 9px; }
.side-panel[data-subtitle-size="small"] .tip-card p { font-size: 8px; }
.side-panel[data-subtitle-size="small"] .level-link { font-size: 10px; }
.side-panel[data-subtitle-size="small"] .side-footer { font-size: 9px; }

@media (max-width: 680px) {
  .subtitle-size-control { gap: 7px; margin-top: 8px; padding: 7px 8px; }
  .subtitle-size-label { font-size: 10px; }
  .subtitle-size-btn { min-width: 25px; padding: 4px 6px; font-size: 10px; }
}

@media (min-width: 901px) and (max-height: 760px) {
  .subtitle-size-control { margin-top: 5px; padding-block: 5px; }
}

/* 抽卡风格的收集册卡片 */
.rarity-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: -4px 0 15px;
  padding: 8px 10px;
  border: 1px solid rgba(100,72,42,.13);
  border-radius: 12px;
  background: rgba(255,248,234,.58);
}
.rarity-legend-title {
  margin-right: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}
.rarity-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}
.rarity-legend-item b {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  padding: 3px 5px;
  border-radius: 999px;
  color: #fff;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
}
.rarity-legend-r b { background: #5b9f88; }
.rarity-legend-sr b { background: #6676c9; }
.rarity-legend-ssr b { background: linear-gradient(135deg, #e789a3, #c57bdb 55%, #e5ad4d); }

.collection-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.collection-word {
  --rarity-main: #5b9f88;
  --rarity-deep: #286b59;
  --rarity-soft: rgba(91,159,136,.17);
  --rarity-shine: rgba(255,255,255,.7);
  --rarity-shadow: rgba(40,107,89,.24);
  min-height: 188px;
  padding: 12px 11px 11px;
  border: 2px solid var(--rarity-main);
  border-radius: 17px;
  background:
    radial-gradient(circle at 85% 10%, rgba(255,255,255,.9) 0 2px, transparent 3px),
    linear-gradient(145deg, rgba(255,255,255,.96), var(--rarity-soft));
  box-shadow: 0 5px 0 var(--rarity-shadow), 0 10px 20px rgba(100,72,42,.1);
  isolation: isolate;
  transform: translateY(0) rotate(0deg);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.collection-word:hover {
  z-index: 2;
  transform: translateY(-7px) rotate(-1.5deg) scale(1.025);
  box-shadow: 0 8px 0 var(--rarity-shadow), 0 18px 30px rgba(100,72,42,.2);
  filter: saturate(1.08);
}
.collection-word::before {
  z-index: -1;
  height: 9px;
  background: linear-gradient(90deg, var(--rarity-main), var(--rarity-shine), var(--rarity-main));
}
.collection-word::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -35%;
  left: -35%;
  width: 32%;
  height: 170%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.68), transparent);
  opacity: 0;
  transform: rotate(22deg);
  pointer-events: none;
}
.collection-word:hover::after {
  opacity: 1;
  animation: collection-card-shine .75s ease both;
}
@keyframes collection-card-shine {
  from { left: -35%; }
  to { left: 125%; }
}
.collection-rarity-r {
  --rarity-main: #63ab91;
  --rarity-deep: #286b59;
  --rarity-soft: rgba(99,171,145,.18);
  --rarity-shadow: rgba(40,107,89,.24);
}
.collection-rarity-sr {
  --rarity-main: #7284dc;
  --rarity-deep: #4655a0;
  --rarity-soft: rgba(114,132,220,.2);
  --rarity-shine: rgba(221,228,255,.95);
  --rarity-shadow: rgba(70,85,160,.24);
}
.collection-rarity-ssr {
  --rarity-main: #e49a5d;
  --rarity-deep: #a94c70;
  --rarity-soft: rgba(235,164,112,.24);
  --rarity-shine: #fff2a5;
  --rarity-shadow: rgba(169,76,112,.26);
  border-color: #d88b65;
  background:
    radial-gradient(circle at 85% 10%, rgba(255,255,255,.95) 0 2px, transparent 3px),
    radial-gradient(circle at 12% 85%, rgba(255,255,255,.65) 0 1px, transparent 2px),
    linear-gradient(145deg, #fffaf0, #f6d9eb 53%, #f9e5a8);
  box-shadow: 0 5px 0 rgba(169,76,112,.26), 0 0 0 2px rgba(255,215,111,.25), 0 12px 27px rgba(194,106,127,.2);
}
.collection-card-glow {
  position: absolute;
  right: -24px;
  bottom: -30px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--rarity-shine), transparent 67%);
  opacity: .45;
  pointer-events: none;
}
.collection-rarity-ssr .collection-card-glow { opacity: .72; }
.collection-card-sparkle {
  position: absolute;
  color: var(--rarity-main);
  font-size: 13px;
  line-height: 1;
  opacity: .78;
  pointer-events: none;
  animation: collection-sparkle 2.6s ease-in-out infinite;
}
.collection-card-sparkle-one { top: 29px; right: 13px; }
.collection-card-sparkle-two { right: 30px; bottom: 47px; font-size: 10px; animation-delay: -1.1s; }
.collection-rarity-ssr .collection-card-sparkle { color: #d58b4e; font-size: 16px; }
@keyframes collection-sparkle {
  0%, 100% { opacity: .35; transform: scale(.8) rotate(0); }
  50% { opacity: .95; transform: scale(1.18) rotate(14deg); }
}
.collection-card-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 25px;
}
.rarity-badge {
  display: inline-grid;
  place-items: center;
  min-width: 35px;
  padding: 5px 7px;
  border: 2px solid rgba(255,255,255,.72);
  border-radius: 8px 8px 10px 10px;
  background: linear-gradient(135deg, var(--rarity-main), var(--rarity-deep));
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .04em;
  line-height: 1;
  box-shadow: 0 3px 0 var(--rarity-shadow);
}
.collection-rarity-ssr .rarity-badge {
  border-color: #fff1a9;
  background: linear-gradient(135deg, #e9899c, #ba70c9 52%, #d79542);
  color: #fffbea;
  box-shadow: 0 0 14px rgba(229,173,77,.45), 0 3px 0 rgba(169,76,112,.25);
}
.collection-word .learned-mark {
  position: static;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255,255,255,.75);
  border-radius: 50%;
  background: var(--rarity-main);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 2px 0 rgba(100,72,42,.14);
}
.collection-card-kicker {
  position: relative;
  z-index: 1;
  margin: 12px 0 5px;
  color: var(--rarity-deep);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .12em;
  opacity: .78;
}
.collection-word h3 {
  position: relative;
  z-index: 1;
  margin: 0;
  overflow: hidden;
  color: var(--rarity-deep);
  font-size: 21px;
  line-height: 1.1;
  letter-spacing: -.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collection-card-meaning {
  position: relative;
  z-index: 1;
  min-height: 22px;
  margin: 5px 0 0;
  overflow: hidden;
  color: #a94c59;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collection-card-footer {
  position: absolute;
  right: 11px;
  bottom: 11px;
  left: 11px;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid rgba(100,72,42,.18);
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}
.collection-card-footer span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collection-card-footer strong {
  flex: none;
  color: var(--rarity-deep);
  font-size: 9px;
  font-weight: 950;
}
.collection-card-seal {
  position: absolute;
  right: 11px;
  top: 73px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid rgba(100,72,42,.26);
  border-radius: 50%;
  color: var(--rarity-main);
  font-size: 17px;
  opacity: .5;
  transform: rotate(12deg);
}
.collection-rarity-ssr .collection-card-seal { color: #d58b4e; opacity: .72; }

@media (max-width: 680px) {
  .rarity-legend { gap: 6px; margin-bottom: 12px; padding: 7px 8px; }
  .rarity-legend-title { font-size: 9px; }
  .rarity-legend-item { font-size: 8px; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .collection-word { min-height: 174px; padding-inline: 9px; }
  .collection-word h3 { font-size: 18px; }
  .collection-card-meaning { font-size: 12px; }
  .collection-card-footer { right: 9px; bottom: 9px; left: 9px; }
  .collection-card-seal { right: 9px; top: 70px; width: 28px; height: 28px; font-size: 15px; }
}

.collection-card-reveal {
  animation: collection-card-reveal .72s cubic-bezier(.2,.82,.24,1.18) both;
}
@keyframes collection-card-reveal {
  0% { opacity: 0; transform: translateY(24px) rotate(-8deg) scale(.7); filter: brightness(1.7) saturate(1.5); }
  62% { opacity: 1; transform: translateY(-8px) rotate(2deg) scale(1.06); filter: brightness(1.18) saturate(1.15); }
  100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); filter: none; }
}

/* 顶部导航：游戏页与独立收集册页之间的轻量切换入口。 */
.top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.top-nav-btn {
  flex: none;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(35,93,75,.25);
  color: rgba(255,248,235,.78);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, color .16s ease;
}
.top-nav-btn:hover,
.top-nav-btn.is-active {
  background: #fff8ea;
  color: var(--green-deep);
}
.top-nav-btn:hover { transform: translateY(-2px); }
.top-nav-btn:active { transform: translateY(1px); }
.panel-dock {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: min(32vw, 280px);
  overflow-x: auto;
  scrollbar-width: none;
}
.panel-dock::-webkit-scrollbar { display: none; }
.panel-dock.is-empty { display: none; }
.panel-dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  background: rgba(251,201,104,.92);
  color: var(--ink);
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(100,72,42,.12);
  transition: transform .16s ease, filter .16s ease;
}
.panel-dock-btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.panel-dock-btn:active { transform: translateY(1px); }

/* 侧栏内容卡片化：每张卡都可以独立收起，并通过顶部 dock 恢复。 */
.side-card {
  position: relative;
  z-index: 1;
  box-shadow: 0 7px 0 rgba(100,72,42,.1), 0 12px 24px rgba(100,72,42,.08);
  transform: rotate(-.35deg);
  transition: opacity .2s ease, transform .2s ease, margin .2s ease;
}
.side-card:nth-of-type(even) { transform: rotate(.35deg); }
.side-card:hover { transform: translateY(-3px) rotate(0); }
.side-card.is-closed { display: none; }
.side-card-close {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(100,72,42,.1);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.side-card-close:hover {
  background: rgba(247,123,145,.28);
  color: var(--ink);
  transform: rotate(8deg) scale(1.05);
}
.side-card-close:active { transform: scale(.92); }

/* 独立收集册页面。游戏舞台和侧栏在 collection-view 状态下隐藏，收集册占满窗口。 */
.collection-page {
  display: none;
  grid-column: 1 / -1;
  min-width: 0;
  min-height: 100vh;
  overflow-y: auto;
  padding: clamp(24px, 4vw, 58px);
  background:
    radial-gradient(circle at 86% 12%, rgba(251,201,104,.32), transparent 24%),
    radial-gradient(circle at 8% 82%, rgba(94,183,247,.14), transparent 24%),
    linear-gradient(145deg, #fff8ea, #f4ead8);
}
.app-shell.collection-view .game-stage,
.app-shell.collection-view .side-panel { display: none; }
.app-shell.collection-view .collection-page { display: block; }
.collection-page-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto 22px;
}
.collection-page-topbar h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}
.collection-page-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}
.collection-back-btn {
  flex: none;
  padding: 10px 15px;
  border: 2px solid rgba(100,72,42,.2);
  border-radius: 999px;
  background: rgba(255,255,255,.6);
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease;
}
.collection-back-btn:hover { transform: translateY(-2px); background: #fff8ea; }
.collection-page-summary,
.collection-page .rarity-legend,
.collection-page .collection-filter-row,
.collection-page .collection-grid {
  width: min(1180px, 100%);
  margin-right: auto;
  margin-left: auto;
}
.collection-page-summary {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) auto minmax(250px, 1.6fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.collection-page-count {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}
.collection-page-count strong {
  color: #8d58be;
  font-size: 46px;
  line-height: 1;
}
.collection-page-badge {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 3px solid #d58b4e;
  border-radius: 22px;
  background: linear-gradient(135deg, #f8c96b, #ed9b8c 55%, #c47bd4);
  color: white;
  font-size: 25px;
  font-weight: 950;
  line-height: .8;
  transform: rotate(5deg);
  box-shadow: 0 7px 0 rgba(169,76,112,.17), 0 10px 22px rgba(169,76,112,.16);
}
.collection-page-badge small { margin-top: 3px; font-size: 9px; }
.collection-page .latest-word-slot { margin-top: 0; min-height: 68px; }
.collection-page .rarity-legend { margin-top: 0; margin-bottom: 13px; }
.collection-page .collection-filter-row { margin-bottom: 15px; }
.collection-page .collection-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

@media (min-width: 901px) and (max-height: 820px) {
  .top-nav-btn { padding-block: 6px; }
  .panel-dock-btn { padding-block: 4px; }
  .collection-page { padding-top: 28px; padding-bottom: 32px; }
  .collection-page-topbar { margin-bottom: 16px; }
}
@media (max-width: 900px) {
  .stage-header { flex-wrap: wrap; }
  .top-nav { order: -1; width: 100%; }
  .panel-dock { max-width: 100%; flex: 1 1 auto; }
  .collection-page { padding: 28px 20px 34px; }
  .collection-page-summary { grid-template-columns: 1fr auto; }
  .collection-page .latest-word-slot { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .top-nav { gap: 5px; }
  .top-nav-btn { padding: 6px 9px; font-size: 10px; }
  .panel-dock-btn { padding: 5px 7px; font-size: 8px; }
  .side-card-close { width: 20px; height: 20px; font-size: 15px; }
  .collection-page { padding: 22px 16px 30px; }
  .collection-page-topbar { flex-direction: column; gap: 14px; }
  .collection-page-topbar h2 { font-size: 32px; }
  .collection-page-subtitle { font-size: 12px; }
  .collection-page-count { font-size: 12px; }
  .collection-page-count strong { font-size: 38px; }
  .collection-page-badge { width: 62px; height: 62px; border-radius: 18px; font-size: 21px; }
  .collection-page .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 收集册进度卡：历史单词始终展示，累计次数越高，水位越高、色彩越饱和。 */
.collection-word {
  --collection-progress: 0;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .65s ease;
}
.collection-word:not(.is-collected) {
  border-color: #aeb5ba;
  box-shadow: 0 5px 0 rgba(93,101,106,.22), 0 10px 20px rgba(100,72,42,.08);
}
.collection-card-content {
  position: relative;
  z-index: 3;
  min-height: 164px;
  filter: grayscale(calc(1 - var(--collection-progress))) saturate(calc(.28 + var(--collection-progress) * .72));
  transition: filter .7s cubic-bezier(.2,.8,.25,1);
}
.collection-card-muted {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(145deg, rgba(221,225,227,.76), rgba(144,153,158,.58));
  opacity: calc(1 - var(--collection-progress));
  pointer-events: none;
  transition: opacity .7s cubic-bezier(.2,.8,.25,1);
}
.collection-card-water {
  position: absolute;
  z-index: 2;
  right: -5%;
  bottom: -2px;
  left: -5%;
  height: calc(var(--collection-progress) * 100%);
  min-height: 0;
  border-radius: 48% 48% 0 0 / 13px 13px 0 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rarity-main) 70%, white), var(--rarity-main));
  opacity: calc(.14 + (1 - var(--collection-progress)) * .58);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 -6px 15px color-mix(in srgb, var(--rarity-main) 28%, transparent);
  pointer-events: none;
  transition: height .72s cubic-bezier(.2,.8,.25,1), opacity .7s ease;
}
.collection-card-water::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 8%;
  left: 8%;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  filter: blur(1px);
  animation: collection-water-wave 2.8s ease-in-out infinite;
}
@keyframes collection-water-wave {
  0%, 100% { transform: translateX(-2%) scaleX(.98); opacity: .45; }
  50% { transform: translateX(2%) scaleX(1.02); opacity: .8; }
}
.collection-word.is-unstarted .rarity-badge,
.collection-word.is-unstarted .learned-mark {
  background: #929ba0;
  box-shadow: 0 3px 0 rgba(80,88,93,.22);
}
.collection-word.is-learning .learned-mark {
  background: #879ca3;
}
.collection-word.is-collected {
  border-color: var(--rarity-main);
}
.collection-word.is-collected .collection-card-muted { opacity: 0; }
.collection-word.is-collected .collection-card-water { opacity: .1; }
.collection-word.is-collected .learned-mark { background: var(--rarity-main); }
.collection-card-status { transition: color .65s ease; }
.collection-word:not(.is-collected) .collection-card-status { color: #778188; }
.collection-word.is-collected .collection-card-status { color: var(--rarity-deep); }
.collection-card-progress { font-variant-numeric: tabular-nums; }

@supports not (background: color-mix(in srgb, red 50%, white)) {
  .collection-card-water {
    background: linear-gradient(180deg, #c5d9de, var(--rarity-main));
    box-shadow: inset 0 2px 0 rgba(255,255,255,.5);
  }
}

@media (max-width: 680px) {
  .collection-card-content { min-height: 150px; }
  .collection-card-water { border-radius: 48% 48% 0 0 / 10px 10px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .collection-card-water::before { animation: none; }
}

.collection-progress-guide {
  width: min(1180px, 100%);
  margin: -4px auto 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.collection-progress-guide span {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  margin-right: 4px;
  border-radius: 50%;
  background: #aeb5ba;
  color: #fff;
  font-size: 12px;
  vertical-align: -4px;
}
@media (max-width: 680px) {
  .collection-progress-guide { margin-top: -2px; font-size: 9px; line-height: 1.45; }
}


/* 游戏卡片重设计：信息层级优先，避免标签、单词和提示互相挤压。 */
.card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  padding: 8px 7px 7px;
  border: 2px solid rgba(100,72,42,.88);
  border-radius: 16px 16px 18px 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.76), transparent 46%), var(--card);
  box-shadow: 0 5px 0 rgba(76,52,28,.24), 0 9px 15px rgba(49,54,29,.15);
}
.card::before {
  inset: 4px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 10px 10px 12px 12px;
}
.card::after {
  left: 16%;
  right: 16%;
  bottom: 5px;
  height: 3px;
  opacity: .72;
}
.card .accent {
  top: -2px;
  left: -2px;
  right: -2px;
  height: 7px;
  border-radius: 13px 13px 0 0;
}
.card .badge {
  position: relative;
  top: auto;
  left: auto;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: auto;
  min-width: 27px;
  height: 19px;
  padding: 2px 6px;
  border: 1px solid rgba(100,72,42,.16);
  border-radius: 999px;
  box-shadow: 0 2px 0 rgba(100,72,42,.12);
  font-size: 9px;
  line-height: 1;
  letter-spacing: .02em;
}
.card .badge b { font-size: inherit; font-weight: 950; }
.card .badge small { display: none; }
@media (min-width: 1000px) {
  .card .badge small { display: inline; font-size: 7px; font-weight: 800; opacity: .9; }
}
.card .badge.zh { background: #ed7188; }
.card .badge.en { background: #4ca9e9; font-size: 8px; }
.card .word {
  align-self: center;
  width: 100%;
  max-width: 100%;
  margin: 3px 0 0;
  padding: 0 1px;
  line-height: 1.05;
  text-overflow: ellipsis;
}
.card.en .word {
  color: #216b98;
  font-size: 15px;
  letter-spacing: -.055em;
}
.card.zh .word {
  color: #a44458;
  font-size: 19px;
  letter-spacing: 0;
}
.card-prompt {
  position: relative;
  z-index: 2;
  display: block;
  max-width: 100%;
  margin: 1px 0 1px;
  overflow: hidden;
  color: rgba(100,72,42,.62);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .04em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.card .pair-mark {
  right: 7px;
  top: 8px;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 1px 2px rgba(76,52,28,.18);
}
.card:not(.blocked):hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 10px 0 rgba(76,52,28,.21), 0 15px 20px rgba(49,54,29,.18);
}
.card:focus-visible {
  outline: 3px solid rgba(251,201,104,.95);
  outline-offset: 3px;
}

/* 卡槽中的信息保持同一套视觉语言，但去掉重复提示，优先保证单词可读。 */
.slot-card {
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  align-items: center;
  padding: 4px 3px 3px;
  border: 2px solid rgba(100,72,42,.82);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255,255,255,.76), transparent 48%), var(--card);
}
.slot-card .badge {
  position: relative;
  top: auto;
  left: auto;
  width: auto;
  min-width: 22px;
  height: 15px;
  padding: 2px 4px;
  border: 0;
  font-size: 7px;
  line-height: 1;
}
.slot-card .badge b { font-size: inherit; }
.slot-card .word {
  align-self: center;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 1px;
  line-height: 1.05;
  text-overflow: ellipsis;
}
.slot-card.en .word { font-size: 9px; letter-spacing: -.05em; }
.slot-card.zh .word { font-size: 12px; }
.slot-card .pair-mark { right: 3px; bottom: 3px; width: 5px; height: 5px; }

@media (max-width: 680px) {
  .card { padding: 7px 5px 6px; border-radius: 13px 13px 15px 15px; }
  .card .badge { min-width: 23px; height: 17px; padding-inline: 4px; font-size: 8px; }
  .card .badge.en { font-size: 7px; }
  .card .word { margin-top: 2px; }
  .card.en .word { font-size: 12px; }
  .card.zh .word { font-size: 16px; }
  .card-prompt { font-size: 6px; letter-spacing: 0; }
  .card .pair-mark { top: 7px; right: 5px; width: 6px; height: 6px; }
}

@media (max-width: 420px) {
  .card-prompt { display: none; }
  .card { padding-bottom: 7px; }
  .card .word { margin-top: 4px; }
}


/* 卡片只保留小色点：蓝点代表英文，红点代表中文，避免文字标签干扰阅读。 */
.card {
  grid-template-rows: 1fr;
}
.card .side-dot,
.slot-card .side-dot {
  position: absolute;
  z-index: 3;
  display: block;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(61,53,38,.24);
  pointer-events: none;
}
.card .side-dot { top: 9px; right: 9px; }
.card .side-dot.en,
.slot-card .side-dot.en { background: #4ca9e9; }
.card .side-dot.zh,
.slot-card .side-dot.zh { background: #ed7188; }
.card .badge,
.card-prompt,
.slot-card .badge { display: none; }
.slot-card {
  grid-template-rows: 1fr;
}
.slot-card .side-dot { top: 6px; right: 6px; width: 5px; height: 5px; }
@media (max-width: 680px) {
  .card .side-dot { top: 7px; right: 7px; width: 6px; height: 6px; }
}


/* 配对颜色提示：同一 pair 的中英文卡共用顶部色带、底部短线和轻微色晕。
   语言类型仍用右上角蓝/红小点表示，避免信息混在一起。 */
.card,
.slot-card {
  overflow: hidden;
}
.card {
  border-color: color-mix(in srgb, var(--tile-color, #64482a) 66%, #64482a);
  background: linear-gradient(145deg, rgba(255,255,255,.9), transparent 48%), var(--card);
  box-shadow:
    0 5px 0 color-mix(in srgb, var(--tile-color, #64482a) 30%, rgba(76,52,28,.24)),
    0 9px 16px rgba(49,54,29,.15),
    0 0 0 1px color-mix(in srgb, var(--tile-color, #64482a) 18%, transparent);
}
.card .accent {
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 0;
}
.card::after {
  background: var(--tile-color, var(--pink));
  box-shadow: 0 0 8px color-mix(in srgb, var(--tile-color, var(--pink)) 52%, transparent);
}
.slot-card {
  border-color: color-mix(in srgb, var(--tile-color, #64482a) 62%, #64482a);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--tile-color, #64482a) 28%, rgba(76,52,28,.22));
}
.slot-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--tile-color, var(--pink));
  pointer-events: none;
}
.card.blocked {
  filter: brightness(.8) saturate(.66);
}
@supports not (color: color-mix(in srgb, red 50%, white)) {
  .card {
    border-color: #a4866f;
    box-shadow: 0 5px 0 rgba(76,52,28,.24), 0 9px 16px rgba(49,54,29,.15);
  }
  .slot-card { border-color: #a4866f; }
}

/* 卡片进入卡槽后仍可点击复听，给出清晰的可操作反馈。 */
.slot-card {
  cursor: pointer;
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
}
.slot-card:hover {
  transform: translateY(-2px) scale(1.025);
  filter: brightness(1.04);
}
.slot-card:active {
  transform: translateY(1px) scale(.99);
}
.slot-card:focus-visible {
  outline: 3px solid rgba(251,201,104,.95);
  outline-offset: 2px;
}

/* 账号系统：封面登录、二次确认与像素头像制作 */
.cover-account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.cover-account-btn {
  min-height: 42px;
  padding: 9px 12px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: rgba(255,255,255,.72);
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(76,52,28,.14);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.cover-account-btn:hover {
  background: #fff8ea;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(76,52,28,.14);
}
.cover-account-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(76,52,28,.14);
}
.cover-account-btn-secondary {
  border-color: rgba(100,72,42,.38);
  background: rgba(251,201,104,.24);
}
.cover-account-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  margin-top: 13px;
  padding: 6px 10px 6px 7px;
  border: 1px solid rgba(100,72,42,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.58);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.cover-account-status strong {
  color: var(--ink);
  font-weight: 950;
}
.hidden { display: none !important; }

.account-overlay {
  position: fixed;
  z-index: 220;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 18px;
  background: rgba(35, 66, 52, .62);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.account-overlay.hidden { display: none; }
.account-dialog {
  width: min(720px, 100%);
  max-height: min(790px, calc(100svh - 36px));
  overflow: auto;
  padding: clamp(20px, 3vw, 32px);
  border: 3px solid var(--ink);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255,255,255,.8), transparent 34%), var(--cream);
  box-shadow: 0 14px 0 rgba(35,73,43,.25), 0 26px 70px rgba(23,54,42,.38);
  color: var(--ink);
  scrollbar-width: thin;
  scrollbar-color: rgba(100,72,42,.45) transparent;
}
.account-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.account-dialog-heading .eyebrow {
  margin: 0 0 5px;
  color: var(--green-deep);
}
.account-dialog-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 32px);
  letter-spacing: .03em;
}
.account-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.account-close-btn {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(100,72,42,.28);
  border-radius: 12px;
  background: rgba(255,255,255,.6);
  color: var(--ink);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
  transition: transform .16s ease, background .16s ease;
}
.account-close-btn:hover {
  background: #fff8ea;
  transform: rotate(5deg) scale(1.04);
}
.account-form { margin: 0; }
#accountFormView {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(280px, 1.1fr);
  gap: 18px 22px;
  align-items: start;
}
.account-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}
.account-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid rgba(100,72,42,.25);
  border-radius: 12px;
  outline: none;
  background: rgba(255,255,255,.72);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.account-field input::placeholder { color: rgba(148,121,98,.72); }
.account-field input:focus {
  border-color: var(--green-deep);
  background: #fffdf8;
  box-shadow: 0 0 0 4px rgba(94,183,247,.16);
}
.account-field-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
}
.account-field-status.is-exists { color: #bb5d62; }
.account-field-status.is-new { color: #438b68; }
.account-field-status.is-error { color: #bb5d62; }
.account-form-error {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: -2px 0 -4px;
  color: #b84f5c;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.4;
}
.account-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  grid-column: 1 / -1;
  margin-top: 2px;
}
.account-cancel-btn,
.account-confirm-btn {
  min-height: 42px;
  padding: 9px 17px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.account-cancel-btn {
  background: rgba(255,255,255,.7);
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(76,52,28,.12);
}
.account-confirm-btn {
  background: var(--green-deep);
  color: #fff8ea;
  box-shadow: 0 4px 0 rgba(35,93,75,.25);
}
.account-cancel-btn:hover,
.account-confirm-btn:hover {
  transform: translateY(-2px);
}
.account-cancel-btn:hover { background: #fff8ea; }
.account-confirm-btn:hover { background: #2d765c; box-shadow: 0 6px 0 rgba(35,93,75,.25); }
.account-cancel-btn:active,
.account-confirm-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(76,52,28,.14);
}

.avatar-maker {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
  padding: 15px;
  border: 2px solid rgba(100,72,42,.17);
  border-radius: 18px;
  background: rgba(255,255,255,.44);
}
.avatar-maker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}
.avatar-maker-heading > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.avatar-maker-heading > div > span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
}
.avatar-maker-heading small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.avatar-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 13px;
}
.avatar-preset {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  padding: 6px 4px 5px;
  border: 1px solid rgba(100,72,42,.16);
  border-radius: 11px;
  background: rgba(255,248,234,.68);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}
.avatar-preset:hover {
  border-color: rgba(100,72,42,.5);
  background: #fff8ea;
  transform: translateY(-2px);
}
.avatar-preset small {
  overflow: hidden;
  max-width: 100%;
  font-size: 9px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar-editor-label {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}
.avatar-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 10px;
}
.avatar-color {
  position: relative;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 2px solid rgba(100,72,42,.25);
  border-radius: 8px;
  background: var(--avatar-color);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.avatar-color:hover { transform: translateY(-2px); }
.avatar-color.is-selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(251,201,104,.5), 0 3px 0 rgba(76,52,28,.14);
  transform: translateY(-1px);
}
.avatar-color.is-eraser,
.avatar-editor-cell.is-empty,
.avatar-pixel.is-empty {
  background-color: #fff8ea;
  background-image: linear-gradient(45deg, rgba(148,121,98,.13) 25%, transparent 25%, transparent 75%, rgba(148,121,98,.13) 75%), linear-gradient(45deg, rgba(148,121,98,.13) 25%, transparent 25%, transparent 75%, rgba(148,121,98,.13) 75%);
  background-position: 0 0, 5px 5px;
  background-size: 10px 10px;
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  width: min(100%, 220px);
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 7px;
  border: 2px solid rgba(100,72,42,.28);
  border-radius: 15px;
  background: #e9d8bd;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.45);
}
.avatar-editor-cell {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(100,72,42,.18);
  border-radius: 5px;
  background: var(--avatar-color);
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.avatar-editor-cell:hover {
  z-index: 1;
  filter: brightness(1.08);
  transform: scale(1.08);
}
.avatar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  flex: 0 0 auto;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff8ea;
  box-shadow: 0 3px 0 rgba(76,52,28,.16);
}
.avatar-pixel { min-width: 0; min-height: 0; background: var(--avatar-color); }
.avatar-pixel.is-empty { background-color: #fff8ea; }
.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 16px;
}
.avatar-preset-preview {
  width: 39px;
  height: 39px;
  border-width: 1px;
  border-radius: 9px;
  box-shadow: none;
}
.avatar-small {
  width: 27px;
  height: 27px;
  border-width: 1px;
  border-radius: 8px;
  box-shadow: none;
}
.avatar-confirm {
  width: 92px;
  height: 92px;
  border-radius: 19px;
}

.account-confirm-view {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 8px 4px 2px;
  text-align: center;
}
.account-confirm-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 0 5px 0 rgba(76,52,28,.18);
  font-size: 30px;
  font-weight: 950;
}
.account-confirm-view h3 {
  margin: 1px 0 0;
  color: var(--ink);
  font-size: 24px;
}
.account-confirm-view > p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
}
.account-confirm-profile {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 2px;
  padding: 9px 17px 9px 9px;
  border: 2px solid rgba(100,72,42,.18);
  border-radius: 16px;
  background: rgba(255,255,255,.65);
}
.account-confirm-profile strong {
  max-width: min(360px, 55vw);
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-confirm-tip {
  padding: 8px 12px;
  border: 1px dashed rgba(100,72,42,.25);
  border-radius: 10px;
  background: rgba(251,201,104,.16);
}

@media (max-width: 680px) {
  .cover-account-actions { gap: 8px; }
  .cover-account-btn { min-height: 40px; padding-inline: 8px; font-size: 11px; }
  .account-overlay { align-items: start; padding: 12px; }
  .account-dialog {
    max-height: calc(100svh - 24px);
    overflow-y: auto;
    padding: 20px;
    border-radius: 23px;
  }
  #accountFormView {
    display: flex;
    flex-direction: column;
    gap: 13px;
  }
  .avatar-maker { width: 100%; }
  .account-form-error { order: 3; margin-top: 0; }
  .account-dialog-actions {
    position: sticky;
    bottom: -20px;
    z-index: 2;
    width: calc(100% + 40px);
    margin: 0 -20px -20px;
    padding: 12px 20px 20px;
    background: linear-gradient(to bottom, transparent, var(--cream) 32%);
  }
}

@media (max-width: 390px) {
  .cover-account-actions { grid-template-columns: 1fr; }
  .account-dialog-heading { gap: 10px; }
  .account-subtitle { font-size: 11px; }
  .avatar-maker { padding: 12px; }
  .avatar-preview { width: 60px; height: 60px; }
  .account-confirm-profile strong { max-width: 48vw; }
}

/* 游戏页账号操作：紧凑放在右上角，随屏幕宽度自适配 */
.game-account-btn,
.game-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 13px;
  background: rgba(35,93,75,.32);
  color: #fff8eb;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.game-account-btn {
  justify-content: flex-start;
  gap: 7px;
  min-width: 42px;
  max-width: 150px;
  padding: 5px 10px 5px 6px;
}
.game-account-btn > span:last-child {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-account-btn .avatar-small {
  width: 29px;
  height: 29px;
  border-color: rgba(255,255,255,.75);
  box-shadow: 0 2px 0 rgba(24,63,49,.24);
}
.game-logout-btn {
  padding: 0 11px;
  border-color: rgba(255,220,220,.34);
  background: rgba(151,65,75,.3);
  color: #fff4ef;
}
.game-account-btn:hover,
.game-logout-btn:hover {
  transform: translateY(-2px);
  background: rgba(35,93,75,.62);
}
.game-logout-btn:hover {
  border-color: rgba(255,220,220,.58);
  background: rgba(169,70,80,.58);
}
.game-account-btn:active,
.game-logout-btn:active {
  transform: translateY(1px);
}
.game-account-btn:focus-visible,
.game-logout-btn:focus-visible {
  outline: 3px solid rgba(251,201,104,.95);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .game-account-btn {
    max-width: 108px;
    padding-right: 7px;
  }
  .game-account-btn > span:last-child { max-width: 62px; }
  .game-logout-btn { padding-inline: 8px; }
}

@media (max-width: 560px) {
  .stage-header {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .stage-status { order: 1; }
  .combo-hud { order: 2; }
  .stage-level { order: 3; margin-left: auto; }
  .stage-actions {
    order: 3;
    width: 100%;
    justify-content: flex-end;
  }
  .game-account-btn,
  .game-logout-btn,
  .icon-button {
    min-height: 34px;
    border-radius: 10px;
  }
  .game-account-btn { max-width: 130px; }
  .game-account-btn .avatar-small { width: 24px; height: 24px; }
  .game-logout-btn { font-size: 10px; }
}

@media (max-width: 390px) {
  .game-account-btn { max-width: 112px; }
  .game-account-btn > span:last-child { max-width: 52px; }
  .game-logout-btn { padding-inline: 7px; }
}
