:root {
  --ink: #f3fbff;
  --soft: #d5eef5;
  --gold: #ffe08a;
  --juice: #7ecfff;
  --font: "Noto Sans SC", "PingFang SC", sans-serif;
  --display: "Fredoka", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: #071c22;
}

button, a { font-family: inherit; }

button { cursor: pointer; border: 0; color: inherit; }

.hidden { display: none !important; }

/* display 写死的元素（.synth、.tube-veil…）也要听 hidden 属性。 */
[hidden] { display: none !important; }

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

.app {
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

.lab-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 28% at 50% 8%, rgba(160, 230, 255, 0.28), transparent 70%),
    linear-gradient(180deg, #1a6270 0%, #0d3a44 42%, #12323a 70%, #071c22 100%);
}

.window {
  position: absolute;
  left: 50%;
  top: 6vh;
  width: min(280px, 34vw);
  height: 18vh;
  transform: translateX(-50%);
  border-radius: 140px 140px 18px 18px;
  background:
    radial-gradient(circle at 50% 42%, #fff6c8 0 18%, transparent 19%),
    linear-gradient(180deg, #d8f6ff, #8fd4ea 70%, #5aa8c4);
  box-shadow: inset 0 0 0 8px #1a4450, 0 12px 30px rgba(0, 0, 0, 0.2);
}

.shelf {
  position: absolute;
  width: min(230px, 24vw);
  height: 92px;
  border-bottom: 8px solid #6a4328;
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.18);
}

.shelf.left { left: 2vw; }
.shelf.right { right: 2vw; }
.shelf.high { top: 18vh; }
.shelf.low { top: 36vh; }
.shelf.left.high { display: none; }

.shelf i {
  position: absolute;
  bottom: 8px;
  display: block;
  width: 26px;
  height: 58px;
  border-radius: 6px 6px 8px 8px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.45), transparent 36%), #3ec8d8;
}

.shelf i::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 6px;
  width: 10px;
  height: 14px;
  background: rgba(255, 255, 255, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-bottom: 0;
}

.shelf i:nth-child(1) { left: 12px; background: linear-gradient(90deg, rgba(255,255,255,.4), transparent 36%), #3ec8d8; }
.shelf i:nth-child(2) { left: 58px; height: 46px; background: linear-gradient(90deg, rgba(255,255,255,.4), transparent 36%), #c9a0ff; }
.shelf i:nth-child(3) { left: 104px; height: 64px; background: linear-gradient(90deg, rgba(255,255,255,.4), transparent 36%), #ffd36a; }
.shelf i:nth-child(4) { left: 154px; }

.flask {
  width: 36px !important;
  height: 42px !important;
  border-radius: 4px 4px 18px 18px !important;
  background: linear-gradient(90deg, rgba(255,255,255,.4), transparent 36%), #7dffc3 !important;
}

.jar {
  width: 34px !important;
  height: 40px !important;
  border-radius: 8px !important;
  background: linear-gradient(90deg, rgba(255,255,255,.4), transparent 36%), #ff9ab6 !important;
}

.floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24vh;
  background: linear-gradient(180deg, #c4894e, #6a3d22 28%, #3a2416 100%);
  border-top: 6px solid #e7c091;
  box-shadow: inset 0 18px 24px rgba(255, 220, 170, 0.18);
}

.screen {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
}

.panel {
  background:
    linear-gradient(180deg, rgba(190, 240, 255, 0.14), transparent 42%),
    rgba(7, 28, 36, 0.72);
  border: 1px solid rgba(190, 236, 255, 0.28);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.kicker, .title-en {
  margin: 0;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
}

h1, h2, h3 { font-family: var(--display); }

.title-stack {
  position: absolute;
  left: 28px;
  top: 28px;
  width: min(520px, calc(100% - 220px));
  padding: 22px 24px 18px;
  border-radius: 24px;
}

.title-stack h1 {
  margin: 8px 0 0;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.05;
}

.title-en { margin-top: 8px; }

.home-progress {
  position: absolute;
  right: 28px;
  top: 28px;
  z-index: 2;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(7, 28, 36, 0.72);
  border: 1px solid rgba(190, 236, 255, 0.28);
  font-weight: 800;
}

.home-panel {
  position: absolute;
  left: 28px;
  bottom: 28px;
  width: min(540px, 46vw);
  padding: 20px 22px 18px;
  border-radius: 24px;
}

.lede {
  margin: 0;
  color: var(--soft);
  line-height: 1.65;
}

.home-hero {
  position: absolute;
  right: 2vw;
  bottom: 3vh;
  width: min(460px, 42vw);
  height: 48vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}

.actions, .prompt-actions, .header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.actions { margin-top: 16px; }

.primary, .ghost, .back, .link-btn, .listen, .lookup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}

.primary {
  color: #083038;
  background: linear-gradient(180deg, #d9fbff, #3ec8d8);
  border: 2px solid #0e6e78;
  box-shadow: 0 4px 0 #0a4c54;
}

.primary.big { min-height: 52px; padding: 0 22px; font-size: 18px; }

.ghost, .back, .link-btn {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(190, 236, 255, 0.35);
}

.listen {
  color: #083038;
  background: #ffe08a;
  border: 2px solid #a57b22;
}

.panel-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.panel.wide {
  width: min(1080px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  padding: 22px;
  border-radius: 28px;
}

.panel header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel h2 { margin: 4px 0 0; font-size: clamp(28px, 4vw, 40px); }

.help-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.help-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(190, 236, 255, 0.16);
}

.help-card strong { display: block; margin-bottom: 6px; }
.help-card p { margin: 0; color: var(--soft); line-height: 1.55; }

.rule-table {
  width: 100%;
  margin-top: 18px;
  border-collapse: collapse;
  font-size: 15px;
}

.rule-table caption {
  margin-bottom: 8px;
  text-align: left;
  font-weight: 800;
  color: var(--gold);
}

.rule-table th, .rule-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(190, 236, 255, 0.16);
  vertical-align: top;
}

.rule-table th { color: #b8f6ff; }

.level-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.level-stage {
  grid-column: 1 / -1;
  margin: 12px 0 0;
  color: var(--gold);
  font-size: 17px;
}

.level-stage:first-child { margin-top: 0; }
.level-copy { min-width: 0; }
.level-copy .sample { overflow-wrap: anywhere; }
.structure-note { margin-top: 14px; }

.lesson-panel { max-width: 880px; }
.lesson-rule {
  padding: 16px 18px;
  border-radius: 18px;
  background: #fff4cc;
  color: #083038;
  line-height: 1.7;
}
.lesson-examples {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.lesson-example {
  padding: 14px 18px;
  border: 1px solid rgba(190, 236, 255, 0.25);
  border-radius: 18px;
  background: rgba(8, 40, 48, 0.55);
}
.lesson-example p { margin: 0 0 10px; line-height: 1.6; }
.lesson-example .example-pair {
  color: var(--gold);
  font-family: var(--display);
  font-size: clamp(20px, 3vw, 28px);
  overflow-wrap: anywhere;
}
.question-phase { margin-bottom: 6px; }
.answer-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(760px, 100%);
  margin: 20px auto 0;
  padding: 16px 18px;
  border: 2px solid #97e6c7;
  border-radius: 20px;
  color: var(--ink);
  background: #103c3d;
}
.answer-feedback p { margin: 0; line-height: 1.65; }
.answer-feedback .primary { flex-shrink: 0; }

.level-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  width: 100%;
  padding: 14px;
  text-align: left;
  color: var(--ink);
  background: rgba(8, 40, 48, 0.55);
  border: 2px solid rgba(184, 246, 255, 0.28);
  border-radius: 20px;
}

.level-card.done { border-color: var(--gold); }

.level-card:hover { transform: translateY(-2px); }

.seal {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #14586a;
  color: #d9fbff;
  font-family: var(--display);
  font-size: 22px;
}

.level-copy { display: grid; gap: 4px; }
.level-copy strong { font-size: 20px; }
.level-copy em { color: #9fd8ea; font-style: normal; font-size: 13px; }
.level-copy p { margin: 0; color: var(--soft); line-height: 1.45; }
.sample, .meta { font-size: 13px; }
.sample { font-family: var(--display); color: #ffe08a; }
.meta { color: #b7d5df; }

.lab {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(280px, 1fr) auto;
  padding: 16px 16px 6vh;
  position: relative;
}

.play-hud, .rule-banner { position: relative; z-index: 2; }

.play-hud {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.board {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(7, 28, 36, 0.72);
  border: 1px solid rgba(190, 236, 255, 0.24);
}

.board h2 { margin: 4px 0 0; font-size: clamp(22px, 3vw, 32px); }

.status {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.status p { margin: 0; font-weight: 800; }

.rule-banner {
  width: min(760px, 100%);
  margin: 10px auto 0;
  padding: 12px 16px 14px;
  text-align: center;
  border-radius: 22px;
  background: rgba(7, 28, 36, 0.82);
  border: 1px solid rgba(190, 236, 255, 0.28);
}

.ask {
  margin: 0;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 900;
}

#play-hint {
  margin: 6px auto 0;
  max-width: 42em;
  color: #d7f6ff;
  line-height: 1.5;
}

.hint-line {
  margin: 8px auto 0;
  max-width: 42em;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 224, 138, 0.16);
  color: #ffe7a8;
  line-height: 1.55;
}

.prompt-actions { justify-content: center; margin-top: 10px; }
.prompt-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.bench {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(12px, 4vw, 56px);
  min-height: 0;
}

.home-hero .bench.demo {
  flex: none;
  gap: 16px;
  width: max-content;
  transform: scale(0.72);
  transform-origin: center bottom;
}

.home-hero .beaker { width: 168px; }
.home-hero .tube-wrap { width: 132px; }
.home-hero .cup { height: 240px; min-height: 0; }
.home-hero .glass { height: 300px; min-height: 0; }

.beaker {
  width: min(30vw, 230px);
  display: flex;
  flex-direction: column;
  align-items: center;
  --juice: #3ee0a0;
}

.beaker-tag, .tube-caption, .reaction {
  margin: 0;
  font-weight: 800;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.beaker-tag { margin-bottom: 8px; }

.cup {
  position: relative;
  width: 100%;
  height: min(42vh, 320px);
  min-height: 220px;
  padding: 0;
  border-radius: 10px 10px 22px 22px;
  background: transparent;
  filter: drop-shadow(0 16px 10px rgba(0, 0, 0, 0.28));
}

.glass-body {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  border: 3px solid rgba(255, 255, 255, 0.78);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.05) 32%, rgba(255, 255, 255, 0.16));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.ticks {
  position: absolute;
  top: 16px;
  bottom: 16px;
  width: 12px;
  z-index: 2;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.85) 0 2px, transparent 2px 18px);
  pointer-events: none;
}

.beaker.left .ticks { left: 10px; }
.beaker.right .ticks { right: 10px; }

.juice {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 62%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 28%),
    var(--juice);
}

.juice::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  top: -8px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
}

.bubbles { position: absolute; inset: 0; pointer-events: none; }

.bubbles i {
  position: absolute;
  bottom: 10px;
  left: 18%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  animation: rise 2.6s infinite;
}

.bubbles i:nth-child(2) { left: 46%; width: 6px; height: 6px; animation-delay: 0.7s; }
.bubbles i:nth-child(3) { left: 68%; animation-delay: 1.2s; }
.bubbles i:nth-child(4) { left: 34%; animation-delay: 1.6s; }

@keyframes rise {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: 0.85; }
  100% { transform: translateY(-78px); opacity: 0; }
}

.cup::before {
  content: "";
  position: absolute;
  z-index: 4;
  top: 26px;
  width: 18px;
  height: 14px;
  border: 3px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.18);
}

.beaker.left .cup::before {
  right: -14px;
  border-left: 0;
  border-radius: 0 12px 12px 0;
}

.beaker.right .cup::before {
  left: -14px;
  border-right: 0;
  border-radius: 12px 0 0 12px;
}

.reagent {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 62%;
  z-index: 3;
  transform: translateY(35%);
  padding: 8px 8px;
  border-radius: 14px;
  background: rgba(255, 252, 245, 0.92);
  color: #083038;
  font-family: var(--display);
  font-size: clamp(16px, 2vw, 26px);
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 0 rgba(8, 40, 48, 0.12);
  pointer-events: none;
}

.beaker.compact .reagent { font-size: clamp(13px, 1.5vw, 18px); }

.lookup {
  margin-top: 10px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
  color: #083038;
  background: rgba(255, 248, 220, 0.92);
  border: 2px solid #8a6420;
}

.tube-wrap {
  position: relative;
  width: min(28vw, 190px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tube { width: 100%; }

.glass {
  position: relative;
  height: min(54vh, 400px);
  min-height: 260px;
  overflow: hidden;
  border-radius: 16px 16px 48px 48px;
  border: 3px solid rgba(255, 255, 255, 0.8);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05) 30%, rgba(255, 255, 255, 0.18));
  box-shadow: inset 10px 0 16px rgba(255, 255, 255, 0.2), 0 16px 18px rgba(0, 0, 0, 0.25);
}

.glass::before {
  content: "";
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.08));
}

.tube-liquid {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  height: 70%;
  border-radius: 8px 8px 40px 40px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 26%),
    var(--juice, #7ecfff);
  transition: height 0.45s ease, background 0.35s ease;
  overflow: hidden;
}

.cardinal {
  position: absolute;
  z-index: 3;
  top: 50%;
  translate: 0 -50%;
  left: 8px;
  right: 8px;
  width: calc(100% - 16px);
  margin: 0;
  padding: 10px 6px;
  border: 2px solid var(--gold);
  border-radius: 12px;
  background: #fff4cc;
  box-shadow: 0 4px 12px rgba(3, 24, 30, 0.28);
  color: #083038;
  font-family: var(--display);
  font-size: clamp(22px, 2.8vw, 34px);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
  text-shadow: none;
  cursor: pointer;
}

.tube-caption { margin-top: 10px; text-align: center; white-space: nowrap; }
.reaction { min-height: 1.2em; margin-top: 4px; color: var(--gold); text-align: center; }

.cup { transition: transform 0.45s ease; }

@media (hover: hover) {
  .cup:hover { transform: translateY(-4px); }
  .level-card:hover { background: rgba(12, 58, 68, 0.72); }
}

.lab.pour-left .beaker.left .cup,
.lab.pour-left .beaker.left .cup:hover {
  transform: rotate(18deg);
  transform-origin: 30% 100%;
}

.lab.pour-right .beaker.right .cup,
.lab.pour-right .beaker.right .cup:hover {
  transform: rotate(-18deg);
  transform-origin: 70% 100%;
}

.lab.is-locked .cup { pointer-events: none; }

/* 倒液体动画跟着「被点的那一杯」走，不再依赖左右写死的位置。 */
.lab.pour-left .cup.is-pouring,
.lab.pour-left .cup.is-pouring:hover {
  transform: rotate(18deg);
  transform-origin: 30% 100%;
}

.lab.pour-right .cup.is-pouring,
.lab.pour-right .cup.is-pouring:hover {
  transform: rotate(-18deg);
  transform-origin: 70% 100%;
}

/* ---- 四种题型共用的选项区 ---- */

/* 两杯的倒液体题：让量杯直接成为实验台的子项，分列试管左右。 */
.bench.flank .options { display: contents; }
.bench.flank .tube-wrap { order: 2; }
.bench.flank .options .beaker.left { order: 1; }
.bench.flank .options .beaker.right { order: 3; }

/* 其余题型：试管在上，选项排在下面一行。 */
.bench.stack {
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2vh, 22px);
  padding-top: 12px;
}

.bench.stack .options {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(10px, 3vw, 28px);
}

.bench.stack .glass {
  height: min(26vh, 200px);
  min-height: 140px;
}

.bench.stack .tube-wrap { width: min(34vw, 210px); }

.bench.stack .beaker {
  width: min(26vw, 190px);
}

.bench.stack .cup {
  height: min(20vh, 150px);
  min-height: 108px;
}

/* 下排的小杯不画壶嘴，省掉一个悬空的方块。 */
.beaker.plain .cup::before,
.beaker.rule-pick .cup::before { content: none; }

.beaker.plain .ticks { left: 8px; }

.choice.spent { opacity: 0.45; }
.choice.spent .juice { background: rgba(255, 255, 255, 0.12); }
.choice.spent .reagent { color: #8d2f2f; }
.choice.is-right .reagent { box-shadow: 0 0 0 3px var(--gold), 0 8px 0 rgba(8, 40, 48, 0.12); }

/* ---- 听音题：盖住试管里的词 ---- */
.tube-veil {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: rgba(6, 34, 42, 0.55);
  color: #d9fbff;
  font-family: var(--display);
  font-size: clamp(40px, 7vw, 72px);
  cursor: pointer;
}

/* ---- 补拼写题：词干 + 空位 ---- */
.synth {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 100%;
  padding: 10px 18px;
  border-radius: 18px;
  background: rgba(255, 252, 245, 0.94);
  color: #083038;
  font-family: var(--display);
  font-size: clamp(26px, 4vw, 44px);
  box-shadow: 0 8px 0 rgba(8, 40, 48, 0.18);
}

.synth-source { font-size: 0.7em; overflow-wrap: anywhere; }
.synth-source del { color: #ad443a; text-decoration-thickness: 2px; }
.synth-arrow { font-size: 0.7em; color: #51777e; }
.synth-result { overflow-wrap: anywhere; text-align: center; }

.synth-slot {
  min-width: 1.6em;
  padding: 0 6px;
  border-bottom: 4px solid #c8462f;
  color: #c8462f;
  text-align: center;
}

.synth-slot.done {
  border-bottom-color: #1f8a5a;
  color: #1f8a5a;
}

.bench.stack .beaker .vial { height: min(15vh, 116px); min-height: 84px; }
.beaker .vial { border-radius: 8px 8px 16px 16px; }
.beaker .vial .reagent { bottom: 58%; }

/* ---- 选规则题：三张规则卡 ---- */
.bench.mode-rule .options {
  flex-wrap: wrap;
  align-items: stretch;
}

.beaker.rule-pick { width: min(30vw, 260px); }

.rule-card {
  display: grid;
  gap: 4px;
  width: 100%;
  height: 100%;
  padding: 14px;
  text-align: left;
  color: var(--ink);
  background: rgba(8, 40, 48, 0.62);
  border: 2px solid rgba(184, 246, 255, 0.3);
  border-radius: 18px;
}

.rule-no {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #14586a;
  font-family: var(--display);
}

.rule-name { font-size: clamp(16px, 2vw, 20px); }
.rule-how { color: var(--soft); font-size: 14px; line-height: 1.45; }
.rule-sample { font-family: var(--display); color: #ffe08a; font-size: 14px; }

@media (hover: hover) {
  .rule-card:hover { background: rgba(12, 58, 68, 0.8); }
}

.rule-card.spent { opacity: 0.45; }
.rule-card.is-right { border-color: var(--gold); }

.bench.mode-notation .options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(520px, 100%);
  gap: 12px;
}
.bench.stack .notation-pick { width: 100%; }
.notation-card {
  width: 100%;
  padding: 18px 12px;
  border: 2px solid #b8f6ff;
  border-radius: 18px;
  background: #fff4cc;
  color: #083038;
  font-family: var(--display);
  font-size: clamp(24px, 4vw, 36px);
}
.notation-card.is-right { border-color: #6fffbc; box-shadow: 0 0 0 3px #1d6653; }
.notation-card.spent { opacity: 0.45; }
.notation-card:focus-visible, .rule-card:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* ---- 结果页：正确率与错题回顾 ---- */
.accuracy {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(20px, 3vw, 28px);
  color: var(--gold);
}

.review {
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(200, 70, 47, 0.16);
  border: 2px solid rgba(255, 170, 150, 0.4);
}

.review-head {
  margin: 0 0 8px;
  font-weight: 800;
  font-size: 14px;
  color: #ffd9cf;
}

.result-chip.miss {
  background: rgba(255, 226, 216, 0.95);
  border-color: #8a3420;
  color: #6d2414;
}

.spill-sample {
  margin: -6px 0 16px;
  font-family: var(--display);
  font-size: clamp(18px, 2.4vw, 26px);
  color: var(--gold);
}

.help-note {
  margin: 14px 0 0;
  color: var(--soft);
  line-height: 1.6;
  font-size: 14px;
}

.choice:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.drops, .smoke {
  position: absolute;
  left: 50%;
  top: 12%;
  width: 0;
  height: 0;
  z-index: 5;
  pointer-events: none;
}

.drops i, .smoke i {
  position: absolute;
  opacity: 0;
}

.drops i {
  width: 12px;
  height: 16px;
  border-radius: 50%;
  background: var(--pour, #7ecfff);
}

.lab.pour-left .drops i,
.lab.pour-right .drops i { animation: drip 0.7s ease forwards; }
.drops i:nth-child(2) { animation-delay: 0.08s; }
.drops i:nth-child(3) { animation-delay: 0.16s; }

@keyframes drip {
  0% { opacity: 0; transform: translate(var(--from-x, -90px), -8px) scale(0.7); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(0, 110px) scale(1); }
}

.lab.react .tube-liquid { height: 86%; }

.lab.react .glass {
  box-shadow: 0 0 28px var(--pour, #7ecfff), inset 10px 0 16px rgba(255, 255, 255, 0.25);
}

.cardinal.became { animation: pop 0.35s ease; }

@keyframes pop {
  0% { transform: scale(0.86); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.lab.spoil .tube { animation: shake 0.45s linear; }

@keyframes shake {
  20% { transform: translateX(-6px) rotate(-1deg); }
  40% { transform: translateX(6px) rotate(1deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.lab.spoil .tube-liquid { filter: saturate(0.35) brightness(0.85); }

.smoke i {
  width: 28px;
  height: 28px;
  margin-left: -14px;
  border-radius: 50%;
  background: rgba(230, 230, 220, 0.75);
  filter: blur(1px);
}

.lab.spoil .smoke i { animation: puff 0.9s ease forwards; }
.smoke i:nth-child(2) { animation-delay: 0.12s; }
.smoke i:nth-child(3) { animation-delay: 0.22s; }

@keyframes puff {
  0% { opacity: 0; transform: translate(-8px, 16px) scale(0.4); }
  35% { opacity: 0.85; }
  100% { opacity: 0; transform: translate(12px, -80px) scale(1.5); }
}

.spill {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(4, 16, 20, 0.46);
}

.spill-card, .result-card {
  width: min(560px, 100%);
  padding: 22px;
  border-radius: 28px;
}

.spill-card h2, .result-card h2 { margin: 6px 0 8px; }

.spill-card .lede { margin-bottom: 16px; }

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: #083038;
  border: 2px solid #b8f6ff;
  font-weight: 800;
}

#result.screen { overflow: auto; }

.result-card {
  width: min(760px, calc(100% - 32px));
  margin: 8vh auto;
}

.result-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.result-chip {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(184, 246, 255, 0.3);
  font-family: var(--display);
}

.result-score {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: 64px;
  line-height: 1;
  color: #b8f6ff;
}

.tip { color: var(--soft); }

.cup:focus-visible, .lookup:focus-visible, .cardinal:focus-visible, .level-card:focus-visible, .primary:focus-visible, .ghost:focus-visible, .back:focus-visible {
  outline: 3px solid #ffe08a;
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .title-stack, .home-panel, .home-progress, .home-hero {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: auto;
  }

  #home.screen {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
  }

  .home-hero { order: 2; height: 280px; overflow: hidden; }
  .home-panel { order: 3; }
  .home-hero .bench.demo { transform: scale(0.62); transform-origin: center bottom; }
  .help-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .shelf { display: none; }
  .window { width: 46vw; height: 12vh; }
  .help-grid, .level-grid { grid-template-columns: 1fr; }
  .beaker { width: 31vw; }
  .tube-wrap { width: 28vw; }
  .cup { min-height: 180px; height: 34vh; }
  .glass { min-height: 210px; height: 42vh; }
  .reagent, .beaker.compact .reagent {
    left: 4px;
    right: 4px;
    padding: 4px 3px;
    font-size: 13px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }
  .cardinal { font-size: 18px; }
  .tube-caption { font-size: 12px; }
  .lookup { font-size: 12px; padding: 0 8px; }
  .beaker-tag { font-size: 12px; }
  .play-hud { align-items: stretch; }
  .play-hud .status { gap: 8px; font-size: 13px; }
  .lab { padding: 12px 12px 24px; }
  .lab > * { min-width: 0; }
  .bench.flank { flex-direction: column; align-items: center; gap: 16px; padding-top: 14px; }
  .bench.flank .options { display: flex; order: 3; width: 100%; gap: 12px; }
  .bench.flank .beaker { flex: 1; width: 0; min-width: 0; }
  .bench.flank .tube-wrap { width: min(70vw, 260px); }
  .bench.flank .glass { min-height: 140px; height: 20vh; }
  .bench.flank .cup { min-height: 136px; height: 20vh; }
  .bench.flank .cup::before { content: none; }
  .answer-feedback { flex-direction: column; align-items: stretch; }
  .answer-feedback .primary { width: 100%; }
  .rule-table { font-size: 13px; }
  .panel header { flex-direction: column; }

  .bench.stack .tube-wrap { width: 46vw; }
  .bench.stack .glass { min-height: 120px; height: 20vh; }
  .bench.stack .beaker { width: min(27vw, 180px); }
  .bench.stack .cup { min-height: 96px; height: 16vh; }
  .bench.stack .options { gap: 8px; }
  .bench.stack .notation-pick { width: 100%; }

  /* 三张规则卡在手机上竖排，文字才读得完。 */
  .bench.mode-rule .options { flex-direction: column; align-items: stretch; width: 100%; }
  .bench.stack .beaker.rule-pick { width: 100%; }
  .rule-card { padding: 10px 12px; }
  .rule-how, .rule-sample { font-size: 13px; }

  .synth { font-size: 26px; padding: 8px 14px; }
  .tube-veil { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .bubbles i, .cardinal.became, .lab.spoil .tube, .drops i, .smoke i { animation: none !important; }
  .cup, .tube-liquid { transition: none; }
}
