:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --ink: #1f2328;
  --ink-soft: #5c6570;
  --line: #e3e1dc;
  --accent: #2f5d50;
  --accent-soft: #e8f0ed;
  --warn: #8a5300;
  --warn-bg: #fdf3e3;
  --danger: #9b2c2c;
  --danger-bg: #fdeaea;
  --max: #3a4d7a;
  --max-bg: #eef1f8;
  --radius: 10px;
  --maxw: 720px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 96px; }
.wrap-wide { max-width: 1180px; }

header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  position: sticky; top: 0; z-index: 20;
}
header.site .inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
header.site.wide .inner { max-width: 1180px; }
.brand { font-weight: 600; font-size: 15px; letter-spacing: .01em; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-soft); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
}
.card h1 { font-size: 24px; margin: 0 0 14px; line-height: 1.4; }
.card h2 { font-size: 19px; margin: 0 0 12px; }
.card h3 { font-size: 16px; margin: 22px 0 8px; color: var(--ink-soft); }
.card p { margin: 0 0 12px; }
.card p:last-child { margin-bottom: 0; }

.stimulus { font-size: 18px; line-height: 1.9; }
.prewrap { white-space: pre-line; }
.stimulus .block { margin-bottom: 22px; }
.stimulus .block:last-child { margin-bottom: 0; }
.label {
  display: block; font-size: 17px; font-weight: 600;
  color: var(--ink); margin-bottom: 8px;
}
.known {
  background: #fbfaf7; border-left: 3px solid var(--line);
  padding: 14px 18px; border-radius: 0 6px 6px 0;
  white-space: pre-line;
}
.known.has-list { white-space: normal; }

.facts { margin: 0; padding: 0; list-style: none; }
.facts li {
  position: relative; padding-left: 20px; margin-bottom: 10px; line-height: 1.85;
}
.facts li:last-child { margin-bottom: 0; }
.facts li::before {
  content: ''; position: absolute; left: 4px; top: .78em;
  width: 6px; height: 6px; border-radius: 50%; background: #b9b5ab;
}

/* 多个选项在两三个维度上对比时，表格比句子省力得多 */
.factstable { margin-top: 14px; margin-bottom: 16px; overflow-x: auto; }
.factstable table { width: 100%; border-collapse: collapse; font-size: 16px; }
.factstable caption {
  text-align: left; font-weight: 600; font-size: 16px;
  color: var(--ink); padding-bottom: 8px;
}
.factstable th, .factstable td {
  border: 1px solid var(--line); padding: 10px 12px;
  text-align: left; vertical-align: top; line-height: 1.6;
  text-transform: none; letter-spacing: normal; font-size: 16px;
}
.factstable th { background: #f2efe9; color: var(--ink); font-weight: 600; }
.factstable td:first-child { font-weight: 600; white-space: nowrap; }
.flowbox {
  background: #fbfaf7; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 18px; margin-top: 18px;
}
.flowbox ol { margin: 8px 0 0; padding-left: 22px; }
.flowbox li { margin-bottom: 4px; }
.flowbox .note { margin: 10px 0 0; }
/* 作答指引：它是提问的一部分，不是脚注。
   正文字号、正文颜色，位置在输入框之前 —— 写之前看得到才有用。 */
.guide {
  margin: 0 0 10px; padding: 12px 16px;
  background: #f4f2ec; border-left: 3px solid #c7c2b5;
  border-radius: 0 6px 6px 0;
  font-size: 16px; line-height: 1.8; color: var(--ink);
  white-space: pre-line;
}
.nudge {
  margin-top: 10px; padding: 12px 14px; border-radius: 8px;
  background: var(--warn-bg); border: 1px solid #f0dfc0; color: var(--warn);
  font-size: 15px; line-height: 1.7;
}
.nudge .row { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.nudge button {
  font: inherit; font-size: 14px; padding: 8px 16px; border-radius: 8px;
  border: 1.5px solid #e0cfa8; background: #fff; color: var(--warn); cursor: pointer;
}

.maxbox {
  background: var(--max-bg); border: 1px solid #d7dcec;
  border-radius: var(--radius); padding: 18px 20px;
}
/* 中性化信息块：没有说话人，也就不该有「谁在对你说话」的视觉暗示 */
.maxbox.neutral { background: #fbfaf7; border-color: var(--line); }
.maxbox .who {
  font-weight: 600; color: var(--max); font-size: 14px;
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.maxbox .who .dot {
  width: 26px; height: 26px; border-radius: 50%; background: var(--max);
  color: #fff; display: grid; place-items: center; font-size: 11px; letter-spacing: 0;
}

.options { display: grid; gap: 10px; margin: 6px 0 0; }
.opt {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1.5px solid var(--line); background: var(--surface);
  border-radius: var(--radius); padding: 14px 16px;
  cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: border-color .12s, background .12s;
}
.opt:hover { border-color: #c9c6bf; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt .mark {
  flex: 0 0 auto; width: 20px; height: 20px; margin-top: 3px;
  border: 2px solid #bfbcb4; border-radius: 50%;
}
.opt[aria-pressed="true"] .mark { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px #fff; }
.opt.multi .mark { border-radius: 5px; }
.opt .txt { flex: 1; }
.opt .help { display: block; font-size: 14px; color: var(--ink-soft); margin-top: 3px; }

textarea, input[type=text], input[type=password], select {
  width: 100%; font: inherit; color: inherit;
  border: 1.5px solid var(--line); border-radius: 8px;
  padding: 10px 12px; background: var(--surface);
}
textarea { min-height: 88px; resize: vertical; line-height: 1.7; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.scale { display: flex; gap: 8px; flex-wrap: wrap; }
.scale button {
  flex: 1; min-width: 56px; font: inherit; padding: 12px 8px;
  border: 1.5px solid var(--line); background: var(--surface);
  border-radius: 8px; cursor: pointer;
}
.scale button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }

button.primary {
  font: inherit; font-weight: 600; padding: 13px 26px;
  background: var(--accent); color: #fff; border: none;
  border-radius: 8px; cursor: pointer;
}
button.primary:disabled { background: #b9c4c0; cursor: not-allowed; }
button.ghost {
  font: inherit; padding: 9px 16px; background: transparent;
  border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; color: var(--ink);
}
.actions { display: flex; gap: 12px; align-items: center; margin-top: 22px; flex-wrap: wrap; }

.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 20px; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.meta { font-size: 13px; color: var(--ink-soft); }

.note { font-size: 14px; color: var(--ink-soft); }
.warn { background: var(--warn-bg); border: 1px solid #f0dfc0; color: var(--warn);
        padding: 12px 14px; border-radius: 8px; font-size: 14px; }
.err  { background: var(--danger-bg); border: 1px solid #f2cdcd; color: var(--danger);
        padding: 12px 14px; border-radius: 8px; font-size: 14px; }
.ok   { background: var(--accent-soft); border: 1px solid #cfe0da; color: var(--accent);
        padding: 12px 14px; border-radius: 8px; font-size: 14px; }

.pid {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px; letter-spacing: .08em; background: #f1efe9;
  padding: 8px 14px; border-radius: 8px; display: inline-block;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.tbl-scroll { overflow-x: auto; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--ink-soft); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button {
  font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px;
        background: #eeece7; color: var(--ink-soft); }
.pill.e0 { background: #f1e6e6; color: #8a4b4b; }
.pill.e1 { background: #f3eede; color: #7a6528; }
.pill.e2 { background: #e3ede8; color: #2f5d50; }
.pill.on { background: var(--accent); color: #fff; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
pre { background: #f4f2ee; padding: 14px; border-radius: 8px; overflow-x: auto; }

.hidden { display: none !important; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 16px 14px 80px; }
  .card { padding: 18px; }
  .card h1 { font-size: 21px; }
  .stimulus { font-size: 17px; }
}

/* --------------------------------------------------------------------------
   双语相关
   -------------------------------------------------------------------------- */

/* 选语言卡片的标题：中英上下并列。
   两行都要够大 —— 把英文缩成小字，等于告诉英国孩子他是附带的。 */
h1.bi span {
  display: block;
  font-size: 0.72em;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 6px;
}

/* 语言选项按钮做得比普通选项高一点：这是整个流程的第一次点击，
   而且点它的人此刻可能一个字都读不懂，目标要足够大。 */
.opt.lang {
  text-decoration: none;
  padding: 20px 18px;
  font-size: 19px;
}
.opt.lang + .opt.lang { margin-top: 12px; }

/* 页眉的语言切换。做成低调的文字链接：它是给中途卡住的人用的退路，
   不该跟「开始」抢注意力。 */
.langswitch {
  margin-left: auto;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}
.langswitch:hover { border-color: var(--accent); color: var(--accent); }

/* --------------------------------------------------------------------------
   被试端（孩子与成人作答页、选语言页）的文字下限
   -------------------------------------------------------------------------- */

/* .note 原本是给【研究者页面】（后台、审计台）用的次要说明样式：14px 灰。
   给成人看没问题，但被试端所有「不是标题、不是选项、不是题干」的文字
   都被顺手套了它 —— 而那些其实全是孩子必须读的东西：
   回答会锁定、排序怎么点、撤回怎么办。
   对 11 岁的孩子，小号灰字等于在说「这行可以跳过」。

   所以被试端把它抬到正文可读的档位。研究者页面不受影响。 */
body.participant .note {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-soft);
}

/* 「点了以后就不能再改了」是不可撤销的后果，不该比正文更小。
   做成带左边线的一小块，读得到但不吓人。 */
body.participant .lock-note {
  display: block;
  margin-top: 10px;
  padding-left: 10px;
  border-left: 3px solid var(--line);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
}

/* 附加题屏顶部的「刚才那道：xxx」是定位信息 —— 孩子先要确定在说哪一题。
   题目名加重，一眼能对上号。 */
body.participant .unitref {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 4px 0 14px;
}
body.participant .unitref strong { color: var(--ink); font-weight: 600; }

/* 屏幕上的说明句（不是题干，但必须读）：与题干同级的可读度 */
body.participant .instruction {
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  margin: 0 0 6px;
}
