/* FDE 量表系统 · 设计系统 v2（全新模板：冷中性 + 专业蓝，替换旧暖绿）
   变量名保持不变，仅换值，供各页内联复用；组件统一精修。 */
:root {
  /* —— 基础色板（全新）—— */
  --bg: #f3f5f9; --card: #ffffff; --ink: #10141b; --ink2: #4b5563; --muted: #8b93a1;
  --line: #e3e7ee; --brand: #2f5ee0; --brand-bg: #eaf1ff; --warn: #b26a12; --danger: #d23b3b;
  --radius: 12px;
  /* —— 扩展令牌 —— */
  --brand-ink: #2247bd; --brand-soft: #f2f6ff; --line-strong: #d3d9e4; --surface-2: #f7f9fc;
  --radius-sm: 8px; --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16,20,27,.06);
  --shadow: 0 1px 3px rgba(16,20,27,.08), 0 4px 14px rgba(16,20,27,.06);
  --shadow-lg: 0 12px 36px rgba(16,20,27,.14);
  --ring: 0 0 0 3px rgba(47,94,224,.20);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15.5px; line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
main { max-width: 880px; margin: 0 auto; padding: 32px 24px 72px; }

/* —— 排版 —— */
h1 { font-size: 25px; font-weight: 680; letter-spacing: -.018em; line-height: 1.25; margin: 0 0 10px; }
h2 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; margin: 30px 0 12px; }
h3 { font-size: 15px; font-weight: 650; margin: 20px 0 8px; }
p { margin: 8px 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
code, kbd { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: .88em;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .5px 5px; }
hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }

/* —— 卡片 —— */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin: 14px 0; box-shadow: var(--shadow-sm); }
.muted { color: var(--muted); font-size: 13.5px; }

/* —— 按钮：主色实心 / .secondary 描边 / .ghost 轻描边 —— */
button, .btn {
  font: inherit; font-size: 14.5px; font-weight: 560; line-height: 1.2;
  padding: 9px 18px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .06s ease, box-shadow .14s ease, background-color .14s ease, border-color .14s ease, color .14s ease, opacity .14s ease;
}
button:hover:not(:disabled), .btn:hover:not(:disabled) { box-shadow: var(--shadow); transform: translateY(-1px); }
button:active:not(:disabled), .btn:active:not(:disabled) { transform: translateY(0); box-shadow: var(--shadow-sm); }
button:focus-visible, .btn:focus-visible, a:focus-visible, .opt:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: var(--ring); }
button.secondary, .btn.secondary { background: #fff; color: var(--brand); border-color: var(--line-strong); }
button.secondary:hover:not(:disabled), .btn.secondary:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
button.ghost, .btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink2); box-shadow: none; }
button.ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* —— 表单控件 —— */
input[type=text], input[type=url], input[type=number], input[type=password], input[type=search], input[type=email], textarea, select {
  font: inherit; width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); transition: border-color .12s ease, box-shadow .12s ease;
}
input:hover, textarea:hover, select:hover { border-color: #b9c0cd; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
label { font-size: 14px; color: var(--ink2); }
::placeholder { color: #a7aec0; }

/* —— 表格基础（各页可内联覆盖）—— */
th { text-align: left; font-weight: 600; color: var(--ink2); }
tbody tr:hover { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* —— 题目 / 选项 / 李克特 —— */
.q { padding: 16px 0; border-bottom: 1px solid var(--line); }
.q:last-child { border-bottom: none; }
.q .stem { font-weight: 560; margin-bottom: 10px; }
.opt { display: block; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  margin: 7px 0; cursor: pointer; background: #fff;
  transition: border-color .1s ease, background-color .1s ease, box-shadow .1s ease; }
.opt:hover { border-color: #b9c0cd; background: var(--surface-2); }
.opt.on { border-color: var(--brand); background: var(--brand-bg); box-shadow: inset 0 0 0 1px var(--brand); }
.likert { display: flex; gap: 8px; flex-wrap: wrap; }
.likert .opt { flex: 1; min-width: 56px; text-align: center; }

/* —— 顶栏（全宽也带横向留白，不再顶着屏幕边）/ 徽标 / 计时 —— */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 5; padding: 13px 0; border-bottom: 1px solid var(--line);
  background: rgba(243,245,249,.82); backdrop-filter: saturate(1.7) blur(9px); -webkit-backdrop-filter: saturate(1.7) blur(9px); }
/* 全宽顶栏（判分台等：topbar 是 body 直接子元素、不在 main 内）补横向留白，不再顶着屏幕边 */
body > .topbar { padding-left: 26px; padding-right: 26px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--brand); }
.pill { display: inline-block; font-size: 12px; font-weight: 550; padding: 2px 11px; border-radius: 999px;
  background: var(--brand-bg); color: var(--brand); }
.danger-pill { background: #fdecec; color: var(--danger); }

/* —— 细节 —— */
::selection { background: rgba(47,94,224,.16); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #cdd3de; border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #b7bfce; }

@media (max-width: 560px) { main { padding: 22px 16px 56px; } .topbar { padding: 12px 16px; } h1 { font-size: 21px; } }
