/* REAL 物理 AI 场景企业调研问卷 —— 样式 */

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #14161b;
  --ink-2: #4a5160;
  --ink-3: #8b92a2;
  --line: #e5e8ee;
  --line-strong: #d5d9e2;
  --accent: #1d5fd0;
  --accent-soft: #ebf2fd;
  --s2: #0d8a72;
  --s2-soft: #e9f7f3;
  --s3: #a2661a;
  --s3-soft: #fbf3e5;
  --danger: #c0392b;
  --danger-soft: #fdeeec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 22, 27, 0.04), 0 8px 24px rgba(20, 22, 27, 0.04);
}

* { box-sizing: border-box; }

/* hidden 属性兜底：像 .org-bar 这种自带 display 的元素，hidden 的默认样式会被类选择器盖掉 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  /* 防止 iOS / 安卓横屏时系统自行放大字号 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
}

/* 旧版内核不支持 flex gap，用 margin 兜底（现代内核渲染结果一致） */
.topbar-inner > * + * { margin-left: 16px; }

.brand {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
  /* 系统字号放大时允许收缩并省略，避免把顶栏右侧的进度文案挤出顶栏 */
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.progress-wrap > * + * { margin-left: 10px; }

.progress-track {
  flex: 1;
  /* 用 em 让进度条随用户字号等比变粗（15px 基准下等于 6px） */
  height: 0.4em;
  background: #edf0f4;
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.25s ease;
}

/* 顶栏右侧进度文案（固定显示「问卷进度」，不显示数字）：字体放大时不参与收缩，避免被进度条挤成两行 */
.progress-text {
  flex: none;
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}

.link-btn {
  font-size: 12.5px;
  color: var(--ink-2);
  text-decoration: none;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 5px 10px;
  background: #fff;
  white-space: nowrap;
  transition: all 0.15s;
}

.link-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- 页面骨架 ---------- */

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

.hero {
  margin-bottom: 22px;
}

/* 主办机构 Logo 条：不加卡片容器，与标题、说明框共用同一条左轴 */
.org-bar {
  display: flex;
  align-items: center;
  /* logo 与主标题之间留出呼吸空间（原 20px 偏紧） */
  margin-bottom: 26px;
}

.org-bar > * + * { margin-left: 18px; }

.org-bar .logo {
  display: block;
  width: auto;
  height: 26px;
  flex: none;
}


.logo-div {
  flex: none;
  width: 1px;
  height: 18px;
  background: var(--line-strong);
}

.hero-kicker {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: 26px;
  line-height: 1.35;
  /* 副标题是主标题的注解，两者应成一组：把这里压紧，留白交给副标题下方 */
  margin: 0 0 2px;
  letter-spacing: -0.01em;
  font-weight: 700;
}

/* 副标题：正标题下方，字号与字重都与说明框正文完全一致，只用颜色区分层级 */
.hero-sub {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: 0.01em;
  margin: 0 0 22px;
}

.hero-orgs {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 16px;
}

.hero-intro {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--ink-2);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.hero-intro p { margin: 0 0 6px; }
/* 称呼行：颜色加深、字重加粗，段后留更大空白，与正文段间拉开层次 */
.hero-intro p:first-child {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
}
.hero-intro p:last-child { margin-bottom: 0; }

/* ---------- 分区 ---------- */

.section {
  margin-top: 26px;
}

.section-head {
  display: flex;
  align-items: baseline;
  margin-bottom: 12px;
  padding-left: 2px;
}

.section-head > * + * { margin-left: 4px; }

/* 序号与标题同字号：中文「一」是一根横画，落在字框的中部；
   只有与标题等字号时，横画才正好落在后面汉字的视觉中线上（字号偏小会明显偏低） */
.section-index {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  flex: none;
}

/* 中文序号统一带括号，如「三、整体判断与后续联系」 */
.section-index::after {
  content: "、";
  color: var(--ink-3);
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  /* 字号放大后标题可收缩换行，不会把分区标题挤出屏幕 */
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.section-desc {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: -4px 0 12px;
  padding-left: 2px;
}

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

/* ---------- 题目 ---------- */

.q {
  padding: 20px 22px;
  border-top: 1px solid var(--line);
}

.q:first-child { border-top: none; }

.q-head {
  display: flex;
  align-items: flex-start;
}

.q-head > * + * { margin-left: 10px; }

.q-num {
  flex: none;
  /* 尺寸用 em（12px 基准下：26px 宽、2px/6px 内边距、2px 上偏移），随系统字号等比放大 */
  min-width: 2.17em;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 0.167em 0.5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  /* 徽标垂直居中于题干首行：行盒 23.25px 与徽标 23.19px 几乎等高，只需 ~0.1px 补偿
     （用 em 表达，字号放大时同步） */
  margin-top: 0.01em;
}

.q-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink);
  /* 允许收缩 + 长串（英文缩写、编号）断行，字号放大时不撑破卡片 */
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.req,
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  /* 与题干文字的视觉中线对齐：0.136em（11px 基准下 = 1.5px，比原 2px 低 0.5px）。
     用 em 而非 px，字号放大时偏移等比放大，大字号下依然共线 */
  vertical-align: 0.136em;
  margin-left: 6px;
}

.req {
  color: var(--danger);
  background: var(--danger-soft);
}

.tag {
  color: var(--ink-2);
  background: #f1f3f7;
  font-variant-numeric: tabular-nums;
}

.q-hint {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 6px 0 0 36px;
}

.q-error {
  display: none;
  font-size: 12.5px;
  color: var(--danger);
  margin: 10px 0 0 36px;
}

.q-warn {
  font-size: 12.5px;
  color: #8a5a10;
  background: #fdf5e7;
  border: 1px solid #f0e0c0;
  border-radius: 6px;
  padding: 7px 11px;
  margin: 10px 0 0 36px;
}

.q-warn[hidden] { display: none; }

.q.is-invalid .q-error { display: block; }

.q.is-invalid .opts,
.q.is-invalid .field {
  outline: 1px solid rgba(192, 57, 43, 0.35);
  outline-offset: 6px;
  border-radius: 6px;
}

/* ---------- 选项 ---------- */

.opts {
  /* 12px = 原 10px + 选项上下内边距从 4px 减到 2px 的补偿，
     保证「题干 → 第一个选项」的视觉距离与改动前完全一致 */
  margin: 12px 0 0 36px;
  display: flex;
  flex-direction: column;
}

.opt-wrap { display: block; }

.opt {
  display: flex;
  align-items: flex-start;
  /* 只压缩选项之间的行距：上下内边距 4px → 2px（用 em 表达，系统放大字号时同步放大，
     大字号用户不会觉得挤）；左右 10px 决定 hover 底色高出文字的宽度，保持不动 */
  padding: 0.1333em 10px;
  margin: 0 -10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}

.opt:hover { background: #f7f9fc; }

.opt input[type="radio"],
.opt input[type="checkbox"] {
  flex: none;
  /* 控件尺寸与偏移都用 em（相对标签字号），系统放大字号时与文字同步变粗变高 */
  font-size: inherit;
  width: 1.13em;
  height: 1.13em;
  /* 与选项文字墨迹的视觉中线对齐（中文字形在行框内偏下，故比纯几何居中多留约 0.27em） */
  margin: 0.27em 0.67em 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.opt-text {
  display: block;
  min-width: 0;
}

/* 所有选项文字统一字号、字重与颜色 */
.opt-label {
  font-size: 14.5px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.45;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.opt-other {
  margin: 0 0 4px 37px;
}

.q.is-invalid .opt-other input {
  border-color: var(--danger);
  background: #fffaf9;
}

.opt-other input {
  width: 100%;
  max-width: 380px;
  font: inherit;
  font-size: 13.5px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fcfdff;
  color: var(--ink);
  outline: none;
}

.opt-other input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- 文本输入 ---------- */

.field {
  margin: 12px 0 0 36px;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fcfdff;
  outline: none;
  transition: all 0.15s;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.6;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* 输入框的提示文字：字号与选项正文（.opt-label）保持一致，比用户实际输入的文字更轻一档。
   注：移动端 input 自身字号是 16px（防 iOS 聚焦放大），但 ::placeholder 的字号可以独立设置，
   不影响该判定，所以提示文字能安全地显示为 14px */
.field input::placeholder,
.field textarea::placeholder,
.opt-other input::placeholder,
.token-row input::placeholder {
  font-size: 14.5px;
  color: #b0b6c2;
}

/* ---------- 场景块 ---------- */

.scene-block {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  /* 顶栏高度随用户字号变化，由 app.js 写入 --topbar-h，定位时不被顶栏遮住 */
  scroll-margin-top: calc(var(--topbar-h, 56px) + 12px);
}

.scene-block[hidden] { display: none; }

.scene-block[data-scene-block="1"] { border-left: 3px solid var(--accent); }
.scene-block[data-scene-block="2"] { border-left: 3px solid var(--s2); }
.scene-block[data-scene-block="3"] { border-left: 3px solid var(--s3); }

.scene-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 20px;
  background: #fbfcfd;
  border-bottom: 1px solid var(--line);
}

.scene-head > .btn-ghost { margin-left: auto; }

.scene-block[data-scene-block="2"] .scene-head { background: #fafdfc; }
.scene-block[data-scene-block="3"] .scene-head { background: #fdfbf7; }

.scene-name {
  font-size: 14.5px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.scene-block[data-scene-block="1"] .scene-name { color: var(--accent); }
.scene-block[data-scene-block="2"] .scene-name { color: var(--s2); }
.scene-block[data-scene-block="3"] .scene-name { color: var(--s3); }

.scene-status {
  font-size: 11.5px;
  color: var(--ink-3);
  background: #f1f3f7;
  border-radius: 4px;
  padding: 2px 7px;
}

.scene-note {
  padding: 14px 20px;
  font-size: 13px;
  color: var(--ink-2);
  background: #f9fbfe;
  border-bottom: 1px solid var(--line);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.scene-note p { margin: 0 0 6px; }
.scene-note p:last-child { margin-bottom: 0; }

/* 灰色按钮 */
.btn-ghost {
  flex: none;
  font: inherit;
  font-size: 13px;
  color: #556070;
  background: #eef0f4;
  border: 1px solid #dde1e8;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-ghost:hover {
  background: #e6e9ef;
  border-color: #cfd5df;
  color: #333b48;
}

.btn-ghost:active { transform: translateY(1px); }

.scene-body[hidden] { display: none; }

.foot-note {
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ---------- 提交区 ---------- */

.submit-bar {
  margin-top: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 22px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.submit-bar .btn-primary { min-width: 180px; }

.btn-primary {
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 9px;
  padding: 11px 26px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary:hover { background: #1a52b5; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.submit-hint {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 12px 0 0;
  text-align: center;
}

.submit-hint:empty { display: none; }

.invalid-count {
  color: var(--danger);
  font-weight: 600;
}

/* ---------- 提交成功 ---------- */

.done-page {
  text-align: center;
  padding: 54px 12px 44px;
}

.done-orgs {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.done-orgs > * + * { margin-left: 18px; }

.done-orgs .logo {
  display: block;
  width: auto;
  height: 26px;
  flex: none;
}

.done-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 30px;
}

.done-check {
  display: block;
  width: 66px;
  height: 66px;
  margin: 0 auto 16px;
  color: var(--accent);
}

.done-h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 10px;
}

.done-thanks {
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 0 0 6px;
}

.done-close {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 0;
}

.done-note {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 14px 0 0;
}

.done-note.warn { color: var(--s3); }

/* ---------- 统计页 ---------- */

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

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

.stat-label {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-value small {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 3px;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab {
  font: inherit;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
}

.tab:hover { border-color: #b9c2d2; }

.tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.tab .tab-count {
  font-size: 11.5px;
  opacity: 0.7;
  margin-left: 5px;
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.empty {
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 44px 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13.5px;
}

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

.res-q-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.res-q-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}

.res-q-meta {
  font-size: 12px;
  color: var(--ink-3);
  margin-left: auto;
  padding-left: 8px;
  text-align: right;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 42%) 1fr 58px;
  gap: 12px;
  align-items: center;
  padding: 5px 0;
}

.bar-label {
  font-size: 13px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 9px;
  background: #f0f2f6;
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.bar-fill.g2 { background: var(--s2); }
.bar-fill.g3 { background: var(--s3); }
.bar-fill.g0 { background: #9aa3b2; }

.bar-num {
  font-size: 12.5px;
  color: var(--ink-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-num span {
  color: var(--ink-3);
  font-size: 11.5px;
  margin-left: 4px;
}

.text-answers {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.text-answers li {
  font-size: 13px;
  color: var(--ink-2);
  background: #fbfcfe;
  border-left: 2px solid var(--line-strong);
  border-radius: 0 6px 6px 0;
  padding: 6px 12px;
  line-height: 1.6;
  word-break: break-word;
}

.more-note {
  font-size: 12px;
  color: var(--ink-3);
  margin: 8px 0 0;
}

/* ---------- 答卷明细（逐条记录 + 追踪信息） ---------- */

.rec-tip { margin: 4px 0 14px; line-height: 1.7; }

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

.rec-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13.5px;
  margin-bottom: 10px;
}

.rec-head > * + * { margin-left: 8px; }

.rec-idx {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 2px 6px;
  font-variant-numeric: tabular-nums;
}

.rec-company {
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.rec-time {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  white-space: nowrap;
}

.rec-badge {
  flex: none;
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 99px;
  background: #eef2f8;
  color: var(--ink-2);
}

.rec-badge.demo { background: var(--danger-soft); color: var(--danger); }

.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2px 20px;
}

.rec-row {
  display: flex;
  align-items: baseline;
  font-size: 12.5px;
  line-height: 1.75;
  min-width: 0;
}

.rec-k {
  flex: 0 0 7.4em;
  color: var(--ink-3);
}

.rec-v {
  color: var(--ink);
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

/* IP 后面的归属地：跟随 IP 显示，不抢主信息，解析中/未知时更淡 */
.rec-ip { font-variant-numeric: tabular-nums; }

.rec-geo { color: var(--ink-3); }

.rec-geo:not(:empty)::before { content: ' · '; color: #c2c8d4; }

.rec-geo.is-pending { color: #aeb5c4; font-size: 12px; }

.rec-geo.is-fail { color: #aeb5c4; font-size: 12px; }

.rec-more {
  margin-top: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}

.rec-more > summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--accent);
  list-style: none;
  outline: none;
}

.rec-more > summary::-webkit-details-marker { display: none; }

.rec-more > summary::before { content: '▸ '; }
.rec-more[open] > summary::before { content: '▾ '; }
.rec-more > summary:hover { color: #14459c; }

.rec-ans-group { margin-top: 10px; }

.rec-ans-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 2px;
}

.rec-ans {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rec-ans li {
  display: grid;
  grid-template-columns: 2.6em 1fr;
  padding: 5px 0;
  border-bottom: 1px solid #f2f4f8;
}

.rec-ans li:last-child { border-bottom: 0; }

.rec-qn {
  grid-row: 1 / span 2;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.rec-qt {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.rec-qa {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.6;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* ---------- 提交确认弹窗 ---------- */

.modal-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 60;
  background: rgba(23, 28, 38, 0.38);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  /* 系统字号调大后弹窗可能高于屏幕：整层可滚动，按钮始终能滚到 */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.modal {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(20, 28, 45, 0.22);
  padding: 22px 22px 18px;
  /* auto 外边距：装得下时垂直居中，装不下时贴顶并可滚动（不会顶出屏幕） */
  margin: auto;
}

.modal-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.modal-text {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.75;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

.modal-actions > * + * { margin-left: 10px; }

.modal-actions .btn-ghost,
.modal-actions .btn-primary {
  padding: 9px 18px;
  font-size: 14px;
}

/* ---------- 草稿恢复提示 ---------- */

.restore-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: #eef4ff;
  border: 1px solid #d6e2fb;
  color: #2b4a7d;
  font-size: 12.5px;
  border-radius: 9px;
  padding: 9px 13px;
  margin-bottom: 14px;
}

.restore-note[hidden] { display: none; }

.restore-note button {
  font: inherit;
  font-size: 12.5px;
  color: #1d5fd0;
  background: transparent;
  border: 0;
  padding: 4px 2px;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- 统计页口令门禁 ---------- */

.token-gate {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.token-gate p { margin: 0 0 12px; }

.token-err {
  color: var(--danger);
  font-size: 13px;
}

.token-row {
  display: flex;
  align-items: center;
}

.token-row input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
}

.token-row input:focus { border-color: var(--accent); }

.token-row .btn-primary { margin-left: 10px; }

/* ---------- 页脚 ---------- */

.foot {
  margin-top: 34px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.9;
}

/* ---------- 响应式 ---------- */

@media (max-width: 720px) {
  .page { padding: 20px 14px 60px; padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .hero h1 { font-size: 21px; }
  /* 副标题字号跟随移动端的说明框正文（13px），保持两者一致 */
  .hero-sub { font-size: 13px; margin-bottom: 19px; }
  .hero-intro { padding: 21px 16px; font-size: 13px; }
  .hero-intro p:first-child { margin-bottom: 14px; }
  .org-bar { margin-bottom: 22px; }
  .org-bar > * + * { margin-left: 12px; }
  .org-bar .logo { height: 19px; }
  .logo-div { height: 15px; }
  .topbar-inner { padding: 9px 14px; }
  .topbar-inner > * + * { margin-left: 10px; }
  .brand { display: none; }
  .progress-text { font-size: 11.5px; }

  .q { padding: 16px 15px; }
  .opts, .field, .q-hint, .q-error, .q-warn { margin-left: 0; }
  /* 题号与题干同行：题号不换行、题干在右侧折行 */
  .q-head { flex-direction: row; align-items: flex-start; }
  .q-head > * + * { margin-left: 8px; margin-top: 0; }
  /* 移动端同样只压缩选项之间的行距：行高 40px → 34px、上下内边距 8px → 5px（em 表达，随系统字号放大） */
  .opt { padding: 0.3333em 5px; margin: 0 -5px; min-height: 30px; }
  /* 13px = 12px + 选项上内边距 6px→5px 的补偿，保持「题干 → 第一个选项」距离不变 */
  .opts { margin-top: 13px; }
  .opt-label { font-size: 14px; }
  .opt-other { margin-left: 27px; }
  /* iOS 上输入框字号小于 16px 会在聚焦时自动放大页面 */
  .field input,
  .field textarea,
  .opt-other input { font-size: 16px; }
  /* 提示文字跟随选项正文字号（14px），不随输入框的 16px */
  .field input::placeholder,
  .field textarea::placeholder,
  .opt-other input::placeholder { font-size: 14px; }

  .scene-head { padding: 13px 15px; gap: 8px; }
  .scene-head > .btn-ghost { margin-left: 0; width: 100%; white-space: normal; }
  .scene-note { padding: 13px 15px; }

  .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .bar-row { grid-template-columns: 1fr 62px; row-gap: 4px; }
  /* 答卷明细：单列堆叠，标签列收窄 */
  .rec-card { padding: 14px 14px; }
  .rec-grid { grid-template-columns: 1fr; }
  .rec-k { flex: 0 0 6.2em; }
  .rec-time { white-space: normal; }
  .rec-ans li { grid-template-columns: 2.2em 1fr; }
  .bar-track { grid-column: 1 / -1; order: 3; }
  .bar-num { text-align: right; }

  .modal-actions { flex-direction: column; }
  .modal-actions > * + * { margin-left: 0; margin-top: 10px; }
  .modal-actions .btn-ghost,
  .modal-actions .btn-primary { width: 100%; }

  .submit-bar { padding: 18px; }
  .submit-bar .btn-primary { width: 100%; min-width: 0; }
  .submit-hint { margin-top: 10px; }
  .done-page { padding: 34px 8px 32px; }
  .done-orgs > * + * { margin-left: 12px; }
  .done-orgs .logo { height: 20px; }
  .done-title { font-size: 18px; margin-bottom: 24px; }
  .done-check { width: 58px; height: 58px; }
  .toolbar .btn-ghost { flex: 1 1 auto; }
}

@media (max-width: 400px) {
  .stat-cards { grid-template-columns: 1fr; }
  /* 12px 基准下等于 24px，随系统字号等比放大 */
  .q-num { min-width: 2em; }
}
