/* 认知测评--飞凡星网：浅色学术风 / 朱砂暖橙点缀 / 衬线标题
   无障碍：正文 >=16px、焦点可见、放大 200% 可用、关键信息不只靠颜色 */
:root {
  --ink: #22201d;
  --ink-soft: #565149;
  --paper: #fbf8f2;
  --paper-2: #ffffff;
  --line: #e6ddd0;
  --vermilion: #b4462c;
  --vermilion-soft: #f6e9e3;
  --teal: #2f6b66;
  --amber: #c8892f;
  --shadow: 0 2px 14px rgba(60, 48, 34, .07);
  --serif: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); line-height: 1.75; font-size: 1rem;
}
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.4; letter-spacing: .01em; margin: 0 0 .6em; }
h1 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--vermilion); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #8f3521; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.site-header { background: var(--paper-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 68px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand .seal { display: inline-block; width: 26px; height: 26px; border-radius: 5px; background: var(--vermilion); color: #fff; font-size: .78rem; text-align: center; line-height: 26px; font-family: var(--serif); }
.brand small { font-family: var(--sans); font-size: .72rem; letter-spacing: .12em; color: var(--ink-soft); font-weight: 400; }
.site-nav { display: flex; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-size: .94rem; padding: 6px 2px; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a.active { color: var(--vermilion); border-bottom-color: var(--vermilion); }
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 28px 0 40px; color: var(--ink-soft); font-size: .88rem; }

.hero { padding: 64px 0 40px; border-bottom: 1px solid var(--line); }
.hero .eyebrow { color: var(--vermilion); letter-spacing: .18em; font-size: .8rem; font-weight: 600; }
.hero p.lead { font-size: 1.12rem; max-width: 760px; color: var(--ink-soft); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 6px; cursor: pointer;
  font: inherit; font-size: .98rem; border: 1px solid var(--vermilion);
  background: var(--vermilion); color: #fff; text-decoration: none;
}
.btn:hover { background: #983a23; border-color: #983a23; color: #fff; }
.btn.secondary { background: transparent; color: var(--vermilion); }
.btn.secondary:hover { background: var(--vermilion-soft); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn.ghost:hover { background: #f3ece2; color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.section { padding: 42px 0 8px; }
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 22px 24px; box-shadow: var(--shadow); }
.card h3 { color: var(--ink); }
.card .tag { display: inline-block; font-size: .74rem; padding: 2px 10px; border-radius: 999px; background: var(--vermilion-soft); color: var(--vermilion); margin-bottom: 10px; }
.card p:last-child { margin-bottom: 0; }
.note { background: #f4f0e7; border-left: 4px solid var(--amber); padding: 14px 18px; border-radius: 0 6px 6px 0; font-size: .93rem; color: var(--ink-soft); }
.note strong { color: var(--ink); }

table.data { width: 100%; border-collapse: collapse; background: var(--paper-2); font-size: .92rem; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-family: var(--serif); background: #f5efe5; font-weight: 600; }
table.data tr:hover td { background: #fcf9f4; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.field input[type=text], .field input[type=password], .field select, .field textarea {
  width: 100%; max-width: 420px; padding: 10px 12px; font: inherit; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink);
}
.field .hint { font-size: .86rem; color: var(--ink-soft); margin-top: 5px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.check input { width: 20px; height: 20px; margin-top: 3px; flex: none; }

/* ---------- 测评任务区 ---------- */
.stage { display: none; }
.stage.active { display: block; }
.stage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.stage-head .step { font-size: .82rem; color: var(--vermilion); letter-spacing: .1em; }
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 10px 0 26px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--vermilion); transition: width .25s ease; }

.task-stage { min-height: 460px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.instruction { max-width: 760px; margin: 0 auto 18px; text-align: center; color: var(--ink-soft); }
.task-canvas {
  position: relative; width: 100%; max-width: 820px; height: 340px; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 8px; background: #fdfbf7; overflow: hidden;
}
.cell-grid { display: grid; gap: 10px; width: 100%; height: 100%; padding: 24px; place-items: center; }
.cell {
  width: 100%; max-width: 74px; aspect-ratio: 1 / 1; border: 2px solid var(--line);
  border-radius: 8px; background: #fff; display: grid; place-items: center; cursor: pointer;
}
.cell.filled { background: var(--vermilion-soft); }
.cell.active { border-color: var(--vermilion); }
.cell.shown { background: var(--teal); border-color: var(--teal); }
.cell.clickable:hover { border-color: var(--vermilion); }
.stim {
  width: 46px; height: 46px; border-radius: 8px; background: var(--vermilion);
  display: inline-block;
}
.stim.cool { background: var(--teal); }
.stim.square { border-radius: 3px; }
.stim.diamond { border-radius: 3px; transform: rotate(45deg) scale(.8); }
.stim.triangle { border-radius: 2px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.stim.circle { border-radius: 50%; }
.stimulus-slot { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.stimulus-slot .stim { width: 76px; height: 76px; }
.response-bar { display: flex; justify-content: center; gap: 22px; margin-top: 18px; flex-wrap: wrap; }
.response-bar button { min-width: 140px; }
.fixation { font-family: var(--serif); font-size: 2rem; color: var(--ink-soft); }
.feedback-line { text-align: center; min-height: 28px; margin-top: 12px; font-size: .95rem; color: var(--ink-soft); }
.counter { text-align: center; font-size: .86rem; color: var(--ink-soft); margin-top: 10px; }
.quality-banner { background: #fff8e9; border: 1px solid #ecd9ae; border-radius: 6px; padding: 10px 14px; font-size: .9rem; margin-bottom: 16px; }
.quality-banner.offline { background: #f7e9e6; border-color: #d9b3aa; }
.task-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 18px 0 24px; }
.task-chip { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: var(--paper-2); }
.task-chip.done { border-color: var(--teal); background: #f0f7f5; }
.task-chip.current { border-color: var(--vermilion); }
.task-chip .state { font-size: .8rem; color: var(--ink-soft); }
.result-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 24px; margin-bottom: 16px; }
.result-card ul { margin: 0; padding-left: 20px; }
.result-card li { margin-bottom: 8px; }
.q-badge { display: inline-block; padding: 3px 12px; border-radius: 999px; background: #eef4f1; color: var(--teal); font-size: .84rem; }
.flag-list { color: var(--vermilion); font-size: .9rem; }
.admin-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-box { background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 18px; overflow-x: auto; }
.toast { position: fixed; right: 18px; bottom: 18px; max-width: 360px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 8px; font-size: .9rem; z-index: 50; }
.toast.error { background: var(--vermilion); }
.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; }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .site-nav { gap: 12px; }
  .task-canvas { height: 300px; }
  .cell-grid { padding: 12px; gap: 6px; }
}
@media print { .site-header, .site-footer, .btn { display: none; } }

/* 参与人账号区与登录/注册弹窗 */
.auth-area { display: inline-flex; align-items: center; gap: 10px; margin-left: 6px; }
.auth-user { font-size: .9rem; color: var(--ink-soft); }
.auth-user strong { color: var(--ink); }
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(34, 32, 29, .42); }
.modal-card { position: relative; background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); width: 100%; max-width: 420px; padding: 26px 24px 20px; }
.modal-close { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--ink-soft); cursor: pointer; }
.modal-card h2 { margin-top: 0; font-size: 1.4rem; }
.tabs { display: flex; gap: 6px; margin: 14px 0 18px; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: none; padding: 8px 14px; font-size: .95rem; color: var(--ink-soft); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--vermilion); border-bottom-color: var(--vermilion); }
.auth-form .field { margin-bottom: 14px; }
.auth-form .btn { width: 100%; }
.auth-form[hidden] { display: none; }
