:root {
  --bg: #0b0d11;
  --bg-soft: #101319;
  --panel: #14171e;
  --panel-2: #191d26;
  --panel-3: #1f242f;
  --line: #262b37;
  --line-soft: #1e232d;
  --text: #e9e6df;
  --text-dim: #b9b6ae;
  --muted: #7f8798;
  --accent: #dda55e;
  --accent-2: #c8873f;
  --accent-soft: rgba(221, 165, 94, 0.13);
  --jade: #6bb3a0;
  --danger: #e07378;
  --radius: 14px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 700px at 78% -10%, rgba(221, 165, 94, 0.08), transparent 60%),
    radial-gradient(900px 600px at 0% 100%, rgba(107, 179, 160, 0.05), transparent 65%), var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(221, 165, 94, 0.26); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #2a303b; border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #39414f; background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

.shell { height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 62px; flex: 0 0 auto;
  display: flex; align-items: center; gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 14, 19, 0.86);
  backdrop-filter: blur(18px);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #3a2a17, #1c1710);
  border: 1px solid rgba(221, 165, 94, 0.32);
  color: var(--accent); font-family: var(--serif); font-size: 19px; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 6px 18px rgba(0, 0, 0, 0.35);
}
.brand-meta { display: flex; flex-direction: column; line-height: 1.15; }
.brand-meta b { font-family: var(--serif); font-size: 16px; letter-spacing: 0.08em; font-weight: 600; }
.brand-meta small { color: var(--muted); font-size: 10.5px; letter-spacing: 0.14em; }

.workbar {
  display: flex; align-items: center; gap: 8px;
  padding-left: 18px; margin-left: 2px;
  border-left: 1px solid var(--line);
  min-width: 0; flex: 1 1 auto;
}
.work-title { font-family: var(--serif); font-size: 14px; color: var(--text-dim); white-space: nowrap; }
.work-title em { color: var(--accent); font-style: normal; }
.chip {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text-dim);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; white-space: nowrap;
  transition: 0.18s;
}
.chip:hover { border-color: rgba(221, 165, 94, 0.4); color: var(--text); }

.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.save-state { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.save-state .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--jade); opacity: 0.85; }
.save-state.saving .dot { background: var(--accent); animation: pulse 1.1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  border-radius: 10px; padding: 8px 14px; font-size: 13px; transition: 0.18s;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: #38404f; }
.btn.primary {
  background: linear-gradient(135deg, #e8b471, #cf9448);
  border-color: transparent; color: #20160a; font-weight: 600;
  box-shadow: 0 6px 18px rgba(221, 165, 94, 0.22);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel-2); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.danger { color: var(--danger); border-color: rgba(224, 115, 120, 0.28); }
.btn.danger:hover { background: rgba(224, 115, 120, 0.12); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; display: none; place-items: center;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text-dim);
}

.layout { flex: 1 1 auto; display: grid; grid-template-columns: 268px minmax(0, 1fr) 346px; min-height: 0; }

.sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 23, 30, 0.95), rgba(13, 15, 20, 0.95));
  display: flex; flex-direction: column; min-height: 0;
}
.sidebar-inner { padding: 16px 14px 10px; display: flex; flex-direction: column; gap: 14px; min-height: 0; flex: 1; }

.work-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(221, 165, 94, 0.09), rgba(20, 23, 30, 0.6));
  padding: 12px 13px;
}
.work-card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.work-card .name { font-family: var(--serif); font-size: 15px; font-weight: 600; letter-spacing: 0.03em; }
.work-card .genre { font-size: 11px; color: var(--accent); border: 1px solid rgba(221, 165, 94, 0.28); border-radius: 6px; padding: 2px 6px; }
.work-card .stats { display: flex; gap: 12px; margin-top: 9px; color: var(--muted); font-size: 11.5px; }
.work-card .stats b { color: var(--text-dim); font-weight: 600; }
.work-card .ops { display: flex; gap: 6px; margin-top: 10px; }
.work-card .ops button { flex: 1; }

.tabs { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 4px; padding: 3px; background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 10px; }
.tabs button {
  border: 0; background: transparent; color: var(--muted); font-size: 11.5px;
  padding: 6px 0; border-radius: 7px; transition: 0.16s;
}
.tabs button.on { background: var(--panel-3); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }

.list-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11.5px; letter-spacing: 0.06em; }
.list-head .add { border: 0; background: transparent; color: var(--accent); font-size: 12px; padding: 2px 4px; }

.nav-list { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 2px 6px 8px; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px;
  border: 1px solid transparent; cursor: pointer; transition: 0.15s; position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.035); }
.nav-item.on { background: var(--panel-3); border-color: var(--line); }
.nav-item.on::before { content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--accent); }
.nav-idx { width: 20px; color: var(--muted); font-size: 11.5px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.nav-item.on .nav-idx { color: var(--accent); }
.nav-main { min-width: 0; flex: 1; }
.nav-title { font-size: 13px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item.on .nav-title { color: var(--text); }
.nav-sub { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-tag { font-size: 10px; color: var(--muted); flex: 0 0 auto; }
.pill { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.pill.draft { color: #9aa3b2; background: rgba(154, 163, 178, 0.1); }
.pill.final { color: var(--jade); background: rgba(107, 179, 160, 0.12); }
.pill.open { color: var(--accent); background: var(--accent-soft); }
.pill.closed { color: var(--jade); background: rgba(107, 179, 160, 0.12); }
.pill.ai { color: #9bb7ff; background: rgba(120, 150, 255, 0.12); }

.empty-hint { color: var(--muted); font-size: 12px; line-height: 1.7; padding: 14px 10px; }

.stage { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg); position: relative; }
.stage-inner { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.editor-head {
  padding: 18px 34px 12px; border-bottom: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 10px;
}
.chapter-title {
  border: 0; background: transparent; font-family: var(--serif); font-size: 22px; font-weight: 600;
  letter-spacing: 0.02em; padding: 2px 0; width: 100%; outline: none;
}
.chapter-title::placeholder { color: #4d5563; }
.editor-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.editor-meta .sep { width: 1px; height: 12px; background: var(--line); }
.mini-select {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-dim);
  border-radius: 7px; padding: 4px 8px; font-size: 11.5px; outline: none;
}
.outline-hint {
  margin: 12px 34px 0; padding: 10px 14px; border-radius: 10px;
  background: rgba(221, 165, 94, 0.06); border: 1px solid rgba(221, 165, 94, 0.16);
  color: var(--text-dim); font-size: 12.5px; line-height: 1.7; display: flex; gap: 10px;
}
.outline-hint .k { color: var(--accent); flex: 0 0 auto; font-size: 11px; letter-spacing: 0.1em; padding-top: 2px; }
.outline-hint .v { flex: 1; min-width: 0; }
.outline-hint.empty { color: var(--muted); }

.editor-scroll { flex: 1; overflow-y: auto; padding: 22px 0 120px; }
.editor-pane { width: 100%; max-width: 780px; margin: 0 auto; padding: 0 34px; }
.editor {
  width: 100%; min-height: 62vh; border: 0; outline: none; resize: none;
  background: transparent; color: #ded9d0;
  font-family: var(--serif); font-size: 17px; line-height: 2.05; letter-spacing: 0.02em;
  text-align: justify; overflow: hidden;
}
.editor::placeholder { color: #4a525f; font-size: 14px; line-height: 2; }
.editor-foot {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 10px 34px; display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, transparent, rgba(11, 13, 17, 0.95) 45%);
  color: var(--muted); font-size: 11.5px; pointer-events: none;
}
.editor-foot span { pointer-events: auto; }

/* 大纲 / 设定 / 伏笔视图 */
.page { flex: 1; overflow-y: auto; padding: 22px 30px 80px; }
.page-inner { max-width: 900px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.page-title { font-family: var(--serif); font-size: 20px; letter-spacing: 0.04em; margin: 0 0 4px; }
.page-desc { color: var(--muted); font-size: 12.5px; line-height: 1.8; margin: 0 0 18px; max-width: 620px; }
.section-bar { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.section-bar h3 { margin: 0; font-size: 13px; color: var(--text-dim); font-weight: 600; letter-spacing: 0.06em; }
.section-bar .line { flex: 1; height: 1px; background: var(--line-soft); }

.card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 14px 16px; margin-bottom: 10px; transition: border-color 0.16s;
}
.card:hover { border-color: #323a48; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.card-head .idx { font-size: 11px; color: var(--accent); border: 1px solid rgba(221, 165, 94, 0.25); border-radius: 5px; padding: 1px 6px; flex: 0 0 auto; }
.card-head .spacer { flex: 1; }
.field { border: 0; background: transparent; outline: none; width: 100%; }
.field.title { font-size: 14.5px; font-weight: 600; color: var(--text); padding: 2px 0; }
.field.hint { font-size: 12px; color: var(--text-dim); line-height: 1.75; padding: 3px 0; resize: vertical; min-height: 44px; }
.field.text {
  font-family: var(--serif); font-size: 14px; line-height: 1.9; color: #d6d2ca;
  background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line-soft); border-radius: 9px;
  padding: 10px 12px; margin-top: 8px; resize: vertical; min-height: 70px;
}
.field.text:focus { border-color: rgba(221, 165, 94, 0.32); background: rgba(255, 255, 255, 0.03); }
.card-ops { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-row select, .tag-row input { height: 27px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* AI 副驾 */
.copilot {
  border-left: 1px solid var(--line); background: linear-gradient(180deg, rgba(22, 26, 34, 0.96), rgba(13, 15, 20, 0.96));
  display: flex; flex-direction: column; min-height: 0;
}
.copilot-head {
  padding: 14px 16px 12px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 8px;
}
.copilot-head .title { font-family: var(--serif); font-size: 14px; letter-spacing: 0.06em; }
.copilot-head .badge { font-size: 10px; color: var(--accent); border: 1px solid rgba(221, 165, 94, 0.3); border-radius: 5px; padding: 1px 5px; letter-spacing: 0.08em; }
.copilot-head .spacer { flex: 1; }
.copilot-body { flex: 1; overflow-y: auto; padding: 14px 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.ctx-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ctx-chip {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
  font-size: 11.5px; padding: 5px 9px; border-radius: 999px; transition: 0.16s;
}
.ctx-chip.on { color: var(--accent); border-color: rgba(221, 165, 94, 0.34); background: var(--accent-soft); }
.ctx-note { font-size: 11px; color: #5f6776; line-height: 1.6; }

.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.action {
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 9px;
  padding: 9px 4px 7px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--text-dim); font-size: 11.5px; transition: 0.16s;
}
.action:hover { border-color: rgba(221, 165, 94, 0.36); background: var(--panel-3); color: var(--text); }
.action.on { border-color: rgba(221, 165, 94, 0.5); background: var(--accent-soft); color: var(--accent); }
.action svg { width: 15px; height: 15px; opacity: 0.8; }

.ai-prompt {
  width: 100%; min-height: 54px; max-height: 140px; resize: vertical;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft);
  padding: 9px 11px; font-size: 12.5px; line-height: 1.7; outline: none; color: var(--text);
}
.ai-prompt:focus { border-color: rgba(221, 165, 94, 0.3); }
.ai-prompt::placeholder { color: #565f6d; }

.ai-run-row { display: flex; align-items: center; gap: 8px; }
.ai-run-row .btn.primary { flex: 1; justify-content: center; }
.ai-hint { font-size: 11px; color: #5f6776; line-height: 1.6; }

.result {
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); overflow: hidden;
}
.result-head { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-bottom: 1px solid var(--line-soft); font-size: 11px; color: var(--muted); }
.result-head .spacer { flex: 1; }
.result-head .ai-gen-tag { font-size: 10px; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent); border-radius: 999px; padding: 1px 7px; letter-spacing: .06em; }
.result-body { padding: 12px; font-family: var(--serif); font-size: 13.5px; line-height: 1.95; color: #d9d4cb; white-space: pre-wrap; max-height: 340px; overflow-y: auto; }
.result-body.empty { color: var(--muted); font-family: var(--sans); font-size: 12px; }
.result-ops { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.loading-line { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 12px; }
.spinner {
  width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid rgba(221, 165, 94, 0.25);
  border-top-color: var(--accent); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.err { color: var(--danger); font-size: 12px; line-height: 1.7; }

/* 设置 */
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row label { font-size: 12px; color: var(--text-dim); }
.form-row .tip { font-size: 11px; color: var(--muted); line-height: 1.7; }
.input {
  width: 100%; border: 1px solid var(--line); background: var(--panel-2); border-radius: 9px;
  padding: 9px 11px; font-size: 13px; outline: none;
}
.input:focus { border-color: rgba(221, 165, 94, 0.35); }
.input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.notice { border: 1px solid rgba(107, 179, 160, 0.24); background: rgba(107, 179, 160, 0.08); color: #a7cfc4; border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.7; }
.notice.warn { border-color: rgba(221, 165, 94, 0.25); background: rgba(221, 165, 94, 0.08); color: #ddc39c; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(5, 7, 10, 0.7); backdrop-filter: blur(6px);
  display: grid; place-items: center; z-index: 150; padding: 20px;
}
.modal { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.modal h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 17px; }
.modal p { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin: 0 0 14px; }
.modal .modal-ops { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.account-warn { color: var(--muted); font-size: 11.5px; line-height: 1.7; margin: 10px 0 0; }
.modal .form-row { margin-bottom: 10px; }

/* 量产流水线 */
.outline-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; color: var(--muted); font-size: 11.5px; }
.outline-meta b { color: var(--text); font-weight: 600; }
.outline-meta .warn b { color: var(--gold); }
.outline-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.batch-mask { z-index: 155; overflow-y: auto; align-items: start; padding-top: max(20px, 7vh); }
.batch-modal { width: min(660px, 100%); padding: 0; overflow: hidden; }
.batch-head { display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.batch-head > div { flex: 1; min-width: 0; }
.batch-eyebrow { color: var(--gold); font-size: 9.5px; letter-spacing: 0.18em; font-weight: 700; margin-bottom: 4px; }
.batch-head h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 21px; }
.batch-head p { margin: 0; max-width: 500px; }
.batch-x { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; }
.batch-x:hover { color: var(--text); background: var(--panel-2); }
.batch-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.batch-stats > div { background: var(--panel); padding: 11px 14px; display: flex; flex-direction: column; gap: 3px; }
.batch-stats span { color: var(--muted); font-size: 10.5px; }
.batch-stats b { font-size: 15px; font-family: var(--serif); font-weight: 600; }
.batch-stats b.warn { color: var(--gold); }
.batch-planbar { position: relative; height: 4px; background: rgba(255, 255, 255, 0.04); }
.batch-planbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #8f6c36, var(--gold)); transition: width 0.3s; }
.batch-planbar em { position: absolute; right: 16px; top: 6px; color: var(--muted); font-size: 9.5px; font-style: normal; }
.batch-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 18px 22px 0; }
.batch-modes button { text-align: left; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.batch-modes button b { color: var(--text); font-size: 13px; font-weight: 600; }
.batch-modes button span { font-size: 10.5px; line-height: 1.5; }
.batch-modes button.on { border-color: rgba(221, 165, 94, 0.5); background: rgba(221, 165, 94, 0.07); }
.batch-modes button.on b { color: var(--gold); }
.batch-controls { display: grid; grid-template-columns: 1fr 1.1fr; gap: 20px; padding: 16px 22px; }
.batch-target label, .batch-size label { display: block; color: var(--muted); font-size: 10.5px; margin-bottom: 6px; }
.batch-target > div { display: flex; align-items: center; gap: 7px; }
.batch-target input { width: 100px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--text); font: inherit; font-size: 14px; padding: 0 9px; outline: none; }
.batch-target input:focus { border-color: rgba(221, 165, 94, 0.35); }
.batch-target > div span { color: var(--muted); font-size: 11px; }
.batch-target small, .batch-size small { display: block; color: var(--muted); font-size: 10px; margin-top: 7px; line-height: 1.5; }
.batch-size-row { display: flex; gap: 6px; flex-wrap: wrap; }
.batch-size-row button { height: 34px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; }
.batch-size-row button.on { border-color: rgba(221, 165, 94, 0.45); color: var(--gold); background: rgba(221, 165, 94, 0.07); }
.batch-progress { margin: 16px 22px 0; padding: 12px 14px; border: 1px solid rgba(221, 165, 94, 0.24); border-radius: 10px; background: rgba(221, 165, 94, 0.045); }
.batch-progress-head { display: flex; justify-content: space-between; gap: 12px; font-size: 11.5px; color: var(--text); }
.batch-progress-head b { color: var(--gold); font-variant-numeric: tabular-nums; }
.batch-progress-track { height: 5px; margin: 8px 0 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.batch-progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8f6c36, var(--gold)); transition: width 0.3s; }
.batch-progress-foot { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.batch-error, .batch-warn { margin: 14px 22px 0; border-radius: 9px; padding: 9px 11px; font-size: 11.5px; line-height: 1.6; }
.batch-error { border: 1px solid rgba(214, 112, 112, 0.3); background: rgba(214, 112, 112, 0.08); color: #e0a7a7; }
.batch-warn { border: 1px solid rgba(221, 165, 94, 0.26); background: rgba(221, 165, 94, 0.07); color: #ddc39c; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.batch-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 22px 18px; }
.batch-note { color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.batch-foot > div { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.batch-stop { border-color: rgba(221, 165, 94, 0.35); color: var(--gold); background: rgba(221, 165, 94, 0.06); }
@media (max-width: 640px) {
  .batch-mask { padding: 0; align-items: stretch; }
  .batch-modal { width: 100%; min-height: 100%; border-radius: 0; border: 0; }
  .batch-stats { grid-template-columns: 1fr 1fr; }
  .batch-controls { grid-template-columns: 1fr; gap: 16px; }
  .batch-modes { grid-template-columns: 1fr; }
  .batch-foot { align-items: flex-start; flex-direction: column; }
  .outline-meta { gap: 8px; }
}

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px);
  background: #20252f; border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 9px 16px; font-size: 12.5px; opacity: 0; pointer-events: none;
  transition: 0.22s; z-index: 260; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.focus-mode .sidebar, .focus-mode .copilot, .focus-mode .topbar { display: none; }
.focus-mode .layout { grid-template-columns: minmax(0, 1fr); }
.focus-mode { background: #0a0c10; }
.focus-mode .editor-head { padding-top: 40px; }
.focus-exit { display: none; position: fixed; top: 16px; right: 18px; z-index: 30; }
.focus-mode .focus-exit { display: inline-flex; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 250px minmax(0, 1fr); }
  .copilot { position: fixed; right: 0; top: 0; bottom: 0; width: min(360px, 90vw); transform: translateX(100%); transition: transform 0.25s ease; z-index: 35; box-shadow: -20px 0 50px rgba(0, 0, 0, 0.45); }
  .shell.copilot-open .copilot { transform: translateX(0); }
  .icon-btn.copilot-toggle { display: none; }
  .top-actions .ai-btn { display: inline-flex; }
}
@media (min-width: 1181px) {
  .top-actions .ai-btn { display: none; }
}
@media (max-width: 860px) {
  .topbar { height: 56px; padding: 0 12px; gap: 10px; }
  .brand-meta small { display: none; }
  .workbar { display: none; }
  .icon-btn.menu { display: grid; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform 0.25s ease; z-index: 36; box-shadow: 20px 0 50px rgba(0, 0, 0, 0.45); }
  .shell.sidebar-open .sidebar { transform: translateX(0); }
  .save-state { display: none; }
  .editor-head { padding: 16px 18px 10px; }
  .chapter-title { font-size: 19px; }
  .outline-hint { margin: 10px 18px 0; }
  .editor-pane { padding: 0 20px; }
  .editor { font-size: 16px; line-height: 1.95; }
  .page { padding: 18px 16px 70px; }
  .editor-foot { padding: 10px 20px; }
  .page-head { flex-direction: column; gap: 8px; }
}

/* 专注模式对齐 */
.focus-mode .editor-head { padding: 42px 0 12px; width: 100%; max-width: 760px; margin: 0 auto; }
.focus-mode .outline-hint { width: 100%; max-width: 760px; margin: 12px auto 0; }
.focus-mode .editor-pane { max-width: 760px; padding: 0; }
.focus-mode .editor { font-size: 17.5px; line-height: 1.95; }

/* 空章引导 */
.starter-card {
  margin: 12px 34px 0; padding: 12px 14px; border-radius: 12px;
  border: 1px dashed rgba(221, 165, 94, 0.34); background: rgba(221, 165, 94, 0.055);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.starter-text { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 3px; }
.starter-text b { font-size: 13px; color: var(--text); font-weight: 600; }
.starter-text span { font-size: 11.5px; color: var(--muted); line-height: 1.6; }

/* 一键开篇 · 全屏向导 */
@media (max-width: 860px) {
  .starter-card { margin: 10px 18px 0; }
}
.qs-overlay {
  position: fixed; inset: 0; z-index: 120; overflow-y: auto; overflow-x: hidden;
  background:
    radial-gradient(1100px 520px at 50% -12%, rgba(221, 165, 94, 0.11), transparent 62%),
    radial-gradient(760px 460px at 100% 106%, rgba(107, 179, 160, 0.07), transparent 62%),
    #0b0d12;
  color: var(--text);
}
.qs-screen { width: min(1040px, 100%); margin: 0 auto; padding: 20px 28px 34px; min-height: 100vh; }
.qs-head { display: flex; align-items: center; gap: 14px; position: relative; padding: 2px 0 6px; }
.qs-back, .qs-x {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim); font-size: 16px; line-height: 1;
}
.qs-back:hover, .qs-x:hover { border-color: rgba(221, 165, 94, 0.4); color: var(--accent); }
.qs-steps { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.qs-step { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid transparent; }
.qs-step i {
  width: 17px; height: 17px; border-radius: 50%; display: inline-grid; place-items: center;
  background: rgba(255, 255, 255, 0.07); color: var(--muted); font-style: normal; font-size: 10px;
}
.qs-step.on { color: var(--text); background: var(--accent-soft); border-color: rgba(221, 165, 94, 0.32); }
.qs-step.on i { background: rgba(221, 165, 94, 0.24); color: var(--accent); }
.qs-step-sep { color: rgba(255, 255, 255, 0.16); }

.qs-mode {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px; margin-top: 14px;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.035);
}
.qs-mode-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 11px 8px;
  border-radius: 10px; border: 1px solid transparent; color: var(--muted);
  background: transparent; transition: 0.16s;
}
.qs-mode-btn:hover { background: rgba(255, 255, 255, 0.03); color: var(--text-dim); }
.qs-mode-btn.on {
  color: var(--text); border-color: rgba(221, 165, 94, 0.32);
  background: linear-gradient(180deg, rgba(221, 165, 94, 0.18), rgba(221, 165, 94, 0.07));
  box-shadow: 0 6px 18px rgba(221, 165, 94, 0.12);
}
.qs-mode-icon { font-size: 13px; color: var(--accent); line-height: 1.2; }
.qs-mode-btn b { font-size: 13.5px; font-weight: 600; }
.qs-mode-btn em { font-style: normal; font-size: 10.5px; color: var(--muted); }

.qs-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 10px; }
.qs-tool {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); color: var(--text-dim); font-size: 11.5px;
}
.qs-tool:hover { border-color: rgba(221, 165, 94, 0.38); color: var(--text); }
.qs-tool span { color: var(--muted); }
.qs-channel {
  display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line);
  border-radius: 999px; background: rgba(255, 255, 255, 0.02);
}
.qs-channel > span { font-size: 10.5px; color: var(--muted); padding: 0 8px; letter-spacing: 0.08em; }
.qs-channel button { padding: 5px 15px; border-radius: 999px; color: var(--text-dim); font-size: 12px; background: transparent; transition: 0.16s; }
.qs-channel button.on { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(221, 165, 94, 0.32); }

.qs-core {
  padding: 18px 20px 14px; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.014));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
}
.qs-core-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.qs-core-title { display: flex; align-items: center; gap: 10px; }
.qs-core-mark {
  width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center;
  color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(221, 165, 94, 0.26); font-size: 13px;
}
.qs-core-title b { display: block; font-family: var(--serif); font-size: 15px; letter-spacing: 0.03em; }
.qs-core-title span { display: block; margin-top: 3px; font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.qs-core-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.qs-pill {
  padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03); color: var(--text-dim); font-size: 11px;
}
.qs-pill:hover { border-color: rgba(221, 165, 94, 0.4); color: var(--accent); }
.qs-default-line { margin: 12px 0 8px; font-size: 11px; line-height: 1.7; color: var(--muted); }
.qs-default-line b { color: var(--text-dim); font-weight: 500; }
.qs-default-line button { margin-left: 6px; color: var(--accent); font-size: 10.5px; border-bottom: 1px dashed rgba(221, 165, 94, 0.4); }

.qs-idea {
  width: 100%; min-height: 150px; resize: vertical; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.18); color: var(--text);
  padding: 14px 15px; font-size: 13.5px; line-height: 1.85; outline: none; font-family: inherit;
}
.qs-idea:focus { border-color: rgba(221, 165, 94, 0.4); box-shadow: 0 0 0 3px rgba(221, 165, 94, 0.07); }
.qs-idea::placeholder { color: #626a78; }
.qs-insert-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.qs-insert-row button {
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--text-dim); font-size: 11px;
}
.qs-insert-row button:hover { border-color: rgba(221, 165, 94, 0.4); color: var(--accent); }
.qs-example { color: var(--jade) !important; border-color: rgba(107, 179, 160, 0.34) !important; background: rgba(107, 179, 160, 0.06) !important; }
.qs-example:hover { color: #8fd4c1 !important; border-color: rgba(107, 179, 160, 0.6) !important; }
.qs-count { margin-left: auto; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.qs-inspire { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 14px 2px 8px; }
.qs-inspire-btn {
  padding: 7px 12px; border-radius: 9px; border: 1px dashed rgba(107, 179, 160, 0.35);
  background: rgba(107, 179, 160, 0.06); color: var(--jade); font-size: 11.5px;
}
.qs-inspire-btn:hover { border-style: solid; background: rgba(107, 179, 160, 0.1); }
.qs-inspire > span { font-size: 10.5px; color: var(--muted); }

.qs-ideas { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.qs-idea-item {
  text-align: left; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025);
  color: var(--text-dim); border-radius: 9px; padding: 9px 11px; font-size: 12px; line-height: 1.65;
  transition: 0.16s;
}
.qs-idea-item:hover { border-color: rgba(221, 165, 94, 0.4); color: var(--text); background: var(--panel-2); }

.qs-more-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  text-align: left; margin: 14px 0 0; padding: 12px 16px; border: 1px solid var(--line);
  border-radius: 12px; background: rgba(255, 255, 255, 0.025);
}
.qs-more-row:hover { border-color: rgba(221, 165, 94, 0.32); background: rgba(255, 255, 255, 0.04); }
.qs-more-row b { display: block; font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.qs-more-row span { display: block; margin-top: 3px; font-size: 10.5px; color: var(--muted); line-height: 1.6; }
.qs-arrow { font-size: 19px; color: var(--muted); flex: none; }
.qs-ref-row { margin-top: 8px; }
.qs-more-row b em { font-style: normal; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 9.5px; color: var(--jade); background: rgba(107, 179, 160, 0.1); }
.qs-ref-sheet { width: min(680px, 96vw); }
.qs-ref-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.qs-ref-ai {
  padding: 8px 12px; border-radius: 9px; border: 1px dashed rgba(107, 179, 160, 0.4);
  background: rgba(107, 179, 160, 0.07); color: var(--jade); font-size: 11.5px;
}
.qs-ref-ai:hover { border-style: solid; background: rgba(107, 179, 160, 0.12); }
.qs-ref-ai:disabled { opacity: 0.6; cursor: wait; }
.qs-ref-import { padding: 8px 12px; border-radius: 9px; border: 1px solid var(--line); color: var(--text-dim); font-size: 11.5px; background: rgba(255, 255, 255, 0.03); }
.qs-ref-import:hover { border-color: rgba(221, 165, 94, 0.4); color: var(--accent); }
.qs-import-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, 0.025); }
.qs-import-main b { display: block; font-family: var(--serif); font-size: 13px; color: var(--text-dim); font-weight: 500; }
.qs-import-main span { display: block; margin-top: 4px; font-size: 10.5px; color: var(--muted); }
.qs-import-ops { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.qs-import-ops .qs-done { font-size: 10.5px; }
.qs-import-ops .qs-done:disabled { opacity: 0.34; cursor: not-allowed; }
.qs-ref-foot-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qs-file-btn { position: relative; overflow: hidden; cursor: pointer; }
.qs-file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.qs-ref-section { margin: 2px 0 10px; font-size: 11.5px; color: var(--text-dim); }
.qs-ref-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.qs-ref-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 108px;
  text-align: left; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025); color: var(--text-dim); transition: 0.16s;
}
.qs-ref-card:hover { border-color: rgba(221, 165, 94, 0.38); background: rgba(255, 255, 255, 0.045); }
.qs-ref-card.filled { border-color: rgba(107, 179, 160, 0.3); background: rgba(107, 179, 160, 0.05); }
.qs-ref-icon { font-size: 14px; color: var(--accent); line-height: 1.2; }
.qs-ref-card b { font-size: 13px; font-weight: 500; color: var(--text); }
.qs-ref-card em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.qs-ref-state { margin-top: auto; font-size: 10px; color: var(--muted); }
.qs-ref-card.filled .qs-ref-state { color: var(--jade); }
.qs-ref-textarea {
  width: 100%; min-height: 260px; resize: vertical; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18); color: var(--text); padding: 13px 14px; font-size: 13px;
  line-height: 1.8; outline: none; font-family: inherit;
}
.qs-ref-textarea:focus { border-color: rgba(221, 165, 94, 0.4); box-shadow: 0 0 0 3px rgba(221, 165, 94, 0.07); }
.qs-ref-textarea::placeholder { color: #626a78; }
.qs-ref-edit-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 10px; color: var(--muted); }
.section-note { font-size: 10.5px; color: var(--muted); }
.ref-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.ref-card { padding: 12px 14px; }
.ref-card .card-head { align-items: center; }
.ref-card .card-head b { font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.ref-text { min-height: 92px; font-size: 12.5px; }

.qs-loading { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(221, 165, 94, 0.24); background: var(--accent-soft); color: var(--accent); font-size: 11.5px; }
.qs-err { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(217, 112, 96, 0.28); background: rgba(217, 112, 96, 0.08); color: #e09388; font-size: 11.5px; line-height: 1.8; }
.qs-err .btn { margin-left: 6px; }

.qs-foot { position: sticky; bottom: 0; margin-top: 24px; padding: 14px 0 8px; background: linear-gradient(180deg, rgba(11, 13, 18, 0), #0b0d12 34%); }
.qs-foot-note { margin-bottom: 8px; text-align: center; font-size: 10.5px; color: var(--muted); }
.qs-start {
  width: 100%; padding: 15px 22px; border-radius: 14px;
  background: linear-gradient(135deg, #e6b876, #c88f43); color: #241607;
  font-size: 15px; font-weight: 700; letter-spacing: 0.05em;
  box-shadow: 0 14px 42px rgba(221, 165, 94, 0.25);
}
.qs-start:hover { filter: brightness(1.06); }
.qs-start:disabled { opacity: 0.7; }

/* 选设定弹层 */
.qs-sheet-mask {
  position: fixed; inset: 0; z-index: 130; display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px 20px; overflow: auto; background: rgba(4, 6, 10, 0.64); backdrop-filter: blur(12px);
}
.qs-sheet {
  width: min(760px, 96vw); max-height: 86vh; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 18px;
  background: linear-gradient(180deg, #1a1e27, #12151c); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
}
.qs-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px 12px; }
.qs-sheet-title b { display: block; font-family: var(--serif); font-size: 16px; letter-spacing: 0.04em; }
.qs-sheet-title span { display: block; margin-top: 4px; font-size: 10.5px; line-height: 1.55; color: var(--muted); }
.qs-sheet-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.qs-notes { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); background: transparent; }
.qs-notes i { position: relative; width: 28px; height: 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); transition: 0.2s; }
.qs-notes i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #7f8796; transition: 0.2s; }
.qs-notes.on i { background: rgba(221, 165, 94, 0.32); }
.qs-notes.on i::after { left: 14px; background: var(--accent); }
.qs-done { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); color: var(--text-dim); font-size: 11.5px; background: transparent; }
.qs-done:hover { border-color: rgba(221, 165, 94, 0.4); color: var(--accent); }
.qs-done.solid { background: var(--accent-soft); color: var(--accent); border-color: rgba(221, 165, 94, 0.3); }
.qs-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 22px 12px; border-bottom: 1px solid var(--line-soft); }
.qs-tab { padding: 8px 16px; border-radius: 999px; border: 1px solid transparent; color: var(--text-dim); font-size: 12.5px; background: transparent; }
.qs-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.qs-tab.on { color: var(--accent); background: var(--accent-soft); border-color: rgba(221, 165, 94, 0.3); }
.qs-sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 22px 18px; }
.qs-sheet-tip { margin-bottom: 14px; padding: 2px 0 2px 10px; border-left: 2px solid rgba(107, 179, 160, 0.4); font-size: 11px; line-height: 1.7; color: var(--muted); }
.qs-sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--line-soft); background: rgba(0, 0, 0, 0.14); }
.qs-sheet-foot span { font-size: 10.5px; color: var(--muted); }

/* 开篇通用字段 */
.qs-field { display: flex; flex-direction: column; gap: 6px; margin: 2px 0 6px; }
.qs-field label { font-size: 12px; color: var(--text-dim); display: flex; gap: 8px; align-items: baseline; }
.qs-field label span { font-size: 10.5px; color: var(--muted); }
.qs-label { font-size: 11.5px; color: var(--text-dim); margin: 12px 0 0; display: flex; align-items: baseline; gap: 8px; }
.qs-label span { font-size: 10.5px; color: var(--muted); }
.qs-genres { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.qs-genre {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text-dim);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; transition: 0.16s;
}
.qs-genre:hover { border-color: rgba(221, 165, 94, 0.35); color: var(--text); }
.qs-genre.on { border-color: rgba(221, 165, 94, 0.55); background: var(--accent-soft); color: var(--accent); }
.qs-tip { margin: 14px 0 2px; padding: 7px 10px; border-radius: 8px; background: rgba(107, 179, 160, 0.07); border: 1px solid rgba(107, 179, 160, 0.16); font-size: 11px; color: var(--muted); line-height: 1.6; }
.qs-write { border-style: dashed; color: var(--muted); }
.qs-write:hover { color: var(--accent); border-color: rgba(221, 165, 94, 0.5); }

@media (max-width: 720px) {
  .qs-screen { padding: 14px 14px 26px; }
  .qs-steps { gap: 4px; font-size: 10.5px; }
  .qs-step { padding: 4px 7px; gap: 4px; }
  .qs-step i { display: none; }
  .qs-mode-btn { padding: 9px 4px; }
  .qs-mode-btn em { display: none; }
  .qs-core { padding: 14px 13px 12px; }
  .qs-core-title span { max-width: 220px; }
  .qs-channel { width: 100%; justify-content: center; }
  .qs-toolbar { align-items: stretch; }
  .qs-sheet-mask { padding: 2vh 8px; }
  .qs-sheet { max-height: 94vh; }
  .qs-ref-grid, .ref-grid { grid-template-columns: 1fr; }
  .qs-ref-card { min-height: 92px; }
  .qs-import-card { flex-direction: column; align-items: stretch; }
  .qs-import-ops { justify-content: flex-start; }
  .qs-sheet-head { padding: 14px 14px 10px; }
  .qs-sheet-tools { gap: 6px; }
  .qs-notes { display: none; }
  .qs-tabs { padding: 0 14px 10px; gap: 2px; }
  .qs-tab { padding: 7px 11px; font-size: 11.5px; }
  .qs-sheet-body { padding: 12px 14px 14px; }
  .qs-sheet-foot { padding: 10px 14px; }
  .qs-sheet-foot span { display: none; }
}

/* 全书核心 */
.core-card { border-color: rgba(221, 165, 94, 0.26); background: linear-gradient(135deg, rgba(221, 165, 94, 0.075), rgba(20, 23, 30, 0.4)); }
.core-card .card-head { margin-bottom: 10px; }
.core-card .card-head b { color: var(--text); }
.core-card .section-note { color: var(--muted); }
.core-card label { display: block; margin: 8px 0 5px; }
.core-card .field.text { font-size: 13px; line-height: 1.7; }
.core-card .card-ops { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
.core-strip {
  margin: 10px 34px 0; padding: 9px 14px; border-radius: 9px;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid rgba(221, 165, 94, 0.24);
  background: linear-gradient(135deg, rgba(221, 165, 94, 0.08), rgba(20, 23, 30, 0.3));
}
.core-strip b { flex: 0 0 auto; font-size: 10.5px; letter-spacing: 0.12em; color: var(--accent); font-weight: 600; }
.core-strip span { flex: 1; min-width: 0; font-size: 12px; line-height: 1.65; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.core-strip.empty { border-style: dashed; border-color: var(--line); background: rgba(255, 255, 255, 0.015); }
.core-strip.empty span { color: var(--muted); }
.core-strip .btn { flex: 0 0 auto; padding: 4px 9px; font-size: 11px; }
.core-strip.empty b { color: var(--text-dim); }

/* 故事记忆 */
.memory-bar {
  margin: 10px 34px 0; padding: 10px 14px; border-radius: 10px;
  border: 1px solid rgba(107, 179, 160, 0.2);
  background: linear-gradient(135deg, rgba(107, 179, 160, 0.07), rgba(20, 23, 30, 0.35));
}
.mem-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mem-k { font-size: 11px; letter-spacing: 0.12em; color: var(--jade); }
.mem-head .spacer { flex: 1; }
.mem-state { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.mem-state.ok { color: var(--jade); border-color: rgba(107, 179, 160, 0.3); background: rgba(107, 179, 160, 0.1); }
.mem-state.stale { color: var(--accent); border-color: rgba(221, 165, 94, 0.3); background: var(--accent-soft); }
.mem-state.none { color: #9aa3b2; }
.mem-sum { margin-top: 7px; font-size: 12px; line-height: 1.75; color: var(--text-dim); }
.mem-prev { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px; font-size: 10.5px; color: var(--muted); align-items: center; }
.mem-prev-item { border: 1px dashed var(--line); border-radius: 6px; padding: 1px 7px; }
.mem-prev-item.on { border-style: solid; border-color: rgba(107, 179, 160, 0.28); color: var(--text-dim); }

.mem-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 12px 0 10px; }
.mem-stats b { color: var(--text-dim); font-weight: 600; }
.mem-stats .warn b { color: var(--accent); }
.mem-tip {
  font-size: 11.5px; line-height: 1.7; color: var(--muted);
  border-left: 2px solid rgba(221, 165, 94, 0.4); padding: 2px 0 2px 10px; margin-bottom: 14px;
}
.mem-list { margin-top: 4px; }
.mem-card-title { font-family: var(--serif); font-size: 14.5px; font-weight: 600; color: var(--text); }
.mem-card .mem-state { margin-left: 2px; }
.mem-text { min-height: 62px; }
.mem-meta { margin-top: 6px; font-size: 10.5px; color: var(--muted); }

/* 设置：创作配置 */
.cfg-sep { height: 1px; background: var(--line-soft); margin: 16px 0 12px; }
.cfg-label { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.cfg-label span { font-size: 10.5px; color: var(--muted); }
.cfg-empty { font-size: 11.5px; color: var(--muted); padding: 6px 0 10px; }
.model-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 6px;
  border: 1px solid var(--line-soft); border-radius: 9px; background: rgba(255, 255, 255, 0.015);
}
.model-row.on { border-color: rgba(221, 165, 94, 0.3); background: rgba(221, 165, 94, 0.05); }
.model-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.model-info b { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.model-info small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-add { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.model-add .btn { grid-column: 1 / -1; justify-content: center; }
.cfg-line { display: flex; gap: 10px; align-items: flex-start; }
.cfg-line label { flex: 0 0 64px; font-size: 12px; color: var(--muted); padding-top: 5px; }
.cfg-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.cfg-chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px;
  padding: 4px 6px 4px 10px; font-size: 11.5px; color: var(--text-dim);
}
.cfg-chip .cfg-x { border: 0; background: transparent; color: var(--muted); font-size: 12px; line-height: 1; padding: 0 3px; }
.cfg-chip .cfg-x:hover { color: var(--danger); }
.cfg-add { display: flex; gap: 6px; margin: 8px 0 0 74px; }
.cfg-add .input { max-width: 220px; }
.cfg-group-title { font-size: 10.5px; letter-spacing: 0.16em; color: var(--accent); margin: 2px 0 10px; }
.cfg-group.sep { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.book-cfg {
  margin: 4px 0 10px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid rgba(221, 165, 94, 0.2); background: rgba(221, 165, 94, 0.05);
  font-size: 12px; line-height: 1.7; color: var(--text-dim);
}
.book-cfg span { display: block; font-size: 10.5px; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 3px; }

@media (max-width: 860px) {
  .memory-bar { margin: 10px 18px 0; }
  .core-strip { margin: 10px 18px 0; }
  .core-strip span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .model-add { grid-template-columns: 1fr; }
  .cfg-add { margin-left: 0; }
}

/* 卷记忆 */
.vol-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.vol-card { border-color: rgba(221, 165, 94, 0.18); background: linear-gradient(180deg, rgba(221, 165, 94, 0.035), transparent 70%); }
.vol-title { font-family: var(--serif); font-size: 14px; color: var(--gold); }
.vol-card .mem-text { min-height: 108px; }
.vol-text { border-left: 2px solid rgba(221, 165, 94, 0.3); }
.taste-mini {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px;
  font-size: 10px; letter-spacing: 0.02em; border: 1px solid var(--line);
  color: var(--muted);
}
.taste-mini.low { color: rgba(107, 179, 160, 0.95); border-color: rgba(107, 179, 160, 0.3); background: rgba(107, 179, 160, 0.06); }
.taste-mini.mid { color: var(--gold); border-color: rgba(221, 165, 94, 0.28); background: rgba(221, 165, 94, 0.06); }
.taste-mini.high { color: #e08b7b; border-color: rgba(224, 139, 123, 0.35); background: rgba(224, 139, 123, 0.07); }

/* AI 味自检 */
.taste-mask { z-index: 160; overflow-y: auto; align-items: start; padding-top: max(20px, 6vh); }
.taste-modal { width: min(640px, 100%); padding: 0; overflow: hidden; }
.taste-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 22px 16px; border-bottom: 1px solid var(--line-soft);
}
.taste-eyebrow { font-size: 10px; letter-spacing: 0.18em; color: var(--accent); margin-bottom: 5px; }
.taste-head h3 { margin: 0 0 5px; }
.taste-head p { margin: 0; font-size: 11.5px; }
.taste-top { display: flex; align-items: center; gap: 20px; padding: 18px 22px; }
.taste-score {
  flex: 0 0 auto; width: 92px; height: 92px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: radial-gradient(circle at 50% 32%, rgba(255,255,255,0.05), transparent 70%);
}
.taste-score b { font-family: var(--serif); font-size: 32px; line-height: 1; color: var(--text); }
.taste-score span { margin-top: 4px; font-size: 10px; color: var(--muted); letter-spacing: 0.1em; }
.taste-score.low { border-color: rgba(107, 179, 160, 0.45); box-shadow: 0 0 0 6px rgba(107, 179, 160, 0.05); }
.taste-score.low b { color: rgba(107, 179, 160, 0.95); }
.taste-score.mid { border-color: rgba(221, 165, 94, 0.45); box-shadow: 0 0 0 6px rgba(221, 165, 94, 0.05); }
.taste-score.mid b { color: var(--gold); }
.taste-score.high { border-color: rgba(224, 139, 123, 0.5); box-shadow: 0 0 0 6px rgba(224, 139, 123, 0.06); }
.taste-score.high b { color: #e08b7b; }
.taste-summary b { display: block; font-size: 15px; margin-bottom: 4px; }
.taste-summary p { margin: 0; }
.taste-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 22px 6px; }
.taste-metric { border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 13px; background: rgba(255,255,255,0.012); }
.taste-metric.mid { border-color: rgba(221, 165, 94, 0.2); }
.taste-metric.bad { border-color: rgba(224, 139, 123, 0.24); }
.taste-metric-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.taste-metric-head span { font-size: 12px; color: var(--text-dim); }
.taste-metric-head b { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.taste-track { height: 4px; border-radius: 99px; background: rgba(255,255,255,0.05); margin: 9px 0 8px; overflow: hidden; }
.taste-track i { display: block; height: 100%; border-radius: 99px; background: rgba(107, 179, 160, 0.7); }
.taste-metric.mid .taste-track i { background: rgba(221, 165, 94, 0.75); }
.taste-metric.bad .taste-track i { background: rgba(224, 139, 123, 0.8); }
.taste-metric small { display: block; font-size: 10.5px; line-height: 1.6; color: var(--muted); }
.taste-evidence { margin: 12px 22px 0; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 13px; display: flex; flex-direction: column; gap: 7px; }
.taste-evidence div { display: flex; gap: 10px; font-size: 11.5px; line-height: 1.6; }
.taste-evidence span { flex: 0 0 72px; color: var(--muted); }
.taste-evidence b { font-weight: 400; color: var(--text-dim); min-width: 0; }
.taste-tips { margin: 12px 22px 0; font-size: 11.5px; line-height: 1.7; color: var(--text-dim); }
.taste-tips > b { display: block; color: var(--accent); font-size: 10px; letter-spacing: 0.14em; margin-bottom: 4px; }
.taste-tips p { margin: 0 0 3px; color: var(--muted); }
.taste-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px 20px; }
.taste-foot span { font-size: 11px; color: var(--muted); }

@media (max-width: 680px) {
  .taste-metrics { grid-template-columns: 1fr; }
  .taste-top { gap: 14px; padding: 16px 18px; }
  .taste-score { width: 78px; height: 78px; }
  .taste-score b { font-size: 27px; }
  .mem-stats { gap: 12px; }
}

/* 模型选择引导 */
.model-guide-line { display:flex; align-items:center; gap:10px; margin-top:12px; font-size:11px; color:var(--muted); flex-wrap:wrap; }
.guide-link { border:0; background:transparent; padding:0; color:var(--gold); font-size:11.5px; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.guide-link:hover { color:var(--accent); }
.model-guide-mask { z-index: 160; overflow-y:auto; align-items:start; padding-top:max(20px, 6vh); }
.model-guide-modal { width:min(620px,100%); padding:0; overflow:hidden; }
.model-guide-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:20px 22px 14px; border-bottom:1px solid var(--line-soft); }
.model-guide-head h3 { margin:0 0 6px; }
.model-guide-head p { margin:0; font-size:11.5px; line-height:1.7; }
.guide-rows { display:flex; flex-direction:column; gap:10px; padding:14px 22px 4px; }
.guide-row { border:1px solid var(--line-soft); border-radius:10px; padding:12px 13px; background:rgba(255,255,255,.012); }
.guide-row-top { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.guide-row-top b { font-size:13px; color:var(--text); }
.guide-row-top span { font-size:10.5px; color:var(--muted); }
.guide-row-top em { margin-left:auto; font-style:normal; font-size:10px; color:var(--gold); border:1px solid rgba(221,165,94,.25); border-radius:99px; padding:2px 7px; }
.guide-row p { margin:7px 0 8px; font-size:11.5px; line-height:1.75; color:var(--text-dim); }
.guide-apply { padding:3px 9px; font-size:10.5px; }
.guide-models { margin:12px 22px 0; border-top:1px dashed var(--line); padding-top:12px; }
.guide-models-head { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:8px; }
.guide-models-head b { font-size:11px; color:var(--text-dim); }
.guide-models-head span { font-size:10px; color:var(--muted); }
.guide-model { width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 10px; margin-bottom:6px; border:1px solid var(--line-soft); border-radius:8px; background:rgba(255,255,255,.012); color:var(--text); text-align:left; cursor:pointer; }
.guide-model:hover { border-color:rgba(221,165,94,.28); background:rgba(221,165,94,.04); }
.guide-model span { display:flex; flex-direction:column; gap:2px; min-width:0; }
.guide-model b { font-size:12px; font-weight:600; }
.guide-model small { font-size:10px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.guide-model em { flex:0 0 auto; font-style:normal; font-size:10.5px; color:var(--gold); }
.guide-empty { margin:12px 22px 0; padding:10px 12px; border:1px dashed var(--line); border-radius:9px; font-size:11px; line-height:1.7; color:var(--muted); }
.model-guide-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 22px 18px; }
.model-guide-foot span { font-size:10.5px; color:var(--muted); }

@media (max-width: 680px) {
  .model-guide-head { padding:16px 18px 12px; }
  .guide-rows { padding:12px 18px 4px; }
  .guide-models { margin-left:18px; margin-right:18px; }
  .guide-row-top em { margin-left:0; }
}

/* 顶部主导航：借鉴“文字导航 + 一个高亮入口”的结构，配色仍用墨色与金 */
.appnav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  flex: 0 0 auto;
}
.appnav-link {
  position: relative;
  border: 0;
  background: transparent;
  padding: 6px 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1;
  white-space: nowrap;
  transition: color .18s;
}
.appnav-link:hover, .appnav-link.on { color: var(--text); }
.appnav-link.on::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--accent);
}
.appnav-cta {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 16px;
  color: #21160a;
  background: linear-gradient(135deg, #e8b471, #cf9448);
  box-shadow: 0 6px 18px rgba(221, 165, 94, .18);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: filter .18s, transform .18s;
}
.appnav-cta:hover { filter: brightness(1.06); transform: translateY(-1px); }
.appnav-cta.logged {
  color: var(--text);
  background: var(--panel-2);
  border-color: rgba(221, 165, 94, .34);
  box-shadow: none;
}
.appnav-cta.logged::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--jade);
  vertical-align: 1px;
}

/* 席位抽屉 */
.seat-mask { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; background: rgba(5, 7, 10, .66); backdrop-filter: blur(5px); }
.seat-mask[hidden] { display: none !important; }
.seat-panel {
  width: min(460px, 100vw);
  height: 100%;
  overflow-y: auto;
  padding: 28px 24px 24px;
  background: linear-gradient(180deg, #151920, #101319);
  border-left: 1px solid #2d3340;
  box-shadow: -24px 0 60px rgba(0, 0, 0, .45);
  animation: seatIn .22s ease;
}
@keyframes seatIn { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.seat-close { position: absolute; right: 18px; top: 16px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); font-size: 22px; }
.seat-close:hover { color: var(--text); }
.seat-eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 10px; letter-spacing: .24em; }
.seat-panel h2 { margin: 0 0 18px; font: 600 26px/1.3 var(--serif); letter-spacing: .06em; }
.seat-loading { padding: 36px 0; color: var(--muted); font-size: 13px; text-align: center; }
.seat-empty { padding: 22px; border: 1px dashed #343b48; border-radius: 14px; background: rgba(255,255,255,.02); }
.seat-empty b { font: 600 16px/1.5 var(--serif); }
.seat-empty p { margin: 8px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.seat-empty .btn { display: inline-flex; }
.seat-current { display: flex; gap: 14px; padding: 18px; border: 1px solid #363c48; border-radius: 14px; background: rgba(221,165,94,.06); }
.seat-seal { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; color: #fff3e2; background: #a84334; border: 1px solid #c55a49; font: 600 20px/1 var(--serif); }
.seat-current-main { min-width: 0; flex: 1; }
.seat-current-main small { color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.seat-current-main h3 { margin: 3px 0 4px; font: 600 21px/1.3 var(--serif); }
.seat-current-main p { margin: 0 0 10px; color: var(--text-dim); font-size: 12px; }
.seat-bar { height: 3px; background: #2b303a; border-radius: 99px; overflow: hidden; }
.seat-bar span { display: block; height: 100%; background: linear-gradient(90deg, #c8873f, #e8b471); }
.seat-used { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; letter-spacing: 0; }
.seat-list-title { display: flex; align-items: baseline; gap: 8px; margin: 26px 0 10px; color: var(--text); font: 600 15px/1.4 var(--serif); }
.seat-list-title span { color: var(--muted); font: 400 10px/1.4 var(--sans); }
.seat-list { display: grid; gap: 9px; }
.seat-plan { padding: 14px; border: 1px solid #2b303b; border-radius: 12px; background: rgba(255,255,255,.015); }
.seat-plan-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.seat-plan-top b { font: 600 15px/1.3 var(--serif); }
.seat-plan-top small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.seat-price { color: var(--accent); font-size: 13px; font-weight: 600; white-space: nowrap; }
.seat-plan-meta { margin: 8px 0 10px; color: var(--text-dim); font-size: 11px; }
.seat-plan .btn { width: 100%; justify-content: center; }
.seat-more { display: block; margin-top: 18px; color: var(--muted); font-size: 11px; text-align: center; }
.seat-more:hover { color: var(--accent); }
body.seat-open { overflow: hidden; }

@media (max-width: 1460px) { .work-title { display: none; } }
@media (max-width: 1280px) { .workbar .chip[data-act="switch-work"] { display: none; } .appnav { gap: 14px; } }
@media (max-width: 980px) { .appnav-link { display: none; } .appnav { padding-left: 10px; border-left: 0; } }
input[type="range"] { accent-color: var(--accent); }

/* 外观切换 */
.theme-btn{width:32px;height:32px;display:grid;place-items:center;flex:0 0 auto;border:1px solid var(--line);border-radius:50%;background:transparent;color:var(--accent);font-size:14px;line-height:1;transition:.2s}
.theme-btn:hover{border-color:var(--accent);background:var(--accent-soft)}
html[data-theme="day"]{
  color-scheme:light;
  --bg:#f4ede1;--bg-soft:#efe4d2;--panel:#faf5ea;--panel-2:#f4ead9;--panel-3:#e9ddc8;
  --line:#d6c6ad;--line-soft:#e3d7c3;--text:#221d16;--text-dim:#4f4639;--muted:#817565;
  --accent:#98651f;--accent-2:#7a4e17;--accent-soft:rgba(152,101,31,.12);
  --jade:#3e7768;--danger:#a53b32;
}
html[data-theme="day"] body{background:radial-gradient(1200px 700px at 78% -10%,rgba(152,101,31,.10),transparent 60%),radial-gradient(900px 600px at 0% 100%,rgba(62,119,104,.05),transparent 65%),var(--bg);color:var(--text)}
html[data-theme="day"] .topbar{background:rgba(249,243,233,.9)}
html[data-theme="day"] .logo{background:linear-gradient(145deg,#f0dfc5,#e4cfae);border-color:rgba(152,101,31,.32);box-shadow:0 6px 18px rgba(90,67,37,.12)}
html[data-theme="day"] .copilot{background:linear-gradient(180deg,#f8f1e5,#f1e6d4)}
html[data-theme="day"] .editor-fade{background:linear-gradient(180deg,transparent,rgba(244,237,225,.97) 45%)}
html[data-theme="day"] .focus-exit{background:linear-gradient(180deg,rgba(250,245,234,.95),rgba(240,231,216,.95))}
html[data-theme="day"] .nav-item:hover{background:rgba(27,23,18,.04)}
html[data-theme="day"] .modal-mask{background:rgba(225,214,195,.65)}
html[data-theme="day"] ::-webkit-scrollbar-thumb{background:#c8b699;border:2px solid transparent}
html[data-theme="day"] ::-webkit-scrollbar-thumb:hover{background:#b6a184}
html[data-theme="day"] ::selection{background:rgba(152,101,31,.22)}
html[data-theme="day"] .sidebar{background:linear-gradient(180deg,#f8f1e4,#efe4d2)}
html[data-theme="day"] .work-card{background:linear-gradient(160deg,rgba(152,101,31,.07),#f8f1e4)}
html[data-theme="day"] .editor{color:#2a241b}
html[data-theme="day"] .editor::placeholder,html[data-theme="day"] .chapter-title::placeholder{color:#9a8e7b}
html[data-theme="day"] .btn:hover{border-color:#c8b699;background:#eee2cf}
html[data-theme="day"] .seat-mask{background:rgba(214,199,176,.55)}
html[data-theme="day"] .seat-panel{background:linear-gradient(180deg,#fbf6ec,#f4ead9);border-left-color:#d6c6ad;box-shadow:-20px 0 50px rgba(90,67,37,.16)}
html[data-theme="day"] .seat-panel h2,html[data-theme="day"] .seat-list-title{color:#221d16}
html[data-theme="day"] .seat-current,html[data-theme="day"] .seat-plan{border-color:#ddceb6;background:rgba(152,101,31,.05)}
html[data-theme="day"] .seat-bar{background:#e2d3bd}
html[data-theme="day"] .seat-empty{border-color:#ddceb6;background:#fbf6ec}

.brand{text-decoration:none;color:inherit}

.mobile-theme{display:none}
@media (max-width:860px){.mobile-theme{display:grid}.top-actions{gap:5px}.top-actions .btn.sm{padding:5px 7px;font-size:11px}}
@media (max-width:560px){.top-actions .btn.sm[data-view="settings"]{display:none}.brand-meta b{font-size:15px}}

/* 战力体系表 */
.power-note{margin:4px 0 16px;padding:10px 14px;border-left:2px solid var(--accent);background:var(--accent-soft);color:var(--text-dim);font-size:12px;line-height:1.8}
.power-table-wrap{overflow-x:auto;border:1px solid var(--line);background:var(--panel)}
.power-table{min-width:720px;padding:0 14px}
.power-row{display:grid;grid-template-columns:36px 150px 130px minmax(220px,1fr) 110px;gap:10px;align-items:center;padding:9px 0;border-bottom:1px solid var(--line-soft)}
.power-row:last-child{border-bottom:0}
.power-head-row{padding:11px 0 8px;color:var(--muted);font-size:10px;letter-spacing:.14em;border-bottom:1px solid var(--line)}
.power-order{color:var(--accent);font:600 11px/1 var(--sans);letter-spacing:.08em}
.power-input{width:100%;border:1px solid transparent;background:transparent;color:var(--text);padding:6px 7px;border-radius:6px;font-size:12.5px;outline:none}
.power-input:hover{border-color:var(--line-soft);background:var(--panel-2)}
.power-input:focus{border-color:var(--accent);background:var(--panel-2)}
.power-input.name{font-family:var(--serif);font-size:14px;font-weight:600}
.power-input.range{color:var(--accent);font-size:12px;letter-spacing:.02em}
.power-ops{display:flex;gap:2px;justify-content:flex-end}
.power-ops .btn.sm{padding:4px 6px;min-width:26px}
.power-empty{padding:44px 24px;text-align:center;border:1px dashed var(--line);background:var(--panel)}
.power-empty b{font:600 20px/1.4 var(--serif)}
.power-empty p{max-width:520px;margin:10px auto 18px;color:var(--muted);font-size:12.5px;line-height:1.9}
.power-foot{margin-top:12px;color:var(--muted);font-size:11px}

/* 结构体检 */
.checkup-hero{display:flex;gap:26px;align-items:center;padding:22px 24px;margin-bottom:16px;border:1px solid var(--line);background:var(--panel);position:relative;overflow:hidden}
.checkup-hero::after{content:"";position:absolute;right:-40px;top:-60px;width:180px;height:180px;border-radius:50%;background:var(--accent-soft);pointer-events:none}
.checkup-hero.critical{border-left:3px solid var(--danger)}
.checkup-hero.warn{border-left:3px solid var(--accent)}
.checkup-hero.ok{border-left:3px solid var(--jade)}
.checkup-score{flex:0 0 132px;text-align:center;position:relative;z-index:1}
.checkup-score b{display:block;font:600 52px/1 var(--serif);letter-spacing:-.04em;color:var(--text)}
.checkup-score b:after{content:"/100";font:400 11px/1 var(--sans);color:var(--muted);margin-left:3px}
.checkup-score span{display:block;margin-top:8px;color:var(--accent);font-size:11px;letter-spacing:.12em}
.checkup-sum{flex:1;min-width:0;position:relative;z-index:1}
.checkup-sum h3{margin:0 0 7px;font:600 20px/1.4 var(--serif)}
.checkup-sum p{margin:0 0 6px;color:var(--text-dim);font-size:12.5px;line-height:1.8}
.checkup-sum small{color:var(--muted);font-size:10.5px;letter-spacing:.06em}
.check-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.check-card{border:1px solid var(--line);background:var(--panel);padding:16px 16px 13px;display:flex;flex-direction:column;min-height:190px}
.check-card.critical{border-top:2px solid var(--danger)}
.check-card.warn{border-top:2px solid var(--accent)}
.check-card.ok{border-top:2px solid var(--jade)}
.check-head{display:flex;align-items:flex-start;gap:10px}
.check-seal{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;background:var(--panel-3);border:1px solid var(--line);color:var(--accent);font:600 14px/1 var(--serif)}
.check-head b{display:block;font:600 15px/1.4 var(--serif)}
.check-head small{display:block;margin-top:3px;color:var(--muted);font-size:10.5px;line-height:1.5}
.check-tag{margin-left:auto;flex:0 0 auto;font-size:10px;color:var(--muted);border:1px solid var(--line);padding:3px 6px;white-space:nowrap}
.check-card.critical .check-tag{color:var(--danger);border-color:rgba(224,115,120,.35)}
.check-card.warn .check-tag{color:var(--accent);border-color:rgba(221,165,94,.35)}
.check-list{margin:13px 0 12px;display:flex;flex-direction:column;gap:7px;flex:1}
.check-item{display:flex;gap:8px;align-items:flex-start;color:var(--text-dim);font-size:11.5px;line-height:1.65}
.check-item i{flex:0 0 auto;width:15px;height:15px;display:grid;place-items:center;margin-top:1px;font-style:normal;font-size:9px;border:1px solid var(--line);color:var(--muted)}
.check-item.critical i{color:var(--danger);border-color:rgba(224,115,120,.35);background:rgba(224,115,120,.08)}
.check-item.warn i{color:var(--accent);border-color:rgba(221,165,94,.35);background:var(--accent-soft)}
.check-item.ok i{color:var(--jade);border-color:rgba(94,160,143,.35)}
.check-foot{border-top:1px dashed var(--line);padding-top:9px;display:flex;align-items:center;gap:10px;color:var(--muted);font-size:10px}
.check-bar{flex:1;height:2px;background:var(--panel-3);overflow:hidden}
.check-bar i{display:block;height:100%;background:var(--accent)}
.checkup-note{margin-top:14px;color:var(--muted);font-size:11px;line-height:1.8}
.quality-modal .check-card{min-height:0}
.quality-bar{height:3px;margin-top:11px;background:var(--panel-3);overflow:hidden;flex:0 0 3px}
.quality-bar i{display:block;height:100%;background:var(--accent)}
.quality-modal .check-head{margin-bottom:2px}
.quality-modal .check-head > div{min-width:0}
.quality-modal .check-head small{font-size:11.5px;line-height:1.65;color:var(--text-dim)}
.quality-modal .check-list{margin-top:4px}
@media (max-width:860px){.quality-modal{width:100%;padding:16px}.quality-modal .checkup-hero{padding:16px}.quality-modal .checkup-score b{font-size:38px}}
@media (max-width:860px){.check-grid{grid-template-columns:1fr}.checkup-hero{flex-direction:column;align-items:flex-start;gap:12px}.checkup-score{flex:none;width:100%;text-align:left}.checkup-score b{font-size:44px}.power-note{font-size:11px}}


/* 云端存稿 */
.cloud-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.cloud-actions [hidden]{display:none!important}
.cloud-hint{color:var(--muted);font-size:11px;line-height:1.7}
.cloud-line{margin:0 0 10px;font-size:12.5px;line-height:1.8}
.cloud-line.ok{color:var(--jade)}
.cloud-line.warn{color:var(--accent)}
.cloud-line.err{color:var(--danger)}
.cloud-history-modal{width:min(680px,100%);max-height:min(80vh,720px);display:flex;flex-direction:column;padding:0;overflow:hidden}
.cloud-history-head{display:flex;gap:16px;align-items:flex-start;justify-content:space-between;padding:20px 20px 14px;border-bottom:1px solid var(--line)}
.cloud-history-head h3{margin:2px 0 6px;font:600 20px/1.3 var(--serif)}
.cloud-history-head p{margin:0;color:var(--muted);font-size:12px;line-height:1.7;max-width:500px}
.cloud-history-list{padding:8px 12px;overflow:auto;flex:1}
.cloud-history-row{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:12px 10px;border-bottom:1px solid var(--line-soft)}
.cloud-history-row:last-child{border-bottom:0}
.cloud-history-row b{display:block;font:600 14px/1.4 var(--serif)}
.cloud-history-row small{display:block;margin-top:3px;color:var(--muted);font-size:10.5px}
.cloud-history-foot{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:12px 20px;border-top:1px solid var(--line);color:var(--muted);font-size:10.5px;line-height:1.6}
@media (max-width:560px){
  .cloud-history-head{padding:16px 14px 12px}
  .cloud-history-row{padding:10px 4px}
  .cloud-history-foot{padding:10px 14px;flex-direction:column;align-items:flex-start}
  .cloud-actions .btn{flex:1}
}

/* 拆书档案 / 仿写 */
.style-studio .page-inner{max-width:1040px}
.style-head-mark{flex:0 0 auto;text-align:right;font:10px/1.55 var(--sans);letter-spacing:.2em;color:var(--muted);border-right:2px solid rgba(221,165,94,.3);padding:3px 10px 3px 0}
.style-import{padding:16px 18px 14px;background:linear-gradient(135deg,rgba(221,165,94,.06),rgba(107,179,160,.03) 55%,var(--panel));border-color:rgba(221,165,94,.24)}
.style-import-top{display:flex;align-items:flex-start;gap:16px}
.style-import-top>div{min-width:0;flex:1}
.style-import-top b{display:block;font:600 16px/1.4 var(--serif)}
.style-import-top span{display:block;margin-top:4px;color:var(--muted);font-size:11.5px;line-height:1.7}
.style-import-top .input{max-width:230px;flex:0 0 auto}
.style-source{width:100%;min-height:160px;resize:vertical;margin-top:13px;padding:13px 14px;border:1px solid var(--line);border-radius:10px;background:rgba(8,10,14,.55);color:var(--text-dim);font-size:12.5px;line-height:1.9;outline:none}
.style-source:focus{border-color:rgba(221,165,94,.45);color:var(--text)}
.style-import-foot{display:flex;align-items:center;gap:12px;margin-top:10px;font-size:11px;color:var(--muted)}
.style-privacy{color:var(--jade);border-left:1px solid var(--line);padding-left:12px}
.style-progress{display:flex;align-items:center;gap:10px;margin-top:12px;color:var(--muted);font-size:11.5px}
.style-progress i{flex:1;height:2px;background:var(--panel-3);overflow:hidden;position:relative}
.style-progress i:after{content:"";position:absolute;inset:0;width:45%;background:linear-gradient(90deg,transparent,var(--accent),transparent);animation:styleScan 1.6s linear infinite}
@keyframes styleScan{from{transform:translateX(-100%)}to{transform:translateX(230%)}}
.style-error{margin-top:11px;padding:10px 12px;border-left:2px solid var(--danger);background:rgba(224,115,120,.06);color:#e5a3a5;font-size:11.5px;line-height:1.7}
.style-active{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:14px 0 4px;padding:13px 16px;border:1px solid rgba(221,165,94,.3);border-left:3px solid var(--accent);background:linear-gradient(90deg,var(--accent-soft),rgba(221,165,94,.03));border-radius:10px}
.style-active div{min-width:0}
.style-active span{display:inline-block;font-size:10px;letter-spacing:.12em;color:var(--accent);margin-right:8px}
.style-active b{font:600 17px/1.4 var(--serif)}
.style-active em{display:block;margin-top:3px;font-style:normal;color:var(--text-dim);font-size:11.5px;line-height:1.65}
.style-off{display:flex;align-items:center;gap:12px;margin:14px 0 4px;padding:12px 16px;border:1px dashed var(--line);border-radius:10px;color:var(--muted);font-size:11.5px}
.style-off span{color:var(--text-dim);font-weight:500;white-space:nowrap}
.style-off small{line-height:1.6}
.style-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.style-card{padding:15px 16px 13px;display:flex;flex-direction:column;position:relative;overflow:hidden}
.style-card:after{content:"";position:absolute;right:-28px;top:-30px;width:90px;height:90px;border:1px solid rgba(221,165,94,.08);transform:rotate(45deg);pointer-events:none}
.style-card.on{border-color:rgba(221,165,94,.42);box-shadow:0 0 0 1px rgba(221,165,94,.06),0 12px 28px rgba(0,0,0,.18)}
.style-card-head{display:flex;align-items:flex-start;gap:10px}
.style-name{font:600 18px/1.3 var(--serif);letter-spacing:.04em}
.style-source-line{margin-top:4px;color:var(--muted);font-size:10.5px}
.style-on-tag{margin-left:auto;flex:0 0 auto;border:1px solid rgba(221,165,94,.35);background:var(--accent-soft);color:var(--accent);border-radius:99px;padding:3px 8px;font-size:9.5px;letter-spacing:.08em}
.style-summary{margin:9px 0 13px;color:var(--text-dim);font-size:12px;line-height:1.75;min-height:42px}
.style-fingerprint{display:grid;grid-template-columns:1fr 1fr;gap:9px 14px;padding:11px 0 12px;border-top:1px solid var(--line-soft);border-bottom:1px solid var(--line-soft)}
.style-bar>div{display:flex;justify-content:space-between;align-items:baseline;color:var(--muted);font-size:10px}
.style-bar b{font-weight:500;color:var(--text-dim);font-size:10px}
.style-bar i{display:block;height:3px;margin-top:6px;background:rgba(255,255,255,.045);overflow:hidden;border-radius:99px}
.style-bar em{display:block;height:100%;background:linear-gradient(90deg,var(--accent-2),var(--accent));border-radius:99px}
.style-details{margin:10px 0 11px;font-size:11px;color:var(--muted)}
.style-details summary{cursor:pointer;color:var(--text-dim);list-style:none}
.style-details summary:before{content:"＋";display:inline-block;width:14px;color:var(--accent)}
.style-details[open] summary:before{content:"－"}
.style-details pre{white-space:pre-wrap;word-break:break-word;margin:9px 0 0;padding:10px 12px;max-height:190px;overflow:auto;background:rgba(8,10,14,.45);border:1px solid var(--line-soft);border-radius:8px;font:11px/1.8 var(--sans);color:var(--text-dim)}
.style-card-foot{display:flex;gap:8px;align-items:center;margin-top:auto}
.style-empty{margin-top:2px}
.style-chip.on{border-color:rgba(221,165,94,.38);color:var(--accent)}
.style-chip:not(.on){color:var(--muted)}

/* 一键去味 */
.taste-fix-modal{width:min(820px,100%)}
.taste-fix-body{padding:16px 22px 18px}
.taste-fix-loading{display:flex;gap:16px;align-items:center;padding:28px 0;color:var(--text-dim)}
.taste-fix-loading b{display:block;font:600 16px/1.4 var(--serif)}
.taste-fix-loading p{margin:4px 0 0;color:var(--muted);font-size:11.5px}
.taste-fix-error{padding:6px 0 2px}
.taste-fix-error b{font:600 16px/1.4 var(--serif);color:#e5a3a5}
.taste-fix-error p{margin:7px 0 16px;color:var(--text-dim);font-size:12px;line-height:1.7}
.taste-fix-compare{display:flex;align-items:center;gap:12px;padding:10px 13px;border:1px solid var(--line-soft);border-radius:10px;background:rgba(255,255,255,.015)}
.taste-fix-compare>div{display:flex;align-items:baseline;gap:7px}
.taste-fix-compare span{color:var(--muted);font-size:10.5px}
.taste-fix-compare b{font:600 25px/1 var(--serif)}
.taste-fix-compare b.low{color:var(--jade)}
.taste-fix-compare b.mid{color:var(--accent)}
.taste-fix-compare b.high{color:#e08b7b}
.taste-fix-compare>i{font-style:normal;color:var(--muted)}
.taste-fix-compare>em{font-style:normal;font-size:10.5px;padding:2px 7px;border-radius:99px}
.taste-fix-compare>em.down{color:var(--jade);background:rgba(107,179,160,.09);border:1px solid rgba(107,179,160,.22)}
.taste-fix-compare>em.up{color:var(--accent);background:var(--accent-soft);border:1px solid rgba(221,165,94,.24)}
.taste-fix-compare>small{margin-left:auto;color:var(--muted);font-size:10px}
.taste-fix-preview{white-space:pre-wrap;word-break:break-word;max-height:48vh;overflow:auto;margin:12px 0;padding:14px 16px;border:1px solid var(--line-soft);border-radius:10px;background:rgba(8,10,14,.5);color:var(--text-dim);font-size:12.5px;line-height:1.9}
.taste-fix-foot{display:flex;align-items:center;justify-content:space-between;gap:14px;color:var(--muted);font-size:10.5px;line-height:1.6}
.taste-foot-ops{display:flex;gap:8px;flex:0 0 auto}
@media (max-width:860px){
  .style-grid{grid-template-columns:1fr}
  .style-import-top{flex-direction:column;gap:10px}
  .style-import-top .input{max-width:none;width:100%}
  .style-active{align-items:flex-start;flex-direction:column}
  .style-fix-foot{flex-direction:column;align-items:flex-start}
  .taste-fix-compare{flex-wrap:wrap}
}
