/* FirstOrder Lab 公共样式
   要求：320~430px 手机宽度不横向溢出；表单点击区域 ≥44px；字号 ≥16px（防 iOS 自动缩放）。 */

:root {
  --color-text: #1f2933;
  --color-muted: #64748b;
  --color-border: #d7dee8;
  --color-bg: #f5f7fa;
  --color-card: #ffffff;
  --color-primary: #1d4ed8;
  --color-primary-dark: #1e40af;
  --color-danger: #b42318;
  --color-warn-bg: #fff7e6;
  --color-warn-border: #f0b429;
  --color-preview-bg: #eef4ff;
  --color-preview-border: #1d4ed8;
  --radius: 8px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
               "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;              /* 双保险：任何意外宽度都不产生横向滚动 */
}

/* ---------- 布局骨架 ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
}

.site-brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--color-text);
  text-decoration: none;
}

.site-nav { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.site-nav a { color: var(--color-primary); text-decoration: none; }
.nav-note { color: var(--color-muted); font-size: 14px; }

.site-main {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.site-footer {
  padding: 16px;
  color: var(--color-muted);
  font-size: 13px;
  text-align: center;
}

.site-footer p { margin: 0 auto; max-width: 720px; }

/* ---------- 卡片 ---------- */

.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 16px;
}

.card h1 { font-size: 22px; margin: 0 0 12px; line-height: 1.35; }
.card h2 { font-size: 18px; margin: 20px 0 10px; }
.card h2:first-child { margin-top: 0; }

.lead { font-size: 17px; }

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

.service-meta { margin: 16px 0; }
.service-meta dt { font-weight: 600; font-size: 14px; color: var(--color-muted); margin-top: 10px; }
.service-meta dd { margin: 2px 0 0; }

.feature-list { margin: 8px 0 0; padding-left: 22px; }
.feature-list li { margin-bottom: 6px; }

/* ---------- 提示条 ---------- */

.notice {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 15px;
}

.notice-preview {
  background: var(--color-preview-bg);
  border-color: var(--color-preview-border);
  font-weight: 500;
}

.notice-warn { background: var(--color-warn-bg); border-color: var(--color-warn-border); }
.notice-locked { background: var(--color-warn-bg); border-color: var(--color-warn-border); }
.notice-consent { background: #f8fafc; font-size: 14px; }
.notice-consent ul { margin: 6px 0 0; padding-left: 20px; }
.notice-consent li { margin-bottom: 4px; }

.notice-error {
  background: #fef3f2;
  border-color: var(--color-danger);
  color: var(--color-danger);
}

/* ---------- 表单 ---------- */

.field { margin-bottom: 16px; }

.field label,
.field .label-text {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
.page-auth input,
textarea,
select {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

textarea { min-height: 88px; resize: vertical; }

input[readonly], textarea[readonly] { background: #f1f5f9; color: var(--color-muted); }

input:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.35);
  outline-offset: 1px;
}

.field-inline { display: flex; align-items: center; gap: 8px; }
.field-inline input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; margin: 0; }
.field-inline label { margin: 0; font-weight: 500; }

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

.question {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0 0 16px;
}

.question legend {
  font-weight: 600;
  font-size: 16px;
  padding: 0 6px;
  line-height: 1.5;
}

.required-mark { color: var(--color-danger); margin-left: 4px; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 8px;
  min-height: 44px;
  border-radius: var(--radius-sm);
}
.option:hover { background: #f8fafc; }
.option input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; flex: 0 0 auto; }
.option label { flex: 1 1 auto; cursor: pointer; }

.option-edit { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.option-edit .option-id {
  flex: 0 0 auto;
  min-width: 32px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  color: var(--color-muted);
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
}
.consent-row input { width: 20px; height: 20px; min-height: 0; margin: 3px 0 0; flex: 0 0 auto; }
.consent-row label { flex: 1 1 auto; font-size: 15px; }

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--color-primary-dark);
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}

code.muted { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

/* ---------- 按钮 ---------- */

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

.button {
  display: inline-block;
  min-height: 44px;
  padding: 11px 18px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.button-primary { background: var(--color-primary); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--color-primary-dark); }

.button-ghost { background: #fff; color: var(--color-primary); border-color: var(--color-primary); }

.button:disabled,
.button[disabled] {
  background: #cbd5e1;
  color: #64748b;
  border-color: #cbd5e1;
  cursor: not-allowed;
}

.form-status { font-size: 14px; color: var(--color-muted); }
.form-status.is-error { color: var(--color-danger); font-weight: 600; }
.form-status.is-ok { color: #067647; font-weight: 600; }

.field-errors {
  background: #fef3f2;
  border: 1px solid var(--color-danger);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 16px;
  color: var(--color-danger);
  font-size: 14px;
}
.field-errors ul { margin: 6px 0 0; padding-left: 20px; }

.preview-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.submission-success {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #067647;
  border-radius: var(--radius);
  background: #ecfdf3;
}
.submission-success h2 { margin-top: 0; color: #067647; }

/* ---------- 无障碍 ---------- */

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

/* ---------- 窄屏微调（320px 起） ---------- */

@media (max-width: 430px) {
  body { font-size: 16px; }
  .site-main { padding: 12px 12px 40px; }
  .card { padding: 14px 12px; }
  .card h1 { font-size: 20px; }
  .button { width: 100%; }          /* 手机上按钮通栏，避免被挤出屏幕 */
  .actions { gap: 10px; }
  .preview-links .button { width: 100%; }
  .option-edit { flex-wrap: wrap; }
  .option-edit input { flex: 1 1 100%; }
}

/* ==========================================================================
   B 追加：项目管理三页（projects.html / project_new.html / workspace.html）
   仅新增类，不覆盖上面任何既有规则；窄屏规则放在本段自己的 @media 里。
   ========================================================================== */

/* 数据表格：项目列表与工作台的题目/工具表都用它 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
.data-table th { font-size: 13px; color: var(--color-muted); font-weight: 600; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table a { color: var(--color-primary); }

/* 等宽文本：项目 ID、UUID、分享链接、时间戳 */
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  word-break: break-all;
}

/* 状态与数据类型标签（.tag 的语义变体，颜色与页面语义一致） */
.tag-draft { background: #eef1f6; color: #475569; }
.tag-planned { background: var(--color-preview-bg); color: var(--color-primary-dark); }
.tag-collecting { background: var(--color-warn-bg); color: #8a5a00; }
.tag-reviewed { background: #e7f6ee; color: #067647; }
.tag-real { background: #e7f6ee; color: #067647; }
.tag-test { background: var(--color-warn-bg); color: #8a5a00; }   /* 测试样例必须一眼可辨 */
.tag-running { background: var(--color-warn-bg); color: #8a5a00; }
.tag-succeeded { background: #e7f6ee; color: #067647; }
.tag-failed { background: #fdecea; color: var(--color-danger); }

/* 工具运行日志 */
.run {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fbfcfe;
}
.run-head { margin: 0 0 8px; font-size: 13px; color: var(--color-muted); word-break: break-all; }
.run .notice { margin: 0 0 8px; }
.run-tools { width: 100%; border-collapse: collapse; font-size: 13px; overflow-wrap: anywhere; }
.run-tools th,
.run-tools td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--color-border); vertical-align: top; }
.run-tools th { color: var(--color-muted); font-weight: 600; white-space: nowrap; }
.tool-status-succeeded { color: #067647; }
.tool-status-failed { color: var(--color-danger); font-weight: 600; }
.tool-status-running { color: #8a5a00; }

/* 窄屏保留数据类型与题干，只隐藏时间列。 */
@media (max-width: 430px) {
  [data-testid="project-table"] th:nth-child(4),
  [data-testid="project-table"] td:nth-child(4) { display: none; }
  .data-table th, .data-table td { padding: 8px 4px; font-size: 14px; }
  .run-tools th:nth-child(3), .run-tools td:nth-child(3),
  .run-tools th:nth-child(4), .run-tools td:nth-child(4) { display: none; }
  .service-meta dd .button { margin-top: 6px; }
}

/* ------------------------------------------------------------------ *
 * 产品门面：首页 Hero 与四步故事条（B 追加，纯新增，不改既有规则）
 * 目的：第一眼是"AI 创业验证产品"，而不是后台管理系统的列表页。
 * ------------------------------------------------------------------ */

.hero {
  background: linear-gradient(180deg, #ffffff 0%, #f2f6ff 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 36px 32px 28px;
  margin-bottom: 20px;
}

.hero-brand {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  font-weight: 600;
}

.hero-title {
  margin: 0 0 16px;
  font-size: 34px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.hero-value {
  margin: 0 0 24px;
  font-size: 17px;
  line-height: 1.9;
  color: var(--color-text);
  max-width: 46em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

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

.button-lg {
  padding: 12px 22px;
  font-size: 16px;
  border-radius: var(--radius);
}

.story { margin-bottom: 20px; }

.story-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.story-step {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px 16px;
}

.story-step h2 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--color-text);
}

.story-step p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-muted);
}

.story-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 430px) {
  .hero { padding: 24px 18px 20px; }
  .hero-title { font-size: 26px; }
  .hero-value { font-size: 15px; line-height: 1.8; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .button { text-align: center; }
}

/* 步骤提示与工作台验证进度条 */
.step-hint {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-primary);
}

.ws-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  margin-bottom: 16px;
}

.ws-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-card);
  font-size: 13px;
  color: var(--color-muted);
  white-space: normal;
  min-width: 0;
  min-height: 44px;
  text-decoration: none;
}

.ws-step:hover { border-color: var(--color-primary); text-decoration: underline; }
.ws-step:active { background: var(--tone-info-bg); }
.page-workspace section[id] { scroll-margin-top: var(--space-4); }

.share-link { min-width: 0; }
.share-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--space-2);
  align-items: center;
}
.share-link-row input { min-width: 0; }
.share-link .form-status { overflow-wrap: anywhere; }

@media (max-width: 600px) {
  .ws-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 430px) {
  .share-link-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-link-row input { grid-column: 1 / -1; }
  .share-link-row .button { justify-self: start; }
}

.ws-step-num {
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}

.ws-step-done {
  border-color: #a7d7bd;
  background: #f2fbf6;
  color: #067647;
  font-weight: 600;
}

.ws-step-done .ws-step-num { background: #067647; color: #fff; }

.ws-step-current {
  border-color: var(--color-primary);
  background: var(--color-preview-bg);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.ws-step-current .ws-step-num { background: var(--color-primary); color: #fff; }

/* 报告已完成但之后又收到新回答（stale）：用琥珀色提示"待更新"，
   避免"第 4 步全绿 + 状态=收反馈中"看起来自相矛盾。 */
.ws-step-stale {
  border-color: var(--color-warn-border);
  background: var(--color-warn-bg);
  color: #8a5a00;
  font-weight: 600;
}

.ws-step-stale .ws-step-num { background: #8a5a00; color: #fff; }

/* ==========================================================================
   B 追加 v2：界面精修层（方向 A 保守精修）
   设计令牌 + 组件六态 + 表格/提示条节奏 + 动效与无障碍 + 窄屏补强。
   原则：**只新增与覆盖式微调**，不删除也不改写上面 C 的规则，把回归风险压到最低。
   上面遗留的硬编码值（6/8/10/12/14/16/20px、#f8fafc、#e2e8f0 等）本轮不动，
   新代码一律走下面的令牌，后续要统一时按令牌逐条替换即可。
   ========================================================================== */

:root {
  /* 间距阶：全站新代码只用这六档 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* 字阶 */
  --font-xs: 12px;
  --font-sm: 13px;
  --font-base: 14px;
  --font-md: 15px;
  --font-lg: 16px;
  --font-xl: 17px;
  --font-2xl: 18px;
  --font-3xl: 22px;

  /* 圆角：控件小圆角 / 卡片大圆角 / 标签胶囊 */
  --radius-sm: 6px;
  --radius-pill: 999px;

  /* 语义色对（前景 + 浅底），与既有 --color-* 同名同义，只是补齐成对的值 */
  --tone-ok-fg: #067647;
  --tone-ok-bg: #e7f6ee;
  --tone-warn-fg: #8a5a00;
  --tone-warn-bg: #fff7e6;
  --tone-info-fg: #1e40af;
  --tone-info-bg: #eef4ff;
  --tone-neutral-fg: #475569;
  --tone-neutral-bg: #eef1f6;
  --tone-danger-fg: #b42318;
  --tone-danger-bg: #fef3f2;

  /* 交互反馈时长 */
  --t-fast: 120ms;
  --t-base: 180ms;

  /* 覆盖：次要文字原为 #64748b，在页面底色 #f5f7fa 上只有 4.43:1，
     未达 WCAG AA 的 4.5:1。这里在**不改变观感量级**的前提下压深一档，
     在页面底上约 5.2:1、在白卡片上约 5.5:1，同时与正文 #1f2933 仍有明显层级差。
     （两个 :root 同规格，后者生效；上面的原值保留以便回溯。） */
  --color-muted: #586879;
}

/* ---------- 1. 标题与段落节奏 ---------- */

/* 报告页大量使用 h3（结论摘要 / 假设评估 / 局限 / 下一步行动），
   原先没有 .card h3 规则，走浏览器默认值，与 h1/h2 不成体系。 */
.card h3 {
  font-size: var(--font-h3, 16px);
  font-size: 16px;
  margin: var(--space-5) 0 var(--space-2);
  line-height: 1.5;
}
.card h3:first-child { margin-top: 0; }

.card p { margin: 0 0 var(--space-3); }
.card p:last-child { margin-bottom: 0; }
.card > .muted + .muted { margin-top: calc(var(--space-2) * -1); }

/* 小标题与紧跟其后的说明之间收紧一点，读起来是一组 */
.card h2 + .muted,
.card h3 + .muted { margin-top: calc(var(--space-2) * -1); }

/* ---------- 2. 按钮：补齐 hover / active / 幽灵态 / 尺寸一致性 ---------- */

.button {
  border-radius: var(--radius-sm);
  transition: background-color var(--t-fast) ease,
              border-color var(--t-fast) ease,
              color var(--t-fast) ease,
              box-shadow var(--t-fast) ease;
}

.button-primary:hover:not(:disabled) {
  /* 覆盖：加一点上浮感，但不做位移动画（避免低端设备抖动） */
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
}

.button-ghost:hover:not(:disabled) {
  background: var(--tone-info-bg);
  border-color: var(--color-primary-dark);
  color: var(--color-primary-dark);
}

.button:active:not(:disabled) {
  /* 按下即时反馈，比 hover 更明显 */
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.18);
}

.button:disabled,
.button[disabled] {
  /* 覆盖：禁用态保持清晰可辨，但不与正文抢注意力 */
  background: var(--tone-neutral-bg);
  color: #94a3b8;
  border-color: #dbe3ec;
  box-shadow: none;
}

/* 链接也有明确的可点反馈 */
.card a { transition: color var(--t-fast) ease; }
.card a:not(.button):hover { color: var(--color-primary-dark); text-decoration-thickness: 2px; }

/* ---------- 3. 表单：焦点、占位、只读的视觉统一 ---------- */

input[type="text"],
input[type="number"],
textarea,
select {
  border-radius: var(--radius-sm);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}

input[type="text"]:hover:not([readonly]),
input[type="number"]:hover:not([readonly]),
textarea:hover:not([readonly]),
select:hover {
  border-color: #b9c6d6;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
  outline: none;
}

/* 键盘用户的焦点环要更醒目（鼠标点击时不出现） */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.55);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::placeholder { color: #94a3b8; opacity: 1; }

input[readonly],
textarea[readonly] {
  border-style: dashed;
  cursor: default;
}

/* 必填标记与字段说明的间距 */
.field .required-mark { font-weight: 700; }
.field > .muted { margin: 6px 0 0; }

/* 字段级错误：左侧色条让"哪里错了"一眼可见 */
.field-errors {
  border-left-width: 4px;
  line-height: 1.7;
}

/* ---------- 4. 状态标签：九种语义色统一成对，间距放宽 ---------- */

.tag {
  /* 覆盖：原先 1px 8px 在中文里偏挤，胶囊高度也不够 */
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--font-xs);
  line-height: 1.6;
  white-space: nowrap;
}

.tag-draft { background: var(--tone-neutral-bg); color: var(--tone-neutral-fg); }
.tag-planned { background: var(--tone-info-bg); color: var(--tone-info-fg); }
.tag-collecting { background: var(--tone-warn-bg); color: var(--tone-warn-fg); }
.tag-reviewed { background: var(--tone-ok-bg); color: var(--tone-ok-fg); }
.tag-real { background: var(--tone-ok-bg); color: var(--tone-ok-fg); }
.tag-test { background: var(--tone-warn-bg); color: var(--tone-warn-fg); }   /* 测试样例必须一眼可辨 */
.tag-running { background: var(--tone-warn-bg); color: var(--tone-warn-fg); }
.tag-succeeded { background: var(--tone-ok-bg); color: var(--tone-ok-fg); }
.tag-failed { background: var(--tone-danger-bg); color: var(--tone-danger-fg); }

/* 同一行里多个标签之间留出呼吸 */
.tag + .tag { margin-left: var(--space-1); }

/* ---------- 5. 提示条：左侧语义色条，扫读时不必逐字读 ---------- */

.notice {
  border-radius: var(--radius-sm);
  border-left-width: 4px;
  line-height: 1.7;
}

.notice-preview { border-left-color: var(--color-primary); }
.notice-warn,
.notice-locked { border-left-color: var(--color-warn-border); }
.notice-error,
.field-errors { border-left-color: var(--color-danger); }
.notice-consent { border-left-color: var(--color-border); }

.notice strong { color: inherit; }

/* ---------- 6. 表格：斑马纹 + 行悬停 + 数字列右对齐 ---------- */

.data-table th,
.data-table td {
  padding: var(--space-3) var(--space-2);
}

.data-table tbody tr:nth-child(even) { background: #fafbfd; }
.data-table tbody tr:hover { background: var(--tone-info-bg); }
.data-table tbody tr { transition: background-color var(--t-fast) ease; }

/* 计数与百分比右对齐，数字才能竖着比大小。
   只作用于明确带语义标记的统计表，避免影响题干表。 */
[data-testid^="stat-option-"] td:not(:first-child),
.page-report .data-table td:last-child,
.page-report .data-table th:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- 7. 统计块与运行日志：轻微底色，和正文区分开 ---------- */

.run {
  background: #fbfcfe;
  transition: background-color var(--t-fast) ease;
}
.run:hover { background: #f7faff; }

.run-head { line-height: 1.9; }

/* ---------- 8. 无障碍与动效偏好 ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* 焦点最少可见：任何可聚焦元素都有兜底，不允许出现无焦点的键盘陷阱 */
:focus-visible { outline-offset: 2px; }

/* ---------- 9. 窄屏补强（390px 优先） ---------- */

@media (max-width: 430px) {
  /* 主操作通栏，次要操作保持行内宽度，避免满屏都是大按钮 */
  .actions .button-primary,
  .actions .button-lg,
  .hero-actions .button { width: 100%; }

  .actions .button-ghost { width: auto; }

  /* 表格：给内容留出最小可读宽度，而不是硬挤 */
  .data-table th,
  .data-table td { padding: var(--space-2) 6px; font-size: var(--font-md); }

  /* 标签可能变多，允许换行而不是撑破卡片 */
  .run-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

  /* 长 UUID / 链接 / 时间戳必须能断行 */
  .mono { overflow-wrap: anywhere; }

  /* 提示条与卡片内边距在窄屏收紧一档，但不低于 12px */
  .notice { padding: 10px 12px; }

  /* 表格里的按钮不要通栏，否则一行只有一个按钮还占满宽度 */
  .data-table .button { width: auto; }
}

@media (max-width: 430px) {
  .ws-step { padding: 6px 10px; font-size: 12px; }
}

/* ------------------------------------------------------------------ *
 * 版心宽度（B 追加，纯 CSS，不改 C 的 base.html）
 * base.html 的 .site-main 统一是 720px：公开填写页保持 720 便于阅读，
 * 但产品门面与管理端（表格密集）用更宽的版心，避免"后台窄条"观感。
 * ------------------------------------------------------------------ */

.page-landing .site-main,
.page-projects .site-main { max-width: 1120px; }

.landing-subtitle {
  margin: 0 0 20px;
  font-size: 22px;
  font-weight: 600;
  color: var(--color-primary);
}

.page-auth .site-main { max-width: 560px; }
.page-profile dd { margin-left: 0; overflow-wrap: anywhere; }
.page-rounds .card, .page-iteration .card { overflow-wrap: anywhere; }
.page-rounds .data-table th { white-space: normal; }

.page-workspace .site-main,
.page-report .site-main { max-width: 1040px; }

/* 版心放宽后，四步故事条排成一行（窄屏仍按 auto-fit 自动折行） */
@media (min-width: 900px) {
  .story-list { grid-template-columns: repeat(4, 1fr); }
}
