/* 认识厘米和米 · 二年级长度单位。单页教程，和 math-add 那批保持同一套视觉语言。 */
:root {
  --ink: #16263a;
  --ink-soft: #5a6b80;
  --muted: #7c93aa;
  --line: #b6cde6;
  --card: rgba(255, 255, 255, 0.92);
  --blue: #2f6df6;
  --teal: #12a594;
  --coral: #e0562f;
  --amber: #f0a020;
  --violet: #7b5ad9;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
  background: #e8f0fa;
  color: var(--ink);
  font-family:
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", ui-sans-serif,
    system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* 方格纸底纹：量长度这件事，格子里最清楚。 */
.paper {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: #e9f1fa;
  background-image:
    linear-gradient(rgba(47, 109, 246, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 109, 246, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(47, 109, 246, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 109, 246, 0.045) 1px, transparent 1px);
  background-size:
    80px 80px,
    80px 80px,
    20px 20px,
    20px 20px;
}

/* ---------- 顶部信息条 ---------- */
.hud {
  position: fixed;
  left: 22px;
  top: 20px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 44px);
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 8px 22px rgba(60, 100, 145, 0.13);
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
}

.hud b {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud__kicker {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.hud__step {
  padding-left: 12px;
  border-left: 1px solid rgba(150, 180, 210, 0.55);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- 舞台 ---------- */
#stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 88px 24px 132px;
}

.scene {
  display: none;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 900px;
  margin: auto;
}

.scene.is-active {
  display: flex;
  animation: sceneIn 260ms ease both;
}

@keyframes sceneIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.scene__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kicker {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  color: var(--blue);
}

.scene__head h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
}

.lead {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-soft);
}

.lead b,
.fact b,
.note b,
.readout b {
  color: var(--ink);
  font-weight: 900;
}

/* ---------- 工具面板（尺子、练习都在这里面） ---------- */
.board {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px 18px;
  border: 1px solid #cfe0f2;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 10px 26px rgba(60, 100, 145, 0.12);
}

.hint {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.readout {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 30px;
  font-size: 19px;
  font-weight: 800;
  color: var(--ink-soft);
}

.readout b {
  font-size: 24px;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.btn {
  align-self: flex-start;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease;
}

.btn:hover {
  border-color: #8fb6dc;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.btn--primary:hover {
  border-color: #24384f;
  background: #24384f;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.note {
  margin: 0;
  padding: 13px 16px;
  border: 1px solid #ffd79a;
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: rgba(255, 248, 234, 0.92);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  color: #7a5310;
}

.note b {
  color: #6b4606;
}

.note--slim {
  padding: 9px 14px;
  font-size: 14px;
}

/* ---------- 第 1 节：课桌 ---------- */
.desk {
  display: flex;
  justify-content: center;
}

.desk svg {
  width: 100%;
  max-width: 440px;
  height: auto;
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid #dce8f5;
  border-radius: 8px;
  background: #f5f9ff;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
}

.row__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e3edfa;
  color: var(--blue);
}

.row__icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.row__text {
  min-width: 0;
}

.row__num {
  margin-left: auto;
  flex: none;
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.row__num small {
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
}

/* ---------- 尺子 ---------- */
.ruler {
  position: relative;
  height: 82px;
  border: 1px solid #cfe0f2;
  border-radius: 10px;
  background: linear-gradient(#ffffff, #eef5fc);
  overflow: hidden;
}

.ruler__scale {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  bottom: 0;
}

.tick {
  position: absolute;
  top: 0;
  width: 1px;
  transform: translateX(-50%);
  background: #9db3ca;
}

.tick--major {
  width: 2px;
  background: #3a506b;
}

.num {
  position: absolute;
  top: 40px;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* 两端刻度上的数字朝里对齐，避免越出尺身边缘。 */
.num--first {
  transform: translateX(0);
}

.num--last {
  transform: translateX(-100%);
}

.seg {
  position: absolute;
  top: 6px;
  bottom: 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.seg:hover {
  background: rgba(47, 109, 246, 0.12);
}

.seg.is-on {
  background: rgba(47, 109, 246, 0.18);
  box-shadow: inset 0 0 0 2px var(--blue);
}

/* ---------- 第 3 节：量一量 ---------- */
.measure {
  position: relative;
  padding-top: 58px;
  cursor: ew-resize;
  touch-action: none;
}

.measure:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
  border-radius: 12px;
}

/* 定位层和尺子的刻度区同宽，小棒的百分比宽度才对得上刻度。 */
.stick-layer {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 52px;
}

.stick {
  position: absolute;
  left: 0;
  top: 4px;
  height: 48px;
  width: 40%;
  transition: width 90ms ease-out;
}

.measure.is-dragging .stick {
  transition: none;
}

.stick__body {
  position: absolute;
  inset: 12px 0 12px 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffd27a, #f0a020);
  box-shadow: inset 0 -2px 0 rgba(150, 95, 10, 0.25);
}

.stick__tip {
  position: absolute;
  right: -9px;
  top: 4px;
  width: 18px;
  height: 40px;
  border-radius: 6px;
  border: 2px solid #fff;
  background: var(--ink);
  box-shadow: 0 3px 8px rgba(22, 38, 58, 0.3);
}

.ruler--plain {
  height: 82px;
}

.ruler--plain .seg {
  display: none;
}

/* ---------- 第 4 节：软尺 ---------- */
.tape {
  position: relative;
  height: 140px;
  border: 1px solid #cfe0f2;
  border-radius: 10px;
  background: linear-gradient(#ffffff, #f1f7fd);
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
}

.tape .ruler__scale {
  left: 10px;
  right: 10px;
}

.tape .num {
  top: 34px;
  font-size: 12px;
}

.tape__band {
  position: absolute;
  left: 0;
  bottom: 14px;
  height: 34px;
  border-radius: 0 6px 6px 0;
  background: linear-gradient(90deg, rgba(47, 109, 246, 0.85), rgba(18, 165, 148, 0.85));
  transition: width 120ms ease-out;
}

.tape.is-dragging .tape__band {
  transition: none;
}

.tape__bandLabel {
  position: absolute;
  bottom: 56px;
  transform: translateX(-50%);
  padding: 3px 10px;
  border: 1px solid #cfe0f2;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: left 120ms ease-out;
  pointer-events: none;
}

.tape.is-dragging .tape__bandLabel {
  transition: none;
}

.tape__bandLabel.is-tight {
  transform: translateX(calc(-100% - 6px));
}

/* ---------- 事实小条 ---------- */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fact {
  margin: 0;
  padding: 10px 15px;
  border: 1px solid #dce8f5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* ---------- 练习 ---------- */
.equations {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.q {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #dce8f5;
  border-radius: 8px;
  background: #f5f9ff;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  transition:
    border-color 180ms ease,
    background-color 180ms ease;
}

.q__label {
  font-variant-numeric: tabular-nums;
}

.q__eq {
  color: var(--muted);
}

.q__blank {
  display: grid;
  place-items: center;
  width: 62px;
  height: 34px;
  border: 2px dashed #a8c4e0;
  border-radius: 8px;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.q__tail {
  color: var(--ink-soft);
}

.q__opts {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.q__opts button {
  min-width: 58px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    transform 130ms ease,
    border-color 130ms ease,
    background-color 130ms ease,
    color 130ms ease;
}

.q__opts button:hover:not([disabled]) {
  border-color: #8fb6dc;
  transform: translateY(-1px);
}

.q__opts button[disabled] {
  cursor: default;
  opacity: 0.75;
}

.q.is-ok {
  border-color: rgba(18, 165, 148, 0.55);
  background: rgba(18, 165, 148, 0.1);
}

.q.is-ok .q__blank {
  border-style: solid;
  border-color: var(--teal);
  color: var(--teal);
}

.q.is-ok button[data-u] {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  opacity: 1;
}

.q.is-bad {
  border-color: rgba(224, 86, 47, 0.5);
  background: rgba(224, 86, 47, 0.09);
  animation: shake 320ms ease;
}

.q.is-bad button.is-picked {
  border-color: var(--coral);
  background: var(--coral);
  color: #fff;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

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

.q--unit {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.q--unit .q__label {
  font-size: 17px;
}

.q--unit .q__opts {
  margin-left: 0;
}

.q--unit .q__opts button {
  flex: 1;
}

/* ---------- 第 7 节：总结 ---------- */
.summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: item;
}

.summary li {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 4px 14px;
  padding: 13px 16px;
  border: 1px solid #dce8f5;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--card);
  counter-increment: item;
}

.summary li::before {
  grid-row: span 2;
  content: counter(item);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e7effb;
  color: var(--blue);
  font-size: 17px;
  font-weight: 900;
}

.summary li:nth-child(3) {
  border-left-color: var(--teal);
}

.summary li:nth-child(3)::before {
  background: rgba(18, 165, 148, 0.14);
  color: var(--teal);
}

.summary li:nth-child(4) {
  border-left-color: var(--amber);
}

.summary li:nth-child(4)::before {
  background: rgba(240, 160, 32, 0.16);
  color: #b8770a;
}

.summary b {
  font-size: 17px;
  font-weight: 900;
}

.summary span {
  grid-column: 2;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-soft);
}

.finale {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 8px;
  background: rgba(22, 38, 58, 0.06);
}

.finale p {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

/* ---------- 底部控制条 ---------- */
.bar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 6;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 44px));
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(56, 96, 140, 0.16);
  overflow: hidden;
}

.bar__progress {
  height: 5px;
  background: rgba(150, 180, 210, 0.28);
}

.bar__progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #f0a020, #2f6df6, #12a594);
  transition: width 260ms ease;
}

.bar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
}

.dots {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dot {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #d3e0ee;
  border-radius: 50%;
  background: #fff;
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.dot:hover {
  border-color: #8fb6dc;
  color: var(--ink);
  transform: translateY(-1px);
}

.dot.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 6px 14px rgba(22, 38, 58, 0.28);
}

.dot.is-done {
  border-color: #9fc7bd;
  color: #0f8a7a;
}

.bar__controls {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.tool {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #d3e0ee;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.tool svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool:hover:not([disabled]) {
  border-color: #8fb6dc;
  transform: translateY(-1px);
}

.tool[disabled] {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

.tool:active {
  transform: translateY(0);
}

.tool--play {
  width: 50px;
  height: 50px;
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.tool--play:hover {
  border-color: #24384f;
  background: #24384f;
}

.tool--play svg {
  width: 23px;
  height: 23px;
}

.tool--play .icon-play {
  fill: currentColor;
  stroke-width: 1.6;
}

.tool--play .icon-pause {
  display: none;
}

.tool--play.is-playing .icon-play {
  display: none;
}

.tool--play.is-playing .icon-pause {
  display: block;
}

.tool--sound[hidden] {
  display: none;
}

.tool--sound .icon-sound-off {
  display: none;
}

.tool--sound.is-muted {
  color: var(--muted);
}

.tool--sound.is-muted .icon-sound-off {
  display: block;
}

.tool--sound.is-muted .icon-sound-on {
  display: none;
}

/* ---------- 提示气泡 ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 22px;
  z-index: 7;
  transform: translate(-50%, -10px);
  padding: 9px 20px;
  border: 1px solid #ffd79a;
  border-radius: 999px;
  background: rgba(255, 248, 234, 0.96);
  color: #9a6711;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(120, 90, 30, 0.14);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 200ms ease,
    transform 200ms ease,
    visibility 200ms;
  pointer-events: none;
}

.toast.is-on {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* ---------- 小屏 ---------- */
@media (max-width: 760px) {
  .hud {
    left: 14px;
    right: 14px;
    top: 12px;
    padding: 8px 14px;
    gap: 8px;
  }

  .hud__kicker {
    display: none;
  }

  .hud b {
    font-size: 16px;
  }

  #stage {
    padding: 76px 14px 178px;
  }

  .scene {
    gap: 13px;
  }

  .scene__head h2 {
    font-size: 23px;
  }

  .lead {
    font-size: 15px;
  }

  .board {
    padding: 16px 15px 14px;
  }

  .readout {
    font-size: 17px;
  }

  .readout b {
    font-size: 21px;
  }

  .ruler,
  .ruler--plain {
    height: 70px;
  }

  .ruler__scale {
    left: 14px;
    right: 14px;
  }

  .stick-layer {
    left: 14px;
    right: 14px;
  }

  .num {
    top: 34px;
    font-size: 12px;
  }

  .tape {
    height: 122px;
  }

  .tape .ruler__scale {
    left: 8px;
    right: 8px;
  }

  .tape .num {
    top: 30px;
  }

  .tape__band {
    bottom: 12px;
    height: 30px;
  }

  .tape__bandLabel {
    bottom: 50px;
    font-size: 12px;
  }

  .grid6 {
    grid-template-columns: minmax(0, 1fr);
  }

  .q {
    font-size: 17px;
  }

  .q__opts {
    margin-left: 0;
    width: 100%;
  }

  .q__opts button {
    flex: 1;
  }

  .summary li {
    grid-template-columns: 32px 1fr;
    gap: 2px 12px;
    padding: 12px 13px;
  }

  .summary li::before {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .bar {
    bottom: 12px;
    width: calc(100vw - 28px);
    border-radius: 18px;
  }

  .bar__row {
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px 12px;
  }

  .dots {
    gap: 6px;
  }

  .dot {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .toast {
    top: auto;
    bottom: 146px;
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  /* 320 宽的老机型上，软尺上 90 和 100 会挤在一起，小一号正好。 */
  .tape .num {
    font-size: 10px;
  }

  .facts {
    flex-direction: column;
  }

  .row__num {
    font-size: 19px;
  }
}

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

/* ============================================================
   录制模式（?record=1）：画面由外部脚本逐帧驱动
   ============================================================ */

/* 导出区只在交互版出现，录制模式按 1080p 整屏输出，不带这段。 */
.is-recording .export {
  display: none;
}

/* #canvas 只是把录制期要一起处理的层收在一起，本身不生成盒子。 */
#canvas {
  display: contents;
}

/* 视频按 1920x1080 输出，正文栏整体放大 1.25 倍才不至于两侧太空。 */
.is-recording #stage,
.is-recording .hud {
  zoom: 1.25;
}

/* 逐帧导出要求整屏锁定：交互版把 #stage 放回文档流是为了让导出区接在它后面，
   录制时必须是原来的 absolute 满屏，否则构图和已导出的成片对不上。 */
.is-recording #stage {
  position: absolute;
  inset: 0;
  min-height: 0;
}

/* 播控条、提示气泡、以及带文字说明的提示行都不进成片。 */
.is-recording .bar,
.is-recording .toast,
.is-recording .hint {
  display: none;
}

/* 逐帧渲染要求同一时刻的画面完全一致，墙钟动画和过渡必须全部关掉
   （无头 Chrome 不会命中 prefers-reduced-motion，只能显式关）。 */
.is-recording .scene.is-active {
  animation: none;
}

.is-recording .stick,
.is-recording .tape__band,
.is-recording .tape__bandLabel,
.is-recording .seg,
.is-recording .q,
.is-recording .q__opts button,
.is-recording .btn {
  transition: none !important;
}

/* ---------- 讲解高亮（成片里代替鼠标悬停） ---------- */
.is-recording .row.is-hot,
.is-recording .fact.is-hot,
.is-recording .note.is-hot,
.is-recording .summary li.is-hot,
.is-recording .q.is-hot {
  border-color: var(--blue);
  background: #e8f0ff;
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.16);
}

.is-recording .note.is-hot {
  color: #17407a;
}

.is-recording .summary li.is-hot::before {
  background: var(--blue);
  color: #fff;
}

/* 总结列表本身每一条就有不同颜色的左边线，高亮再明显一点才分得出来。 */
.is-recording .summary li.is-hot {
  border-color: var(--blue);
  background: #d9e6ff;
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.24);
  transform: translateX(6px);
}

.is-recording .finale.is-hot {
  background: rgba(47, 109, 246, 0.14);
}

.is-recording .readout.is-hot {
  border-radius: 8px;
  background: #e8f0ff;
  box-shadow: 0 0 0 2px rgba(47, 109, 246, 0.16);
}

.is-recording .num.is-hot {
  color: var(--blue);
}

/* ---------- 假光标 ---------- */
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 30;
  display: none;
  width: 30px;
  height: 36px;
  margin: -2px 0 0 -2px;
  transform-origin: 5px 3px;
  pointer-events: none;
  filter: drop-shadow(0 3px 6px rgba(22, 38, 58, 0.32));
}

.is-recording .cursor {
  display: block;
}

.cursor svg {
  width: 100%;
  height: 100%;
  fill: var(--ink);
  stroke: #fff;
  stroke-width: 1.3;
  stroke-linejoin: round;
}

/* ============================================================
   视频封面（?cover=1440x1080）
   ============================================================ */

.cover {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.6vmin;
  padding: 6vmin;
  text-align: center;
  background-color: #e9f1fa;
  background-image:
    linear-gradient(rgba(47, 109, 246, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 109, 246, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(47, 109, 246, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 109, 246, 0.045) 1px, transparent 1px);
  background-size:
    7.4vmin 7.4vmin,
    7.4vmin 7.4vmin,
    1.85vmin 1.85vmin,
    1.85vmin 1.85vmin;
}

.cover[hidden] {
  display: none;
}

/* 截图封面时页面只剩这张封面。 */
html.is-cover .hud,
html.is-cover #stage,
html.is-cover .bar,
html.is-cover .toast,
html.is-cover .cursor {
  display: none;
}

.cover__kicker {
  margin: 0;
  padding: 0.7vmin 2.2vmin;
  border: 1px solid rgba(47, 109, 246, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--blue);
  font-size: 2.5vmin;
  font-weight: 900;
}

.cover__title {
  margin: 0;
  font-size: 10.5vmin;
  font-weight: 900;
  line-height: 1.16;
  color: var(--ink);
}

.cover__title em {
  font-style: normal;
  color: var(--blue);
}

.cover__title em + em {
  color: var(--teal);
}

.cover__sub {
  margin: 0;
  padding: 1vmin 3vmin;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 4vmin;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.cover__ruler {
  position: relative;
  width: min(74vw, 1000px);
  height: 13vmin;
  border: 1px solid #cfe0f2;
  border-radius: 1.4vmin;
  background: linear-gradient(#ffffff, #eef5fc);
  box-shadow: 0 1.4vmin 3vmin rgba(60, 100, 145, 0.16);
  overflow: hidden;
}

.cover__ruler .ruler__scale {
  left: 3.5%;
  right: 3.5%;
}

.cover__ruler .num {
  top: 44%;
  font-size: 1.9vmin;
  color: var(--ink-soft);
}

.cover__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.6vmin;
}

.cover__chip {
  padding: 1.1vmin 2.4vmin;
  border: 1px solid #cfe0f2;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 2.6vmin;
  font-weight: 700;
  color: var(--ink-soft);
}

.cover__chip b {
  color: var(--ink);
  font-weight: 900;
}

/* ============================================================
   导出视频（只在交互版显示）
   ============================================================ */

.export {
  position: relative;
  z-index: 1;
  /* 底部播控条是 fixed 的，留白要盖过它，否则最后一个按钮会被压住。 */
  padding: 8px 24px 150px;
}

.export__inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 22px;
  border: 1px solid #d3e3f4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(31, 62, 98, 0.07);
}

.export__title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
}

.export__sub {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.export__video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #0f1b2a;
}

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

.export__link {
  padding: 10px 16px;
  border: 1px solid #cfe0f2;
  border-radius: 999px;
  background: #f4f8fe;
  font-size: 14px;
  font-weight: 700;
  color: #1d4f9c;
  text-decoration: none;
}

.export__link:hover {
  background: #e8f0ff;
  border-color: var(--blue);
}

@media (max-width: 520px) {
  .export {
    padding: 8px 16px 210px;
  }

  .export__inner {
    padding: 16px;
  }

  .export__link {
    flex: 1 1 100%;
    text-align: center;
  }
}
