/* 正式用户 Web 样式表。保留已经通过验证的创作界面视觉与交互。 */

:root {
  --paper: #f7f4ee;
  --panel: #fffdf8;
  --ink: #2b2a26;
  --ink-soft: #6b675e;
  --ink-faint: #a39c8d;
  --line: #e3ddd0;
  --line-soft: #ece6d9;
  --accent: #2f6fbd;
  --accent-soft: #e8f0fa;
  --done: #2e8b57;
  --done-soft: #e8f5e9;
  --warn: #c98a12;
  --warn-soft: #fff8e1;
  --error: #c0392b;
  --error-soft: #fdecea;
  --sidebar-w: 300px;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  /* 统一尺寸：圆角、间距、字号、可点击高度 */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --font-sm: 13px;
  --font-body: 15px;
  --font-reading: 17px;
  --control-h: 38px;
  --shadow-pop: 0 10px 30px rgba(43, 42, 38, .18);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶栏 ---------- */
header.topbar {
  border-bottom: 2px solid var(--ink);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--panel);
}
.topbar h1 { font-size: 20px; font-weight: 700; }
.topbar .eyebrow {
  font-size: 12px; letter-spacing: .12em; color: var(--ink-soft);
  text-transform: uppercase; margin-bottom: 2px;
}
.topbar-right { font-size: 12px; color: var(--ink-soft); text-align: right; }
.topbar-right code {
  background: var(--line-soft); padding: 2px 6px; border-radius: 3px;
  font-family: "Cascadia Code", "Consolas", monospace; font-size: 11px;
}
.workbench-auth-status { color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.nav-tabs { display: flex; gap: 0; margin-left: 32px; }
.nav-tab {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 6px 16px; cursor: pointer;
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  color: var(--ink-soft);
  transition: color .12s, border-color .12s;
}
.nav-tab:hover { color: var(--ink); }
.nav-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.live-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--error);
  margin-right: 4px; animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.main { display: flex; flex: 1; overflow: hidden; }

/* ---------- 左侧资源列表 ---------- */
aside.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  border-right: 1px solid var(--line);
  overflow-y: auto; background: var(--panel);
}
.sidebar-actions {
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
  display: flex; gap: 8px;
}
.sidebar-actions button {
  flex: 1; font: inherit; font-size: 12px; font-weight: 600;
  padding: 7px 10px; cursor: pointer;
  border: 1px solid var(--ink); border-radius: 3px;
  background: var(--panel); color: var(--ink);
}
.sidebar-actions button:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.sidebar-group { border-bottom: 1px solid var(--line-soft); }
.sidebar-group-title {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  color: var(--ink-soft); text-transform: uppercase;
  padding: 14px 16px 6px; background: var(--paper);
}
.prompt-purpose-catalog {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.prompt-purpose-title {
  font-size: 13px; font-weight: 700; color: var(--ink);
}
.prompt-purpose-hint {
  margin-top: 4px; font-size: 11px; line-height: 1.45; color: var(--ink-faint);
}
.prompt-purpose-list { margin-top: 9px; display: grid; gap: 5px; }
.prompt-purpose-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 8px; border: 1px solid var(--line-soft); border-radius: 5px;
  background: var(--paper);
}
.prompt-purpose-item.available { cursor: pointer; }
.prompt-purpose-item.available:hover { border-color: var(--accent); background: var(--accent-soft); }
.prompt-purpose-item.missing { opacity: .78; }
.prompt-purpose-main { min-width: 0; }
.prompt-purpose-main strong { display: block; font-size: 12px; }
.prompt-purpose-main span { display: block; margin-top: 1px; font-size: 10px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resource-item {
  padding: 10px 16px; border-left: 3px solid transparent;
  cursor: pointer; transition: background .12s, border-color .12s;
}
.resource-item:hover { background: var(--accent-soft); }
.resource-item.active { background: var(--accent-soft); border-left-color: var(--accent); }
.resource-item .ri-title { font-size: 14px; font-weight: 600; display: block; }
.resource-item .ri-desc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.resource-item .ri-meta { font-size: 11px; color: var(--ink-faint); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 1px 6px; border-radius: 3px;
  background: var(--line-soft); color: var(--ink-soft);
}
.badge.layer { background: var(--done-soft); color: var(--done); }
.badge.type { background: #e3f2fd; color: #1565c0; }

.iv-goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0 4px; }
.iv-goal-choice {
  display: flex; flex-direction: column; gap: 7px; min-height: 126px;
  padding: 16px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--ink); font: inherit; transition: border-color .12s, box-shadow .12s, background .12s;
}
.iv-goal-choice:hover { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 2px 8px rgba(40,70,120,.08); }
.iv-goal-choice strong { font-size: 14px; }
.iv-goal-choice span { color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.full-life-wizard-shell { width: 560px; max-width: calc(100vw - 32px); max-height: 88vh; overflow-y: auto; }
.full-life-wizard-heading h3 { margin-bottom: 5px; }
.full-life-wizard-heading p { margin: 0 0 18px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.full-life-wizard-progress { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 18px; padding: 9px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--ink-soft); font-size: 12px; }
.full-life-wizard-progress strong { color: var(--accent); font-size: 12px; }
.full-life-wizard-body { min-height: 290px; }
.full-life-wizard-question { padding: 3px 2px 0; }
.full-life-wizard-kicker { display: block; margin-bottom: 7px; color: var(--accent); font-size: 12px; font-weight: 700; }
.full-life-wizard-question h4 { margin: 0 0 8px; font-size: 20px; line-height: 1.4; }
.full-life-wizard-question > p { margin: 0 0 22px; color: var(--ink-soft); font-size: 13px; line-height: 1.8; }
.full-life-wizard-question .field-row { margin: 0 0 16px; }
.full-life-wizard-question .field-row label { margin-bottom: 6px; }
.full-life-wizard-question input, .full-life-wizard-question select, .full-life-wizard-question textarea { width: 100%; box-sizing: border-box; }
.full-life-wizard-choice-list { display: grid; gap: 12px; }
.full-life-wizard-choice { display: flex; width: 100%; min-height: 92px; padding: 16px; flex-direction: column; gap: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; font: inherit; transition: border-color .12s, box-shadow .12s, background .12s; }
.full-life-wizard-choice:hover, .full-life-wizard-choice.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 2px 8px rgba(40,70,120,.08); }
.full-life-wizard-choice.active { outline: 2px solid color-mix(in srgb, var(--accent) 24%, transparent); }
.full-life-wizard-choice strong { font-size: 14px; }
.full-life-wizard-choice span { color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.full-life-wizard-checkbox { display: flex; gap: 8px; align-items: center; color: var(--ink-soft); font-size: 12px; }
.full-life-wizard-checkbox input { width: auto; }
.full-life-wizard-card { margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.full-life-wizard-card-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 11px; font-size: 12px; }
.full-life-wizard-card-heading > span { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.full-life-wizard-card-heading .btn { padding: 3px 7px; font-size: 11px; }
.full-life-wizard-range-separator { padding: 28px 4px 0; color: var(--ink-soft); }
.full-life-wizard-summary { display: grid; gap: 9px; margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.full-life-wizard-summary div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.full-life-wizard-summary span { color: var(--ink-soft); }
.full-life-wizard-summary strong { color: var(--ink); text-align: right; }
.full-life-wizard-status { min-height: 22px; margin-top: 10px; font-size: 12px; line-height: 1.6; }
.full-life-wizard-error { color: var(--error); }
@media (max-width: 760px) {
  .iv-goal-grid { grid-template-columns: 1fr; }
  .full-life-wizard-shell { max-height: 92vh; }
  .full-life-wizard-question h4 { font-size: 18px; }
  .full-life-wizard-card-heading { align-items: flex-start; flex-direction: column; }
  .full-life-wizard-card-heading > span { justify-content: flex-start; }
  .full-life-wizard-range-separator { display: none; }
}

/* ---------- USR-001 用户身份后端验证工作区 ---------- */
.account-view { min-height: 0; }
.account-sidebar { display: flex; flex-direction: column; }
.account-sidebar-heading { padding: 18px 16px 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
.account-sidebar-heading .eyebrow { color: var(--accent); font-size: 11px; letter-spacing: .12em; }
.account-sidebar-heading strong { display: block; margin-top: 3px; font-size: 16px; }
.account-sidebar-heading p { margin-top: 5px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.account-sidebar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.account-sidebar-actions .btn { padding: 6px 7px; font-size: 11px; }
.account-step-nav { padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.account-step-nav button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 15px; border: 0; background: transparent; color: var(--ink-soft); text-align: left; cursor: pointer; font: inherit; font-size: 12px; }
.account-step-nav button:hover { color: var(--accent); background: var(--accent-soft); }
.account-step-nav button span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--accent); font-size: 11px; font-weight: 700; }
.account-sidebar-note { margin-top: auto; padding: 13px 15px; border-top: 1px solid var(--line-soft); color: var(--ink-faint); font-size: 11px; line-height: 1.7; }
.account-sidebar-note code { color: var(--accent); background: var(--accent-soft); padding: 1px 4px; border-radius: 3px; }
.account-editor { padding: 22px 30px 48px; overflow-y: auto; }
.account-banner { margin-bottom: 14px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); background: var(--paper); font-size: 13px; line-height: 1.6; }
.account-banner.success { border-color: #b8ddc3; color: #216a42; background: var(--done-soft); }
.account-banner.warning { border-color: #e8cf92; color: #8a6010; background: var(--warn-soft); }
.account-banner.error { border-color: #e6b8b2; color: #a12d22; background: var(--error-soft); }
.account-user-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.account-user-summary > div { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.account-user-summary span, .account-user-summary strong { display: block; }
.account-user-summary span { color: var(--ink-faint); font-size: 11px; }
.account-user-summary strong { margin-top: 3px; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.account-summary-empty { grid-column: 1 / -1; padding: 11px 13px; border: 1px dashed var(--line); border-radius: 7px; color: var(--ink-faint); background: var(--paper); font-size: 12px; }
.account-card { margin-bottom: 16px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); scroll-margin-top: 14px; }
.account-card-heading { display: flex; align-items: flex-start; gap: 11px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.account-card-heading h3 { font-size: 16px; line-height: 1.45; }
.account-card-heading p { margin-top: 3px; color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.account-step-number { display: inline-flex; flex: 0 0 auto; 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: 700; }
.account-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; padding-top: 13px; }
.account-form-grid .field-row { margin-bottom: 11px; }
.account-form-grid input { width: 100%; font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); }
.account-form-grid input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.account-action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.account-action-row .btn { padding: 7px 11px; font-size: 12px; }
.account-inline-state { color: var(--ink-faint); font-size: 11px; }
.account-substep { margin-top: 14px; padding: 12px 13px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--paper); }
.account-substep-title { margin-bottom: 2px; color: var(--ink); font-size: 12px; font-weight: 700; }
.account-secondary-action { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.account-result-box { margin-top: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.account-result-box strong { color: var(--ink); }
.account-result-box p { margin-top: 4px; }
.account-result-box code { display: inline-block; max-width: 100%; padding: 1px 4px; border-radius: 3px; background: var(--line-soft); color: var(--ink); overflow-wrap: anywhere; }
.account-result-box pre { margin-top: 6px; max-height: 230px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-soft); font: 11px/1.55 "Cascadia Code", "Consolas", monospace; }
.account-result-box.success { border-color: #b8ddc3; background: var(--done-soft); }
.account-result-box.warning { border-color: #e8cf92; background: var(--warn-soft); }
.account-result-box.error { border-color: #e6b8b2; background: var(--error-soft); }
.account-log-card { background: var(--paper); }
.account-log { display: grid; gap: 7px; margin-top: 12px; }
.account-log-empty { color: var(--ink-faint); font-size: 12px; }
.account-log-item { padding: 8px 10px; border-left: 3px solid var(--line); background: var(--panel); color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.account-log-item.success { border-left-color: var(--done); }
.account-log-item.warning { border-left-color: var(--warn); }
.account-log-item.error { border-left-color: var(--error); }
.account-log-heading { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 2px; color: var(--ink); }
.account-log-heading span { color: var(--ink-faint); font-size: 10px; }
@media (max-width: 860px) {
  .account-user-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-form-grid { grid-template-columns: 1fr; }
  .account-editor { padding: 18px 16px 40px; }
}

/* ---------- 右侧编辑区 ---------- */
section.editor { flex: 1; overflow-y: auto; padding: 24px 32px; }
.editor-placeholder {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--ink-faint); font-size: 15px;
}

.edit-header { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 20px; }
.edit-header h2 { font-size: 18px; font-weight: 700; }
.edit-header .edit-desc { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.edit-header .edit-path { font-size: 12px; color: var(--ink-faint); margin-top: 6px; font-family: "Cascadia Code", "Consolas", monospace; word-break: break-all; }

.field-row { margin-bottom: 16px; }
.field-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.field-row label .hint { font-weight: 400; color: var(--ink-soft); font-size: 12px; }
.field-row input[type="text"], .field-row select {
  width: 100%; font: inherit; font-size: 13px;
  padding: 6px 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); border-radius: 3px;
}
.field-row input:focus, .field-row select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft);
}
.field-row-inline { display: flex; gap: 12px; }
.field-row-inline .field-row { flex: 1; }
textarea {
  width: 100%; font: 13px/1.5 "Cascadia Code", "Consolas", "Source Code Pro", monospace;
  padding: 10px 14px; border: 1px solid var(--line);
  background: #fcfbf7; color: var(--ink);
  border-radius: 3px; resize: vertical; tab-size: 2;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
textarea.json-editor { min-height: 400px; }
textarea.prompt-editor { min-height: 320px; }

.pack-meta {
  background: var(--panel); border: 1px solid var(--line);
  padding: 12px 16px; margin-bottom: 16px;
  display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px;
}
.pack-meta .pm-item { display: flex; flex-direction: column; }
.pack-meta .pm-label { font-size: 11px; color: var(--ink-soft); }
.pack-meta .pm-value { font-weight: 600; }

.question-summary { margin-bottom: 16px; border: 1px solid var(--line); max-height: 280px; overflow-y: auto; }
.question-summary table { width: 100%; border-collapse: collapse; font-size: 12px; }
.question-summary th { text-align: left; padding: 6px 10px; background: var(--line-soft); border-bottom: 1px solid var(--line); font-weight: 600; position: sticky; top: 0; }
.question-summary td { padding: 5px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.question-summary td.qid { font-family: monospace; color: var(--ink-soft); white-space: nowrap; }
.question-summary td.qtext { max-width: 300px; }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.btn { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 20px; border: 1px solid var(--ink); background: var(--ink); color: var(--panel); cursor: pointer; border-radius: 3px; transition: background .12s; }
.btn:hover:not(:disabled) { background: #46443d; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn.secondary { background: var(--panel); color: var(--ink); }
.btn.secondary:hover:not(:disabled) { background: var(--line-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { background: #1d5fa3; }
.status-msg { font-size: 12px; color: var(--ink-soft); transition: color .2s; }
.status-msg.ok { color: var(--done); font-weight: 600; }
.status-msg.err { color: var(--error); font-weight: 600; }
.status-msg.dirty { color: var(--warn); font-weight: 600; }

.tabs { display: flex; gap: 0; margin-bottom: 0; border-bottom: 1px solid var(--line); }
.tab { font: inherit; font-size: 13px; font-weight: 600; padding: 8px 16px; cursor: pointer; background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--ink-soft); transition: color .12s, border-color .12s; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.readonly-note { background: var(--warn-soft); border: 1px solid #ffe082; padding: 8px 12px; margin-bottom: 12px; font-size: 12px; color: #8d6e00; border-radius: 3px; }

/* ---------- 监视器 ---------- */
.monitor-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.monitor-toolbar .auto-refresh {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
}
.monitor-toolbar input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.monitor-toolbar select {
  font: inherit; font-size: 13px; padding: 4px 8px;
  border: 1px solid var(--line); border-radius: 3px;
  background: var(--panel);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.stat-card {
  background: var(--panel); border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  padding: 12px 14px;
}
.stat-card .stat-label { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.stat-card .stat-value { font-size: 22px; font-weight: 700; margin-top: 4px; font-family: "Cascadia Code", "Consolas", monospace; }
.stat-card .stat-unit { font-size: 11px; font-weight: 400; color: var(--ink-soft); }
.stat-card.input { border-top-color: var(--accent); }
.stat-card.input .stat-value { color: var(--accent); }
.stat-card.output { border-top-color: var(--done); }
.stat-card.output .stat-value { color: var(--done); }
.stat-card.total { border-top-color: var(--ink); }
.stat-card.cost { border-top-color: var(--warn); }
.stat-card.cost .stat-value { color: var(--warn); }
.stat-card.calls { border-top-color: var(--ink-soft); }
.stat-card.calls .stat-value { color: var(--ink-soft); }

/* 调用列表 */
.call-list { display: flex; flex-direction: column; gap: 8px; }
.call-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 4px; overflow: hidden;
}
.call-card.error { border-left: 4px solid var(--error); }
.call-card.success { border-left: 4px solid var(--done); }
.call-header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper);
}
.call-header:hover { background: var(--accent-soft); }
.call-header .ch-time { font-size: 12px; color: var(--ink-soft); font-family: monospace; white-space: nowrap; }
.call-header .ch-type { font-size: 13px; font-weight: 600; }
.call-header .ch-source { font-size: 11px; }
.call-header .ch-tokens { font-size: 12px; color: var(--ink-soft); margin-left: auto; font-family: monospace; }
.call-header .ch-cost { font-size: 12px; font-weight: 600; color: var(--warn); font-family: monospace; }
.call-header .ch-duration { font-size: 11px; color: var(--ink-faint); font-family: monospace; }

.call-detail { padding: 14px; display: none; }
.call-detail.open { display: block; }
.call-detail-section { margin-bottom: 16px; }
.call-detail-section:last-child { margin-bottom: 0; }
.call-detail-section h4 {
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 6px;
}
.call-detail-section .content-box {
  background: #fcfbf7; border: 1px solid var(--line);
  padding: 10px 12px; font-size: 12px;
  font-family: "Cascadia Code", "Consolas", monospace;
  white-space: pre-wrap; word-break: break-word;
  max-height: 400px; overflow-y: auto;
  border-radius: 3px;
}
.call-detail-section .content-box.input { border-left: 3px solid var(--accent); }
.call-detail-section .content-box.output { border-left: 3px solid var(--done); }
.call-detail-section .content-box.system { border-left: 3px solid var(--warn); }

.call-mini-stats {
  display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px;
  padding: 8px 14px; background: var(--line-soft);
}
.call-mini-stats .cms-item { display: flex; gap: 4px; }
.call-mini-stats .cms-label { color: var(--ink-soft); }
.call-mini-stats .cms-value { font-weight: 600; font-family: monospace; }

/* 弹窗 */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-overlay[hidden] { display: none !important; }
.modal {
  background: var(--panel); border: 2px solid var(--ink);
  padding: 24px 28px; width: 520px; max-width: 90vw; max-height: 90vh; overflow-y: auto;
  border-radius: 4px;
}
.modal h3 { font-size: 18px; margin-bottom: 16px; }
.modal .modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }
.detail-muted { margin-top: 6px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }

/* 统一创作工作区：阶段性回忆与完整人生使用同一套任务空间视觉语言。 */
.nav-tab-divider { width: 1px; height: 24px; background: var(--line); margin: 0 5px; }

/* 工作台认证门禁：登录/注册流程与小程序正式认证页保持同一业务语义。 */
.workbench-auth-gate { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 28px; background: rgba(35, 30, 24, .38); backdrop-filter: blur(2px); }
.workbench-auth-gate[hidden] { display: none; }
.workbench-auth-panel { width: min(470px, 100%); max-height: calc(100vh - 56px); overflow-y: auto; padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 18px 60px rgba(56, 43, 28, .2); }
.workbench-auth-brand { margin-bottom: 18px; }
.workbench-auth-brand .eyebrow { color: var(--accent); font-size: 11px; letter-spacing: .12em; }
.workbench-auth-brand h2 { margin-top: 6px; font-size: 24px; line-height: 1.35; }
.workbench-auth-brand p { margin-top: 8px; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.workbench-auth-card { padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
/* CR-089：已绑定的微信；改备注、解绑是文字链接，解绑先确认 */
.account-wechat-card { margin-top: 12px; }
.account-wechat-help { margin: 4px 0 8px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.account-wechat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.account-wechat-row strong { display: block; font-size: 14px; }
.account-wechat-row span { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 12px; }
.account-wechat-actions { display: flex; flex-shrink: 0; gap: 14px; }
.account-wechat-link { padding: 4px 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; }
.account-wechat-link.danger { color: var(--danger); }
.workbench-auth-label { display: block; margin: 13px 0 6px; color: var(--ink); font-size: 12px; font-weight: 700; }
.workbench-auth-label:first-child { margin-top: 0; }
.workbench-auth-input { box-sizing: border-box; width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; }
.workbench-auth-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.workbench-auth-mode-tabs { display: flex; gap: 6px; margin: 16px 0 2px; padding: 3px; border-radius: 7px; background: var(--line-soft); }
.workbench-auth-mode { flex: 1; min-height: 34px; padding: 6px 9px; border: 0; border-radius: 5px; background: transparent; color: var(--ink-soft); cursor: pointer; font: inherit; font-size: 12px; }
.workbench-auth-mode.active { background: var(--paper); color: var(--accent); box-shadow: 0 1px 3px rgba(56, 43, 28, .12); font-weight: 700; }
.workbench-auth-help, .workbench-auth-footnote { margin-top: 7px; color: var(--ink-faint); font-size: 11px; line-height: 1.65; }
.workbench-auth-help code { padding: 1px 3px; border-radius: 3px; background: var(--line-soft); color: var(--ink); }
.workbench-auth-flow-note { margin: 14px 0 2px; padding: 9px 10px; border-radius: 6px; background: var(--accent-soft); color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.workbench-auth-flow-note strong { color: var(--ink); }
.workbench-auth-button { width: 100%; margin-top: 12px; }
.workbench-auth-message { margin-bottom: 12px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; line-height: 1.6; }
.workbench-auth-message[hidden] { display: none; }
.workbench-auth-message.error { border-color: #e6b8b2; color: #a12d22; background: var(--error-soft); }
.workbench-auth-message.notice { border-color: #e8cf92; color: #8a6010; background: var(--warn-soft); }
.workbench-auth-step-head { display: flex; align-items: flex-start; gap: 9px; }
.workbench-auth-step-head > span { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }
.workbench-auth-step-head strong { font-size: 15px; }
.workbench-auth-step-head p { margin-top: 3px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.workbench-auth-text-button { display: block; margin: 14px auto 0; border: 0; background: transparent; color: var(--accent); cursor: pointer; font: inherit; font-size: 12px; }
.workbench-auth-success { text-align: center; }
.workbench-auth-success-mark { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 11px; border-radius: 50%; background: var(--done-soft); color: var(--done); font-size: 25px; font-weight: 700; }
.workbench-auth-success strong { font-size: 17px; }
.workbench-auth-success p { margin-top: 6px; color: var(--ink-soft); font-size: 12px; }
.creative-view { min-height: 0; }
.creative-sidebar { width: 292px; min-width: 292px; background: var(--paper); }
.creative-editor { min-width: 0; min-height: 0; overflow: hidden; background: #fcfbf7; }
.creative-sidebar-actions { padding: 14px 14px 10px; display: flex; gap: 7px; }
.creative-sidebar-actions .btn { flex: 1; font-size: 12px; padding: 8px 9px; }
.stage-memory-filter-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; color: var(--ink-soft); font-size: 11px; }
.stage-memory-filter-wrap select { width: 100%; min-width: 0; box-sizing: border-box; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font: inherit; cursor: pointer; }
.stage-memory-filter-legend { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 0 14px 8px; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.stage-memory-filter-legend span { display: inline-flex; align-items: center; gap: 5px; }
.stage-memory-color-swatch { width: 10px; height: 10px; border-radius: 3px; border: 1px solid rgba(40,50,60,.12); }
.stage-memory-color-swatch.included { background: #e8f3ee; }
.stage-memory-color-swatch.unincluded { background: #f5eee2; }
.creative-sidebar-empty { padding: 20px 16px; color: var(--ink-faint); font-size: 13px; line-height: 1.7; }
.creative-card-list { padding: 4px 10px 20px; display: grid; gap: 7px; }
.creative-sidebar-card { width: 100%; text-align: left; border: 1px solid transparent; border-radius: 9px; padding: 12px 12px 10px; cursor: pointer; background: transparent; color: var(--ink); font: inherit; transition: .15s ease; }
.creative-sidebar-card:hover { background: #fff; border-color: var(--line); }
.creative-sidebar-card.active { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 1px 4px rgba(40,80,160,.08); }
.creative-sidebar-card.stage-memory-card-included { background: #e8f3ee; border-color: #c9e2d5; }
.creative-sidebar-card.stage-memory-card-included:hover { background: #dceee5; border-color: #a9d1bb; }
.creative-sidebar-card.stage-memory-card-unincluded { background: #f5eee2; border-color: #eadbc2; }
.creative-sidebar-card.stage-memory-card-unincluded:hover { background: #f0e5d4; border-color: #ddc6a2; }
.creative-sidebar-card.stage-memory-card-included.active { background: #d3e9dc; border-color: var(--accent); }
.creative-sidebar-card.stage-memory-card-unincluded.active { background: #ecddc4; border-color: var(--accent); }
.creative-card-title { font-weight: 700; font-size: 14px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creative-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 7px; color: var(--ink-soft); font-size: 11px; }
.creative-card-action { margin-top: 9px; color: var(--accent); font-size: 12px; font-weight: 600; display: flex; justify-content: space-between; }
.creative-card-topic { margin-top: 6px; color: var(--ink-soft); font-size: 11px; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.creative-card-memberships, .stage-memory-memberships { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; }
.stage-memory-membership { display: inline-flex; width: fit-content; max-width: 100%; padding: 2px 6px; border-radius: 999px; background: rgba(76, 121, 196, .1); color: var(--accent); font-size: 10px; line-height: 1.35; }
.stage-memory-membership.empty { background: rgba(120, 120, 120, .1); color: var(--ink-faint); }
.stage-memory-meta-edit { position: relative; }
.stage-memory-meta-edit > summary { list-style: none; cursor: pointer; }
.stage-memory-meta-edit > summary::-webkit-details-marker { display: none; }
.stage-memory-meta-panel { position: absolute; z-index: 10; right: 0; top: calc(100% + 6px); width: 330px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.stage-memory-meta-panel label { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: 11px; }
.stage-memory-meta-panel input, .stage-memory-meta-panel textarea { box-sizing: border-box; width: 100%; margin-top: 4px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 12px; background: #fff; }
.stage-memory-meta-time { display: flex; gap: 6px; align-items: center; margin-bottom: 9px; }
.stage-memory-meta-time input { margin-top: 0; }
.stage-memory-archived-list { margin: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.55); font-size: 12px; }
.stage-memory-archived-list > summary { cursor: pointer; color: var(--ink-soft); }
.stage-memory-archived-item { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.stage-memory-archived-item .btn { padding: 4px 8px; font-size: 11px; }
.module-card-subtitle, .module-card-topic { margin-top: 4px; color: var(--ink-soft); font-size: 11px; line-height: 1.4; }
.creative-empty-state { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; color: var(--ink-soft); }
.creative-empty-state h2 { color: var(--ink); margin: 10px 0 4px; font-size: 22px; }
.creative-empty-state p { max-width: 430px; line-height: 1.8; font-size: 14px; margin: 0 0 18px; }
.creative-empty-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; color: var(--accent); background: var(--accent-soft); }
.creative-context-header { padding: 18px 28px 12px; border-bottom: 1px solid var(--line-soft); background: var(--panel); }
.creative-breadcrumb { font-size: 12px; color: var(--ink-faint); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.creative-title-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.creative-title-row h2 { font-size: 21px; margin: 0; }
.creative-subtitle { margin-top: 5px; color: var(--ink-soft); font-size: 12px; }
.creative-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stage-memory-more-wrap { position: relative; }
.stage-memory-more-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; min-width: 150px; padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 6px 18px rgba(30,40,50,.14); }
.stage-memory-danger-action { width: 100%; border: 0; border-radius: 5px; padding: 8px 10px; background: transparent; color: var(--error, #b42318); text-align: left; font: 12px inherit; cursor: pointer; }
.stage-memory-danger-action:hover { background: #fff1f0; }
.creative-task-tabs { display: flex; gap: 2px; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--panel); }
.creative-task-tab { border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--ink-soft); font: inherit; font-weight: 600; padding: 12px 14px 10px; cursor: pointer; }
.creative-task-tab:hover { color: var(--ink); }
.creative-task-tab.active { border-bottom-color: var(--accent); color: var(--accent); }
.creative-task-note { padding: 9px 28px; color: var(--ink-soft); font-size: 12px; background: #f7f9ff; border-bottom: 1px solid var(--line-soft); }
.creative-task-content { flex: 1 1 auto; min-height: 0; background: #fcfbf7; overflow-y: auto; }
#stage-memory-workspace { display: flex; flex-direction: column; min-height: 0; }
#conversation-area { overflow: hidden; }
#interview-area, #stage-memory-delivery-area { overflow-y: auto; }
#iv-writing-pane { min-height: 100%; display: flex; flex-direction: column; }
.iv-token-usage { margin-top: 7px; padding-top: 5px; border-top: 1px solid rgba(120,135,155,.2); color: var(--ink-faint); font-size: 10px; line-height: 1.45; text-align: right; white-space: normal; }
.iv-token-usage-missing { color: var(--ink-faint); font-style: italic; }
.iv-token-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.72); color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.iv-token-summary strong { color: var(--ink); font-size: 13px; }
.iv-token-summary small { color: var(--ink-faint); font-size: 11px; }
/* 文章与修改任务页（WEB-011 / CR-080）：进入即正文，右侧“本次修改”，底部唯一确认。 */
.iv-writing-page { flex: 1 0 auto; width: 100%; box-sizing: border-box; padding: 22px 28px 32px; max-width: 1280px; margin: 0 auto; }
.iv-writing-notice { margin: 0 0 12px; padding: 10px 12px; border-radius: 7px; background: var(--accent-soft); color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.iv-writing-notice.is-error { background: var(--error-soft); color: var(--error); }
.iv-draft-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.iv-draft-bar-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.iv-draft-bar-title strong { color: var(--ink); font-size: 17px; }
.iv-draft-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.iv-draft-source-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0; padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; background: #fff; color: var(--ink); font-size: 14px; }
.iv-draft-source-box strong { color: var(--accent); }
.iv-narration-update { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 0 0 14px; padding: 14px 16px; border: 1px solid var(--warn, #d69e2e); border-radius: 10px; background: var(--warn-soft, #fff8e8); }
.iv-narration-update.is-soft { border-color: var(--line); background: var(--paper); }
.iv-narration-update strong { display: block; color: var(--ink); font-size: 15px; }
.iv-narration-update span { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.iv-narration-update-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.iv-generating-card { margin: 12px 0; padding: 16px 18px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); }
.iv-generating-card p { margin: 8px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.iv-correction-undo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--done); border-radius: 8px; background: var(--done-soft, #f2faf2); font-size: 13px; }
.iv-correction-undo span { flex: 1 1 auto; color: var(--ink); }
.iv-draft-source-list { max-height: 320px; overflow: auto; margin: 0 0 14px; padding: 10px 12px 10px 30px; border-radius: 8px; background: #fff; border: 1px solid var(--line-soft); }
.iv-draft-source-list li { margin-bottom: 8px; white-space: pre-wrap; color: var(--ink); }
.iv-draft-source-list li span { display: block; color: var(--ink-faint); font-size: 12px; }
.iv-draft-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.iv-draft-layout.is-readonly { grid-template-columns: minmax(0, 1fr); }
.iv-draft-layout > .iv-correction-article, .iv-correction-article.is-readonly { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.iv-correction-paragraph-row.is-readonly { grid-template-columns: minmax(0, 1fr); }
.iv-correction-mark.is-flash { outline: 2px solid var(--accent); outline-offset: 2px; }
.iv-correction-message { margin: 0 0 12px; padding: 9px 11px; border-radius: 7px; background: var(--warn-soft, #fff8e8); color: var(--ink-soft); font-size: 12px; }
.iv-correction-target-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.iv-correction-target-note { margin-top: 8px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.iv-correction-target-error { margin-bottom: 8px; color: var(--error); font-size: 12px; }
.iv-correction-target textarea { width: 100%; box-sizing: border-box; resize: vertical; line-height: 1.6; }
.iv-correction-ai-title { font-weight: 600; margin-bottom: 6px; }
.iv-draft-side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.iv-draft-side .iv-correction-panel { position: static; }
.iv-audit-panel { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13px; line-height: 1.6; }
.iv-audit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.iv-audit-note { margin: 4px 0 8px; color: var(--ink-soft); font-size: 12px; }
.iv-audit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.iv-audit-card { padding: 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--paper); }
.iv-audit-card.is-adopted { border-color: var(--accent); background: var(--accent-soft, #f5f8ff); }
.iv-audit-card.is-dismissed, .iv-audit-card.is-unlocated { color: var(--ink-soft); }
.iv-audit-card-head { display: block; margin: 0 0 6px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.iv-audit-line { display: flex; gap: 6px; align-items: baseline; }
.iv-audit-tag { flex: none; color: var(--ink-faint); font-size: 12px; }
.iv-audit-before { color: var(--ink-soft); }
.iv-audit-before mark { color: var(--ink); background: #f3e2b3; border-radius: 3px; padding: 0 1px; }
.iv-audit-after { color: var(--ink); }
.iv-audit-reason { margin: 6px 0 0; color: var(--ink-soft); font-size: 12px; }
.iv-audit-state { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 12px; }
.iv-audit-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.iv-audit-dismissed { margin-top: 10px; }
.iv-audit-dismissed summary { cursor: pointer; color: var(--ink-soft); font-size: 12px; }
.iv-audit-dismissed .iv-audit-list { margin-top: 8px; }
.iv-audit-mark { text-decoration: underline dotted var(--accent); text-underline-offset: 3px; cursor: help; }
.iv-audit-mark.is-flash { outline: 2px solid var(--accent); outline-offset: 2px; }
.iv-correction-panel { position: sticky; top: 12px; padding: 14px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft, #f5f8ff); font-size: 13px; line-height: 1.6; }
.iv-correction-panel.is-empty { border-style: dashed; border-color: var(--line); background: var(--paper); color: var(--ink-soft); }
.iv-correction-panel.is-empty p { margin: 6px 0 0; font-size: 12px; }
.iv-correction-panel.is-stale { border-color: var(--error); background: var(--error-soft); }
.iv-correction-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.iv-correction-save-status { color: var(--ink-faint); font-size: 11px; }
.iv-correction-save-status.is-error, .iv-correction-panel-error { color: var(--error); }
.iv-correction-panel-error { margin: 8px 0 0; font-size: 12px; }
.iv-correction-panel-list { display: grid; gap: 6px; max-height: 42vh; overflow: auto; margin: 10px 0; padding: 0; list-style: none; }
.iv-correction-panel-item { display: grid; gap: 2px; width: 100%; padding: 6px 8px; border: 1px solid var(--line-soft); border-radius: 7px; background: #fff; font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.iv-correction-panel-item:hover { border-color: var(--accent); }
.iv-correction-panel-before { color: #8f2c25; text-decoration: line-through; overflow-wrap: anywhere; }
.iv-correction-panel-after { color: var(--done); overflow-wrap: anywhere; }
.iv-correction-panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.iv-correction-panel-note { margin: 8px 0 0; color: var(--ink-faint); font-size: 11px; }
.iv-writing-footer { position: sticky; bottom: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 28px; border-top: 1px solid var(--line); background: rgba(252, 251, 247, .96); backdrop-filter: blur(6px); }
.iv-writing-footer span { flex: 1; min-width: 200px; color: var(--ink-soft); font-size: 13px; }
.iv-writing-empty { padding: 56px 20px; text-align: center; }
.iv-writing-empty strong { font-size: 17px; }
.iv-writing-empty p { margin: 8px 0 16px; color: var(--ink-soft); font-size: 13px; }
.iv-compare-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; background: var(--accent-soft); font-size: 13px; }
.iv-compare-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.iv-compare-grid h4 { margin: 0 0 6px; font-size: 13px; }
.history-section { margin-bottom: 22px; }
.history-section h4 { margin: 0 0 10px; font-size: 14px; }
.history-version, .history-revision { margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.history-version.is-current, .history-revision.is-current { border-color: var(--accent); background: var(--accent-soft); }
.history-version-head, .history-revision-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.history-version-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.history-muted { color: var(--ink-faint); font-size: 12px; }
.history-error { color: var(--error); font-size: 13px; }
.history-changes { display: grid; gap: 8px; margin: 8px 0; padding-left: 18px; font-size: 12px; }
.history-before { color: #8f2c25; text-decoration: line-through; white-space: pre-wrap; }
.history-after { color: var(--done); white-space: pre-wrap; }
.history-snapshot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.history-revert-preview { max-height: 55vh; overflow: auto; }
.iv-correction-article { position: relative; padding: 20px 22px 28px; line-height: 1.9; font-size: 15px; word-break: break-word; user-select: text; }
.iv-correction-article.has-correction-target { padding-bottom: 360px; }
.iv-correction-text { white-space: pre-wrap; cursor: text; }
.iv-correction-paragraph-break { display: block; height: 14px; margin: 9px 0 4px; border-top: 1px solid var(--line-soft); font-size: 0; line-height: 0; }
.iv-correction-paragraph-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(245px, 34%); gap: 24px; align-items: start; padding: 8px 0 16px; margin: 0 0 10px; border-bottom: 1px solid var(--line-soft); }
.iv-correction-paragraph-row:last-child { border-bottom: 0; }
.iv-correction-paragraph-main { min-width: 0; }
.iv-correction-paragraph-label { margin-bottom: 3px; color: var(--ink-faint); font-size: 10px; line-height: 1.4; user-select: none; }
.iv-selected-correction { background: #fff0a8; box-shadow: 0 0 0 2px rgba(201,138,18,.28); border-radius: 3px; padding: 1px 2px; }
.iv-correction-mark { border-radius: 3px; padding: 1px 2px; }
.iv-correction-mark-delete, .iv-correction-mark-replace { color: #8f2c25; background: rgba(255,226,222,.78); text-decoration-line: line-through; text-decoration-thickness: 2px; text-decoration-color: #c4473e; }
.iv-correction-mark-replace { background: rgba(255,244,205,.88); text-decoration-color: #a36b00; }
.iv-correction-side-notes { position: relative; display: block; min-width: 0; min-height: 0; padding-top: 0; }
.iv-correction-side-note { position: absolute; top: 0; right: 0; left: 0; display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: stretch; min-width: 0; }
.iv-correction-note-connector { position: relative; min-height: 32px; color: var(--accent); font-size: 9px; writing-mode: vertical-rl; text-align: center; }
.iv-correction-note-connector::before { content: ''; position: absolute; top: calc(15px + var(--iv-note-anchor-offset, 0px)); left: -24px; width: 24px; border-top: 1px solid rgba(74,116,180,.72); }
.iv-correction-note-connector::after { content: ''; position: absolute; top: calc(15px + var(--iv-note-anchor-offset, 0px)); left: -24px; width: 5px; height: 5px; border-left: 1px solid rgba(74,116,180,.72); border-top: 1px solid rgba(74,116,180,.72); transform: translateY(-3px) rotate(-45deg); }
.iv-correction-side-note-card { display: flex; align-items: flex-start; gap: 6px; min-width: 0; padding: 2px 0 2px 7px; border: 0; border-left: 2px solid var(--accent); border-radius: 0; background: transparent; box-shadow: none; }
.iv-correction-side-note-input { box-sizing: border-box; flex: 0 1 auto; width: fit-content; max-width: calc(100% - 38px); min-width: 12em; min-height: 26px; max-height: 84px; padding: 4px 5px; border: 1px solid rgba(74,116,180,.28); border-radius: 4px; background: rgba(255,255,255,.66); resize: vertical; overflow-y: auto; line-height: 1.45; font: 12px inherit; field-sizing: content; }
.iv-correction-side-note-card > .btn { flex: 0 0 auto; margin: 0; padding: 4px 6px; font-size: 10px; line-height: 1.3; }
.iv-correction-side-note-delete { flex: 1 1 auto; min-width: 0; padding: 5px 0; color: var(--error); font-size: 12px; line-height: 1.4; }
.iv-correction-target { position: absolute; z-index: 5; width: min(520px, calc(100% - 24px)); box-sizing: border-box; padding: 13px 15px; border: 1px solid rgba(74,116,180,.72); border-radius: 10px; background: rgba(239,246,255,.66); box-shadow: 0 12px 30px rgba(47,111,189,.22); backdrop-filter: blur(16px) saturate(145%); -webkit-backdrop-filter: blur(16px) saturate(145%); isolation: isolate; }
.iv-correction-target textarea { font-family: inherit; background: rgba(255,255,255,.68); }
.iv-correction-close { width: 30px; height: 30px; padding: 0 !important; border-radius: 50% !important; font-size: 21px !important; line-height: 26px; font-weight: 500 !important; }
.iv-correction-input-hint { margin-top: 4px; color: var(--ink-faint); font-size: 11px; line-height: 1.5; }
.iv-correction-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.iv-correction-actions .btn { padding: 7px 13px; }
.iv-correction-actions .iv-correction-delete-btn:not(:disabled) { border-color: var(--error); color: var(--error); background: rgba(255,255,255,.55); }
.iv-correction-actions .iv-correction-delete-btn:hover:not(:disabled) { background: rgba(255,241,240,.8); }
.iv-correction-ai-panel { margin-top: 12px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
@media (max-width: 900px) {
  .iv-draft-layout { grid-template-columns: minmax(0, 1fr); }
  .iv-draft-side { position: static; max-height: none; overflow-y: visible; }
  .iv-correction-panel { position: static; }
  .iv-compare-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .iv-writing-page { padding: 18px 14px 28px; }
  .iv-writing-footer { padding: 10px 14px; }
  .iv-correction-article { padding: 16px 14px 24px; }
  .iv-correction-paragraph-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .iv-correction-side-notes { position: static; display: grid; gap: 12px; min-height: 0 !important; padding-top: 0; }
  .iv-correction-side-note { position: static; }
  .iv-correction-note-connector { display: none; }
  .iv-correction-target { width: calc(100% - 16px); }
}
.workspace-section { padding: 24px 30px; max-width: 1080px; margin: 0 auto; }
.workspace-section.secondary-section { padding-top: 0; }
.workspace-section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.workspace-section h3 { font-size: 19px; margin: 0; }
.workspace-section p { color: var(--ink-soft); font-size: 13px; line-height: 1.7; margin: 6px 0 0; }
.workspace-message { margin-top: 13px; padding: 10px 12px; border-radius: 7px; background: var(--accent-soft); color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.workspace-empty { border: 1px dashed var(--line); border-radius: 9px; padding: 24px 18px; color: var(--ink-faint); text-align: center; font-size: 13px; line-height: 1.7; background: rgba(255,255,255,.45); }
.stage-memory-delivery-toolbar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-top: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.stage-memory-delivery-toolbar .wide-select { min-width: 220px; }
.stage-memory-delivery-version-note { color: var(--ink-soft); font-size: 12px; padding-bottom: 8px; }
.stage-memory-delivery-word-count { color: var(--ink); font-size: 12px; font-weight: 600; padding-bottom: 8px; }
.stage-memory-delivery-article { margin-top: 14px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 10px; background: #fff; line-height: 1.95; font-size: 15px; box-shadow: 0 1px 2px rgba(30,40,50,.03); }
.stage-memory-delivery-article p { margin: 14px 0 0; white-space: pre-wrap; }
.stage-memory-delivery-article p.first { margin-top: 0; }
.stage-memory-delivery-assembly-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.stage-memory-delivery-assembly-row .wide-select { width: auto; min-width: 210px; }
.full-life-mainline-cards { display: grid; gap: 10px; margin-top: 18px; }
.full-life-module-card { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.full-life-module-card.dragging { opacity: .45; }
.full-life-module-card.drag-over { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.module-drag-handle { color: var(--ink-faint); font-size: 20px; cursor: grab; user-select: none; }
.module-index { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px; flex: 0 0 auto; }
.module-card-main { min-width: 0; flex: 1; }
.module-card-title { font-size: 14px; font-weight: 700; }
.module-card-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--ink-soft); font-size: 11px; margin-top: 6px; }
.module-card-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.module-card-actions .btn { font-size: 11px; padding: 5px 8px; }
.module-edit-details { margin-top: 8px; color: var(--ink-soft); font-size: 11px; }
.module-edit-details summary { cursor: pointer; color: var(--accent); }
.module-edit-fields { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.module-edit-fields input { min-width: 90px; max-width: 150px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 5px; font: 12px inherit; }
.module-edit-fields .module-edit-title { flex: 1; min-width: 180px; max-width: none; }
.module-edit-fields .btn { font-size: 11px; padding: 5px 8px; }
.secondary-section details { border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 12px 14px; }
.secondary-section summary { cursor: pointer; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.candidate-list { display: grid; gap: 7px; margin-top: 12px; }
.candidate-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 7px; }
.candidate-row strong { display: block; font-size: 13px; }
.candidate-row span { display: block; color: var(--ink-faint); font-size: 11px; margin-top: 3px; }
.generation-confirm-box { margin: 16px 0; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.generation-confirm-box strong { display: block; color: var(--ink); font-size: 13px; margin-bottom: 3px; }
.field-label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.wide-select { width: min(420px, 100%); padding: 8px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; }
.generation-items { display: grid; gap: 8px; margin-top: 14px; }
.generation-item { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.generation-item-title { min-width: 180px; flex: 1; font-size: 13px; font-weight: 600; }
.generation-item select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font: 12px inherit; min-width: 180px; }
.generation-item-note { color: var(--ink-faint); font-size: 11px; }
.workspace-actions { display: flex; gap: 8px; margin-top: 16px; }
.full-life-work-body { display: grid; gap: 14px; margin-top: 16px; }
.full-life-work-card { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.work-version-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 13px 15px; border-bottom: 1px solid var(--line-soft); background: var(--paper); }
.work-version-header h4 { display: inline; margin: 0 8px 0 0; font-size: 15px; }
.work-version-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.work-version-actions .btn { font-size: 11px; padding: 5px 8px; }
.full-life-article { padding: 15px 17px; line-height: 1.9; font-size: 15px; }
.full-life-article .iv-full-life-paragraph-block { padding: 8px 9px 10px; margin-bottom: 8px; border-radius: 6px; }
.full-life-article .iv-full-life-paragraph-block:hover { background: var(--paper); }
.article-paragraph-label { color: var(--ink-faint); font-size: 10px; margin-bottom: 3px; user-select: none; }
.full-life-article .iv-full-life-select-paragraph { margin-top: 7px; font-size: 11px; padding: 4px 7px; }
.full-life-task-content { height: calc(100% - 126px); overflow-y: auto; }
.full-life-outline-planning { min-height: 100%; background: var(--paper); }
.full-life-outline-heading { padding: 24px 30px 18px; border-bottom: 1px solid var(--line-soft); background: #fff; }
.full-life-outline-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-top: 8px; }
.full-life-outline-heading h3 { margin: 0; font-size: 21px; }
.full-life-outline-heading p { max-width: 760px; margin: 7px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.8; }
.full-life-outline-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.full-life-outline-hint { color: var(--ink-soft); font-size: 12px; }
.full-life-outline-conversation { max-width: 920px; margin: 0 auto; padding: 8px 30px 32px; }
.full-life-outline-conversation .iv-token-summary { margin-top: 20px; }
.full-life-outline-return-note { margin: 0 30px 14px; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
@media (max-width: 760px) {
  .full-life-outline-heading { padding: 20px 16px 15px; }
  .full-life-outline-heading-row { flex-direction: column; }
  .full-life-outline-heading-row .btn { align-self: flex-start; }
  .full-life-outline-conversation { padding: 6px 16px 24px; }
  .full-life-outline-return-note { margin-left: 16px; margin-right: 16px; }
}

@media (max-width: 900px) {
  .creative-sidebar { width: 230px; min-width: 230px; }
  .module-card-actions { width: 100%; justify-content: flex-start; margin-left: 62px; }
  .creative-title-row { align-items: flex-start; flex-direction: column; }
}
/* COM-004：沿用账户卡片与按钮；原生 dialog 负责焦点、Esc 和遮罩。 */
.creative-points-dialog { width: min(620px, calc(100vw - 40px)); max-height: 80vh; overflow: auto; padding: 24px; border: 1px solid #d7d1c5; border-radius: 12px; background: #fffdf8; color: #2f302c; }
.creative-points-dialog::backdrop { background: rgb(0 0 0 / 35%); }
.creative-points-dialog p { overflow-wrap: anywhere; }
.creative-points-dialog summary { cursor: pointer; padding: 8px 0; }

/* CR-070：当前回答和问题处理各占一个明确的视觉区域。 */
.iv-question-options[hidden] { display: none; }
.iv-free-workspace { margin-top: 12px; padding: 20px; border: 1px solid var(--accent); border-radius: 10px; background: var(--panel); }
.iv-workspace-kicker { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.iv-free-workspace h3 { margin-top: 4px; font-size: 19px; }
.iv-free-workspace p { margin: 7px 0 14px; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.iv-free-workspace #iv-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.iv-free-text { width: 100%; min-height: 150px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 14px/1.7 inherit; resize: vertical; }
.iv-shelved-question { margin-bottom: 14px; color: var(--ink-soft); font-size: 13px; }
.iv-shelved-question summary { cursor: pointer; }
.iv-shelved-question > div { margin-top: 7px; padding: 9px 11px; background: var(--paper); border-radius: 6px; }
.iv-free-history-label { align-self: flex-start; margin: 5px 0 0; padding: 4px 9px; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 700; }
.iv-question-options button:focus-visible, .iv-free-workspace button:focus-visible, .iv-free-workspace textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.iv-wait-heading { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.iv-wait-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--accent); animation: iv-wait-pulse 1.3s ease-in-out infinite; }
@keyframes iv-wait-pulse { 50% { opacity: .25; transform: scale(.7); } }
/* 等待下一题：居中三点跳动 + 文字，整段等待期间界面不变。 */
.iv-next-wait { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; text-align: center; font-size: 13px; }
.iv-next-wait strong { color: var(--ink); font-size: 16px; }
.iv-next-wait #iv-next-elapsed { font-size: 12px; color: var(--ink-faint); }
.iv-wait-dots { display: inline-flex; gap: 7px; height: 22px; align-items: center; margin-bottom: 6px; }
.iv-wait-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: iv-wait-bounce 1.2s ease-in-out infinite; }
.iv-wait-dots i:nth-child(2) { animation-delay: .15s; }
.iv-wait-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes iv-wait-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-8px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .iv-wait-dot, .iv-wait-dots i { animation: none; } }
@media (max-width: 760px) {
  .iv-free-workspace { padding: 16px; }
}

/* ---------- 统一交互基线（CR-076 / WEB-004） ---------- */
/* hidden 属性必须始终生效；.btn 等组件自带 display，会覆盖浏览器默认的隐藏样式。 */
[hidden] { display: none !important; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--control-h); border-radius: var(--radius-sm); line-height: 1.3;
}
.btn:focus-visible, .nav-tab:focus-visible, .creative-task-tab:focus-visible, .ui-choice:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
/* 界面按钮与布局规范（CR-088）：卡片内按钮（只作用于这一张卡片）用小号；同一行的区域按钮保持标准高度。 */
.btn.small { min-height: 30px; padding: 4px 12px; font-size: 12px; }
.btn.danger:hover:not(:disabled) { background: #8f1f18; }
.btn:disabled { cursor: not-allowed; }

.ui-dialog { border: none; padding: 0; background: transparent; width: 460px; max-width: calc(100vw - 32px); overflow: visible; }
.ui-dialog::backdrop { background: rgba(0, 0, 0, .4); }
.ui-dialog-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
  padding: var(--space-5) 28px; max-height: 85vh; overflow-y: auto; color: var(--ink);
}
.ui-dialog h3 { font-size: 18px; margin-bottom: var(--space-3); }
.ui-dialog .modal-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: flex-end; margin-top: 20px; }
.ui-dialog-message { font-size: var(--font-body); line-height: 1.7; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.ui-dialog-field { margin-top: var(--space-3); }
.ui-dialog-field textarea, .ui-dialog-field input {
  width: 100%; font: inherit; font-size: var(--font-body); line-height: 1.6;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; resize: vertical;
}
.ui-dialog-field textarea:focus, .ui-dialog-field input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.ui-choice-list { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); max-height: 50vh; overflow-y: auto; }
.ui-choice {
  font: inherit; text-align: left; cursor: pointer; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  display: flex; flex-direction: column; gap: 2px;
}
.ui-choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.ui-choice strong { font-size: var(--font-body); }
.ui-choice span { font-size: var(--font-sm); color: var(--ink-soft); }
.ui-choice span:empty { display: none; }

.ui-toast-host {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: var(--space-2); align-items: center;
  width: min(520px, calc(100vw - 32px)); pointer-events: none;
}
.ui-toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: var(--space-3); width: 100%;
  padding: 10px 12px 10px 16px; border-radius: var(--radius); box-shadow: var(--shadow-pop);
  background: var(--ink); color: var(--panel); font-size: 14px; line-height: 1.6;
  animation: ui-toast-in .18s ease-out;
}
.ui-toast.success { background: var(--done); }
.ui-toast.error { background: var(--danger); }
.ui-toast-text { flex: 1; white-space: pre-wrap; word-break: break-word; }
.ui-toast-close { font: inherit; font-size: 18px; line-height: 1; background: none; border: none; color: inherit; cursor: pointer; opacity: .8; padding: 2px 4px; }
.ui-toast-close:hover { opacity: 1; }
@keyframes ui-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ui-toast { animation: none; } }

/* ---------- 右侧抽屉（CR-076 / WEB-005） ---------- */
.ui-drawer {
  margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(520px, 100vw); max-width: 100vw;
  padding: 0; border: none; background: transparent; overflow: visible;
}
.ui-drawer::backdrop { background: rgba(0, 0, 0, .32); }
.ui-drawer-panel {
  height: 100%; display: flex; flex-direction: column; background: var(--panel); color: var(--ink);
  border-left: 1px solid var(--line); box-shadow: var(--shadow-pop); animation: ui-drawer-in .2s ease-out;
}
@keyframes ui-drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ui-drawer-panel { animation: none; } }
.ui-drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); padding: 18px var(--space-5) 14px; border-bottom: 1px solid var(--line-soft); }
.ui-drawer-header h3 { font-size: 18px; }
.ui-drawer-description { margin-top: 4px; color: var(--ink-soft); font-size: var(--font-sm); line-height: 1.6; }
.ui-drawer-close { font: inherit; font-size: 22px; line-height: 1; border: none; background: none; color: var(--ink-soft); cursor: pointer; padding: 2px 6px; border-radius: var(--radius-sm); }
.ui-drawer-close:hover { background: var(--line-soft); color: var(--ink); }
.ui-drawer-body { flex: 1; overflow-y: auto; padding: var(--space-4) var(--space-5); }
.ui-drawer-actions { display: flex; justify-content: flex-end; gap: var(--space-3); padding: 14px var(--space-5) calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line-soft); }

/* 阶段资料表单 */
.sm-meta-form fieldset { border: none; padding: 0; margin: 0 0 var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.sm-meta-form legend { font-size: 15px; font-weight: 700; margin-bottom: var(--space-2); padding: 0; }
.sm-meta-form label { display: flex; flex-direction: column; gap: 6px; font-size: var(--font-sm); color: var(--ink-soft); }
.sm-meta-form input, .sm-meta-form textarea, .sm-meta-form select {
  font: inherit; font-size: var(--font-body); color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; min-height: var(--control-h);
}
.sm-meta-form textarea { resize: vertical; line-height: 1.6; }
.sm-meta-form input:focus, .sm-meta-form textarea:focus, .sm-meta-form select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.sm-meta-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.sm-meta-category { display: flex; flex-direction: column; gap: var(--space-3); }
.sm-meta-category:empty { display: none; }
.sm-meta-hint { margin: -4px 0 0; color: var(--ink-faint); font-size: var(--font-sm); }
@media (max-width: 560px) { .sm-meta-row { grid-template-columns: 1fr; } }

/* ---------- 顶栏与账号菜单 ---------- */
header.topbar { gap: var(--space-4); padding: 10px 24px; border-bottom: 1px solid var(--line); }
.topbar-left { display: flex; align-items: center; gap: var(--space-5); min-width: 0; }
.topbar-brand { font-size: 18px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.topbar-left .nav-tabs { margin-left: 0; }
.topbar-right { display: flex; align-items: center; gap: var(--space-2); text-align: left; }
.topbar-compact { font-size: var(--font-sm); padding: 5px 12px; min-height: 34px; }
.account-menu { position: relative; }
.account-menu-trigger {
  font: inherit; font-size: var(--font-sm); display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 34px; padding: 3px 10px 3px 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); cursor: pointer;
}
.account-menu-trigger:hover { border-color: var(--ink-faint); }
.account-menu-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.account-avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px; }
.account-menu-caret { color: var(--ink-faint); font-size: 11px; }
.account-menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 160px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
}
.account-menu-list[hidden] { display: none; }
.account-menu-list button { font: inherit; font-size: 14px; text-align: left; padding: 9px 12px; border: none; background: none; border-radius: var(--radius-sm); cursor: pointer; color: var(--ink); }
.account-menu-list button:hover, .account-menu-list button:focus-visible { background: var(--line-soft); outline: none; }
@media (max-width: 640px) {
  header.topbar { padding: 8px 16px; flex-wrap: wrap; }
  .topbar-left { gap: var(--space-3); }
  #workbench-auth-status { display: none; }
}

/* ---------- 阶段性回忆主页 ---------- */
.sm-home { height: 100%; overflow-y: auto; }
.sm-home-inner { max-width: 1080px; margin: 0 auto; padding: var(--space-2) 0 40px; }
.sm-home-empty { min-height: 60vh; }
.sm-continue {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap;
  padding: var(--space-4) 20px; margin-bottom: var(--space-5);
  background: var(--accent-soft); border: 1px solid rgba(47, 111, 189, .25); border-radius: var(--radius-lg);
}
.sm-continue-text { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; min-width: 0; }
.sm-continue-label { color: var(--accent); font-size: var(--font-sm); font-weight: 700; }
.sm-continue-text strong { font-size: 17px; }
.sm-home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.sm-home-head h2 { font-size: 22px; }
.sm-home-head p { margin-top: 4px; color: var(--ink-soft); font-size: var(--font-sm); }
.sm-home-tools { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.sm-filter { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--ink-soft); font-size: var(--font-sm); }
.sm-filter select { font: inherit; font-size: var(--font-sm); min-height: var(--control-h); padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
.sm-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--space-4); }
.sm-grid-empty { grid-column: 1 / -1; padding: 32px; text-align: center; color: var(--ink-faint); border: 1px dashed var(--line); border-radius: var(--radius-lg); }
.sm-card {
  display: flex; flex-direction: column; gap: var(--space-2); min-height: 180px; padding: var(--space-4);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); cursor: pointer;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.sm-card:hover { border-color: var(--ink-faint); box-shadow: 0 4px 14px rgba(43, 42, 38, .08); transform: translateY(-1px); }
.sm-card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.sm-card h3 { font-size: 17px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.sm-card-topic { color: var(--ink-soft); font-size: var(--font-sm); line-height: 1.6; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.sm-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.sm-card-time { color: var(--ink-faint); font-size: 12px; }
.sm-card-membership { font-size: 12px; color: var(--done); background: var(--done-soft); padding: 2px 8px; border-radius: 999px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-status { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.sm-status.interview { background: var(--warn-soft); color: #8a5d00; }
.sm-status.writing { background: var(--accent-soft); color: var(--accent); }
.sm-status.done { background: var(--done-soft); color: var(--done); }
.sm-archived { margin: var(--space-5) 0 0; }

/* ---------- 阶段性回忆工作区页头与步骤条 ---------- */
.sm-header-nav { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-2); }
.sm-back { font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.sm-back:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.sm-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 999px; }
.sm-header-main { min-width: 0; }
.sm-header-meta { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; margin-top: 6px; color: var(--ink-soft); font-size: var(--font-sm); }
.stage-memory-more-menu[hidden] { display: none; }
.stage-stepper {
  flex-shrink: 0; display: flex; align-items: center; gap: var(--space-2); padding: 10px 28px;
  background: var(--panel); border-bottom: 1px solid var(--line-soft); overflow-x: auto;
}
.stage-step {
  font: inherit; display: inline-flex; align-items: center; gap: var(--space-2); padding: 6px 12px 6px 6px;
  border: 1px solid transparent; border-radius: 999px; background: none; color: var(--ink-soft); cursor: pointer; white-space: nowrap;
}
.stage-step:hover { background: var(--line-soft); }
.stage-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stage-step-index {
  width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; border: 1.5px solid var(--line); background: #fff; color: var(--ink-soft);
}
.stage-step-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.stage-step-text strong { font-size: 14px; }
.stage-step-text small { font-size: 11px; color: var(--ink-faint); }
.stage-step-text small:empty { display: none; }
.stage-step.active { color: var(--ink); background: var(--accent-soft); border-color: rgba(47, 111, 189, .3); }
.stage-step.active .stage-step-index { background: var(--accent); border-color: var(--accent); color: #fff; }
.stage-step.done .stage-step-index { background: var(--done-soft); border-color: var(--done); color: var(--done); font-size: 0; }
.stage-step.done .stage-step-index::after { content: "✓"; font-size: 14px; }
.stage-step.locked { opacity: .5; cursor: not-allowed; }
.stage-step.locked:hover { background: none; }
.stage-step-line { flex: 0 0 28px; height: 1.5px; background: var(--line); }
@media (max-width: 640px) {
  .stage-stepper { padding: 8px 16px; }
  .stage-step-line { flex-basis: 12px; }
  .stage-step-text small { display: none; }
}
.sm-meta-group { display: flex; flex-direction: column; gap: 6px; }
.sm-meta-group-label { font-size: var(--font-sm); color: var(--ink-soft); }
.sm-meta-time-hint { margin: 0; }
/* 讲述状态行：左侧状态信息，右侧常驻暂停/结束（DEF-117） */
.iv-status-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.iv-status-controls { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.iv-status-controls .btn { font-size: var(--font-sm); padding: 5px 12px; min-height: 34px; }

/* ---------- 讲述经历任务页：按一次对话排布（CR-077 / WEB-006） ---------- */
.iv-status-row > :first-child { flex: 1 1 320px; min-width: 0; }

/* 已讲内容栏 */
.iv-previous-story { margin: 14px 0; }
.iv-previous-story > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--space-3);
  padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff;
}
.iv-previous-story > summary::-webkit-details-marker { display: none; }
.iv-previous-story > summary:hover { border-color: var(--ink-faint); }
.iv-previous-story > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.iv-story-title { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.iv-story-preview { flex: 1; min-width: 0; color: var(--ink-soft); font-size: var(--font-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-story-toggle { margin-left: auto; color: var(--accent); font-size: var(--font-sm); font-weight: 600; white-space: nowrap; }
.iv-story-toggle::after { content: "展开全部 ▾"; }
.iv-previous-story[open] .iv-story-toggle::after { content: "收起 ▴"; }
.iv-previous-story[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.iv-previous-story > summary + * { border: 1px solid var(--line); border-top: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); padding: 4px 16px 12px; background: #fff; }

/* CR-091：AI 目前对这篇的理解、内容超出本篇的提醒 */
.iv-concept { margin: 14px 0; }
.iv-concept > summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: var(--space-3);
  padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--accent-soft);
}
.iv-concept > summary::-webkit-details-marker { display: none; }
.iv-concept[open] .iv-story-toggle::after { content: "收起 ▴"; }
.iv-concept[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.iv-concept-kicker { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.iv-concept-main { flex: 1; min-width: 0; color: var(--ink); font-size: 14px; line-height: 1.7; }
.iv-concept-body { border: 1px solid var(--line); border-top: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); padding: 10px 16px 12px; background: #fff; font-size: var(--font-sm); line-height: 1.7; color: var(--ink-soft); }
.iv-concept-group + .iv-concept-group { margin-top: 8px; }
.iv-concept-label { font-weight: 700; color: var(--ink); }
.iv-concept-body ul { margin: 2px 0 0; padding-left: 18px; }
.iv-concept-body p { margin: 2px 0 0; }
.iv-concept-body .iv-concept-note { margin-top: 10px; color: var(--ink-faint); font-size: 12px; }
.iv-topic-check { margin-top: var(--space-3); padding: 12px 16px; border: 1px solid #ecd9b4; border-radius: var(--radius-lg); background: #fdf7ec; font-size: 14px; line-height: 1.7; color: var(--ink); }
.iv-topic-check p { margin: 0; }
.iv-topic-check-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.iv-topic-check .iv-topic-check-error { margin-top: 6px; color: var(--error); font-size: 12px; }

/* 问答合一卡片 */
.iv-qa-card { margin-top: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; overflow: hidden; box-shadow: 0 1px 3px rgba(43, 42, 38, .04); }
.iv-qa-ask { padding: 20px 24px 16px; }
.iv-qa-kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--accent); margin-bottom: 10px; }
.iv-qa-lead { margin: 0 0 12px; color: var(--ink-soft); font-size: 14px; line-height: 1.8; }
.iv-qa-question { font-size: 18px; font-weight: 700; line-height: 1.7; color: var(--ink); }
.iv-qa-note { margin-top: 8px; font-size: var(--font-sm); color: var(--accent); }
.iv-qa-note.muted { color: var(--ink-soft); }
.iv-qa-basis { margin-top: 10px; }
.iv-qa-basis > summary { cursor: pointer; font-size: 12px; color: var(--ink-faint); width: fit-content; }
.iv-qa-basis-body { margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--paper); color: var(--ink-soft); font-size: var(--font-sm); line-height: 1.7; }
.iv-qa-answer { padding: 16px 24px 20px; border-top: 1px solid var(--line-soft); background: #fcfbf8; }
.iv-answer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: 10px; }
.iv-answer-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.iv-qa-answer #iv-input-area textarea { background: #fff; font-size: 15px; }
.iv-qa-actions { margin-top: 14px; display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.iv-qa-actions:empty { display: none; }
.iv-qa-actions.outline { justify-content: flex-start; }
.iv-qa-msg { margin-top: 8px; font-size: var(--font-sm); }
.iv-qa-msg:empty { display: none; }

/* 打字 / 录音 分段切换 */
.iv-mode-bar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: 10px; }
.iv-mode-bar.in-slot { margin-bottom: 0; }
.iv-mode-label, .iv-mode-note { font-size: 12px; color: var(--ink-soft); }
.iv-mode-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.iv-mode-option { font: inherit; font-size: var(--font-sm); padding: 4px 14px; border: none; border-radius: 999px; background: none; color: var(--ink-soft); cursor: pointer; }
.iv-mode-option.active { background: var(--accent); color: #fff; font-weight: 600; }
.iv-mode-option:disabled { cursor: not-allowed; opacity: .5; }
.iv-mode-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 题外操作：两行文字操作 */
.iv-question-options { margin: 14px 4px 28px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-soft); font-size: 14px; }
.iv-question-options:empty { display: none; }
.iv-alt-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; line-height: 1.7; }
.iv-alt-label { color: var(--ink-faint); white-space: nowrap; }
.iv-link { font: inherit; font-size: 14px; color: var(--accent); background: none; border: none; padding: 2px 2px; cursor: pointer; border-radius: 3px; }
.iv-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.iv-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.iv-link-sep { color: var(--line); }
@media (max-width: 640px) {
  .iv-qa-ask, .iv-qa-answer { padding-left: 16px; padding-right: 16px; }
  .iv-answer-head { flex-wrap: wrap; }
  .iv-story-preview { display: none; }
}

/* 免费段落标记（含邀请获赠）与收费段落区分 */
.sm-free-badge { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: #f6e7c4; color: #6b4e16; font-size: 12px; font-weight: 600; }
.sm-card-billing { margin: 4px 0 0; font-size: 12px; }
.sm-free-note { color: #7a5a1f; }
.sm-paid-note { color: var(--ink-soft, #7a847d); }

/* CR-100：AI 给出一组问题，勾选后依次回答 */
.iv-offer { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 18px 20px; margin-top: 12px; }
.iv-offer-understanding { margin: 6px 0 10px; color: var(--ink); line-height: 1.8; }
.iv-offer-hint { margin: 0 0 10px; color: var(--ink-soft); font-size: 13px; }
.iv-offer-list { display: grid; gap: 8px; }
.iv-offer-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; line-height: 1.7; }
.iv-offer-item:hover { border-color: var(--accent); }
.iv-offer-item input { margin-top: 6px; flex: none; width: 16px; height: 16px; }
.iv-offer-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.iv-offer-text .badge { margin-left: 6px; font-size: 11px; }
/* CR-113：一段关系的对象种类（与“你想完成哪一种作品”的选项同一种样子：对等选项，选中描深色边） */
.iv-rel-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 6px; }
.iv-rel-opt { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.iv-rel-opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.iv-rel-opt.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.iv-rel-opt strong { font-size: 14px; color: var(--ink); }
.iv-rel-opt span { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.iv-rel-note { margin-top: 6px; font-size: 12px; color: var(--ink-soft); }
.iv-rel-status { margin-top: 8px; font-size: 12px; color: var(--ink-soft); }
.sm-meta-relation { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
/* CR-112：分类板块访谈里，每个问题前标出它问的是哪一块 */
.iv-offer-slot { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; font-size: 11px; line-height: 18px; color: var(--muted, #666); background: rgba(0, 0, 0, 0.05); vertical-align: 1px; }
.iv-offer-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.iv-offer-count { color: var(--ink-soft); font-size: 13px; }
/* AI 判断这段讲完整了：收尾放在最前面，问题折起来 */
.iv-offer-closing { border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); padding: 20px 22px; margin-top: 12px; }
.iv-offer-closing h3 { margin: 6px 0 8px; font-size: 20px; color: var(--ink); }
.iv-offer-closing-note { margin: 0 0 14px; color: var(--ink-soft); font-size: 13px; }
.iv-offer-closing-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.iv-offer-more { margin-top: 14px; }
.iv-offer-more > summary { cursor: pointer; color: var(--accent); font-size: 14px; padding: 6px 0; }

/* DEF-159：改了最新一段讲述后，提示按改后的内容重新出题 */
.iv-reask { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 14px; line-height: 1.7; }
.iv-reask p { margin: 0 0 10px; }
.iv-reask-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* CR-101：写作前核对 */
.iv-check { border: 1px solid var(--accent); border-radius: 12px; background: #fff; padding: 20px 22px; margin-top: 12px; }
.iv-check h3 { margin: 6px 0 8px; font-size: 20px; color: var(--ink); }
.iv-check-hint { margin: 0 0 14px; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.iv-check-list { display: grid; gap: 12px; }
.iv-check-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.iv-check-item.is-done { border-color: var(--accent); background: var(--accent-soft); }
.iv-check-q { font-size: 15px; line-height: 1.7; color: var(--ink); }
.iv-check-no { margin-right: 6px; color: var(--accent); font-weight: 600; }
.iv-check-why { margin-top: 2px; font-size: 12px; color: var(--ink-soft); }
.iv-check-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.iv-check-opt { border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--ink); }
.iv-check-opt:hover { border-color: var(--accent); }
.iv-check-opt.is-on { border-color: var(--accent); background: var(--accent); color: #fff; }
.iv-check-write { margin-top: 8px; }
.iv-check-input { width: 100%; box-sizing: border-box; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.iv-check-edited { margin-top: 8px; font-size: 13px; color: var(--accent); }
.iv-check-sources { margin-top: 10px; }
.iv-check-sources > summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.iv-check-source { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--line); background: var(--paper, #faf8f4); font-size: 13px; line-height: 1.7; }
.iv-check-source-q { color: var(--ink-soft); }
.iv-check-source-a { color: var(--ink); white-space: pre-wrap; }
.iv-check-source mark { background: #ffe58f; padding: 0 1px; }
.iv-check-source-edit textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: 14px/1.7 inherit; resize: none; overflow: hidden; }
.iv-check-edit-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.iv-check-edit-btn { margin-top: 4px; font-size: 12px; }
.iv-check-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.iv-check-count { color: var(--ink-soft); font-size: 13px; }
.iv-check-edit-hint { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: #fffdf5; border: 1px dashed var(--accent); font-size: 12px; color: var(--ink-soft); line-height: 1.7; }
.iv-check-fix { border-style: dashed; }
.iv-check-source-links { display: flex; gap: 14px; margin-top: 4px; }
.iv-check-fixer { margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--accent); border-radius: 8px; background: #fffdf5; }
.iv-check-fixer-title { font-weight: 600; color: var(--accent); font-size: 13px; }
.iv-check-fixer-sel { margin-top: 6px; font-size: 13px; }
.iv-check-fixer-sel mark { background: #ffe58f; }
.iv-check-fixer-tip { color: var(--ink-soft); font-size: 12px; }
.iv-check-fixer-fact { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 14px; resize: vertical; }
.iv-check-fixer-suggest { margin-top: 8px; font-size: 13px; line-height: 1.7; }
.iv-check-fixer-preview { margin-top: 4px; color: var(--ink-soft); }
.iv-check-fixer-preview mark { background: #d9ecd6; }
.iv-check-fixer-note { margin-top: 6px; font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.iv-check-fixer-msg { margin-top: 4px; font-size: 12px; color: var(--warn); }
/* CR-105：一组问题下方的“换一批 / 这事说完了 / 不想聊这个” */
.iv-offer-alt { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; margin-top: 10px; font-size: 13px; }
/* CR-105：文章页上方“讲述里可能说岔的地方”（写文章时顺带核对，不挡路） */
/* DEF-167：平时只是一行小入口，点开才列出来 */
.iv-record-check { margin: 0 0 10px; padding: 0; border: none; background: none; }
.iv-record-check .iv-check-item { background: #fff; }
/* CR-110：文章页第一屏“这篇文章”——深绿色主入口 + “其他”一列对等入口；第二屏“阅读和修改” */
.iv-read-entry { display: block; width: 100%; margin: 14px 0 18px; padding: 16px 20px; border: none; border-radius: 12px; background: #34453b; color: #fffdf8; text-align: left; cursor: pointer; }
.iv-read-entry:hover { background: #2a3a31; }
.iv-read-entry-title { display: flex; justify-content: space-between; align-items: center; font-size: 17px; font-weight: 600; }
.iv-read-entry-preview { display: block; margin-top: 6px; font-family: Georgia, "Songti SC", serif; font-size: 13px; line-height: 1.6; opacity: .85; }
.iv-entry-group { margin: 0 0 6px 2px; color: var(--ink-soft); font-size: 12px; }
.iv-entry-list { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.iv-entry-row, .iv-entry-check > summary { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 8px 16px; border: none; border-top: 1px solid var(--line-soft); background: none; color: var(--ink); font-size: 14px; text-align: left; cursor: pointer; list-style: none; }
.iv-entry-check > summary::-webkit-details-marker { display: none; }
.iv-entry-list > :first-child, .iv-entry-list > .iv-entry-check:first-child > summary { border-top: none; }
.iv-entry-row:hover, .iv-entry-check > summary:hover { background: var(--paper); }
.iv-entry-row.is-warn, .iv-entry-check > summary { background: var(--warn-soft); color: #8a6010; }
.iv-entry-name { flex: 0 0 76px; font-weight: 600; }
.iv-entry-desc { flex: 1; min-width: 0; color: var(--ink-soft); }
.iv-entry-row.is-warn .iv-entry-desc, .iv-entry-check .iv-entry-desc { color: #8a6010; }
.iv-entry-arrow { flex: 0 0 auto; color: var(--ink-faint); }
.iv-entry-check[open] > summary .iv-entry-arrow { transform: rotate(90deg); }
.iv-entry-body { padding: 10px 16px 14px; border-top: 1px dashed var(--line-soft); background: var(--paper); }
.iv-entry-body .iv-narration-update, .iv-entry-body .iv-draft-source-box { margin: 0; }
.iv-record-check.iv-entry-check { margin: 0; padding: 0; border: none; border-radius: 0; background: none; }
.iv-entry-check > .iv-check-hint, .iv-entry-check > .iv-check-list { margin: 0; padding: 10px 16px; background: var(--paper); }
.iv-read-back { margin: 0 0 10px; }
.iv-read-hint { margin: 10px 0; color: var(--ink-soft); font-size: 13px; }
/* CR-105：已删除的问答，可以找回 */
.iv-deleted { margin: 12px 0; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 8px; font-size: 13px; color: var(--ink-soft); }
.iv-deleted > summary { cursor: pointer; }
.iv-deleted-note { margin: 6px 0; font-size: 12px; }
.iv-deleted-list { display: grid; gap: 8px; }
.iv-deleted-item { padding: 6px 10px; border-left: 3px solid var(--line); background: #fff; }
.iv-deleted-q { color: var(--ink-soft); }
.iv-deleted-a { color: var(--ink); white-space: pre-wrap; margin: 2px 0; }
.iv-formal-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 8px 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--ink); font-size: 13px; }

/* COM-007 purchase dialog uses the shared buttons, centered above the current task. */
#points-purchase-dialog { margin: auto; }
#points-purchase-dialog p { margin: 10px 0; }
#points-purchase-dialog > button { margin: 6px 6px 0 0; }
#points-purchase-dialog img { display: block; margin: 16px auto; max-width: 100%; }

.iv-narration-choice { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.iv-narration-choice h4 { font-size: 15px; margin: 0 0 10px; }
.iv-narration-choice .iv-goal-choice strong { display: flex; align-items: center; }
.iv-narration-choice .iv-nc-note { font-size: 12px; color: var(--ink-soft); margin-top: 10px; line-height: 1.6; }
.iv-mode-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
.iv-self-home { border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; background: #fff; margin-top: 12px; }
.iv-self-home h3 { font-size: 16px; margin: 0 0 6px; }
.iv-self-home p { font-size: 13px; color: var(--ink-soft); line-height: 1.7; margin: 0; }
.iv-self-home .iv-self-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* CR-114 / FLOW-007 扣费标识（方案 B）：凡是“请 AI 干活”、会用积分的按钮统一暖黄色，文字后跟一枚小硬币；
   你自己的动作（确认回答、保存讲述、跳过）不标。颜色只是提示，不改计费。 */
.cost-coin, .costs::after { display: inline-block; width: .9em; height: .9em; margin-left: .35em; border-radius: 50%; background: #f2b53b; border: .13em solid #9a6510; box-sizing: border-box; vertical-align: -.1em; flex: none; }
.costs::after { content: ''; }
.btn.primary.costs { background: #e9a93a; border-color: #e9a93a; color: #3f2a06; }
.btn.primary.costs:hover:not(:disabled) { background: #de9c2b; border-color: #de9c2b; }
.btn.secondary.costs, .btn.costs:not(.primary) { background: #fbefd5; border-color: #d9a13f; color: #6e4708; }
.btn.secondary.costs:hover:not(:disabled), .btn.costs:not(.primary):hover:not(:disabled) { background: #f7e3b8; }
.iv-link.costs { color: #8a5a0b; }
.iv-direction-option.costs { position: relative; padding-right: 34px !important; }
.iv-direction-option.costs::after { position: absolute; right: 14px; top: 15px; margin: 0; }
.iv-cost-legend { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--ink-soft); }
.iv-cost-legend .cost-coin { margin: 0 4px 0 0; }
.btn.primary.costs::after { background: #fde7b0; }
