/* 管理端样式。
 *
 * 基调：干净、克制、留白多、单一强调色。
 * 这份问卷是要让人静下来想事情的，界面不能吵。
 */

:root {
  --ink: #1f1d1a;
  --ink-soft: #75706a;
  --ink-faint: #a09a92;
  --line: #e4e0d8;
  --line-soft: #efece6;
  --paper: #faf8f5;
  --card: #ffffff;
  --accent: #8a5a2b;
  --accent-soft: #f5eee4;
  --accent-line: #ddc9ae;
  --ok: #4a7040;
  --ok-soft: #f0f5ee;
  --danger: #a33a2a;
  --danger-soft: #fdf4f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(31, 29, 26, 0.04), 0 4px 14px rgba(31, 29, 26, 0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
               "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

body.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: 0.01em; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
h4 { font-size: 13px; font-weight: 600; margin: 0 0 10px; color: var(--ink-soft);
     letter-spacing: 0.04em; }

.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.right { text-align: right; }
.mt { margin-top: 22px; }
.hidden { display: none !important; }

code {
  background: var(--accent-soft);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* ---------- 顶栏 ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.brand { font-weight: 600; color: var(--ink); letter-spacing: 0.02em; }
.brand:hover { text-decoration: none; }
.logout { margin: 0; }

.linkish {
  background: none; border: none; padding: 0;
  color: var(--ink-soft); font: inherit; cursor: pointer;
}
.linkish:hover { color: var(--ink); }

.page { max-width: 880px; margin: 0 auto; padding: 34px 28px 100px; }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
}

.crumbs { font-size: 13px; color: var(--ink-soft); margin-bottom: 16px; }
.crumbs span { margin: 0 6px; color: var(--ink-faint); }

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

.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: inherit; font-size: 14px; line-height: 1.5;
  cursor: pointer; white-space: nowrap;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.btn:hover { border-color: var(--accent-line); color: var(--accent); text-decoration: none; }
.btn:active { background: var(--accent-soft); }

.btn.primary-sm {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn.primary-sm:hover { filter: brightness(1.09); color: #fff; border-color: var(--accent); }

.btn.tiny { padding: 2px 9px; font-size: 13px; }
.btn.ghost { border-color: transparent; color: var(--ink-soft); background: transparent; }
.btn.ghost:hover { border-color: var(--line); background: var(--card); }
.btn.danger-text:hover { color: var(--danger); border-color: #e2c0b8; }

.tag {
  display: inline-block; padding: 1px 9px; border-radius: 20px;
  font-size: 12px; background: var(--accent-soft); color: var(--accent);
  white-space: nowrap;
}
.tag.draft { background: #f1efea; color: var(--ink-soft); }
.tag.live { background: var(--ok-soft); color: var(--ok); }

/* ---------- 卡片 / 登录 ---------- */

.card-plain, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.panel.danger { border-color: #e8cac2; background: var(--danger-soft); }
.panel.good { border-color: #cfdec9; background: var(--ok-soft); }
.panel p:last-child { margin-bottom: 0; }

.panel.frozen {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; border-color: var(--accent-line); background: var(--accent-soft);
}
.panel.frozen h2 { margin-bottom: 4px; }
.panel.frozen p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.panel.frozen form { margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.narrow {
  width: 100%; max-width: 380px; margin: 24px; padding: 36px 32px;
}
.card.narrow h1 { margin-bottom: 2px; }
.card.narrow p { margin-top: 0; }

ul.problems { margin: 0; padding-left: 20px; font-size: 14px; }
ul.problems li { margin-bottom: 8px; line-height: 1.6; }
ul.problems li .btn { margin-left: 8px; vertical-align: 1px; }

.note, .flow-hint {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 22px;
  line-height: 1.7;
}
.flow-hint strong { color: var(--ink); }

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

label { display: block; }

input[type="password"], input[type="text"], input[type="number"],
textarea, select {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit; font-size: 15px;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  transition: border-color 0.12s, background 0.12s;
}
textarea { resize: vertical; line-height: 1.7; overflow: hidden; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); background: var(--card);
}
input[readonly], textarea[readonly] { background: var(--line-soft); opacity: 0.85; }

.card.narrow label {
  margin: 20px 0 6px; font-size: 14px; color: var(--ink-soft);
}
button.primary {
  margin-top: 20px; width: 100%; padding: 11px 16px;
  border: none; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font: inherit; font-weight: 500;
  cursor: pointer;
}
button.primary:hover { filter: brightness(1.09); }

.error {
  margin: 16px 0 0; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--danger-soft); color: var(--danger); font-size: 14px;
}
.warn {
  margin: 24px 0 0; padding: 12px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--ink-soft);
  font-size: 13px; line-height: 1.65;
}

details.inline-new summary { list-style: none; cursor: pointer; }
details.inline-new summary::-webkit-details-marker { display: none; }
.row-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 12px; }
.row-form.wide { flex-wrap: wrap; }
.row-form input[type="text"] { width: 240px; }
label.stacked { display: flex; flex-direction: column; margin: 0; gap: 5px;
                font-size: 13px; color: var(--ink-soft); }

/* ---------- 列表表格 ---------- */

table.list {
  width: 100%; border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table.list th, table.list td {
  text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
}
table.list th {
  font-size: 13px; font-weight: 500; color: var(--ink-soft); background: var(--paper);
}
table.list tr:last-child td { border-bottom: none; }
table.list .num { text-align: right; width: 92px; }
table.list tr.dimmed { opacity: 0.45; }
.sub { font-size: 13px; }
code.link { font-size: 12px; word-break: break-all; }

.head-actions, .actions { display: flex; gap: 8px; align-items: center; }
.head-actions form, .actions form { margin: 0; }
.actions { justify-content: flex-end; }

.empty {
  background: var(--card);
  border: 1px dashed var(--accent-line);
  border-radius: var(--radius);
  padding: 46px 32px;
  text-align: center;
}
.empty p { margin: 0 auto 8px; max-width: 420px; }
.empty p:last-child { margin-bottom: 0; font-size: 14px; }

/* ================= 读答卷 ================= */

.nav { display: flex; align-items: baseline; gap: 20px; }
.navlink { font-size: 14px; color: var(--ink-soft); }
.navlink:hover { color: var(--accent); text-decoration: none; }

.print-title { display: none; }

.rd-head {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
dl.rd-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 22px;
  margin: 0;
  font-size: 14px;
}
dl.rd-meta > div { display: flex; gap: 8px; }
dl.rd-meta dt { color: var(--ink-soft); flex: 0 0 62px; }
dl.rd-meta dd { margin: 0; }

.rd-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.rd-no { font-size: 12.5px; color: var(--ink-faint); margin-bottom: 5px; }
.rd-prompt { font-size: 16.5px; font-weight: 500; line-height: 1.65; margin-bottom: 9px; }
.rd-prompt.sub { font-size: 15px; font-weight: 400; color: var(--ink-soft); }
.rd-prompt .tag { margin-left: 7px; vertical-align: 2px; }
.rd-note {
  font-size: 13.5px;
  line-height: 1.65;
  margin: 0 0 8px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}

/* 答案用引用样式，和题干明确区分开 */
.rd-answer {
  font-size: 16px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  padding-left: 14px;
  border-left: 3px solid var(--accent-line);
}
.rd-followup {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.rd-board {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-top: 30px;
}
.rd-board h2 { margin-bottom: 4px; }
.rd-board > p.small { margin: 0 0 14px; }
.rd-answer.board { border-left-color: var(--accent); background: var(--card);
                   padding: 14px 16px; border-radius: 8px; }

/* ================= 打印：Ctrl+P 存 PDF ================= */

@media print {
  /* 导航、按钮、提示条一律不上纸 */
  .no-print, .topbar, .editor-bar, .crumbs, .note, .btn, button { display: none !important; }

  @page { size: A4; margin: 18mm 16mm; }

  body {
    background: #fff;
    color: #000;
    font-size: 11.5pt;
    line-height: 1.7;
  }
  .page { max-width: none; margin: 0; padding: 0; }

  /* 屏幕上的卡片阴影和圆角在纸上只会显脏 */
  .rd-head, .rd-item, .rd-board {
    background: #fff;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0 0 14pt;
  }

  .print-title {
    display: block;
    font-size: 16pt;
    margin: 0 0 10pt;
    padding-bottom: 6pt;
    border-bottom: 1pt solid #000;
  }
  .rd-head { margin-bottom: 18pt; }
  dl.rd-meta { grid-template-columns: 1fr 1fr; font-size: 9.5pt; gap: 3pt 18pt; }
  dl.rd-meta dt { color: #555; }

  /* 一道题不要被拦腰截断在两页之间 */
  .rd-item, .rd-followup, .rd-board { break-inside: avoid; page-break-inside: avoid; }

  .rd-no { font-size: 9pt; color: #666; }
  .rd-prompt { font-size: 12pt; }
  .rd-answer {
    font-size: 11.5pt;
    border-left: 2pt solid #999;
    padding-left: 8pt;
  }
  .rd-followup { border-top: 1px dotted #bbb; margin-top: 10pt; padding-top: 8pt; }

  .rd-board {
    margin-top: 20pt;
    padding-top: 10pt;
    border-top: 1pt solid #000;
  }
  .rd-answer.board { background: #fff; border-left: 2pt solid #999; padding: 0 0 0 8pt; }
  .rd-board h2 { font-size: 12pt; }

  a { color: #000; text-decoration: none; }
}

/* ================= 记事板的写作过程（阶段 8） ================= */

.blog { display: flex; flex-direction: column; }

.blog-item { display: flex; gap: 14px; position: relative; padding-bottom: 20px; }

/* 竖直时间轴。和流程图一样的表达：一条主干串起先后顺序。 */
.blog-item::before {
  content: "";
  position: absolute;
  left: 13px; top: 30px; bottom: 0;
  width: 1px; background: var(--line);
}
.blog-item:last-child::before { display: none; }

.blog-side { flex: 0 0 27px; }
.blog-no {
  display: flex; align-items: center; justify-content: center;
  width: 27px; height: 27px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 600;
  position: relative; z-index: 1;
}
.blog-item.tail .blog-no { background: var(--ink-faint); color: #fff; }

.blog-body { flex: 1 1 auto; min-width: 0; padding-top: 2px; }

.blog-where { font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.blog-item.tail .blog-where { color: var(--ink-soft); }

.blog-flag {
  font-size: 13px; line-height: 1.6;
  background: var(--danger-soft); color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 8px 11px; margin-bottom: 9px;
}

.blog-text { font-size: 15.5px; }
.blog-foot { margin-top: 7px; }

.blog-full { margin-top: 26px; }
.blog-full summary {
  cursor: pointer; font-size: 14px; color: var(--accent);
  margin-bottom: 12px;
}

/* ================= 问卷列表 ================= */

.q-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.q-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
}
.q-card:hover {
  text-decoration: none;
  border-color: var(--accent-line);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(31, 29, 26, 0.05), 0 10px 24px rgba(138, 90, 43, 0.08);
}
.q-card-title {
  font-size: 16px; font-weight: 600; line-height: 1.5;
  margin-bottom: 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.q-card-stats {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  font-size: 13px; color: var(--ink-soft);
}
.q-card-stats strong { color: var(--ink); font-weight: 600; }
.q-card-foot { font-size: 12px; margin-top: 10px; }

/* ================= 问卷中枢页 ================= */

.version-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch;
  margin-bottom: 18px;
}
.vtab {
  display: flex; flex-direction: column; gap: 3px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  min-width: 138px;
  transition: border-color 0.12s, background 0.12s;
}
.vtab:hover { text-decoration: none; border-color: var(--accent-line); }
.vtab.on { border-color: var(--accent); background: var(--accent-soft); }
.vtab-no { font-size: 15px; font-weight: 600; }
.vtab .tag { align-self: flex-start; }
.vtab-meta { font-size: 12px; }
.vtab-add { display: flex; align-items: center; margin: 0; }

.version-panel {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.version-panel.is-draft { border-color: var(--accent-line); }
.vp-main { flex: 1 1 300px; }
.vp-main h2 { margin-bottom: 4px; }
.vp-stats { font-size: 14px; margin: 0 0 4px; }
.vp-main p:last-child { margin-bottom: 0; }
.vp-actions { display: flex; gap: 9px; flex: 0 0 auto; flex-wrap: wrap; }

.section-head {
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  letter-spacing: 0.06em;
  margin: 34px 0 14px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

/* 题目详情（只读概览） */
.outline { display: flex; flex-direction: column; }
.ol-item {
  display: flex; gap: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 18px;
  box-shadow: var(--shadow);
}
.ol-no {
  flex: 0 0 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 600;
}
.ol-body { flex: 1 1 auto; min-width: 0; }
.ol-prompt { font-size: 15.5px; line-height: 1.65; }
.ol-meta { font-size: 12.5px; }
.ol-note {
  font-size: 13.5px;
  line-height: 1.65;
  padding-left: 10px;
  border-left: 2px solid var(--line);
  margin: 4px 0;
}
ul.ol-options { margin: 8px 0 0; padding-left: 19px; font-size: 14px; }
ul.ol-options li { margin-bottom: 2px; }
.ol-jump {
  margin-left: 7px; font-size: 12.5px;
  color: var(--accent); background: var(--accent-soft);
  padding: 0 7px; border-radius: 4px;
}
.ol-followup {
  margin-top: 11px; padding-left: 12px;
  border-left: 2px solid var(--accent-line);
  font-size: 14px; line-height: 1.65;
}
.ol-flow {
  display: flex; align-items: center; justify-content: center;
  height: 28px; font-size: 12px; position: relative;
}
.ol-flow::before {
  content: ""; position: absolute; left: 31px; top: 0; bottom: 0;
  width: 1px; background: var(--line);
}
.ol-flow { padding-left: 62px; justify-content: flex-start; }
.outline > .ol-flow:last-child { color: var(--ink-faint); }

/* 作答状态 */
.pill {
  display: inline-block; padding: 1px 9px; border-radius: 20px;
  font-size: 12.5px; background: var(--line-soft); color: var(--ink-soft);
  white-space: nowrap;
}
.pill.done { background: var(--ok-soft); color: var(--ok); }
.pill.doing { background: var(--accent-soft); color: var(--accent); }

.btn.copied { border-color: var(--ok); color: var(--ok); }

/* ================= 流程图预览（阶段 6，只读） ================= */

.flow-panel { padding: 18px 20px; }
.flow-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 14px;
}
.flow-head h2 { margin-bottom: 3px; }
.flow-head p { margin: 0; line-height: 1.6; }

/* 图可能比面板宽（分支多了会往两边长），横向滚动而不是压缩变形 */
.flow-scroll {
  overflow: auto;
  max-height: 72vh;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.flow-scroll svg { display: block; }
.flow-scroll img { display: block; max-width: none; }

/* 问卷详情页上的流程图默认折叠——那页主要是读题目和答卷情况的 */
.flow-details { margin-bottom: 20px; }
.flow-details > summary {
  cursor: pointer;
  display: inline-block;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 14px;
  color: var(--ink);
}
.flow-details > summary:hover { border-color: var(--accent-line); color: var(--accent); }
.flow-details[open] > summary { margin-bottom: 12px; }
.flow-details .flow-panel { margin-bottom: 0; }
.flow-details .flow-panel > p { margin: 0 0 12px; }

/* 图例里的小色标，跟图上的颜色一致 */
.lg { padding: 0 3px; border-radius: 3px; font-weight: 500; }
.lg.jump { color: var(--accent); background: var(--accent-soft); }
.lg.bad { color: var(--danger); background: var(--danger-soft); }

/* ================= 题目编辑器 ================= */

.editor-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.editor-bar .left, .editor-bar .right { display: flex; align-items: center; gap: 11px; }
.editor-bar .right form { margin: 0; }

.save-state { font-size: 13px; color: var(--ink-faint); }
.save-state.ok { color: var(--ok); }
.save-state.bad { color: var(--danger); }

.cards { display: flex; flex-direction: column; }

.card {
  transition: border-color 0.12s, box-shadow 0.12s;
}
.card.open {
  border-color: var(--accent-line);
  box-shadow: 0 2px 4px rgba(31, 29, 26, 0.05), 0 10px 28px rgba(138, 90, 43, 0.08);
}

.card-head {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 15px 18px;
  cursor: pointer;
  user-select: none;
}
.card-head.static { cursor: default; padding-bottom: 6px; }
.card:not(.open) .card-head:hover { background: var(--paper); border-radius: var(--radius); }

.card-no {
  flex: 0 0 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 600;
  margin-top: 1px;
}
.card.open .card-no { background: var(--accent); color: #fff; }

.card-title { flex: 1 1 auto; min-width: 0; }
.card-prompt {
  font-size: 15px; line-height: 1.55;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-prompt.blank { color: var(--ink-faint); font-style: italic; }
.card-meta { font-size: 12.5px; line-height: 1.5; }

.card-tools { display: flex; gap: 2px; flex: 0 0 auto; opacity: 0; transition: opacity 0.12s; }
.card:hover .card-tools, .card.open .card-tools { opacity: 1; }
.card-caret { flex: 0 0 auto; font-size: 12px; margin-top: 3px; }

.card-body { padding: 4px 18px 18px 57px; }

.f { margin-bottom: 16px; }
.f.inline { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.f-label {
  display: block; font-size: 12.5px; color: var(--ink-soft);
  margin-bottom: 5px; letter-spacing: 0.02em;
}
.f.inline .f-label { margin-bottom: 0; flex: 0 0 auto; }
.f-hint { font-size: 12.5px; line-height: 1.5; }
.f.inline .f-hint { flex: 1 1 200px; }

textarea[data-role="prompt"] { font-size: 16px; }
input.seconds { width: 78px !important; text-align: center; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  padding: 4px 12px;
  border: 1px solid var(--line); border-radius: 20px;
  font-size: 14px; cursor: pointer; background: var(--paper);
  transition: border-color 0.12s, background 0.12s;
}
.chip:hover { border-color: var(--accent-line); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip input { margin: 0; width: auto; }

.options { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.opt-row { display: flex; align-items: center; gap: 9px; width: 100%; }
.opt-no { flex: 0 0 18px; font-size: 13px; text-align: right; }
input.opt-label { flex: 1 1 auto; width: auto !important; }
.add-opt { margin-top: 3px; margin-left: 27px; }

.sub-block {
  margin: 22px 0 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.followups { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.followup {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 13px 15px 2px;
  background: var(--paper);
}
.followup-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px;
}
.followup-no { font-size: 12.5px; color: var(--ink-soft); letter-spacing: 0.03em; }
.followup .tools { display: flex; gap: 2px; }
.followup input, .followup textarea { background: var(--card); }
.no-followup { margin: 0 0 10px; line-height: 1.6; }

/* 特殊跳转：默认折叠，因为绝大多数题不需要它 */
.jump-block {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.disclosure {
  background: none; border: none; padding: 0;
  font: inherit; font-size: 13.5px; color: var(--ink);
  cursor: pointer; display: inline-flex; align-items: baseline; gap: 4px;
}
.disclosure:hover { color: var(--accent); }
.jump-block.open { background: var(--paper); border-radius: var(--radius-sm);
                   padding: 13px 15px; border-top: 1px solid var(--line-soft); }
.jump-block.open > p { margin: 8px 0 12px; }

.jump-row {
  display: flex; align-items: center; gap: 11px;
  padding: 5px 0; flex-wrap: wrap;
}
.jump-row.muted-row { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 9px; }
.jump-when { flex: 0 0 auto; min-width: 150px; font-size: 14px; }
select.jump { width: auto !important; min-width: 210px; max-width: 340px; font-size: 14px; }
select.jump.set { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.card-foot {
  display: flex; gap: 8px; align-items: center;
  margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line-soft);
}

/* 题与题之间的流向提示线 */
.flow-link {
  display: flex; align-items: center; justify-content: center;
  height: 30px; position: relative;
}
.flow-link::before {
  content: ""; position: absolute; left: 31px; top: 0; bottom: 0;
  width: 1px; background: var(--line);
}
.flow-link span {
  font-size: 12px; color: var(--ink-faint);
  background: var(--paper); padding: 0 9px;
  position: relative; left: -50%; margin-left: 31px;
}
.flow-link.branched span { color: var(--accent); }
.cards > .flow-link:last-child span { color: var(--ink-faint); }

.add-bar { margin-top: 10px; }
.btn.add-big {
  width: 100%; justify-content: center; padding: 13px;
  border-style: dashed; border-color: var(--accent-line);
  color: var(--accent); background: transparent; font-size: 15px;
}
.btn.add-big:hover { background: var(--accent-soft); }

/* 已发布版本的只读预览 */
.card.preview { border-color: var(--line); box-shadow: none; }
.card.preview .card-body { padding-top: 0; }
.pv-prompt { font-size: 16px; line-height: 1.7; margin-bottom: 8px; }
ul.pv-options { margin: 0 0 8px; padding-left: 20px; font-size: 14px; }
ul.pv-options li { margin-bottom: 3px; }
ul.pv-options .small { margin-left: 6px; }
.pv-followup {
  margin-top: 12px; padding-left: 12px;
  border-left: 2px solid var(--accent-line); font-size: 14px;
}

/* 发布确认弹窗 */
.dialog-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(31, 29, 26, 0.34);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.dialog {
  background: var(--card); border-radius: var(--radius);
  padding: 28px 30px; max-width: 460px; width: 100%;
  box-shadow: 0 12px 48px rgba(31, 29, 26, 0.22);
}
.dialog h2 { font-size: 18px; margin-bottom: 12px; }
.dialog p { font-size: 14px; color: var(--ink-soft); margin: 0 0 12px; line-height: 1.7; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* 导出方式二选一 */
.export-picks { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.export-pick {
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  transition: border-color 0.12s, background 0.12s;
}
.export-pick:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: var(--accent-soft);
}
.export-pick strong { font-weight: 600; font-size: 15px; }
.export-pick .small { line-height: 1.55; }

/* 批量导入弹窗 */
.dialog.wide { max-width: 640px; }
ul.rules {
  margin: 6px 0 12px;
  padding-left: 20px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.8;
}
ul.rules strong { color: var(--ink); }

#import-text {
  width: 100%;
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 13.5px;
  line-height: 1.75;
  /* 粘进来的内容靠 Tab 表达层级，所以要看得见缩进 */
  tab-size: 4;
  white-space: pre;
  overflow: auto;
  resize: vertical;
}

.import-preview {
  margin-top: 14px;
  padding: 13px 15px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  max-height: 260px;
  overflow: auto;
  font-size: 14px;
}
.preview-sum { margin: 0 0 8px; font-weight: 600; }
.preview-warn {
  margin: 0 0 8px;
  color: #8a6d2b;
  background: var(--accent-soft);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
}
ol.preview-list { margin: 0; padding-left: 22px; line-height: 1.7; }
ol.preview-list ul {
  margin: 2px 0 6px;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 13.5px;
}
.preview-note { color: var(--accent); font-size: 13px; }

.btn.add-big.secondary {
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn.add-big.secondary:hover { border-color: var(--accent-line); color: var(--accent); }
.add-bar { display: flex; gap: 10px; }

@media (max-width: 720px) {
  .page { padding: 22px 16px 80px; }
  .card-body { padding-left: 18px; }
  .flow-link::before, .flow-link span { display: none; }
  .card-tools { opacity: 1; }
  .ol-flow { padding-left: 20px; }
  .ol-flow::before { display: none; }
  .version-panel { flex-direction: column; align-items: stretch; }
  .q-grid { grid-template-columns: 1fr; }
}
