@font-face { font-family: 'LXGW WenKai Screen'; src: url('../fonts/LXGWWenKai-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'LXGW WenKai Screen'; src: url('../fonts/LXGWWenKai-Medium.woff2') format('woff2'); font-weight: 500 700; font-display: swap; }
/* ============ 应用外壳：纸墨浅色（参考主流阅读平台的克制风格） ============
   书架等固定界面用 :root 浅色变量；
   阅读器内的面板/工具条在 #reader 上被 --live-* 变量覆盖为跟随阅读主题。 */
:root {
  --paper: #f0ebf8;      /* 浅紫页面背景 */
  --paper-2: #ffffff;    /* 表单卡片 */
  --paper-3: #f6f4fa;    /* 控件与按压面 */
  --ink: #202124;
  --ink-2: #5f6368;
  --ink-3: #73777c;
  --line: #e0dce8;
  --line-2: #dadce0;
  --brand: #673ab7;
  --brand-deep: #512da8;
  --seal: var(--brand);
  --danger: #b3261e;
  --on-brand: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(43, 42, 38, .04), 0 6px 24px rgba(43, 42, 38, .07);
}
* { box-sizing: border-box; }
html, body { height: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans SC", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
body.reduce-motion * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }

/* 本地无障碍字体 */
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('../fonts/AtkinsonHyperlegible-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('../fonts/AtkinsonHyperlegible-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'OpenDyslexic'; src: url('../fonts/OpenDyslexic-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'OpenDyslexic'; src: url('../fonts/OpenDyslexic-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

.serif { font-family: "Noto Serif SC", "Songti SC", SimSun, Georgia, serif; }

/* ---------- 通用按钮 ---------- */
.btn {
  padding: 8px 16px; border-radius: 8px; font-size: 14px;
  background: var(--paper-2); border: 1px solid var(--line-2); color: var(--ink);
  transition: border-color .15s, background .15s;
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
}
.btn:hover { border-color: var(--ink-3); background: var(--paper-3); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-deep); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.btn.big { padding: 13px 20px; font-size: 15px; }
.btn small { font-size: 11px; color: inherit; opacity: .6; font-weight: 400; }
a.btn { text-decoration: none; color: var(--ink); }
.jump-row { gap: 10px 12px; }
.jump-row .btn { flex-direction: row; gap: 8px; align-items: baseline; padding: 9px 16px; max-width: 100%; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--ink-2); flex: none;
}
.icon-btn:hover { background: var(--paper-3); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- 书架 ---------- */
#shelf { min-height: 100vh; }
.hero { border-bottom: 1px solid var(--line); background: var(--paper); }
.hero-inner { max-width: 1040px; margin: 0 auto; padding: 40px 24px 28px; }
.hero h1 { font-size: clamp(24px, 3.6vw, 32px); letter-spacing: .04em; }
.hero h1 em { font-style: normal; color: var(--seal); }
.hero .sub { color: var(--ink-2); margin: 10px 0 0; font-size: 13.5px; letter-spacing: .06em; }
.hero-meta { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-2); background: var(--paper-2);
  padding: 6px 13px; border-radius: 999px; font-size: 12.5px; color: var(--ink);
}
.chip:hover { border-color: var(--ink-3); }
.hero-hint { color: var(--ink-2); font-size: 13px; margin: 14px 0 0; max-width: 660px; line-height: 1.8; }
.hero-rule { border: none; border-top: 1px solid var(--line); margin: 22px 0 0; }

.shelf-main { max-width: 1040px; margin: 0 auto; padding: 6px 24px 64px; }
.sec { margin-top: 34px; }
.sec h2 { font-size: 15.5px; margin-bottom: 14px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-weight: 600; }
.sec h2 small { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 18px 16px; }
.book-card {
  position: relative; text-align: left; padding: 0; border-radius: 6px;
  background: transparent; border: none; overflow: visible;
  transition: transform .15s;
}
.book-card:hover { transform: translateY(-2px); }
.bc-cover {
  overflow: hidden;
  height: 152px; display: flex; align-items: center; justify-content: center;
  padding: 14px 10px; writing-mode: vertical-rl;
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: 14.5px; letter-spacing: .18em; line-height: 1.7;
  border-radius: 4px 8px 8px 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 2px 3px 10px rgba(43, 42, 38, .14);
  position: relative;
}
.bc-cover::after { /* 书脊 */
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: rgba(0, 0, 0, .16);
}
.bc-cover span {
  max-height: 128px; overflow: hidden;
  color: rgba(245, 238, 219, .96);
  text-shadow: 0 1px 2px rgba(20, 18, 12, .45);
}
.bc-text  { background: #41586e; }
.bc-epub  { background: #6b5a80; }
.bc-pdf   { background: #8a5a44; }
.bc-c0 { background: #41586e; } .bc-c1 { background: #6b5a80; } .bc-c2 { background: #8a5a44; }
.bc-c3 { background: #4f6b57; } .bc-c4 { background: #7d6a4c; } .bc-c5 { background: #5c6470; }
.bc-title { padding: 9px 2px 2px; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-sub { padding: 0 2px; font-size: 11.5px; color: var(--ink-3); }
.bc-del {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 6px;
  background: rgba(20, 20, 18, .55); color: #fff; opacity: 0; transition: opacity .15s; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.book-card:hover .bc-del { opacity: 1; }
.bc-del:hover { background: rgba(20, 20, 18, .8); }

.import-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; }
.upload-zone {
  border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 22px;
  display: flex; align-items: center; gap: 16px; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--ink-3); background: var(--paper-2); }
.upload-zone svg { width: 26px; height: 26px; color: var(--ink-3); flex: none; }
.uz-sub { color: var(--ink-3); font-size: 12.5px; margin-top: 4px; }
.about { color: var(--ink-2); font-size: 13px; line-height: 1.9; max-width: 760px; }
.data-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.data-stats { font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }
/* 书架页无障碍前测区块的结构样式：PC 左文右操作 */
.scr-hero { display: flex; flex-direction: column; gap: 14px; }
.scr-hero-text .about { margin: 0; }
.scr-hero-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
@media (min-width: 900px) {
  .scr-hero { flex-direction: row; align-items: flex-start; gap: 28px; }
  .scr-hero-text { flex: 1; min-width: 0; }
  .scr-hero-text .about { max-width: none; }
  .scr-hero-actions { flex: none; width: 400px; }
}


/* ---------- 对话框 ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(38, 36, 30, .38); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal-box {
  width: min(600px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); animation: pop .16s ease;
}
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px 8px; }
.modal-head h3 { font-size: 15.5px; }
.modal-body { padding: 4px 18px 6px; overflow-y: auto; overflow-x: hidden; font-size: 13.5px; line-height: 1.8; color: var(--ink); }
.modal-body ol { padding-left: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px 16px; }
.modal-foot.row { justify-content: space-between; }
.q-note { color: var(--ink-3); font-size: 12px; }

/* 问卷 */
.q-group { margin: 10px 0; }
.q-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.q-hint2 { color: var(--ink-3); font-size: 12px; margin-bottom: 6px; }
.q-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.q-check {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2);
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px; cursor: pointer; user-select: none;
  background: var(--paper-2);
}
.q-check:has(input:checked) {
  border-color: var(--ink); color: var(--ink); font-weight: 600;
  background: color-mix(in srgb, var(--brand) 14%, transparent);
}
.q-check input { accent-color: var(--brand); margin: 0; }
.q-check input[type=radio], .q-check input[type=checkbox] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.q-check:focus-within, .q-opt:focus-within, .switch:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.q-multi { font-size: 11px; color: var(--ink-3); font-weight: 400; margin-left: 6px; letter-spacing: .04em; }
/* 设备题：上图标下名称的等尺寸多选卡片 */
.q-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.q-icon-opt {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  min-height: 88px; padding: 12px 6px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--paper-2); cursor: pointer; text-align: center; user-select: none;
  transition: border-color .15s, background .15s;
}
.q-icon-opt:hover { border-color: var(--ink-3); }
.q-icon-opt input { display: none; }
.q-icon-opt .q-icon-glyph { display: flex; color: var(--ink-2); transition: color .15s; }
.q-icon-opt .q-icon-glyph svg { width: 26px; height: 26px; }
.q-icon-opt .q-icon-name { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.q-icon-opt:has(input:checked) {
  border-color: var(--ink); background: color-mix(in srgb, var(--brand) 14%, transparent);
}
.q-icon-opt:has(input:checked) .q-icon-glyph, .q-icon-opt:has(input:checked) .q-icon-name { color: var(--ink); }
.q-req {
  font-size: 10px; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  border-radius: 4px; padding: 0 4px; margin-left: 6px; font-weight: 500; vertical-align: 1px;
}
.q-sublevel { min-height: 0; }
.q-group.q-missing .q-title { color: var(--danger); }
.q-group.q-missing .q-checks {
  outline: 1.5px dashed color-mix(in srgb, var(--danger) 55%, transparent);
  outline-offset: 4px; border-radius: 8px;
}
.q-form select, .q-form textarea, .ctl-text {
  width: 100%; background: var(--paper); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 13px;
}
/* 文本域内容自适应：禁用手动拖拽，随内容增高（原生 field-sizing + JS 兜底） */
textarea.ctl-text, .q-form textarea {
  resize: none;
  field-sizing: content;
  min-height: 96px; max-height: 50vh;
  overflow-y: auto;
}
.q-form select:focus, .q-form textarea:focus, .ctl-text:focus { outline: none; border-color: var(--brand); }
.q-row { display: block; margin: 14px 0; }
.q-text { font-size: 13px; font-weight: 600; display: block; }
.q-opts { display: flex; gap: 8px; margin-top: 8px; }
.q-opt {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 0; cursor: pointer; font-size: 13px;
  background: var(--paper-2);
}
.q-opt:has(input:checked) { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.q-opt input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.q-hint { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 11px; margin-top: 4px; }
.q-session { color: var(--ink-2); font-size: 12.5px; margin: 4px 0 8px; }

/* ---------- 设置面板（阅读器内跟随阅读主题，书架内用浅色） ---------- */
.settings-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); z-index: 120;
  /* 半透明毛玻璃：阅读器内跟随阅读主题，正文从磨砂层后隐约透出 */
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: blur(22px) saturate(1.1);
  -webkit-backdrop-filter: blur(22px) saturate(1.1);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(102%); transition: transform .25s ease;
  box-shadow: -10px 0 34px rgba(43, 42, 38, .12);
}
.settings-panel.open { transform: translateX(0); }
.sp-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
.sp-head h3 { font-size: 14.5px; }

.preset-row { padding: 0 14px 10px; border-bottom: 1px solid var(--line); }
/* 两行网格横向滚动；右缘渐隐提示可继续横向滚动 */
.preset-scroll {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto);
  gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin;
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 26px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 26px), transparent 100%);
}
.preset-chip {
  flex: none; border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 11px;
  display: flex; flex-direction: column; gap: 1px; background: var(--paper-2); text-align: left;
}
.preset-chip:hover { border-color: var(--ink-3); }
.p-name { font-size: 12px; font-weight: 600; white-space: nowrap; }
.p-desc { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }

.tabbar { display: flex; border-bottom: 1px solid var(--line); }
.tab { flex: 1; padding: 10px 0; font-size: 13px; color: var(--ink-2); border-bottom: 2px solid transparent; }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tabpanes { flex: 1; overflow-y: auto; padding: 6px 16px 30px; }
.tabpane { display: none; }
.tabpane.active { display: block; }

.ctl-row { margin: 14px 0; }
.ctl-label { font-size: 12.5px; font-weight: 600; margin-bottom: 7px; }
.ctl-hint { font-size: 11px; color: var(--ink-3); margin: -3px 0 7px; line-height: 1.6; }
.row-inline { display: flex; align-items: center; justify-content: space-between; }
.row-inline .ctl-label { margin: 0; }

.range-wrap { display: flex; align-items: center; gap: 10px; }
.ctl-range { flex: 1; accent-color: var(--ink); height: 22px; }
.ctl-val { font-size: 11.5px; color: var(--ink-2); min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }

.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.switch .slider {
  position: absolute; inset: 0; border-radius: 999px; background: var(--paper-3);
  border: 1px solid var(--line-2); transition: background .15s, border-color .15s;
}
.switch .slider::after {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  top: 2px; left: 2px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .18s;
}
.switch input:checked + .slider { background: var(--brand); border-color: var(--brand); }
.switch input:checked + .slider::after { transform: translateX(18px); }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-btn {
  border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 12px; font-size: 12px;
  color: var(--ink-2); background: var(--paper-2);
}
.seg-btn.active { color: var(--paper-2); border-color: var(--ink); background: var(--ink); }

.swatches { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.swatch {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-2);
  font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.swatch:hover { border-color: var(--ink); }
.color-box { display: flex; flex-direction: column; gap: 6px; }
.color-line { display: flex; align-items: center; gap: 10px; }
.color-line input[type=color] { width: 44px; height: 28px; border: 1px solid var(--line-2); border-radius: 6px; background: none; padding: 2px; cursor: pointer; }

.contrast-badge { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cb-pill { font-size: 11.5px; padding: 4px 10px; border-radius: 999px; font-weight: 600; border: 1px solid transparent; }
.cb-pill.ok3 { color: #2c6e49; background: color-mix(in srgb, #2c6e49 10%, transparent); border-color: color-mix(in srgb, #2c6e49 35%, transparent); }
.cb-pill.ok2 { color: #4f6b2c; background: color-mix(in srgb, #4f6b2c 10%, transparent); border-color: color-mix(in srgb, #4f6b2c 35%, transparent); }
.cb-pill.warn { color: #8a6116; background: color-mix(in srgb, #8a6116 10%, transparent); border-color: color-mix(in srgb, #8a6116 35%, transparent); }
.cb-pill.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.cb-note { font-size: 11px; color: var(--ink-3); }

.font-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.font-card {
  border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 4px 8px; background: var(--paper-2);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.font-card:hover, .font-card.active { border-color: var(--ink); }
.f-glyph { font-size: 19px; line-height: 1.15; }
.f-name { font-size: 10px; color: var(--ink-3); text-align: center; }

/* 实验面板 */
.lab-sec { margin: 16px 0; padding-bottom: 14px; border-bottom: 1px dashed var(--line-2); }
.lab-sec:last-child { border-bottom: none; }
.lab-title { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-bottom: 8px; letter-spacing: .08em; }
.lab-p { font-size: 13px; margin: 0 0 8px; line-height: 1.7; overflow-wrap: anywhere; }
.lab-p.dim { color: var(--ink-3); font-size: 12px; }
.lab-sec .btn { width: 100%; margin: 6px 0; flex-direction: row; justify-content: center; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 12px); z-index: 400;
  background: var(--ink); color: var(--paper-2);
  padding: 9px 18px; border-radius: 8px; font-size: 12.5px; opacity: 0; transition: all .25s;
  pointer-events: none; max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 侧栏（目录） */
.side-panel {
  position: absolute; top: 0; left: 0; bottom: 0; width: min(320px, 85vw); z-index: 120;
  background: color-mix(in srgb, var(--paper) 96%, #fff 4%);
  border-right: 1px solid var(--line);
  transform: translateX(-102%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.side-panel.open { transform: translateX(0); }
#tocList { flex: 1; overflow-y: auto; padding: 6px 10px 20px; }
.toc-head { font-size: 11px; color: var(--ink-3); letter-spacing: .12em; margin: 12px 6px 6px; }
.toc-item {
  display: block; width: 100%; text-align: left; padding: 8px 10px; font-size: 13px;
  border-radius: 7px; color: var(--ink); line-height: 1.5;
}
.toc-item:hover { background: var(--paper-3); }
.toc-empty { color: var(--ink-3); font-size: 12.5px; padding: 12px; }

/* ---------- 无障碍前测 ---------- */
.scr-box { width: min(640px, 100%); }
.scr-body {
  flex: 1 1 auto; min-width: 0; min-height: 0;
  padding: 4px 18px 6px; overflow-y: auto; overflow-x: hidden;
}
/* 时间轴步骤条：圆点 + 连线；完成节点实心打勾，当前节点高亮描边 */
.scr-steps { display: flex; padding: 10px 14px 6px; }
.scr-step { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.scr-step .dot {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--line-2); background: var(--paper-2); color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; line-height: 1; z-index: 1; transition: all .2s;
}
.scr-step .lbl { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
/* 连线：位于圆点中线，跨到相邻节点 */
.scr-step:not(:first-child)::before {
  content: ''; position: absolute; top: 9px; left: calc(-50% + 15px); right: calc(50% + 15px);
  height: 1.5px; background: var(--line-2); transition: background .2s;
}
.scr-step.done:not(:first-child)::before, .scr-step.on:not(:first-child)::before { background: var(--ink); }
.scr-step.done .dot { background: var(--ink); border-color: var(--ink); color: var(--paper-2); font-size: 11px; }
.scr-step.on .dot {
  border-color: var(--ink); color: var(--ink); background: var(--paper-2); font-weight: 600;
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--ink) 14%, transparent);
}
.scr-step.on .lbl { color: var(--ink); font-weight: 600; }
@media (max-width: 360px) { .scr-step .lbl { font-size: 10px; } }
.scr-q { font-size: 14px; font-weight: 600; margin: 6px 0 12px; }
.scr-plate { display: flex; justify-content: center; margin: 4px 0 14px; }
.scr-plate canvas { border-radius: 50%; box-shadow: var(--shadow); }
.scr-opts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.scr-opt {
  border: 1px solid var(--line-2); background: var(--paper-2); border-radius: 9px;
  min-width: 72px; padding: 10px 0; font-size: 16px; text-align: center;
}
.scr-opt:hover { border-color: var(--ink); }
.scr-likert, .scr-yn { margin: 10px 0; }
.scr-likert-q { font-size: 13px; margin-bottom: 6px; line-height: 1.6; display: flex; align-items: center; gap: 6px; }
.scr-shade { display: none; }
.scr-warn {
  font-size: 12.5px; color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 10px;
}
.scr-result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 10px 0 14px; }
.scr-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 10px; background: var(--paper-2); text-align: center; }
.scr-card.ok { border-color: color-mix(in srgb, #2c6e49 40%, transparent); }
.scr-card.warn { border-color: color-mix(in srgb, #8a6116 45%, transparent); background: color-mix(in srgb, #8a6116 6%, transparent); }
.scr-card-title { font-size: 11.5px; color: var(--ink-2); margin-bottom: 6px; }
.scr-card-val { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.scr-card.warn .scr-card-val { color: #8a6116; }
.scr-card.ok .scr-card-val { color: #2c6e49; }
.scr-card-note { font-size: 10.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; }
.scr-suggest { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 4px 0 14px; background: var(--paper-2); }
.scr-suggest-title { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; letter-spacing: .08em; }
.scr-suggest-item {
  display: flex; align-items: stretch; gap: 14px; padding: 12px 0;
  border-top: 1px dashed var(--line-2);
}
.scr-suggest-item:first-of-type { border-top: none; }
.scr-suggest-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; align-items: flex-start; padding-top: 18px; }
.scr-suggest-info span { color: var(--ink-3); font-size: 11.5px; line-height: 1.6; }
.scr-suggest-info .btn { margin-top: 8px; }
/* 应用前后对比卡（上：应用前；下：应用后） */
.scr-compare { flex: none; width: 230px; display: flex; flex-direction: column; gap: 8px; }
.scr-sample-wrap { position: relative; }
.scr-sample-tag {
  position: absolute; top: -7px; left: 10px; z-index: 1;
  font-size: 10px; line-height: 1; padding: 3px 7px 3px;
  color: var(--ink-2); background: var(--paper-2);
  border: 1px solid var(--line-2); border-radius: 5px;
}
.scr-sample {
  height: 84px; overflow: hidden; border-radius: 8px;
  border: 1px solid var(--line-2); padding: 12px 10px 8px;
  box-shadow: inset 0 0 0 100px transparent;
}
.scr-sample p { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .scr-suggest-item { flex-direction: column; }
  .scr-compare { width: 100%; }
  .scr-suggest-info { padding-top: 0; }
}
.scr-ok-note { font-size: 13px; color: var(--ink-2); margin: 6px 0 14px; }
.scr-link-title { font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 4px 0 6px; letter-spacing: .08em; }
.scr-links { margin: 4px 0 8px; }
.scr-link-cat { font-size: 11.5px; color: var(--ink-3); margin: 8px 0 4px; }
.scr-link {
  display: block; font-size: 12.5px; overflow-wrap: anywhere; color: var(--brand); text-decoration: none;
  padding: 4px 0 4px 12px; position: relative;
}
.scr-link::before { content: '↗'; position: absolute; left: 0; font-size: 11px; opacity: .7; }
.scr-link:hover { text-decoration: underline; }
.scr-link-note { font-size: 11px; color: var(--ink-3); margin-top: 10px; line-height: 1.7; }
@media (max-width: 560px) { .scr-result-grid { grid-template-columns: minmax(0, 1fr); } }

/* 移动端：设置面板变底部抽屉 */
@media (max-width: 720px) {
  .settings-panel {
    top: auto; width: 100%; height: 74vh; border-left: none; border-top: 1px solid var(--line);
    border-radius: 14px 14px 0 0; transform: translateY(102%);
  }
  .settings-panel.open { transform: translateY(0); }
}

/* 设置面板：预设进入独立页，六个标签始终完整显示。 */
.settings-panel { width: var(--reader-panel-width, min(408px, 92vw)); min-width: 0; }
.tabbar { min-width: 0; }
.tab { min-width: 0; padding-left: 2px; padding-right: 2px; white-space: nowrap; }
.tabpanes { min-width: 0; }
.preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding-top: 0; }
.preset-grid .preset-chip { position: relative; width: auto; min-width: 0; height: 112px; padding: 3px; overflow: hidden; justify-content: stretch; }
.preset-grid .preset-chip.active { border-color: var(--ink); background: color-mix(in srgb, var(--brand) 10%, var(--paper-2)); box-shadow: inset 0 0 0 1px var(--ink); }
.preset-grid .p-name, .preset-grid .p-desc { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) {
  .tab { font-size: 12px; }
  .preset-grid { gap: 6px; }
  .preset-grid .preset-chip { height: 104px; }
}
.preset-preview { position: relative; display: block; flex: 1; width: 100%; min-height: 0; border-radius: 5px; overflow: hidden; text-align: left; }
.preset-preview-text { position: absolute; inset: 8px; overflow: hidden; overflow-wrap: anywhere; }
.preset-preview-text p { margin: 0 0 .7em; }
.preset-preview-texture, .preset-preview-mask, .preset-preview-ruler { position: absolute; inset: 0; pointer-events: none; }
.preset-preview-mask { background: linear-gradient(to right, color-mix(in srgb, currentColor 16%, transparent) 0 20%, transparent 20% 80%, color-mix(in srgb, currentColor 16%, transparent) 80%); }
.preset-preview-ruler { inset: 42% 0 auto; height: 24%; background: color-mix(in srgb, currentColor 9%, transparent); border-block: 1px solid color-mix(in srgb, currentColor 20%, transparent); }

/* ---------- 视界首页重排 ---------- */
.shelf-masthead {
  max-width: 1120px; min-height: 58px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line);
}
.site-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 650; letter-spacing: .08em; }
.brand-mark { width: 27px; height: 27px; display: inline-flex; align-items: center; justify-content: center; color: var(--paper-2); background: var(--brand); border-radius: 7px; font-family: "Noto Serif SC", "Songti SC", serif; font-size: 16px; letter-spacing: 0; }
.brand-caption { display: block; margin-top: 2px; color: var(--ink-3); font-size: 9px; font-weight: 400; letter-spacing: .12em; }
.shelf-masthead .chip { padding: 5px 11px; font-size: 11.5px; }
.hero { background: var(--paper-2); }
.hero-inner { max-width: 1120px; min-height: 390px; padding: 58px 28px 54px; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(280px, .88fr); align-items: center; gap: clamp(42px, 7vw, 92px); }
.hero-copy { min-width: 0; }
.eyebrow { margin: 0 0 17px; color: var(--brand); font-size: 11px; font-weight: 650; letter-spacing: .18em; }
.hero h1 { font-size: clamp(40px, 5.4vw, 66px); line-height: 1.14; letter-spacing: .035em; }
.hero .sub { margin-top: 15px; font-size: clamp(13px, 1.4vw, 16px); letter-spacing: .06em; }
.hero-hint { max-width: 530px; margin: 22px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.9; }
.hero-actions { margin-top: 28px; gap: 10px; }
.hero-actions .btn { min-width: 0; padding: 11px 16px; flex-direction: row; gap: 16px; justify-content: space-between; }
.hero-actions .btn.primary { min-width: 196px; }
.hero-actions .btn.ghost { min-width: 134px; }
.hero-actions .btn span[aria-hidden] { font-size: 18px; line-height: 1; }
.experiment-guide { min-width: 0; padding: 23px 23px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 5%, transparent); }
.guide-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 15px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 650; }
.guide-duration { color: var(--ink-3); font-size: 11px; font-weight: 400; white-space: nowrap; }
.guide-steps { display: grid; gap: 16px; margin: 20px 0 16px; padding: 0; list-style: none; }
.guide-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.guide-num { color: var(--seal); font-family: Georgia, serif; font-size: 12px; font-weight: 700; line-height: 1.5; }
.guide-steps b, .guide-steps span { display: block; }
.guide-steps b { font-size: 12.5px; font-weight: 600; }
.guide-steps li div span { margin-top: 3px; color: var(--ink-3); font-size: 11px; }
.guide-note { margin: 0; padding-top: 14px; border-top: 1px dashed var(--line-2); color: var(--ink-3); font-size: 10.5px; }
.shelf-main { max-width: 1120px; padding: 4px 28px 58px; }
.sec { margin-top: 44px; }
.shelf-section { margin-top: 38px; }
.sec-head { align-items: center; }
.sec-head h2 { margin: 0; }
.section-note { color: var(--ink-3); font-size: 11px; white-space: nowrap; }
.shelf-surface { border-radius: 10px; }
.workspace-tools { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(280px, .84fr); gap: 18px; align-items: stretch; }
.workspace-tools > section { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); }
.workspace-tools h2 { margin-bottom: 17px; }
.workspace-tools h2 small { font-size: 11px; }
.import-section .import-row { grid-template-columns: minmax(0, 1fr) minmax(140px, .34fr); gap: 10px; }
.import-section .upload-zone { min-height: 106px; padding: 18px; }
.import-section .btn { min-height: 106px; padding: 14px; flex-direction: row; justify-content: center; gap: 8px; }
.screening-sec { display: flex; flex-direction: column; align-items: flex-start; }
.screening-sec .about { margin: 0; font-size: 12.5px; line-height: 1.75; }
.screening-sec .btn { margin-top: auto; padding: 9px 13px; flex-direction: row; gap: 13px; }
.action-time { color: var(--ink-3); font-size: 11px; }
.privacy-panel { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.privacy-panel summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 0; cursor: pointer; font-size: 14px; font-weight: 650; list-style: none; }
.privacy-panel summary::-webkit-details-marker { display: none; }
.privacy-panel summary::after { content: '+'; color: var(--ink-3); font-size: 18px; font-weight: 400; }
.privacy-panel[open] summary::after { content: '−'; }
.privacy-body { padding: 0 0 20px; }
.privacy-body .about { max-width: 780px; margin: 0; font-size: 12px; line-height: 1.8; }
.shelf-footer { display: flex; justify-content: space-between; gap: 16px; padding-top: 21px; color: var(--ink-3); font-size: 10.5px; letter-spacing: .06em; }

@media (max-width: 900px) {
  .hero-inner { min-height: 0; grid-template-columns: 1fr; gap: 34px; padding-top: 46px; }
  .experiment-guide { max-width: 540px; }
  .workspace-tools { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shelf-masthead { min-height: 52px; padding: 0 18px; }
  .hero-inner { padding: 38px 20px 40px; gap: 29px; }
  .hero h1 { font-size: clamp(37px, 12vw, 52px); }
  .hero .sub { line-height: 1.6; }
  .hero-hint { margin-top: 16px; font-size: 13px; }
  .hero-actions { margin-top: 22px; }
  .hero-actions .btn.primary, .hero-actions .btn.ghost { min-width: 0; width: 100%; }
  .experiment-guide { padding: 18px; }
  .guide-steps { gap: 13px; margin: 16px 0 14px; }
  .shelf-main { padding: 0 18px 42px; }
  .shelf-section { margin-top: 31px; }
  .section-note { display: none; }
  .workspace-tools { gap: 12px; margin-top: 31px; }
  .workspace-tools > section { padding: 18px; }
  .import-section .import-row { grid-template-columns: 1fr; }
  .import-section .btn { min-height: 52px; }
  .import-section .upload-zone { min-height: 90px; }
  .privacy-panel { margin-top: 31px; }
  .shelf-footer { padding-bottom: 10px; }
}

/* ---------- 研究入口与层级 ---------- */
.hero { background: var(--paper-2); }
.hero-inner { padding-top: clamp(36px, 6vw, 78px); padding-bottom: 42px; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); letter-spacing: .015em; line-height: 1.2; }
.hero .sub { margin-top: 14px; font-size: clamp(14px, 1.7vw, 17px); letter-spacing: .03em; }
.hero-hint { max-width: 560px; margin-top: 22px; font-size: 14px; }
.hero-actions { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-actions .btn { min-width: 184px; justify-content: center; }
.hero-actions .btn.primary { min-width: 252px; }
.shelf-main { padding-top: 8px; }
.sec { margin-top: 46px; }
.sec h2 { font-size: 19px; margin-bottom: 18px; }
.sec h2 small { font-size: 12px; }
.screening-sec { border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; background: var(--paper-2); }
.scr-hero-actions { width: auto; }
.scr-hero-actions > .btn { min-height: 46px; }
.book-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px 18px; }
.book-card { min-width: 0; }
.book-card:focus-visible, .btn:focus-visible, .bar-btn:focus-visible, .tab:focus-visible,
.seg-btn:focus-visible, .palette-card:focus-visible, .palette-tab:focus-visible,
.upload-zone:focus-visible,
.study-choices button:focus-visible, .study-score-picks button:focus-visible {
  outline: 3px solid var(--brand); outline-offset: 3px;
}
.bc-cover { height: 170px; }
.bc-title { font-size: 14px; }
.upload-zone { min-height: 94px; cursor: pointer; }

/* 设置控件使用统一节奏；预设固定尺寸，文字不再决定卡片长度。 */
.settings-panel { width: min(408px, 92vw); }
.preset-scroll { grid-auto-columns: 154px; grid-template-rows: repeat(2, 58px); }
.preset-chip { width: 154px; height: 58px; overflow: hidden; justify-content: center; }
.p-name, .p-desc { overflow: hidden; text-overflow: ellipsis; }
.tabpanes { padding: 10px 18px 32px; }
.ctl-row { margin: 0; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ctl-row:last-child { border-bottom: none; }
.ctl-label { margin-bottom: 8px; }
.seg-btn { min-height: 35px; }
.font-card { min-height: 68px; }
.palette-picker { min-width: 0; }
.palette-picker .ctl-hint { margin: 0 0 10px; }
.palette-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 8px; }
.palette-tab { flex: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 12px; font-size: 12px; color: var(--ink-2); }
.palette-tab.active { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.palette-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.palette-card { min-width: 0; text-align: left; border: 1px solid var(--line-2); border-radius: 9px; padding: 5px; background: var(--paper-2); }
.palette-card.active { border: 2px solid var(--ink); padding: 4px; }
.palette-sample { display: flex; align-items: center; min-height: 58px; padding: 8px 10px; border-radius: 5px; font-family: "Songti SC", SimSun, serif; font-size: 12px; line-height: 1.6; }
.palette-card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; padding: 6px 4px 3px; }
.palette-card-meta b { font-size: 12px; }
.palette-card-meta small { font-size: 10px; color: var(--ink-3); white-space: nowrap; }

/* 标准化阅读任务 */
.study-dialog { width: min(520px, 100%); }
.study-dialog .modal-body { padding-top: 8px; padding-bottom: 14px; }
.study-choices { display: grid; gap: 8px; margin: 10px 0 18px; }
.study-choices .btn { align-items: flex-start; text-align: left; width: 100%; min-height: 44px; }
.study-choices .btn.selected, .study-score-picks .btn.selected { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--paper-2)); color: var(--ink); font-weight: 600; }
.study-score { padding: 9px 0; border-top: 1px solid var(--line); }
.study-score-picks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.study-score-picks .btn { min-height: 38px; padding: 5px; }
.study-summary { display: grid; gap: 7px; margin: 16px 0 20px; }
.study-summary-row { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--paper-2); font-size: 12px; line-height: 1.6; }
.study-dialog .modal-foot .btn { min-width: 110px; }
.study-dialog .modal-foot .btn:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 720px) {
  .hero-inner { padding: 34px 20px 30px; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .hero-actions .btn, .hero-actions .btn.primary { width: 100%; min-width: 0; }
  .hero-meta { margin-top: 14px; }
  .shelf-main { padding: 0 18px 48px; }
  .sec { margin-top: 34px; }
  .screening-sec { padding: 17px; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .import-row { grid-template-columns: 1fr; }
  .settings-panel { width: 100%; height: min(80vh, 760px); }
  .preset-scroll { grid-auto-columns: 144px; }
  .preset-chip { width: 144px; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box { width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0; }
}
/* 一屏一步：底部入场须知与自适应问答面板。 */
.guided-overlay { align-items: flex-end; padding: 0; }
.guided-overlay .modal-box { width: min(600px, 100%); max-height: 100dvh; border-radius: 12px 12px 0 0; animation: guide-rise .32s cubic-bezier(.2,.7,.2,1); }
@keyframes guide-rise { from { transform: translateY(100%); } to { transform: translateY(0); } }
.guided-box { height: min(680px, 94dvh); overflow: hidden; }
.guided-box .modal-head { flex: none; padding: 16px 20px 12px; }
.guide-progress { height: 2px; flex: none; background: var(--line); }
.guide-progress span { display: block; height: 100%; background: var(--brand); transition: width .2s; }
.guided-body { flex: 1; min-height: 0; min-width: 0; padding: clamp(16px, 3vh, 28px) 24px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.guide-count { margin: 0 0 12px; color: var(--ink-3); font-size: 11px; }
.guide-question { font-size: clamp(18px, 2.7vh, 24px); line-height: 1.55; margin: 0 0 18px; overflow-wrap: anywhere; outline: none; }
.guide-hint, .guide-original { margin: -6px 0 16px; color: var(--ink-2); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.guide-original { font-size: 11px; color: var(--ink-3); }
.guide-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.guide-answers .btn { min-width: 0; min-height: clamp(40px, 6vh, 52px); padding: 9px 12px; text-align: left; align-items: flex-start; justify-content: center; font-size: 13px; overflow-wrap: anywhere; }
.guide-answers .btn.selected { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--paper-2)); box-shadow: inset 0 0 0 1px var(--brand); }
.guide-answers textarea { grid-column: 1 / -1; }
.guide-answers-compact { gap: 6px; }
.guide-answers-compact .btn { font-size: 12px; padding: 8px; }
.guided-foot { flex: none; border-top: 1px solid var(--line); padding: 12px 20px max(14px, env(safe-area-inset-bottom)); gap: 8px; }
.guided-foot .btn { min-height: 42px; min-width: 0; }
.guided-foot .btn:first-child { margin-right: auto; }
.guided-foot .btn:disabled { opacity: .4; cursor: default; }
.consent-sheet { padding-top: 16px; }
.consent-body { padding: 12px 28px 10px; line-height: 1.7; }
.consent-body h2 { font-size: 25px; margin-bottom: 10px; }
.consent-body > p { font-size: 13px; }
.consent-route { display: grid; gap: 10px; padding-left: 22px; margin: 20px 0; font-size: 14px; }
.consent-privacy { color: var(--ink-2); font-size: 12px !important; border-top: 1px solid var(--line); padding-top: 14px; }
@media (max-width: 720px) {
 .guided-body { padding: 18px; }
 .guide-question { margin-bottom: 14px; }
 .guided-foot { padding-left: 18px; padding-right: 18px; }
 .consent-body { padding: 8px 22px; }
}
@media (prefers-reduced-motion: reduce) { .guided-overlay .modal-box { animation: none; } }
.guide-source { display: inline-block; color: var(--brand); font-size: 11px; margin-bottom: 12px; }
/* 表单视觉：浅紫画布、白色卡片、紫色主操作与明确选择标记。 */
.hero h1.serif, .hero .sub.serif { font-family: inherit; }
.hero h1 { font-size: clamp(34px, 4.6vw, 52px); letter-spacing: -.02em; }
.shelf-masthead { background: var(--paper); }
.experiment-guide { background: var(--paper-2); box-shadow: none; }
.guide-num { color: var(--brand); }
.modal-overlay { background: color-mix(in srgb, var(--ink) 30%, transparent); }
.guided-overlay .modal-box { border-color: var(--line); box-shadow: 0 8px 30px color-mix(in srgb, var(--ink) 12%, transparent); }
.consent-sheet { border-top: 8px solid var(--brand); }
.consent-body h2 { font-weight: 550; letter-spacing: -.02em; }
.consent-route li::marker { color: var(--brand); font-weight: 600; }
.guided-box .modal-head { background: var(--paper-2); }
.guide-progress { height: 4px; background: var(--paper); }
.guide-count { color: var(--brand); font-weight: 500; }
.guide-question { font-weight: 500; }
.guide-answers .btn { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; background: var(--paper-2); border-color: var(--line-2); }
.guide-answers .btn:hover { background: var(--paper-3); border-color: var(--brand); }
.guide-answers .btn.selected { color: var(--ink); background: color-mix(in srgb, var(--brand) 7%, var(--paper-2)); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.guide-answers [role=radio]::before, .guide-answers [role=checkbox]::before { content: ''; display: block; flex: 0 0 16px; width: 16px; height: 16px; border: 2px solid var(--ink-3); border-radius: 50%; box-sizing: border-box; }
.guide-answers [role=checkbox]::before { border-radius: 3px; }
.guide-answers [role=radio].selected::before { border: 5px solid var(--brand); background: var(--paper-2); }
.guide-answers [role=checkbox].selected::before { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 2px var(--paper-2); }
.guided-foot { background: var(--paper-2); border-top-color: var(--line); }
.guided-foot .btn.ghost { color: var(--brand); border-color: transparent; }
.guided-foot .btn.ghost:hover { background: var(--paper-3); }
.guide-source { color: var(--brand); }
.startup-error { position: fixed; inset: 12px 12px auto; z-index: 500; padding: 16px; color: var(--danger); background: var(--paper-2); border: 1px solid var(--danger); border-radius: 8px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
/* Material-inspired tokens; standard, restrained motion for a research tool. */
:root {
 --motion-fast: 120ms;
 --motion-standard: 220ms;
 --motion-sheet: 320ms;
 --ease-standard: cubic-bezier(.2, 0, 0, 1);
 --ease-enter: cubic-bezier(0, 0, .2, 1);
 --state-hover: 8%;
 --state-pressed: 12%;
}
.guided-overlay { animation: scrim-in var(--motion-standard) linear; }
@keyframes scrim-in { from { background: transparent; } }
.guided-overlay .modal-box { animation-duration: var(--motion-sheet); animation-timing-function: var(--ease-enter); }
.guided-box .modal-head h3 { font-size: 16px; line-height: 1.5; font-weight: 500; letter-spacing: .01em; }
.guide-question { line-height: 1.5; letter-spacing: 0; }
.guide-hint { color: var(--ink-2); line-height: 1.65; }
.guide-progress span { transition: width var(--motion-standard) var(--ease-standard); }
.guided-overlay button, .study-compare-dock button { position: relative; isolation: isolate; overflow: hidden; -webkit-tap-highlight-color: transparent; transition: background-color var(--motion-fast) linear, border-color var(--motion-fast) linear, box-shadow var(--motion-fast) linear; }
.guided-overlay .btn, .study-compare-dock .btn { min-height: 44px; font-weight: 500; }
.guided-overlay .icon-btn { width: 44px; height: 44px; }
.guided-overlay button:focus-visible, .study-compare-dock button:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.guided-overlay button:active:not(:disabled), .study-compare-dock button:active:not(:disabled) { box-shadow: inset 0 0 0 999px color-mix(in srgb, currentColor var(--state-pressed), transparent); }
.guided-overlay .btn.primary:hover { background: var(--brand); box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--on-brand) var(--state-hover), transparent), 0 1px 3px color-mix(in srgb, var(--ink) 18%, transparent); }
.guided-overlay .btn.primary:active { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--on-brand) var(--state-pressed), transparent); }
.guide-answers .btn { font-weight: 400; }
.guide-answers.guide-scale { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 16px 8px 8px; }
.guide-answers.guide-scale::before { content: ''; position: absolute; left: 10%; right: 10%; top: 31px; height: 2px; background: var(--line-2); z-index: 0; }
.guide-scale-choice { z-index: 1; min-height: 52px !important; padding: 0 !important; flex-direction: column !important; align-items: center !important; justify-content: flex-start !important; gap: 0 !important; text-align: center !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.guide-scale-choice::before { display: none !important; }
.guide-scale-dot { width: 30px; height: 30px; border: 2px solid var(--ink-3); border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: var(--ink-2); background: var(--paper-2); box-sizing: border-box; }
.guide-scale-choice.selected .guide-scale-dot { border: 8px solid var(--brand); color: transparent; }
.guide-scale-rank, .guide-scale-label { display: none; }
.guide-scale-ends { display: flex; justify-content: space-between; gap: 16px; margin: 2px 8px 0; color: var(--ink-2); font-size: 12px; line-height: 1.45; }
.guide-scale-ends span { max-width: 45%; }
.guide-scale-ends span:last-child { text-align: right; }
@media (max-width: 560px) { .guide-answers.guide-scale { gap: 4px; padding-inline: 2px; } .guide-scale-ends { font-size: 11px; margin-inline: 2px; } }
.guide-answers [role=radio]::before, .guide-answers [role=checkbox]::before { transition: border-color var(--motion-fast), background-color var(--motion-fast), border-width var(--motion-fast); }
.guide-answers [role=checkbox].selected::before { content: '✓'; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--on-brand); box-shadow: none; }
/* 频次题：前三项等宽一行，第四项「不愿回答」整行弱化，仍可点选。 */
.guide-answers.guide-frequency { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.guide-frequency .btn { min-height: 44px; }
.guide-frequency > .btn:nth-child(4) { grid-column: 1 / -1; }
.guide-frequency .guide-answer-muted { color: var(--ink-2); background: var(--paper-3); border-color: var(--line); }
.guide-frequency .guide-answer-muted:hover { color: var(--ink-2); background: var(--paper-3); border-color: var(--ink-2); }
.guide-frequency .guide-answer-muted.selected { color: var(--ink); background: color-mix(in srgb, var(--ink-2) 12%, var(--paper-3)); border-color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--ink-2); }
.guide-frequency .guide-answer-muted[role=radio].selected::before { border: 5px solid var(--ink-2); background: var(--paper-3); }
@media (max-width: 560px) {
 .guide-answers.guide-frequency { gap: 6px; }
 .guide-frequency .btn { padding: 8px 6px; gap: 6px; }
}
.guided-foot .btn { padding: 9px 18px; letter-spacing: .02em; }
.guided-foot .btn:disabled { opacity: 1; color: color-mix(in srgb, var(--ink) 38%, var(--paper-2)); background: color-mix(in srgb, var(--ink) 8%, var(--paper-2)); border-color: transparent; }
.ink-ripple { position: absolute; display: block; border-radius: 50%; pointer-events: none; background: currentColor; z-index: 2; }
@media (prefers-reduced-motion: reduce) {
 .guided-overlay, .guided-overlay .modal-box { animation: none !important; }
 .guided-overlay *, .study-compare-dock * { transition: none !important; }
}
