/* ============ 基础与设计令牌 ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f2f6fb;
  --card: #ffffff;
  --ink: #16212c;
  --muted: #4f5f70;
  --line: #dbe4ee;
  --brand: #0b5fcc;
  --brand-strong: #094eaa;
  --brand-soft: #e7f0fe;
  --ok: #0f8a4f;
  --ok-soft: #e2f6ea;
  --bad: #cf3030;
  --bad-soft: #fdeaea;
  --warn: #9a6700;
  --warn-soft: #fff4d6;
  --pad-bg: #ffffff;
  --shadow: 0 1px 2px rgba(18, 34, 54, 0.06), 0 8px 24px rgba(18, 34, 54, 0.07);
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141b;
    --card: #19212c;
    --ink: #e8eef6;
    --muted: #9db0c3;
    --line: #2c3846;
    --brand: #6ea8ff;
    --brand-strong: #8fbcff;
    --brand-soft: #1d3050;
    --ok: #4cc38a;
    --ok-soft: #12301f;
    --bad: #ff8080;
    --bad-soft: #3a1a1a;
    --warn: #e2b341;
    --warn-soft: #33290f;
    --pad-bg: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

html {
  -webkit-text-size-adjust: 100%;
  /* 粘顶栏高度：由 app.js 在载入/缩放/切换大字模式时同步为实测值，
     保证粘顶进度条与滚动定位始终对齐顶栏底缘 */
  --header-h: 62px;
  /* 滚动定位（scrollIntoView / 锚点 / 聚焦）预留粘顶进度条与粘底操作栏的高度，
     避免目标落在遮盖物下方 */
  scroll-padding-top: calc(var(--header-h) + 60px);
  scroll-padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
}

body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    "PingFang SC",
    "HarmonyOS Sans SC",
    "Microsoft YaHei",
    "Noto Sans SC",
    sans-serif;
  /* 适老基准：17px / 1.7，正文不小于 14px；长辈模式（html.elder）再放大一档 */
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  /* 测试中途误触发下拉刷新会丢失全部作答，禁用该手势 */
  overscroll-behavior-y: contain;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3 {
  line-height: 1.35;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 0.8em;
}

p:last-child {
  margin-bottom: 0;
}

ul {
  padding-left: 1.2em;
  margin: 0 0 0.8em;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 8px 14px;
  border-radius: 0 0 10px 0;
  z-index: 99;
}

.skip-link:focus {
  left: 0;
}

/* ============ 顶栏 / 页脚 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 620px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 26px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}

.brand-text strong {
  font-size: 17px;
}

.brand-text small {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.site-footer {
  max-width: 620px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

main {
  max-width: 620px;
  margin: 0 auto;
  padding: 18px 14px calc(30px + env(safe-area-inset-bottom, 0px));
}

/* ============ 首页 ============ */
.intro h1 {
  font-size: 26px;
  margin-bottom: 10px;
}

.lead {
  color: var(--muted);
  font-size: 16.5px;
}

.lead strong {
  color: var(--ink);
}

.meta-chips {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 20px;
}

.meta-chips li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 14px;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.start-card h2 {
  font-size: 18px;
}

.start-field {
  border: none;
  padding: 0;
  margin: 0 0 14px;
}

.start-field legend {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 8px;
  padding: 0;
}

.start-agree {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.notes,
.faq {
  margin-top: 26px;
}

.notes h2,
.faq h2 {
  font-size: 18px;
}

.notes ul {
  color: var(--muted);
  font-size: 15.5px;
}

.notes strong {
  color: var(--ink);
}

.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  margin-bottom: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15.5px;
  padding: 14px 0;
  list-style-position: outside;
}

.faq details[open] summary {
  border-bottom: 1px dashed var(--line);
  margin-bottom: 8px;
}

.faq details p {
  color: var(--muted);
  font-size: 15px;
  padding-bottom: 6px;
}

.disclaimer {
  margin-top: 26px;
  font-size: 14px;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed color-mix(in srgb, var(--warn) 45%, var(--line));
  border-radius: 12px;
  padding: 12px 14px;
}

/* 温馨提示：在隐私告知之外补充适老用法说明，语气更亲和 */
.disclaimer.tip {
  border-style: solid;
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  background: var(--brand-soft);
  color: var(--ink);
}

/* ============ 首页：微信小游戏引流卡片 ============ */
.game-card {
  margin-top: 20px;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line));
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  box-shadow: var(--shadow);
}

.game-eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ok);
}

.game-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
}

.game-text {
  margin: 0;
  font-size: 15.5px;
  color: var(--muted);
}

.game-text strong {
  color: var(--ink);
}

.game-card .btn.xl {
  margin-top: 14px;
}

/* 微信开放标签 wx-open-launch-weapp：标签本体铺满容器；
   插槽内按钮样式与页面隔离，由 app.js 内联注入 */
.game-launch {
  display: block;
  width: 100%;
}

.game-card .game-launch {
  margin-top: 14px;
}

.game-hint {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px dashed color-mix(in srgb, var(--warn) 45%, var(--line));
  border-radius: 10px;
  padding: 10px 12px;
}

.game-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ============ 量表说明内容区（#about） ============ */
.about {
  margin-top: 34px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.about .notes p {
  color: var(--muted);
  font-size: 15.5px;
}

.about .notes p strong {
  color: var(--ink);
}

/* 8 大认知域标签（复用 meta-chips 外观，收紧纵向间距） */
.domain-chips {
  margin: 10px 0 14px;
}

.domain-chips li {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 25%, var(--line));
  color: var(--ink);
}

/* ============ 表单控件 ============ */
.radio,
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  margin: 8px 0;
  cursor: pointer;
  font-size: 16.5px;
  background: var(--card);
  transition:
    border-color 0.15s,
    background 0.15s;
  touch-action: manipulation;
}

@media (hover: hover) {
  .radio:hover,
  .check:hover {
    border-color: var(--brand);
  }
}

.radio input,
.check input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--brand);
}

.radio:has(input:checked),
.check:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.field {
  width: 100%;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.field:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.field.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 2px;
}

.field:disabled {
  opacity: 0.85;
}

.field-label {
  display: block;
  font-weight: 600;
  font-size: 16px;
  margin: 12px 0 6px;
}

.q-label {
  display: block;
  font-weight: 600;
  font-size: 16px;
  margin: 4px 0 8px;
}

/* ============ 按钮 ============ */
.btn {
  font: inherit;
  font-weight: 600;
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 12px 20px;
  /* 适老：所有按钮保证 ≥44px 触控高度 */
  min-height: 44px;
  cursor: pointer;
  transition:
    transform 0.1s,
    background 0.15s,
    border-color 0.15s,
    opacity 0.15s;
  touch-action: manipulation;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

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

@media (hover: hover) {
  .btn.primary:hover {
    background: var(--brand-strong);
  }
}

.btn.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn.ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}

@media (hover: hover) {
  .btn.ghost:hover {
    border-color: var(--brand);
    color: var(--brand);
  }
}

.btn.wx {
  background: #07c160;
  color: #fff;
}

@media (hover: hover) {
  .btn.wx:hover {
    background: #06ad56;
  }
}

.btn.sm {
  padding: 9px 15px;
  font-size: 15px;
  min-height: 42px;
  border-radius: 10px;
}

.btn.xl {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  margin-top: 12px;
}

.link-btn {
  font: inherit;
  font-size: 14.5px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  /* 触屏最小点击目标 ~36px，负 margin 抵消占位 */
  padding: 12px 10px;
  margin: -12px -6px;
  touch-action: manipulation;
}

@media (hover: hover) {
  .link-btn:hover {
    color: var(--bad);
  }
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.row .field {
  flex: 1;
  min-width: 140px;
}

/* ============ 提示文本 ============ */
.hint {
  color: var(--muted);
  font-size: 14.5px;
  margin-top: 10px;
}

.hint b {
  color: var(--ink);
}

.warn-note {
  color: var(--bad);
  font-size: 14.5px;
  margin: 6px 0 0;
}

.ok-note {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--ok);
  background: var(--ok-soft);
  border-radius: 12px;
  padding: 12px;
}

.big-note {
  font-size: 17.5px;
  text-align: center;
  margin-bottom: 10px;
}

.center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0 4px;
}

/* ============ 测试进行区 ============ */
.progress-wrap {
  position: sticky;
  top: var(--header-h);
  z-index: 9;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(6px);
  padding: 8px 0 6px;
}

.progress-track {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
  font-size: 14px;
  color: var(--muted);
}

.q-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 20px;
  margin-top: 10px;
}

.q-card.anim {
  animation: fadeUp 0.3s ease both;
}

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

.q-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.q-domain {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 3px 10px;
}

.q-pts {
  font-size: 13.5px;
  color: var(--muted);
}

.q-title {
  font-size: 22px;
  margin: 0 0 6px;
}

.q-title:focus {
  outline: none;
}

.q-desc {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 14px;
}

.q-desc b,
.q-desc strong {
  color: var(--ink);
}

.q-nav {
  /* 粘底操作栏：长题目滚动时【下一步】始终可见可点；负边距贴住卡片底缘，
     底部 padding 延伸至全面屏安全区之下（viewport-fit=cover） */
  position: sticky;
  bottom: calc(-1 * env(safe-area-inset-bottom, 0px));
  z-index: 4;
  margin: 16px -18px -20px;
  padding: 12px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--card);
  border-top: 1px solid var(--line);
  border-radius: 0 0 15px 15px;
  box-shadow: 0 -6px 18px rgba(18, 34, 54, 0.08);
}

.q-nav .btn {
  width: 100%;
  padding: 15px;
  font-size: 17px;
  min-height: 50px;
}

/* 测试阶段调试行（?debug=1）：查看当前题实时得分 */
.dbg-row {
  text-align: center;
  margin: 12px 0 0;
}

/* ============ 连线测试 ============ */
.trail-box {
  display: flex;
  justify-content: center;
}

.trail-svg {
  width: 100%;
  max-width: 360px;
  touch-action: manipulation;
  user-select: none;
}

.trail-lines line {
  stroke: var(--brand);
  stroke-width: 3.5;
  stroke-linecap: round;
}

.tnode {
  cursor: pointer;
  outline: none;
}

.tnode circle {
  fill: var(--card);
  stroke: #8fa3ba;
  stroke-width: 2.5;
  transition:
    fill 0.15s,
    stroke 0.15s;
}

.tnode text {
  font-size: 18px;
  font-weight: 700;
  fill: var(--ink);
  pointer-events: none;
}

.tnode:focus-visible circle {
  stroke: var(--brand);
}

@media (hover: hover) {
  .tnode:hover circle {
    stroke: var(--brand);
  }
}

.tnode.done circle {
  fill: #d3f4e0;
  stroke: var(--ok);
}

.tnode.done text {
  fill: #0a6a3c;
}

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

/* ============ 绘画（立方体 / 钟表） ============ */
.compare {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.compare .pad-wrap {
  flex: 1;
  min-width: 200px;
}

.ref {
  margin: 0;
  width: 128px;
  flex-shrink: 0;
  text-align: center;
}

.ref svg {
  width: 100%;
  height: auto;
  color: var(--ink);
}

.ref.small {
  width: 170px;
  margin: 4px auto 0;
}

.ref figcaption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.pad-wrap {
  border-radius: 12px;
  overflow: hidden;
}

canvas.pad {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  background: var(--pad-bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  touch-action: none;
  cursor: crosshair;
  color-scheme: light;
}

/* ============ 命名 ============ */
.name-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.name-card {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}

.name-emoji {
  font-size: 58px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.name-card .field {
  padding: 9px 6px;
  font-size: 16px;
  text-align: center;
}

/* ============ 词语展示 / 数字闪现 ============ */
.word-flash {
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-weight: 700;
  letter-spacing: 2px;
}

.mem-progress,
.dg-progress {
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
}

.recall-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0;
}

.recall-slots .field {
  text-align: center;
}

/* ============ 警觉性 ============ */
.dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin: 8px 0 14px;
}

.dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
}

.dots span.on {
  background: var(--brand);
}

.tap-btn {
  width: 100%;
  padding: 24px;
  font-size: 21px;
  border-radius: 16px;
}

/* 警觉性大按钮：每次点击的缩放弹跳反馈（手机端另有 buzz() 震动） */
@keyframes tap-pop {
  0%,
  100% {
    transform: scale(1);
  }
  40% {
    transform: scale(0.92);
  }
  75% {
    transform: scale(1.05);
  }
}

.tap-btn.pop {
  animation: tap-pop 0.28s ease;
}

/* 按住说话（数字广度 / 句子复述语音输入）：禁用长按选中/系统菜单，按住期间不触发页面滚动 */
.mic-btn {
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* 录音期间全局禁用长按选择与呼出菜单：手指在按钮上轻微移动时，
   选区不再扩散到旁边的说明文字/输入框（app.js 在按下/结束时切换） */
body.recording,
body.recording * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

.mic-btn.listening {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand);
}

.mic-note {
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
  margin: 8px 0 0;
  min-height: 1.5em;
}

/* ============ 连续减 7 ============ */
.shake {
  animation: shake 0.4s ease;
}

/* 连续减 7：【跳过】40% +【确定】60%，两按钮等大（grow/shrink 吸收舍入误差避免换行） */
.s7-actions {
  margin-top: 12px;
  flex-wrap: nowrap;
}

.s7-actions .btn {
  padding: 15px;
  font-size: 17px;
}

.s7-actions .btn.ghost {
  flex: 1 1 calc(40% - 5px);
}

.s7-actions .btn.primary {
  flex: 1 1 calc(60% - 5px);
}

/* ============ 句子复述 ============ */
.sentence-show {
  font-size: 21px;
  font-weight: 600;
  background: var(--brand-soft);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  margin: 8px 0 14px;
}

/* ============ 词语流畅性 ============ */
.flu-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 10px 0;
}

.flu-time {
  font-size: 42px;
  font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  min-width: 68px;
  text-align: center;
}

.flu-stat .unit {
  color: var(--muted);
}

.flu-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 15px;
}

.flu-count b {
  font-size: 19px;
  color: var(--ink);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 8px 5px 12px;
  font-size: 15.5px;
}

.chip button {
  border: none;
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  color: var(--ink);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  touch-action: manipulation;
}

.chip-demo {
  display: inline-block;
  background: var(--brand-soft);
  border-radius: 6px;
  padding: 0 8px;
  margin-right: 4px;
}

/* ============ 选择题 ============ */
.mcq {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px 6px;
  margin: 0 0 14px;
}

.mcq legend {
  font-weight: 600;
  font-size: 16px;
  padding: 0 6px;
}

/* ============ 定向 ============ */
.ori-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ori-grid .field-label {
  margin: 0;
}

/* ============ 结果页 ============ */
.result-head {
  text-align: center;
}

.ring-wrap {
  position: relative;
  width: 168px;
  margin: 14px auto 6px;
}

.ring-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.ring-bg {
  fill: none;
  stroke: var(--line);
  stroke-width: 10;
}

.ring-fg {
  fill: none;
  stroke: var(--ok);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 339.29;
  stroke-dashoffset: 339.29;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 1s ease;
}

.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-label b {
  font-size: 44px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ring-label span {
  color: var(--muted);
  font-size: 14px;
}

.edu-note {
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
}

.domains {
  margin: 18px 0 6px;
}

.domain-row {
  display: grid;
  grid-template-columns: 96px 1fr 44px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 15px;
}

.domain-row .name {
  color: var(--muted);
}

.domain-row .bar {
  height: 9px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.domain-row .bar-fill {
  height: 100%;
  width: 0;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.8s ease;
}

.domain-row .val {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.interpret {
  border-radius: 12px;
  padding: 14px 16px;
  margin: 14px 0;
  font-size: 16px;
}

.interpret.good {
  background: var(--ok-soft);
  border: 1.5px solid color-mix(in srgb, var(--ok) 45%, transparent);
}

.interpret.warn {
  background: var(--warn-soft);
  border: 1.5px solid color-mix(in srgb, var(--warn) 45%, transparent);
}

.interpret.bad {
  background: var(--bad-soft);
  border: 1.5px solid color-mix(in srgb, var(--bad) 45%, transparent);
}

.interpret h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.interpret.good h3 {
  color: var(--ok);
}
.interpret.warn h3 {
  color: var(--warn);
}
.interpret.bad h3 {
  color: var(--bad);
}

.result-details {
  margin-top: 12px;
  font-size: 15px;
}

.result-details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 8px 0;
}

.result-details table {
  width: 100%;
  border-collapse: collapse;
}

.result-details td {
  padding: 6px 4px;
  border-bottom: 1px dashed var(--line);
}

.result-details td:last-child {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.actions .btn {
  width: 100%;
}

.sent-area {
  width: 100%;
  resize: vertical;
  font-size: 17px;
  line-height: 1.7;
  padding: 12px;
}

.rs-btn {
  margin-top: 16px;
}

/* ============ 响应式 ============ */
@media (min-width: 480px) {
  .recall-slots {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 420px) {
  .name-grid {
    grid-template-columns: 1fr;
  }

  .name-emoji {
    font-size: 46px;
  }

  .word-flash {
    font-size: 52px;
  }

  .domain-row {
    grid-template-columns: 82px 1fr 44px;
    font-size: 14px;
  }

  .compare {
    flex-direction: column;
    align-items: stretch;
  }

  .ref {
    width: 130px;
    margin: 0 auto;
  }
}

/* 超小屏（320–360px）：定向网格转单列、缩放开场标题与闪现字 */
@media (max-width: 360px) {
  .ori-grid {
    grid-template-columns: 1fr;
  }

  .word-flash {
    font-size: 46px;
    min-height: 112px;
  }

  .q-title {
    font-size: 20px;
  }

  .intro h1 {
    font-size: 23px;
  }

  .ring-wrap {
    width: 150px;
  }
}

/* ============ 打印 / 减少动效 ============ */
@media print {
  .site-header,
  .site-footer,
  .progress-wrap,
  .q-nav,
  .q-tools,
  .actions,
  .link-btn,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .q-card {
    border: none;
    box-shadow: none;
  }
}

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

/* ============ 适老可访问性：可见焦点环 ============ */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* ============ 顶栏：大字（长辈）模式开关 ============ */
.elder-toggle {
  flex-shrink: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1.5px solid color-mix(in srgb, var(--brand) 40%, transparent);
  border-radius: 999px;
  padding: 9px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  touch-action: manipulation;
}

html.elder .elder-toggle {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

/* 窄屏优先保住「大字模式」入口，隐藏装饰性角标（说明文案在正文另有交代） */
@media (max-width: 560px) {
  .badge {
    display: none;
  }
}

/* ============ 朗读题目 ============ */
.q-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -6px 0 12px;
}

.read-btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1.5px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  touch-action: manipulation;
}

.read-btn.speaking {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

/* ============ 长辈（大字）模式 ============ */
html.elder {
  --muted: #3d4b59;
}

@media (prefers-color-scheme: dark) {
  html.elder {
    --muted: #c6d5e4;
  }
}

html.elder body {
  font-size: 20px;
  line-height: 1.85;
}

html.elder .brand-text strong {
  font-size: 18px;
}
html.elder .intro h1 {
  font-size: 30px;
}
html.elder .lead {
  font-size: 19px;
}
html.elder .meta-chips li {
  font-size: 16px;
  padding: 7px 15px;
}
html.elder .start-card h2,
html.elder .notes h2,
html.elder .faq h2 {
  font-size: 21px;
}
html.elder .start-field legend,
html.elder .start-agree {
  font-size: 19px;
}
html.elder .notes ul,
html.elder .about .notes p {
  font-size: 18px;
}
html.elder .faq summary {
  font-size: 18px;
  padding: 16px 0;
}
html.elder .faq details p {
  font-size: 17.5px;
}
html.elder .disclaimer {
  font-size: 16.5px;
}
html.elder .game-eyebrow {
  font-size: 15px;
}
html.elder .game-card h2 {
  font-size: 22px;
}
html.elder .game-text {
  font-size: 18px;
}
html.elder .game-hint {
  font-size: 16.5px;
}
html.elder .game-note {
  font-size: 15px;
}
html.elder .radio,
html.elder .check {
  font-size: 19px;
  padding: 15px 16px;
}
html.elder .radio input,
html.elder .check input {
  width: 26px;
  height: 26px;
}
html.elder .field,
html.elder .sent-area {
  font-size: 20px;
  padding: 14px;
}
html.elder .field-label,
html.elder .q-label {
  font-size: 18px;
}
html.elder .btn {
  font-size: 19px;
  padding: 15px 22px;
  min-height: 52px;
}
html.elder .btn.sm {
  font-size: 17px;
  min-height: 46px;
}
html.elder .btn.xl {
  font-size: 21px;
  padding: 19px;
}
html.elder .link-btn {
  font-size: 17px;
}
html.elder .hint,
html.elder .warn-note,
html.elder .mic-note,
html.elder .mem-progress,
html.elder .dg-progress,
html.elder .edu-note,
html.elder .progress-meta {
  font-size: 17px;
}
html.elder .big-note {
  font-size: 20px;
}
html.elder .ok-note {
  font-size: 21px;
}
html.elder .progress-track {
  height: 10px;
}
html.elder .q-domain,
html.elder .q-pts {
  font-size: 15.5px;
}
html.elder .q-title {
  font-size: 26px;
}
html.elder .q-desc {
  font-size: 18.5px;
}
html.elder .q-nav .btn {
  font-size: 20px;
  padding: 18px;
  min-height: 58px;
}
html.elder .read-btn {
  font-size: 17.5px;
  padding: 12px 18px;
  min-height: 50px;
}
html.elder .elder-toggle {
  font-size: 15px;
  min-height: 46px;
}
html.elder .word-flash {
  font-size: 68px;
  letter-spacing: 1px;
  min-height: 150px;
}
html.elder .name-emoji {
  font-size: 68px;
}
html.elder .name-card .field {
  font-size: 19px;
}
html.elder .tap-btn {
  font-size: 24px;
  padding: 28px;
}
html.elder .sentence-show {
  font-size: 24px;
}
html.elder .flu-time {
  font-size: 52px;
  min-width: 84px;
}
html.elder .flu-count {
  font-size: 17px;
}
html.elder .chip {
  font-size: 18px;
}
html.elder .chip button {
  width: 30px;
  height: 30px;
  font-size: 18px;
}
html.elder .mcq legend {
  font-size: 18px;
}
html.elder .interpret {
  font-size: 18px;
}
html.elder .interpret h3 {
  font-size: 19px;
}
html.elder .result-details {
  font-size: 17px;
}
html.elder .result-details td {
  padding: 9px 4px;
}
html.elder .domain-row {
  font-size: 17px;
}
html.elder .ring-wrap {
  width: 200px;
}
html.elder .ring-label b {
  font-size: 54px;
}
html.elder .ring-label span {
  font-size: 16px;
}
html.elder .ref figcaption {
  font-size: 14px;
}
html.elder .trail-svg {
  max-width: 420px;
}

/* ============ 录音诊断面板（URL 带 ?micdiag 时显示） ============ */
.mic-diag {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 999;
  max-width: 420px;
  margin: 0 auto;
}

.mic-diag-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.mic-diag-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.mic-diag-card table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 6px;
  font-size: 14px;
}

.mic-diag-card td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
}

.mic-diag-card td:last-child {
  text-align: right;
  white-space: nowrap;
}

.mic-diag-card .btn {
  width: 100%;
  margin-top: 8px;
}

.mic-diag-card .mic-note {
  min-height: 1.5em;
  word-break: break-all;
}
