/**
 * 好奇星人测试 H5 — 组件皮肤与动画
 * 依赖：css/tokens.css（设计令牌 + 流体根字号 + --rx 封顶）
 *       css/layout-flow.css（容器查询版心 / 选项网格 / 首页结构）
 */

html.mode-dark {
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #e8e8ec;
}

/* 先行题 / 测试 / 匹配：整页一屏内排版，中间区域单独滚动 */
html.h5-flow-tight {
  height: 100%;
}
html.h5-flow-tight body {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100svh;
  max-height: 100svh;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
html.h5-flow-tight #main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
html.h5-flow-tight #main > .view.is-active.page-with-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
/* 禁止 100vh 把 flex 子项撑出父级，避免「下一题」等底部按钮被裁切 */
html.h5-flow-tight .view.is-active.page-with-nav {
  min-height: 0 !important;
  max-height: 100%;
}
html.h5-flow-tight .page-with-nav {
  min-height: 0 !important;
}

main#main {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}
html.h5-flow-tight main#main {
  min-height: 0;
}

/* 非当前流程的 section 不占文档流，避免首屏下出现大块空白 */
main#main > .view:not(.is-active) {
  display: none !important;
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ========== 顶栏（对齐 system-nav-bar sn-root） ========== */
.app-nav.sn-root {
  position: sticky;
  top: 0;
  z-index: 800;
  width: 100%;
  flex-shrink: 0;
  background: rgba(232, 232, 238, 0.98);
  border-bottom: 1px solid rgba(26, 31, 28, 0.06);
}

.sn-root--dark,
html.mode-dark .app-nav.sn-root {
  background: rgba(14, 17, 23, 0.98);
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

.sn-bar-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  min-height: calc(88 * var(--rx));
  padding: 0 calc(12 * var(--rx)) calc(8 * var(--rx));
}

.sn-side {
  width: calc(96 * var(--rx));
  min-width: calc(96 * var(--rx));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sn-back {
  border: none;
  background: transparent;
  font-size: calc(44 * var(--rx));
  font-weight: 300;
  line-height: 1;
  color: rgba(26, 31, 28, 0.88);
  cursor: pointer;
  padding: 0;
}

html.mode-dark .sn-back {
  color: rgba(255, 255, 255, 0.92);
}

.sn-title-wrap--flex {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 calc(8 * var(--rx));
}

.sn-title {
  max-width: 100%;
  font-size: calc(34 * var(--rx));
  font-weight: 600;
  color: rgba(26, 31, 28, 0.88);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

html.mode-dark .sn-title {
  color: rgba(255, 255, 255, 0.92);
}

.sn-theme {
  border: none;
  background: transparent;
  font-size: calc(30 * var(--rx));
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  color: rgba(26, 31, 28, 0.55);
  cursor: pointer;
}

html.mode-dark .sn-theme {
  color: rgba(255, 255, 255, 0.65);
}

/* ========== 视图切换 ========== */
.view {
  display: none;
  min-height: 100vh;
}

.view.is-active {
  display: flex;
  flex-direction: column;
}

.page-with-nav {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-with-nav > .flow-test-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ========== 首页 = test-required-modal（components/test-required-modal） ========== */
.trm-root {
  position: relative;
  z-index: 1;
}

.trm-mask {
  position: absolute;
  inset: 0;
  background: rgba(55, 65, 81, 0.38);
  backdrop-filter: blur(calc(12 * var(--rx)));
  -webkit-backdrop-filter: blur(calc(12 * var(--rx)));
  z-index: 0;
}

.trm-root--dark .trm-mask {
  background: rgba(0, 0, 0, 0.62);
}

.trm-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(628 * var(--rx));
  padding: calc(72 * var(--rx)) calc(56 * var(--rx)) calc(52 * var(--rx));
  box-sizing: border-box;
  background:
    radial-gradient(ellipse 95% 70% at 18% 0%, rgba(255, 255, 255, 0.88) 0%, transparent 48%),
    radial-gradient(ellipse 80% 55% at 100% 100%, rgba(226, 232, 240, 0.65) 0%, transparent 42%),
    linear-gradient(165deg, #f8fafc 0%, #eef1f7 38%, #e2e8f0 72%, #d8dee9 100%);
  border-radius: calc(48 * var(--rx));
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 calc(28 * var(--rx)) calc(72 * var(--rx)) rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(148, 163, 184, 0.22);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  animation: trm-in 0.28s ease-out;
}

@keyframes trm-in {
  from {
    opacity: 0;
    transform: translateY(calc(24 * var(--rx))) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.trm-root--dark .trm-panel {
  background:
    radial-gradient(ellipse 88% 58% at 22% 0%, rgba(140, 152, 168, 0.22) 0%, transparent 46%),
    linear-gradient(165deg, #3d434d 0%, #32373f 40%, #262a32 72%, #1c2026 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 calc(28 * var(--rx)) calc(72 * var(--rx)) rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

.trm-close {
  position: absolute;
  top: calc(28 * var(--rx));
  right: calc(28 * var(--rx));
  width: calc(64 * var(--rx));
  height: calc(64 * var(--rx));
  line-height: calc(60 * var(--rx));
  text-align: center;
  font-size: calc(46 * var(--rx));
  font-weight: 300;
  color: rgba(71, 85, 105, 0.72);
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.trm-root--dark .trm-close {
  color: rgba(226, 232, 240, 0.78);
}

.trm-theme-corner {
  position: absolute;
  top: calc(28 * var(--rx));
  left: calc(28 * var(--rx));
  z-index: 2;
}

.trm-brand-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  flex-shrink: 0;
}

.trm-logo {
  display: block;
  width: 100%;
  max-width: calc(360 * var(--rx));
  height: auto;
  aspect-ratio: 360 / 144;
  margin: 0 auto;
}

.trm-root--dark .trm-logo {
  filter: brightness(0) invert(1);
  opacity: 0.94;
}

.trm-ascii-stage {
  position: relative;
  width: 100%;
  height: calc(196 * var(--rx));
  margin-top: calc(12 * var(--rx));
  box-sizing: border-box;
}

.trm-ascii-layer {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 calc(6 * var(--rx));
  box-sizing: border-box;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.32s ease-in-out;
}

.trm-ascii-layer.is-active {
  opacity: 1;
  z-index: 1;
}

.trm-ascii-box {
  width: 100%;
  max-width: calc(520 * var(--rx));
  margin: 0 auto;
  min-height: calc(160 * var(--rx));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(6 * var(--rx)) calc(12 * var(--rx));
  border-radius: calc(20 * var(--rx));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(241, 245, 249, 0.55) 100%);
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  box-sizing: border-box;
}

.trm-root--dark .trm-ascii-box {
  background: linear-gradient(180deg, rgba(30, 34, 42, 0.92) 0%, rgba(18, 21, 28, 0.95) 100%);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.trm-sct-ascii-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.trm-sct-ascii-line {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  line-height: 1.28;
}

.trm-sct-ascii-glyph {
  font-size: calc(34 * var(--rx));
  font-family: Menlo, Monaco, monospace;
  line-height: 1.28;
}

.trm-untested-ascii-grid .trm-sct-ascii-glyph {
  font-size: calc(28 * var(--rx));
}

.trm-sct-ascii-glyph--twinkle {
  animation: trm-ascii-glyph-twinkle 2.05s ease-in-out infinite;
}

@keyframes trm-ascii-glyph-twinkle {
  0%,
  100% {
    opacity: 1;
  }
  45% {
    opacity: 0.4;
  }
  70% {
    opacity: 0.92;
  }
}

.trm-sub {
  margin-top: calc(18 * var(--rx));
  font-size: calc(28 * var(--rx));
  font-weight: 400;
  color: rgba(51, 65, 85, 0.82);
  line-height: 1.6;
  padding: 0 calc(8 * var(--rx));
  max-width: calc(480 * var(--rx));
  margin-left: auto;
  margin-right: auto;
}

.trm-root--dark .trm-sub {
  color: rgba(226, 232, 240, 0.78);
}

.trm-btn {
  width: 100%;
  margin: 0;
  padding: 0;
  height: calc(104 * var(--rx));
  line-height: calc(104 * var(--rx));
  font-size: calc(30 * var(--rx));
  font-weight: 600;
  border-radius: calc(999 * var(--rx));
  border: none;
  box-sizing: border-box;
  cursor: pointer;
  font-family: inherit;
}

.trm-btn--primary {
  margin-top: calc(40 * var(--rx));
  color: #ffffff;
  background: linear-gradient(90deg, #49d7f2 0%, #a166f5 52%, #f7d358 100%);
}

.trm-btn--secondary {
  margin-top: calc(24 * var(--rx));
  color: rgba(51, 65, 85, 0.92);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.55);
}

.trm-root--dark .trm-btn--secondary {
  color: rgba(241, 245, 249, 0.9);
  background: rgba(15, 18, 24, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.trm-footer {
  margin-top: calc(32 * var(--rx));
  font-size: calc(28 * var(--rx));
  color: rgba(100, 116, 139, 0.88);
  line-height: 1.55;
}

.trm-root--dark .trm-footer {
  color: rgba(148, 163, 184, 0.82);
}

.trm-link-last {
  margin-top: calc(20 * var(--rx));
  width: 100%;
  border: none;
  background: transparent;
  font-size: calc(26 * var(--rx));
  font-weight: 600;
  color: rgba(2, 132, 199, 0.95);
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}

.trm-root--dark .trm-link-last {
  color: rgba(125, 211, 252, 0.95);
}

.trm-deferred {
  padding: calc(24 * var(--rx)) 0 calc(8 * var(--rx));
}

.trm-deferred-copy {
  font-size: calc(28 * var(--rx));
  color: rgba(51, 65, 85, 0.88);
  line-height: 1.55;
  margin: 0 0 calc(28 * var(--rx));
}

.trm-root--dark .trm-deferred-copy {
  color: rgba(226, 232, 240, 0.88);
}

/* ========== 测试流页面底（warmup / test / match / result） ========== */
.warmup-flow-page,
.test-flow-page,
.match-flow-page,
.result-flow-page--deep {
  --test-spectrum-grad: linear-gradient(90deg, #00e5ff 0%, #ff3dbd 100%);
  --test-spectrum-cyan: #00e5ff;
  --test-spectrum-violet: #ff3dbd;
  --test-spectrum-gold: #5ef38c;
  --test-spectrum-line: rgba(0, 229, 255, 0.38);
  --test-spectrum-glow-v: rgba(255, 61, 189, 0.35);
  --test-spectrum-glow-c: rgba(0, 229, 255, 0.4);
  background:
    radial-gradient(ellipse 92% 68% at 16% 0%, rgba(255, 255, 255, 0.5) 0%, transparent 46%),
    radial-gradient(ellipse 78% 52% at 100% 100%, rgba(255, 255, 255, 0.22) 0%, transparent 44%),
    linear-gradient(165deg, #f2f2f4 0%, #ebebed 38%, #e2e2e6 72%, #d8d8e0 100%);
}

.warmup-flow-page.mode-dark,
.test-flow-page.mode-dark,
.match-flow-page.mode-dark,
.result-flow-page--deep.mode-dark {
  background: linear-gradient(180deg, #000000 0%, #02040a 55%, #030712 100%);
}

.warmup-flow-page .sn-root,
.test-flow-page .sn-root,
.match-flow-page .sn-root,
.result-flow-page--deep .sn-root {
  background: #ffffff !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.warmup-flow-page.mode-dark .sn-root,
.test-flow-page.mode-dark .sn-root,
.match-flow-page.mode-dark .sn-root,
.result-flow-page--deep.mode-dark .sn-root {
  background: #141414 !important;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.match-flow-page .sn-root {
  border-bottom: none !important;
}

/* ========== warmup ========== */
.warmup-page {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.warmup-stack {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.warmup-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: calc(14 * var(--rx)) var(--gutter) calc(12 * var(--rx));
  margin: 0;
  width: 100%;
  background:
    radial-gradient(ellipse 90% 64% at 18% 0%, rgba(255, 255, 255, 0.55) 0%, transparent 44%),
    linear-gradient(165deg, #f8f8fa 0%, #efeff2 40%, #e6e6ea 72%, #dcdce2 100%);
  border-radius: calc(32 * var(--rx));
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 calc(16 * var(--rx)) calc(44 * var(--rx)) rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(100, 116, 139, 0.14);
}

.warmup-flow-page.mode-dark .warmup-main {
  background: linear-gradient(180deg, rgba(12, 14, 20, 0.88) 0%, rgba(4, 6, 10, 0.94) 45%, rgba(0, 0, 0, 0.96) 100%);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 calc(12 * var(--rx)) calc(40 * var(--rx)) rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.warmup-head-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  position: relative;
  z-index: 6;
  margin-bottom: calc(10 * var(--rx));
  min-height: calc(52 * var(--rx));
  padding: calc(4 * var(--rx)) 0;
}

.warmup-prev-btn {
  margin: 0;
  padding: calc(10 * var(--rx)) calc(12 * var(--rx)) calc(10 * var(--rx)) 0;
  border: none;
  background: transparent;
  font-size: calc(26 * var(--rx));
  font-weight: 600;
  color: rgba(3, 105, 161, 0.92);
  letter-spacing: 0.02em;
  cursor: pointer;
  line-height: 1.25;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.warmup-flow-page.mode-dark .warmup-prev-btn {
  color: rgba(180, 240, 255, 0.88) !important;
}

.warmup-ascii-scene {
  width: 100%;
  margin: 0 0 calc(28 * var(--rx));
  padding: calc(18 * var(--rx)) calc(14 * var(--rx));
  max-height: calc(220 * var(--rx));
  border-radius: calc(4 * var(--rx));
  background: linear-gradient(180deg, #020508 0%, #050c14 45%, #02060a 100%);
  border: 1px solid rgba(0, 229, 255, 0.28);
  box-shadow: inset 0 0 calc(40 * var(--rx)) rgba(0, 229, 255, 0.04), inset 0 calc(-24 * var(--rx)) calc(48 * var(--rx)) rgba(255, 61, 189, 0.05),
    0 0 calc(20 * var(--rx)) rgba(0, 0, 0, 0.5);
  font-family: Menlo, Monaco, Consolas, monospace;
  font-size: calc(14 * var(--rx));
  line-height: 1.34;
  color: rgba(210, 250, 255, 0.88);
  white-space: pre;
  overflow: hidden;
}

/* 先行题流程内：ASCII 作顶区装饰，压低高度保证题干 + 选项首屏可见 */
.warmup-ascii-scene--flow {
  flex: 0 0 auto;
  margin: 0 0 calc(12 * var(--rx));
  max-height: min(16dvh, calc(140 * var(--rx)));
  min-height: 0;
  padding: calc(8 * var(--rx)) calc(10 * var(--rx));
  font-size: clamp(9px, 2.6vw, calc(12 * var(--rx)));
  line-height: 1.28;
}

.warmup-flow-page:not(.mode-dark) .warmup-ascii-scene {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: calc(8 * var(--rx)) calc(4 * var(--rx)) calc(12 * var(--rx));
  color: rgba(51, 65, 85, 0.82);
}

.warmup-flow-page:not(.mode-dark) .warmup-ascii-scene--flow {
  padding: calc(6 * var(--rx)) calc(4 * var(--rx));
  max-height: min(14dvh, calc(120 * var(--rx)));
}

.warmup-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.warmup-q-hud {
  position: relative;
  margin-bottom: calc(20 * var(--rx));
  padding: calc(24 * var(--rx)) calc(28 * var(--rx)) calc(28 * var(--rx));
}

.warmup-q-hud--year {
  margin-bottom: calc(20 * var(--rx));
  padding: calc(28 * var(--rx)) calc(32 * var(--rx)) calc(24 * var(--rx));
}

.warmup-q-hud-corner {
  position: absolute;
  width: calc(22 * var(--rx));
  height: calc(22 * var(--rx));
  pointer-events: none;
  z-index: 2;
  border-style: solid;
  box-shadow: 0 0 calc(12 * var(--rx)) rgba(14, 165, 233, 0.22);
}

.warmup-q-hud-corner--tl {
  left: 0;
  top: 0;
  border-width: calc(3 * var(--rx)) 0 0 calc(3 * var(--rx));
  border-color: rgba(14, 165, 233, 0.85);
}

.warmup-q-hud-corner--tr {
  right: 0;
  top: 0;
  border-width: calc(3 * var(--rx)) calc(3 * var(--rx)) 0 0;
  border-color: rgba(56, 189, 248, 0.82);
}

.warmup-q-hud-corner--bl {
  left: 0;
  bottom: 0;
  border-width: 0 0 calc(3 * var(--rx)) calc(3 * var(--rx));
  border-color: rgba(2, 132, 199, 0.78);
}

.warmup-q-hud-corner--br {
  right: 0;
  bottom: 0;
  border-width: 0 calc(3 * var(--rx)) calc(3 * var(--rx)) 0;
  border-color: rgba(14, 116, 185, 0.72);
}

.warmup-flow-page.mode-dark .warmup-q-hud-corner {
  box-shadow: 0 0 calc(12 * var(--rx)) rgba(0, 229, 255, 0.25);
}

.warmup-flow-page.mode-dark .warmup-q-hud-corner--tl {
  border-color: var(--test-spectrum-cyan);
}

.warmup-flow-page.mode-dark .warmup-q-hud-corner--tr {
  border-color: var(--test-spectrum-violet);
}

.warmup-flow-page.mode-dark .warmup-q-hud-corner--bl {
  border-color: var(--test-spectrum-violet);
}

.warmup-flow-page.mode-dark .warmup-q-hud-corner--br {
  border-color: var(--test-spectrum-gold);
}

.warmup-pre-num {
  font-size: calc(24 * var(--rx));
  font-weight: 600;
  color: rgba(2, 132, 199, 0.9);
  letter-spacing: 0.12em;
  margin: 0 0 calc(22 * var(--rx));
  padding: 0 calc(6 * var(--rx));
}

.warmup-flow-page.mode-dark .warmup-pre-num {
  color: rgba(0, 229, 255, 0.82);
}

.warmup-q-title {
  font-size: calc(34 * var(--rx));
  font-weight: 700;
  color: #0f172a;
  line-height: 1.5;
  letter-spacing: 0.02em;
  padding: calc(6 * var(--rx)) calc(6 * var(--rx)) 0;
  min-height: 0;
}

.warmup-flow-page.mode-dark .warmup-q-title {
  color: #f2f9fc;
}

.warmup-q-hud-rule--soft {
  margin-top: calc(26 * var(--rx));
  height: calc(2 * var(--rx));
  border-radius: calc(2 * var(--rx));
  background: linear-gradient(90deg, #49d7f2 0%, #a166f5 52%, #f7d358 100%);
  opacity: 0.45;
}

.warmup-flow-page.mode-dark .warmup-q-hud-rule--soft {
  background: var(--test-spectrum-grad);
  opacity: 0.45;
}

.warmup-options {
  display: flex;
  flex-direction: column;
  gap: calc(18 * var(--rx));
}

.warmup-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: calc(24 * var(--rx)) calc(26 * var(--rx));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(248, 250, 252, 0.38) 100%);
  border-radius: calc(4 * var(--rx));
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 calc(4 * var(--rx)) calc(16 * var(--rx)) rgba(15, 23, 42, 0.06);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}

.warmup-option.is-selected {
  border-color: rgba(14, 165, 233, 0.55);
  background: rgba(14, 165, 233, 0.08);
  box-shadow: 0 0 calc(22 * var(--rx)) rgba(14, 165, 233, 0.14), inset 0 0 0 1px rgba(14, 165, 233, 0.12);
}

.warmup-flow-page.mode-dark .warmup-option {
  background: rgba(12, 16, 24, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.warmup-flow-page.mode-dark .warmup-option.is-selected {
  border-color: rgba(0, 229, 255, 0.55);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 calc(22 * var(--rx)) rgba(0, 229, 255, 0.16), inset 0 0 0 1px rgba(0, 229, 255, 0.1);
}

.warmup-option-title {
  font-size: calc(32 * var(--rx));
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}

.warmup-option-sub {
  margin-top: calc(10 * var(--rx));
  font-size: calc(24 * var(--rx));
  color: rgba(71, 85, 105, 0.78);
  line-height: 1.45;
}

.warmup-flow-page.mode-dark .warmup-option-title {
  color: #f1f5f9;
}

.warmup-flow-page.mode-dark .warmup-option-sub {
  color: rgba(200, 210, 240, 0.55);
}

.warmup-picker-wrap {
  padding-top: calc(8 * var(--rx));
}

/* 出生年份：圆环内纵向滚轮（scroll-snap） */
.warmup-year-wheel {
  max-width: min(100%, calc(520 * var(--rx)));
  margin: 0 auto;
}

.warmup-year-wheel-frame {
  position: relative;
  width: min(72vw, calc(400 * var(--rx)));
  height: min(72vw, calc(400 * var(--rx)));
  max-height: 52dvh;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.45);
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.98) 0%, rgba(236, 240, 247, 0.95) 55%, #d4d8e2 100%);
  box-shadow: inset 0 0 calc(20 * var(--rx)) rgba(255, 255, 255, 0.5), 0 calc(6 * var(--rx)) calc(18 * var(--rx)) rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.warmup-flow-page.mode-dark .warmup-year-wheel-frame {
  border-color: rgba(0, 229, 255, 0.28);
  background: radial-gradient(circle at 50% 45%, rgba(0, 229, 255, 0.08) 0%, rgba(2, 6, 11, 0.96) 52%, #020508 100%);
  box-shadow: 0 0 calc(24 * var(--rx)) rgba(0, 229, 255, 0.12), inset 0 0 calc(40 * var(--rx)) rgba(0, 0, 0, 0.45);
}

.warmup-year-wheel-mask {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  mask-image: radial-gradient(circle at 50% 50%, #000 66%, transparent 70.5%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 66%, transparent 70.5%);
}

.warmup-year-wheel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.warmup-year-wheel-list::-webkit-scrollbar {
  display: none;
}

.warmup-year-wheel-list li {
  scroll-snap-align: center;
  height: calc(52 * var(--rx));
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Menlo, Monaco, Consolas, monospace;
  font-size: calc(30 * var(--rx));
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(51, 65, 85, 0.35);
}

.warmup-year-wheel-list li.is-active {
  color: #0f172a;
  font-size: calc(34 * var(--rx));
}

.warmup-flow-page.mode-dark .warmup-year-wheel-list li {
  color: rgba(148, 163, 184, 0.35);
}

.warmup-flow-page.mode-dark .warmup-year-wheel-list li.is-active {
  color: #f1f5f9;
}

.warmup-year-wheel-lens {
  pointer-events: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78%;
  height: calc(52 * var(--rx));
  min-height: 44px;
  transform: translate(-50%, -50%);
  border-radius: calc(999 * var(--rx));
  border: 1px solid rgba(3, 105, 161, 0.35);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.12) 35%,
    rgba(255, 255, 255, 0.12) 65%,
    rgba(255, 255, 255, 0) 100%
  );
  box-shadow: 0 0 0 1px rgba(3, 105, 161, 0.08);
}

.warmup-flow-page.mode-dark .warmup-year-wheel-lens {
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.12);
}

.warmup-year-wheel-hint {
  text-align: center;
  margin: calc(14 * var(--rx)) 0 0;
  padding: 0 calc(12 * var(--rx));
  font-size: calc(22 * var(--rx));
  line-height: 1.45;
  color: rgba(71, 85, 105, 0.78);
}

.warmup-flow-page.mode-dark .warmup-year-wheel-hint {
  color: rgba(180, 235, 255, 0.55);
}

.warmup-year-out-caption {
  text-align: center;
  margin-bottom: calc(20 * var(--rx));
  padding: 0 calc(12 * var(--rx));
  font-size: calc(22 * var(--rx));
  font-weight: 600;
  letter-spacing: 0.22em;
  color: rgba(3, 105, 161, 0.82);
  font-family: Menlo, Monaco, Consolas, monospace;
}

.warmup-flow-page.mode-dark .warmup-year-out-caption {
  color: rgba(0, 229, 255, 0.52);
}

.warmup-year-picker-disc {
  position: relative;
  width: min(82vw, 64dvh, calc(520 * var(--rx)));
  height: min(82vw, 64dvh, calc(520 * var(--rx)));
  margin: 0 auto;
  padding: calc(14 * var(--rx)) calc(28 * var(--rx));
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.98) 0%, rgba(240, 240, 244, 0.94) 48%, #d4d4dc 100%);
  box-shadow: inset 0 0 calc(28 * var(--rx)) rgba(255, 255, 255, 0.55), 0 calc(8 * var(--rx)) calc(22 * var(--rx)) rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

/* 单行 select：调起系统选择器；避免圆盘过高、overflow 裁切原生弹层 */
.warmup-year-picker-disc--single {
  width: min(100%, calc(360 * var(--rx)));
  height: auto;
  min-height: calc(120 * var(--rx));
  max-height: none;
  padding: calc(20 * var(--rx)) calc(24 * var(--rx));
  border-radius: min(999px, 50vw);
  overflow: visible;
}

.warmup-flow-page.mode-dark .warmup-year-picker-disc {
  border-color: rgba(0, 229, 255, 0.32);
  background: radial-gradient(circle at 50% 42%, rgba(0, 229, 255, 0.1) 0%, rgba(2, 6, 11, 0.96) 48%, #020508 100%);
  box-shadow: 0 0 calc(40 * var(--rx)) rgba(0, 229, 255, 0.14), inset 0 0 calc(72 * var(--rx)) rgba(0, 0, 0, 0.55);
}

.warmup-flow-page.mode-dark .warmup-year-picker-disc--single {
  box-shadow: 0 0 calc(28 * var(--rx)) rgba(0, 229, 255, 0.12), inset 0 0 calc(36 * var(--rx)) rgba(0, 0, 0, 0.45);
}

.warmup-year-picker-column-shell {
  display: block;
  width: 100%;
  max-width: calc(220 * var(--rx));
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  box-sizing: border-box;
  mask-image: linear-gradient(
    180deg,
    transparent 0%,
    #000 14%,
    #000 86%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0%,
    #000 14%,
    #000 86%,
    transparent 100%
  );
}

.warmup-year-picker-column-shell--single {
  overflow: visible;
  max-width: min(100%, calc(320 * var(--rx)));
  mask-image: none;
  -webkit-mask-image: none;
}

.warmup-year-native {
  display: block;
  width: 100%;
  max-width: calc(220 * var(--rx));
  margin: 0 auto;
  height: min(52dvh, calc(400 * var(--rx)));
  min-height: calc(280 * var(--rx));
  border: none;
  background: transparent;
  font-family: Menlo, Monaco, Consolas, monospace;
  font-size: calc(28 * var(--rx));
  font-weight: 500;
  letter-spacing: 0.06em;
  text-align: center;
  color: #0f172a;
  color-scheme: light;
  /* 必须保留系统外观，否则 iOS / 微信内置浏览器下 select 无法正常使用 */
  appearance: auto;
  -webkit-appearance: menulist-button;
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
  z-index: 2;
}

.warmup-year-picker-disc--single .warmup-year-native {
  height: auto;
  min-height: max(calc(88 * var(--rx)), 48px);
  max-width: 100%;
  padding: calc(12 * var(--rx)) calc(16 * var(--rx));
  box-sizing: border-box;
  border-radius: calc(12 * var(--rx));
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.warmup-flow-page.mode-dark .warmup-year-picker-disc--single .warmup-year-native {
  background: rgba(2, 8, 18, 0.55);
  border-color: rgba(0, 229, 255, 0.22);
}

.warmup-year-native option {
  padding: calc(10 * var(--rx)) 0;
  font-size: calc(26 * var(--rx));
}

.warmup-flow-page.mode-dark .warmup-year-native {
  color: rgba(226, 232, 240, 0.92);
  color-scheme: dark;
}

.warmup-year-out-suffix {
  text-align: center;
  margin-top: calc(18 * var(--rx));
  margin-bottom: calc(4 * var(--rx));
  padding: 0 calc(12 * var(--rx));
  font-size: calc(24 * var(--rx));
  letter-spacing: 0.14em;
  color: rgba(51, 65, 85, 0.78);
}

.warmup-flow-page.mode-dark .warmup-year-out-suffix {
  color: rgba(180, 235, 255, 0.55);
}

.warmup-footer-cta {
  flex: 0 0 auto;
  margin-top: calc(12 * var(--rx));
  padding-top: calc(4 * var(--rx));
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 10px);
}

.warmup-btn-next {
  margin-top: 0;
  width: 100%;
  height: calc(96 * var(--rx));
  line-height: calc(96 * var(--rx));
  padding: 0;
  background: linear-gradient(90deg, #49d7f2 0%, #a166f5 52%, #f7d358 100%) !important;
  color: #ffffff !important;
  font-size: calc(30 * var(--rx));
  font-weight: 600;
  letter-spacing: 0.06em;
  border-radius: calc(999 * var(--rx)) !important;
  border: none !important;
  box-shadow: 0 calc(12 * var(--rx)) calc(32 * var(--rx)) rgba(90, 70, 140, 0.22);
  cursor: pointer;
}

.warmup-flow-page.mode-dark .warmup-btn-next {
  background: rgba(2, 8, 14, 0.95) !important;
  color: #00e5ff !important;
  border-radius: calc(4 * var(--rx)) !important;
  border: 2px solid #00e5ff !important;
  box-shadow: 0 0 calc(28 * var(--rx)) rgba(0, 229, 255, 0.22), inset 0 0 calc(36 * var(--rx)) rgba(0, 229, 255, 0.05);
}

/* ========== test ========== */
.test-page {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.test-stack {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.test-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: calc(14 * var(--rx)) var(--gutter) calc(12 * var(--rx));
  margin: 0;
  width: 100%;
  background:
    radial-gradient(ellipse 90% 64% at 18% 0%, rgba(255, 255, 255, 0.55) 0%, transparent 44%),
    linear-gradient(165deg, #f8f8fa 0%, #efeff2 40%, #e6e6ea 72%, #dcdce2 100%);
  border-radius: calc(32 * var(--rx));
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 calc(16 * var(--rx)) calc(44 * var(--rx)) rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(100, 116, 139, 0.14);
}

.test-flow-page.mode-dark .test-main {
  background: linear-gradient(180deg, rgba(12, 14, 20, 0.88) 0%, rgba(4, 6, 10, 0.94) 45%, rgba(0, 0, 0, 0.96) 100%);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 calc(12 * var(--rx)) calc(40 * var(--rx)) rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.test-main-top {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.test-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.test-head-row {
  display: flex;
  flex: 0 0 auto;
  position: relative;
  z-index: 6;
  margin-bottom: calc(10 * var(--rx));
  min-height: calc(52 * var(--rx));
  align-items: center;
}

.test-head-side--left {
  flex: 1;
}

.test-prev-btn {
  border: none;
  background: transparent;
  font-size: calc(26 * var(--rx));
  font-weight: 600;
  color: rgba(3, 105, 161, 0.92);
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: calc(10 * var(--rx)) calc(12 * var(--rx)) calc(10 * var(--rx)) 0;
  line-height: 1.25;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.test-flow-page.mode-dark .test-prev-btn {
  color: rgba(180, 240, 255, 0.88);
}

.test-q-hud {
  position: relative;
  margin-bottom: calc(20 * var(--rx));
  padding: calc(24 * var(--rx)) calc(28 * var(--rx)) calc(28 * var(--rx));
}

.test-q-hud-corner {
  position: absolute;
  width: calc(22 * var(--rx));
  height: calc(22 * var(--rx));
  pointer-events: none;
  z-index: 2;
  border-style: solid;
}

.test-q-hud-corner--tl {
  left: 0;
  top: 0;
  border-width: calc(3 * var(--rx)) 0 0 calc(3 * var(--rx));
  border-color: rgba(14, 165, 233, 0.85);
  box-shadow: 0 0 calc(10 * var(--rx)) rgba(14, 165, 233, 0.22);
}

.test-q-hud-corner--tr {
  right: 0;
  top: 0;
  border-width: calc(3 * var(--rx)) calc(3 * var(--rx)) 0 0;
  border-color: rgba(56, 189, 248, 0.82);
}

.test-q-hud-corner--bl {
  left: 0;
  bottom: 0;
  border-width: 0 0 calc(3 * var(--rx)) calc(3 * var(--rx));
  border-color: rgba(2, 132, 199, 0.78);
}

.test-q-hud-corner--br {
  right: 0;
  bottom: 0;
  border-width: 0 calc(3 * var(--rx)) calc(3 * var(--rx)) 0;
  border-color: rgba(14, 116, 185, 0.72);
}

.test-flow-page.mode-dark .test-q-hud-corner--tl {
  border-color: var(--test-spectrum-cyan);
  box-shadow: 0 0 calc(12 * var(--rx)) rgba(0, 229, 255, 0.25);
}

.test-flow-page.mode-dark .test-q-hud-corner--tr {
  border-color: var(--test-spectrum-violet);
}

.test-flow-page.mode-dark .test-q-hud-corner--bl {
  border-color: var(--test-spectrum-violet);
}

.test-flow-page.mode-dark .test-q-hud-corner--br {
  border-color: var(--test-spectrum-gold);
}

.test-pre-num {
  font-size: calc(24 * var(--rx));
  font-weight: 600;
  color: rgba(2, 132, 199, 0.9);
  letter-spacing: 0.12em;
  margin: 0 0 calc(22 * var(--rx));
}

.test-flow-page.mode-dark .test-pre-num {
  color: rgba(0, 229, 255, 0.82);
}

.test-q-title {
  font-size: calc(34 * var(--rx));
  font-weight: 700;
  color: #0f172a;
  line-height: 1.5;
  min-height: 0;
  padding: calc(6 * var(--rx)) calc(6 * var(--rx)) 0;
}

.test-flow-page.mode-dark .test-q-title {
  color: #f2f9fc;
}

.test-q-hud-rule--soft {
  margin-top: calc(26 * var(--rx));
  height: calc(2 * var(--rx));
  border-radius: calc(2 * var(--rx));
  background: linear-gradient(90deg, #49d7f2 0%, #a166f5 52%, #f7d358 100%);
  opacity: 0.45;
}

.test-flow-page.mode-dark .test-q-hud-rule--soft {
  background: var(--test-spectrum-grad);
}

.test-options {
  display: flex;
  flex-direction: column;
  gap: calc(18 * var(--rx));
}

.test-option {
  display: flex;
  padding: calc(24 * var(--rx)) calc(26 * var(--rx));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(248, 250, 252, 0.38) 100%);
  border-radius: calc(4 * var(--rx));
  border: 1px solid rgba(148, 163, 184, 0.45);
  cursor: pointer;
  text-align: left;
  font: inherit;
  width: 100%;
  color: inherit;
}

.test-option.is-selected {
  border-color: rgba(14, 165, 233, 0.55);
  background: rgba(14, 165, 233, 0.08);
}

.test-flow-page.mode-dark .test-option {
  background: rgba(12, 16, 24, 0.88);
  border-color: rgba(148, 163, 184, 0.18);
}

.test-flow-page.mode-dark .test-option.is-selected {
  border-color: rgba(0, 229, 255, 0.55);
  background: rgba(0, 229, 255, 0.08);
}

.test-option-title-row {
  display: flex;
  gap: calc(12 * var(--rx));
  align-items: flex-start;
}

.test-option-id {
  flex-shrink: 0;
  font-size: calc(26 * var(--rx));
  font-weight: 700;
  color: rgba(2, 132, 199, 0.88);
  font-family: Menlo, Monaco, Consolas, monospace;
  margin-top: calc(4 * var(--rx));
}

.test-flow-page.mode-dark .test-option-id {
  color: rgba(0, 229, 255, 0.5);
}

.test-option-title {
  flex: 1;
  font-size: calc(32 * var(--rx));
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}

.test-flow-page.mode-dark .test-option-title {
  color: #f1f5f9;
}

.test-option-sub {
  margin-top: calc(10 * var(--rx));
  font-size: calc(24 * var(--rx));
  color: rgba(71, 85, 105, 0.78);
  line-height: 1.45;
}

.test-flow-page.mode-dark .test-option-sub {
  color: rgba(200, 210, 240, 0.55);
}

.test-main-dock {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: calc(12 * var(--rx));
  margin-top: calc(8 * var(--rx));
  padding-top: calc(4 * var(--rx));
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 10px);
}

.test-btn-submit {
  width: 100%;
  height: calc(96 * var(--rx));
  line-height: calc(96 * var(--rx));
  padding: 0;
  background: linear-gradient(90deg, #49d7f2 0%, #a166f5 52%, #f7d358 100%) !important;
  color: #ffffff !important;
  font-size: calc(30 * var(--rx));
  font-weight: 600;
  letter-spacing: 0.06em;
  border-radius: calc(999 * var(--rx)) !important;
  border: none !important;
  box-shadow: 0 calc(12 * var(--rx)) calc(32 * var(--rx)) rgba(90, 70, 140, 0.22);
  cursor: pointer;
}

.test-flow-page.mode-dark .test-btn-submit {
  background: rgba(2, 8, 14, 0.95) !important;
  color: #00e5ff !important;
  border-radius: calc(4 * var(--rx)) !important;
  border: 2px solid #00e5ff !important;
  box-shadow: 0 0 calc(28 * var(--rx)) rgba(0, 229, 255, 0.22), inset 0 0 calc(36 * var(--rx)) rgba(0, 229, 255, 0.05);
}

.test-ascii-scene {
  width: 100%;
  margin: 0;
  padding: calc(22 * var(--rx)) calc(16 * var(--rx)) calc(26 * var(--rx));
  min-height: calc(280 * var(--rx));
  max-height: calc(420 * var(--rx));
  border-radius: calc(4 * var(--rx));
  background: transparent;
  border: none;
  box-shadow: none;
  font-family: Menlo, Monaco, Consolas, monospace;
  font-size: calc(17 * var(--rx));
  line-height: 1.48;
  color: rgba(51, 65, 85, 0.82);
  white-space: pre;
  overflow: hidden;
}

/* 测试题内：ASCII 顶区装饰，为题干与选项留出首屏空间 */
.test-ascii-scene--flow {
  flex: 0 0 auto;
  margin: 0 0 calc(12 * var(--rx));
  min-height: 0;
  max-height: min(16dvh, calc(150 * var(--rx)));
  padding: calc(8 * var(--rx)) calc(10 * var(--rx));
  font-size: clamp(9px, 2.6vw, calc(12 * var(--rx)));
  line-height: 1.28;
}

.test-flow-page:not(.mode-dark) .test-ascii-scene--flow {
  max-height: min(14dvh, calc(130 * var(--rx)));
  padding: calc(6 * var(--rx)) calc(8 * var(--rx));
}

.test-flow-page.mode-dark .test-ascii-scene {
  background: linear-gradient(180deg, #010408 0%, #061018 42%, #02060c 100%);
  border: 1px solid rgba(0, 229, 255, 0.24);
  box-shadow: inset 0 0 calc(48 * var(--rx)) rgba(0, 229, 255, 0.05), inset 0 calc(-28 * var(--rx)) calc(56 * var(--rx)) rgba(255, 61, 189, 0.06),
    0 0 calc(24 * var(--rx)) rgba(0, 0, 0, 0.55);
  color: rgba(195, 245, 255, 0.82);
}

/* ========== match ========== */
.match-page {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.match-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 90% 64% at 18% 0%, rgba(255, 255, 255, 0.55) 0%, transparent 44%),
    linear-gradient(165deg, #f8f8fa 0%, #efeff2 40%, #e6e6ea 72%, #dcdce2 100%);
  border-radius: calc(40 * var(--rx)) calc(40 * var(--rx)) 0 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  margin: 0 calc(10 * var(--rx));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), inset 0 -1px 0 rgba(100, 116, 139, 0.14);
}

.match-flow-page.mode-dark .match-body {
  background: linear-gradient(180deg, rgba(10, 12, 18, 0.92) 0%, rgba(2, 4, 8, 0.97) 100%);
  border-color: rgba(255, 255, 255, 0.06);
}

.match-body-inner {
  flex: 1;
  min-height: 0;
  padding: calc(32 * var(--rx)) calc(40 * var(--rx)) calc(48 * var(--rx) + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.match-center-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: calc(620 * var(--rx));
  gap: calc(48 * var(--rx));
}

.match-brand-logo {
  display: block;
  width: 100%;
  max-width: calc(468 * var(--rx));
  height: auto;
}

.match-flow-page.mode-dark .match-brand-logo {
  filter: brightness(0) invert(1);
  opacity: 0.94;
}

.match-orbit-wrap {
  position: relative;
  width: 100%;
  max-width: calc(620 * var(--rx));
  height: calc(120 * var(--rx));
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-orbit-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -40%);
  width: 85%;
  height: calc(56 * var(--rx));
  background: radial-gradient(ellipse 70% 80% at 50% 50%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.08) 45%, transparent 70%);
  pointer-events: none;
  animation: match-glow-breathe 2.2s ease-in-out infinite;
}

.match-orbit {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: calc(14 * var(--rx));
}

.match-dot {
  border-radius: 50%;
  background: #334155;
}

.match-flow-page.mode-dark .match-dot {
  background: #ffffff;
}

.match-dot--center {
  width: calc(56 * var(--rx));
  height: calc(56 * var(--rx));
  box-shadow: 0 0 calc(24 * var(--rx)) rgba(255, 255, 255, 0.5), 0 0 calc(56 * var(--rx)) rgba(14, 165, 233, 0.25);
  animation: match-center-pulse 1.6s ease-in-out infinite;
}

.match-flow-page.mode-dark .match-dot--center {
  box-shadow: 0 0 calc(24 * var(--rx)) rgba(255, 255, 255, 0.85), 0 0 calc(56 * var(--rx)) rgba(255, 255, 255, 0.35);
}

.match-dot--near {
  width: calc(22 * var(--rx));
  height: calc(44 * var(--rx));
  opacity: 0.72;
  animation: match-side-near 1.4s ease-in-out infinite;
}

.match-dot--mid {
  width: calc(16 * var(--rx));
  height: calc(36 * var(--rx));
  opacity: 0.48;
  animation: match-side-mid 1.4s ease-in-out infinite;
}

.match-dot--far {
  width: calc(12 * var(--rx));
  height: calc(28 * var(--rx));
  opacity: 0.28;
  animation: match-side-far 1.4s ease-in-out infinite;
}

.match-dot--a {
  animation-delay: 0s;
}
.match-dot--b {
  animation-delay: 0.1s;
}
.match-dot--c {
  animation-delay: 0.2s;
}
.match-dot--d {
  animation-delay: 0.2s;
}
.match-dot--e {
  animation-delay: 0.1s;
}
.match-dot--f {
  animation-delay: 0s;
}

@keyframes match-center-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.92;
  }
}

@keyframes match-glow-breathe {
  0%,
  100% {
    opacity: 0.65;
    transform: translate(-50%, -40%) scaleX(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -40%) scaleX(1.06);
  }
}

@keyframes match-side-near {
  0%,
  100% {
    opacity: 0.5;
    transform: scaleX(0.92);
  }
  50% {
    opacity: 0.95;
    transform: scaleX(1.05);
  }
}

@keyframes match-side-mid {
  0%,
  100% {
    opacity: 0.32;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes match-side-far {
  0%,
  100% {
    opacity: 0.18;
  }
  50% {
    opacity: 0.45;
  }
}

.match-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(20 * var(--rx));
}

.match-loading-en {
  font-size: calc(34 * var(--rx));
  font-style: italic;
  font-weight: 400;
  color: rgba(30, 41, 59, 0.92);
  font-family: Georgia, 'Times New Roman', Times, serif;
}

.match-loading-zh {
  font-size: calc(28 * var(--rx));
  font-weight: 400;
  color: rgba(51, 65, 85, 0.88);
  text-align: center;
  line-height: 1.5;
  max-width: calc(560 * var(--rx));
  margin: 0;
}

.match-flow-page.mode-dark .match-loading-en {
  color: rgba(241, 245, 249, 0.94);
}

.match-flow-page.mode-dark .match-loading-zh {
  color: rgba(226, 232, 240, 0.86);
}

.match-progress-wrap {
  width: 100%;
  max-width: calc(560 * var(--rx));
}

.match-progress {
  height: calc(6 * var(--rx));
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  overflow: hidden;
}

.match-progress__bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--test-spectrum-grad);
  transition: width 0.25s ease;
}

/* ========== result / report ========== */
.result-page {
  flex: 1 1 auto;
  min-height: 0;
  padding: calc(24 * var(--rx)) calc(28 * var(--rx)) calc(48 * var(--rx) + env(safe-area-inset-bottom, 0px));
}

.result-flow-page--deep.mode-dark .result-page {
  background: transparent;
}

.result-specimen-card,
.report-specimen-card {
  background:
    radial-gradient(ellipse 90% 64% at 18% 0%, rgba(255, 255, 255, 0.55) 0%, transparent 44%),
    linear-gradient(165deg, #f8f8fa 0%, #efeff2 40%, #e6e6ea 72%, #dcdce2 100%);
  border-radius: calc(32 * var(--rx));
  border: 1px solid rgba(255, 255, 255, 0.55);
  padding: calc(32 * var(--rx)) calc(28 * var(--rx)) calc(36 * var(--rx));
  box-shadow: 0 calc(16 * var(--rx)) calc(44 * var(--rx)) rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(100, 116, 139, 0.14);
}

.result-flow-page--deep.mode-dark .result-specimen-card,
.result-flow-page--deep.mode-dark .report-specimen-card {
  background:
    linear-gradient(158deg, rgba(255, 255, 255, 0.06) 0%, transparent 42%),
    linear-gradient(168deg, #343a44 0%, #282c34 48%, #1c2028 100%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 calc(16 * var(--rx)) calc(48 * var(--rx)) rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.result-specimen-head {
  text-align: center;
  margin-bottom: calc(16 * var(--rx));
}

.result-hero-emoji {
  font-size: calc(80 * var(--rx));
  line-height: 1;
}

.result-specimen-title {
  margin: calc(12 * var(--rx)) 0 calc(4 * var(--rx));
  font-size: calc(40 * var(--rx));
  font-weight: 800;
  color: #0f172a;
}

.result-flow-page--deep.mode-dark .result-specimen-title {
  color: #f1f5f9;
}

.result-hero-en {
  margin: 0;
  font-size: calc(24 * var(--rx));
  color: rgba(71, 85, 105, 0.88);
}

.result-flow-page--deep.mode-dark .result-hero-en {
  color: rgba(148, 163, 184, 0.9);
}

.result-sct-ascii-pre {
  font-family: Menlo, Monaco, Consolas, monospace;
  font-size: calc(22 * var(--rx));
  line-height: 1.25;
  text-align: center;
  white-space: pre;
  margin: calc(12 * var(--rx)) 0;
  color: #0284c7;
}

.result-sct-ascii-pre--hero {
  font-size: clamp(calc(26 * var(--rx)), 3.8vw, calc(36 * var(--rx)));
  line-height: 1.22;
  margin: calc(16 * var(--rx)) 0 calc(10 * var(--rx));
}

.result-specimen-cta--subtle {
  background: rgba(255, 255, 255, 0.5) !important;
  color: #334155 !important;
  border: 1px solid rgba(148, 163, 184, 0.55) !important;
  font-weight: 500 !important;
  font-size: calc(24 * var(--rx)) !important;
  padding: calc(18 * var(--rx)) calc(16 * var(--rx)) !important;
}

.result-flow-page--deep.mode-dark .result-specimen-cta--subtle {
  background: rgba(30, 41, 59, 0.65) !important;
  color: #e2e8f0 !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
}

.result-flow-page--deep.mode-dark .result-sct-ascii-pre {
  color: #22d3ee;
}

.result-specimen-tagline {
  text-align: center;
  font-size: calc(28 * var(--rx));
  color: rgba(51, 65, 85, 0.88);
  margin: 0 0 calc(8 * var(--rx));
}

.result-flow-page--deep.mode-dark .result-specimen-tagline {
  color: rgba(226, 232, 240, 0.88);
}

.result-specimen-kicker {
  text-align: center;
  font-size: calc(22 * var(--rx));
  color: rgba(100, 116, 139, 0.9);
  margin: 0 0 calc(16 * var(--rx));
}

.result-dim-grid {
  display: flex;
  flex-direction: column;
  gap: calc(10 * var(--rx));
  margin-bottom: calc(16 * var(--rx));
}

.result-dim-row {
  display: grid;
  grid-template-columns: calc(72 * var(--rx)) 1fr calc(40 * var(--rx));
  align-items: center;
  gap: calc(8 * var(--rx));
  font-size: calc(22 * var(--rx));
  color: rgba(51, 65, 85, 0.9);
}

.result-flow-page--deep.mode-dark .result-dim-row {
  color: rgba(226, 232, 240, 0.85);
}

.result-dim-bar {
  height: calc(8 * var(--rx));
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  overflow: hidden;
}

.result-dim-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00e5ff, #ff3dbd);
}

.result-pair-stack {
  display: flex;
  flex-direction: column;
  gap: calc(12 * var(--rx));
  margin-bottom: calc(20 * var(--rx));
}

.result-pair-card {
  border-radius: calc(16 * var(--rx));
  padding: calc(20 * var(--rx)) calc(22 * var(--rx));
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.45);
}

.result-flow-page--deep.mode-dark .result-pair-card {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.08);
}

.result-pair-card--golden {
  border-color: rgba(234, 179, 8, 0.45);
}

.result-pair-card--danger {
  border-color: rgba(248, 113, 113, 0.45);
}

.result-pair-badge {
  font-size: calc(20 * var(--rx));
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(100, 116, 139, 0.95);
  margin-bottom: calc(4 * var(--rx));
}

.result-pair-name {
  font-size: calc(28 * var(--rx));
}

.result-pair-desc {
  margin: calc(8 * var(--rx)) 0 0;
  font-size: calc(24 * var(--rx));
  line-height: 1.45;
  color: rgba(71, 85, 105, 0.9);
}

.result-flow-page--deep.mode-dark .result-pair-desc {
  color: rgba(203, 213, 225, 0.9);
}

.warmup-option-texts {
  flex: 1;
  min-width: 0;
}

.result-specimen-actions {
  display: flex;
  flex-direction: column;
  gap: calc(16 * var(--rx));
  margin: calc(24 * var(--rx)) 0 calc(20 * var(--rx));
}

.result-specimen-cta {
  width: 100%;
  text-align: center;
  padding: calc(26 * var(--rx)) calc(20 * var(--rx));
  border-radius: calc(999 * var(--rx));
  border: none;
  font-size: calc(28 * var(--rx));
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(90deg, #49d7f2 0%, #a166f5 52%, #f7d358 100%);
  color: #fff;
}

.result-specimen-cta--secondary {
  background: rgba(255, 255, 255, 0.55);
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.result-flow-page--deep.mode-dark .result-specimen-cta--secondary {
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.12);
}

.result-cosmos-scene {
  width: 100%;
  margin-top: calc(12 * var(--rx));
  padding: calc(16 * var(--rx)) calc(12 * var(--rx));
  border-radius: calc(4 * var(--rx));
  font-family: Menlo, Monaco, Consolas, monospace;
  font-size: calc(14 * var(--rx));
  line-height: 1.34;
  white-space: pre;
  overflow: hidden;
  color: rgba(51, 65, 85, 0.82);
  background: transparent;
}

.result-flow-page--deep.mode-dark .result-cosmos-scene {
  color: rgba(195, 245, 255, 0.82);
  background: linear-gradient(180deg, #010408 0%, #061018 42%, #02060c 100%);
  border: 1px solid rgba(0, 229, 255, 0.24);
}

.report-compat-stack {
  display: flex;
  flex-direction: column;
  gap: calc(12 * var(--rx));
}

.report-doc-meta {
  font-size: calc(22 * var(--rx));
  color: rgba(100, 116, 139, 0.95);
  margin: 0 0 calc(12 * var(--rx));
}

.report-section-title {
  font-size: calc(28 * var(--rx));
  font-weight: 700;
  margin: calc(24 * var(--rx)) 0 calc(10 * var(--rx));
  color: #0f172a;
}

.result-flow-page--deep.mode-dark .report-section-title {
  color: #f1f5f9;
}

.trait-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: calc(10 * var(--rx));
}

/* 五维：分层卡片（替代原「括号+整段」列表） */
.trait-layer {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  margin: 0;
  border-radius: calc(14 * var(--rx));
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 calc(4 * var(--rx)) calc(18 * var(--rx)) rgba(15, 23, 42, 0.04);
}

.result-flow-page--deep.mode-dark .trait-layer {
  background: rgba(30, 41, 59, 0.42);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: none;
}

.trait-layer__accent {
  width: calc(5 * var(--rx));
  flex-shrink: 0;
  background: linear-gradient(180deg, #38bdf8, #818cf8);
}

.trait-layer[data-layer='0'] .trait-layer__accent {
  background: linear-gradient(180deg, #f472b6, #e879f9);
}

.trait-layer[data-layer='1'] .trait-layer__accent {
  background: linear-gradient(180deg, #38bdf8, #22d3ee);
}

.trait-layer[data-layer='2'] .trait-layer__accent {
  background: linear-gradient(180deg, #fbbf24, #fb923c);
}

.trait-layer[data-layer='3'] .trait-layer__accent {
  background: linear-gradient(180deg, #a78bfa, #6366f1);
}

.trait-layer[data-layer='4'] .trait-layer__accent {
  background: linear-gradient(180deg, #34d399, #14b8a6);
}

.trait-layer__body {
  flex: 1 1 auto;
  min-width: 0;
  padding: calc(14 * var(--rx)) calc(16 * var(--rx)) calc(14 * var(--rx)) calc(12 * var(--rx));
}

.trait-layer__top {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: calc(8 * var(--rx));
  margin-bottom: calc(6 * var(--rx));
}

.trait-layer__badge {
  display: inline-block;
  font-size: calc(20 * var(--rx));
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(71, 85, 105, 0.88);
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

.result-flow-page--deep.mode-dark .trait-layer__badge {
  color: rgba(148, 163, 184, 0.92);
}

.trait-layer__score {
  font-size: calc(22 * var(--rx));
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(14, 165, 233, 0.95);
}

.result-flow-page--deep.mode-dark .trait-layer__score {
  color: rgba(125, 211, 252, 0.95);
}

.trait-layer__meter {
  display: block;
  height: calc(5 * var(--rx));
  margin: 0 0 calc(10 * var(--rx));
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.trait-layer__meter-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.85), rgba(129, 140, 248, 0.9));
  transition: width 0.35s ease;
}

.trait-layer__name {
  display: block;
  font-size: calc(28 * var(--rx));
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
  margin: 0 0 calc(6 * var(--rx));
}

.result-flow-page--deep.mode-dark .trait-layer__name {
  color: #f1f5f9;
}

.trait-layer__desc {
  margin: 0;
  font-size: calc(24 * var(--rx));
  line-height: 1.5;
  color: rgba(51, 65, 85, 0.9);
}

.result-flow-page--deep.mode-dark .trait-layer__desc {
  color: rgba(203, 213, 225, 0.92);
}

.report-radar {
  width: 100%;
  max-width: calc(600 * var(--rx));
  margin: calc(12 * var(--rx)) auto;
  aspect-ratio: 1;
}

.report-radar svg {
  width: 100%;
  height: 100%;
}

/* ========== toast / modal ========== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(100 * var(--rx));
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: calc(20 * var(--rx)) calc(32 * var(--rx));
  border-radius: 999px;
  font-size: calc(26 * var(--rx));
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(32 * var(--rx));
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  background: #fff;
  color: #0f172a;
  border-radius: calc(24 * var(--rx));
  padding: calc(28 * var(--rx));
  max-width: calc(600 * var(--rx));
  width: 100%;
  box-shadow: 0 calc(24 * var(--rx)) calc(60 * var(--rx)) rgba(0, 0, 0, 0.2);
}

html.mode-dark .modal {
  background: #1e293b;
  color: #f1f5f9;
}

.modal h3 {
  margin: 0 0 calc(10 * var(--rx));
  font-size: calc(32 * var(--rx));
}

.modal p {
  margin: 0 0 calc(20 * var(--rx));
  font-size: calc(26 * var(--rx));
  color: rgba(71, 85, 105, 0.95);
}

html.mode-dark .modal p {
  color: rgba(148, 163, 184, 0.95);
}

.modal__actions {
  display: flex;
  gap: calc(12 * var(--rx));
  justify-content: flex-end;
}

.modal-btn {
  flex: 1;
  padding: calc(20 * var(--rx)) calc(16 * var(--rx));
  border-radius: calc(12 * var(--rx));
  font-size: calc(26 * var(--rx));
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.modal-btn--ghost {
  background: transparent;
  color: inherit;
}

.modal-btn--primary {
  background: linear-gradient(90deg, #49d7f2 0%, #a166f5 52%, #f7d358 100%);
  color: #fff;
  border: none;
}

/* ========== 矮视口：压缩纵向节奏，保证底栏 CTA 留在布局内 ========== */
@media (max-height: 760px) {
  .warmup-main,
  .test-main {
    padding-top: calc(12 * var(--rx));
    padding-bottom: calc(10 * var(--rx));
  }

  .warmup-ascii-scene--flow,
  .test-ascii-scene--flow {
    max-height: min(12dvh, 104px) !important;
    margin-bottom: calc(6 * var(--rx)) !important;
  }

  .warmup-q-hud,
  .test-q-hud {
    padding: calc(16 * var(--rx)) calc(20 * var(--rx)) calc(18 * var(--rx));
    margin-bottom: calc(12 * var(--rx));
  }

  .warmup-q-hud-rule--soft,
  .test-q-hud-rule--soft {
    margin-top: calc(16 * var(--rx));
  }

  .warmup-options,
  .test-options {
    gap: calc(12 * var(--rx));
  }

  .warmup-option,
  .test-option {
    padding: calc(18 * var(--rx)) calc(20 * var(--rx));
  }

  .warmup-btn-next,
  .test-btn-submit {
    height: max(46px, calc(80 * var(--rx))) !important;
    line-height: max(46px, calc(80 * var(--rx))) !important;
    font-size: calc(28 * var(--rx)) !important;
  }
}

@media (max-height: 640px) {
  .warmup-head-row,
  .test-head-row {
    min-height: calc(44 * var(--rx));
    margin-bottom: calc(4 * var(--rx));
  }

  .warmup-pre-num,
  .test-pre-num {
    margin-bottom: calc(10 * var(--rx));
    font-size: calc(22 * var(--rx));
  }

  .warmup-q-title,
  .test-q-title {
    font-size: calc(30 * var(--rx));
    line-height: 1.42;
  }

  .warmup-option-title,
  .test-option-title {
    font-size: calc(28 * var(--rx));
  }

  .warmup-option-sub,
  .test-option-sub {
    font-size: calc(22 * var(--rx));
    margin-top: calc(6 * var(--rx));
  }

  .warmup-ascii-scene--flow,
  .test-ascii-scene--flow {
    max-height: min(10dvh, 88px) !important;
  }
}
