/* AI Slides (html-ppt) — 会话式工作台。
   视觉基准对齐主站品牌（紫蓝渐变系），tokens 依据 docs/brand-design-system.md 第 7 节。 */

:root {
  --bg: #F9F9F9;
  --surface: #FFFFFF;
  --surface-alt: #F4F4F5;
  --surface-soft: #F4F4F5;
  --border: #ECECEE;
  --border-strong: #D9D9DE;
  --text: #18181B;
  --text-soft: #3F3F46;
  --text-muted: #71717A;

  /* 品牌色系（主站同源：#9963FF→#2664FF 渐变、#462DE1 实色强调） */
  --accent: #462DE1;
  --accent-soft: #EEEBFC;
  --accent-deep: #3721B8;
  --accent-glow: rgba(70, 45, 225, 0.18);
  --brand-gradient: linear-gradient(90deg, #9963FF 0%, #2664FF 100%);
  --brand-glow: 0 6px 20px rgba(123, 92, 250, 0.4);

  --cta: #2664FF;
  --cta-hover: #1E55E0;
  --danger: #DC2626;
  --done: #10B981;

  --radius-btn: 10px;
  --radius-card: 14px;
  --radius-stage: 16px;
  --radius-input: 18px;
  --radius-pill: 999px;
  --radius-thumb: 8px;

  --shadow-card: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-stage: 0 12px 48px rgba(17,17,17,0.18);
  --shadow-pop: 0 8px 24px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
textarea, input, select { font-family: inherit; }

/* ── Shell: two-panel grid ──────────────────────────────────────── */
.hp-root {
  display: grid;
  grid-template-columns: var(--hp-side-w, minmax(300px, 360px)) 1fr;
  height: 100vh;
  overflow: hidden;
}
.hp-root > * { min-width: 0; min-height: 0; overflow: hidden; }

/* ── Far-left history rail ──────────────────────────────────────── */
.hp-rail {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 8px; background: #F1F1F3; border-right: 1px solid var(--border);
  overflow-y: auto;
}
.hp-rail::-webkit-scrollbar { width: 0; }
.hp-rail-new {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 12px; text-decoration: none;
  background: var(--accent); color: #fff; transition: background 0.15s;
}
.hp-rail-new:hover { background: var(--accent-deep); }
.hp-rail-new svg { display: block; }
.hp-rail-list { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; margin-top: 4px; }
.hp-rail-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%;
  padding: 6px 2px; border-radius: 12px; text-decoration: none; color: var(--text-muted);
  transition: background 0.15s;
}
.hp-rail-item:hover { background: rgba(17,17,17,0.05); }
.hp-rail-ic {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-soft); font-size: 15px; font-weight: 700;
}
.hp-rail-item.active .hp-rail-ic { background: var(--accent); color: #fff; border-color: var(--accent); }
.hp-rail-item.active { color: var(--text); }
.hp-rail-label {
  max-width: 100%; font-size: 10px; line-height: 1.2; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Thin scrollbars */
.hp-side-body, .hp-film, .hp-panel-host {
  scrollbar-width: thin;
  scrollbar-color: rgba(17,17,17,0.35) transparent;
}
.hp-side-body::-webkit-scrollbar, .hp-film::-webkit-scrollbar, .hp-panel-host::-webkit-scrollbar { width: 6px; height: 6px; }
.hp-side-body::-webkit-scrollbar-thumb, .hp-film::-webkit-scrollbar-thumb, .hp-panel-host::-webkit-scrollbar-thumb { background: rgba(17,17,17,0.35); border-radius: 3px; }

/* ── Left chat panel ────────────────────────────────────────────── */
.hp-side {
  position: relative; /* 拖拽分栏热区定位基准 */
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface-alt);
}
/* 左右分栏拖拽热区：悬停/拖动时浮现一条主题色细线 */
.hp-resizer {
  position: absolute; top: 0; bottom: 0; right: -3px; width: 7px;
  cursor: col-resize; z-index: 40;
}
.hp-resizer::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px;
  background: transparent; transition: background .15s;
}
.hp-resizer:hover::after, .hp-resizer.dragging::after { background: var(--accent); }
body.hp-resizing { cursor: col-resize; user-select: none; }
body.hp-resizing iframe { pointer-events: none; } /* 拖过 iframe 时事件不被吞 */
.hp-side-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--border);
}
.hp-home {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius-btn);
  text-decoration: none; color: var(--text-muted); flex-shrink: 0; transition: all 0.15s;
}
.hp-home:hover { background: var(--accent-soft); color: var(--accent-deep); }
.hp-doc { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
/* 可移动控件簇（模型/语言/金币）：宽屏内联右栏顶栏、窄屏搬进左栏顶栏的弹层；插槽只作挂载点 */
.hp-ctrl-slot { display: inline-flex; align-items: center; flex-shrink: 0; }
.hp-controls { display: flex; align-items: center; gap: 8px; }
/* 左栏顶栏的「控件」按钮及其弹层：默认（桌面）隐藏，窄屏才出现 */
.hp-ctrl-menu { display: none; flex-shrink: 0; }
.hp-ctrl-pop { min-width: 216px; padding: 12px; }
.hp-ctrl-pop .hp-controls { flex-direction: column; align-items: stretch; gap: 12px; }
.hp-ctrl-pop .hp-model-select { max-width: none; width: 100%; height: 36px; }
.hp-ctrl-pop .hp-lang-menu { width: 100%; }
.hp-ctrl-pop .hp-lang-btn { width: 100%; justify-content: flex-start; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-btn); }
.hp-ctrl-pop .hp-lang-cur { display: inline-block; max-width: none; }
.hp-ctrl-pop .hp-lang-dropdown { position: static; box-shadow: none; border: none; padding: 4px 0 0; min-width: 0; }
.hp-ctrl-pop .hp-coins { width: 100%; justify-content: center; height: 34px; }
.hp-doc-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2;
}
.hp-doc-meta { font-size: 11px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.hp-doc-meta .dot { color: var(--done); font-size: 9px; }

.hp-side-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }

/* Intro block (blank workbench, in chat) */
.hp-intro { color: var(--text-soft); font-size: 12.5px; line-height: 1.6; }
.hp-intro h2 { font-size: 15px; margin: 0 0 6px; color: var(--text); }
.hp-intro p { margin: 0 0 10px; color: var(--text-muted); }

/* ── Chat transcript ────────────────────────────────────────────── */
.hp-msg { display: flex; width: 100%; animation: hp-in 0.2s ease-out; }
.hp-msg.user { justify-content: flex-end; }
.hp-msg.assistant { justify-content: flex-start; }
.hp-bubble {
  max-width: 92%; padding: 9px 12px; border-radius: 14px;
  font-size: 12.5px; line-height: 1.55; word-break: break-word; white-space: pre-wrap;
}
.hp-msg.user .hp-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.hp-msg.assistant .hp-bubble { background: var(--surface); color: var(--text-soft); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
@keyframes hp-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Compact per-page generation event line */
.hp-event {
  display: flex; align-items: flex-start; gap: 9px; width: 100%;
  padding: 7px 11px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-soft); line-height: 1.35; animation: hp-in 0.2s ease-out;
}
.hp-ev-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 6px; font-size: 10px; font-weight: 700;
  flex-shrink: 0; color: #fff; background: var(--accent);
}
.hp-ev-icon.done { background: var(--done); }
.hp-ev-icon.active { background: transparent; }
.hp-ev-icon.active .hp-spin-inline { width: 13px; height: 13px; border-width: 2px; }
.hp-ev-body { flex: 1; min-width: 0; }
.hp-ev-label { font-weight: 650; color: var(--text); display: flex; align-items: center; gap: 6px; }
.hp-ev-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--surface-alt); color: var(--text-muted); font-size: 10.5px; font-weight: 600;
}
.hp-ev-detail { color: #7A7F87; overflow-wrap: anywhere; margin-top: 1px; }
.hp-ev-bullets { list-style: none; margin: 5px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.hp-ev-bullets li { position: relative; padding-left: 12px; color: #7A7F87; overflow-wrap: anywhere; }
.hp-ev-bullets li::before { content: ''; position: absolute; left: 2px; top: 7px; width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }

/* thinking bubble */
.hp-thinking { display: inline-flex; align-items: center; gap: 8px; }
.hp-spin-inline {
  width: 13px; height: 13px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  display: inline-block; animation: hp-spin 0.8s linear infinite;
  user-select: none; -webkit-user-select: none; pointer-events: none;
}

/* progress card (slides phase) */
.hp-prog {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 13px; animation: hp-in 0.2s ease-out;
}
.hp-prog-head { display: flex; align-items: center; gap: 8px; }
.hp-prog-title { font-weight: 650; color: var(--text); font-size: 12.5px; flex: 1; }
.hp-prog-pct { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hp-prog-bar { height: 5px; border-radius: 3px; background: var(--surface-alt); overflow: hidden; margin: 9px 0 7px; }
.hp-prog-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s ease; }
.hp-prog-summary { font-size: 12px; color: var(--text); font-weight: 600; }
.hp-prog-detail { font-size: 11.5px; color: var(--text-muted); overflow-wrap: anywhere; margin-top: 1px; }

/* chat error */
.hp-chat-error {
  margin: 0 16px 6px; padding: 8px 12px; border-radius: 10px;
  background: #FEF2F2; border: 1px solid #FCA5A5; color: var(--danger); font-size: 12px;
}
.hp-chat-error[hidden] { display: none; }

/* Input area */
.hp-side-foot { padding: 8px 16px 14px; background: var(--surface-alt); }
.hp-input-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-input); padding: 10px 12px 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.hp-input-card:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.hp-input-card textarea {
  width: 100%; border: none; padding: 0; resize: none;
  min-height: 46px; max-height: 160px; font-size: 13px; outline: none;
  background: transparent; color: var(--text); line-height: 1.5;
}
.hp-input-card textarea::placeholder { color: var(--text-muted); }
.hp-input-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.hp-send {
  width: 32px; height: 32px; padding: 0; background: var(--brand-gradient); color: #fff;
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.hp-send:not(:disabled):hover { filter: brightness(1.08); box-shadow: var(--brand-glow); }
.hp-send:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
.hp-send svg { display: block; }

/* ── Right content panel ────────────────────────────────────────── */
.hp-content { display: flex; flex-direction: column; background: var(--bg); position: relative; }

.hp-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 22px; border-bottom: 1px solid var(--border); gap: 16px; flex-shrink: 0;
}
.hp-head-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.hp-head-main { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 6px; padding: 1px 5px; margin: -1px -5px; transition: background 0.15s; }
/* 可改名：hover 提示可点，编辑态描边 */
.hp-head-main.renamable { cursor: text; }
.hp-head-main.renamable:hover { background: var(--surface-alt); }
.hp-head-main.editing { background: var(--surface); box-shadow: 0 0 0 2px var(--accent); cursor: text; overflow: visible; white-space: normal; outline: none; }
.hp-head-sub { font-size: 11px; color: var(--text-muted); }
.hp-head-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.hp-icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-btn);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all 0.15s;
}
.hp-icon-btn:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-deep); }
.hp-icon-btn svg { display: block; }

.hp-menu { position: relative; }
.hp-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 200px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-pop); padding: 6px; z-index: 90;
}
.hp-dropdown[hidden] { display: none; }
.hp-dropdown button {
  display: flex; width: 100%; text-align: left; padding: 9px 12px;
  border-radius: 8px; font-size: 12.5px; color: var(--text-soft); transition: background 0.15s;
}
.hp-dropdown button:hover { background: var(--accent-soft); color: var(--accent-deep); }

.hp-error-banner {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 16px 0; padding: 10px 14px; border-radius: var(--radius-btn);
  background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; font-size: 13px;
}
/* display:flex 会覆盖原生 hidden 属性，必须显式补 [hidden] 隐藏规则，否则空横幅一直显示成红条 */
.hp-error-banner[hidden] { display: none; }
.hp-error-badge {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  background: #DC2626; color: #fff; font-weight: 700; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.hp-error-text { flex: 1 1 auto; line-height: 1.4; }
.hp-error-retry {
  flex: none; height: 30px; padding: 0 14px; border-radius: var(--radius-btn);
  background: #DC2626; color: #fff; border: none; font-size: 13px; cursor: pointer;
  transition: background 0.15s;
}
.hp-error-retry:hover:not(:disabled) { background: #B91C1C; }
.hp-error-retry:disabled { opacity: 0.6; cursor: not-allowed; }
.hp-pending-stop { font-size: 30px; line-height: 1; margin-bottom: 6px; }

.hp-recovery-banner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin: 10px 16px 0; padding: 10px 14px; border-radius: var(--radius-btn);
  background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; font-size: 13px;
}
.hp-recovery-banner[hidden] { display: none; }
.hp-recovery-badge {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  background: #D97706; color: #fff; font-weight: 700; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.hp-recovery-text { flex: 1 1 180px; line-height: 1.4; }
.hp-recovery-btn {
  flex: none; height: 30px; padding: 0 12px; border-radius: var(--radius-btn);
  background: #D97706; color: #fff; border: none; font-size: 13px; cursor: pointer;
}
.hp-recovery-btn:hover:not(:disabled) { background: #B45309; }
.hp-recovery-btn.ghost {
  background: transparent; color: #92400E; border: 1px solid #F59E0B;
}
.hp-recovery-btn.ghost:hover:not(:disabled) { background: #FEF3C7; }
.hp-recovery-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.hp-recovery-dismiss {
  flex: none; height: 30px; padding: 0 10px; border: none; background: transparent;
  color: #A16207; font-size: 12px; cursor: pointer; text-decoration: underline;
}
.hp-recovery-dismiss:disabled { opacity: 0.5; cursor: not-allowed; }

.hp-model-select {
  height: 30px; max-width: 170px; padding: 0 10px; border-radius: var(--radius-btn);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  font-size: 12px; outline: none; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.hp-model-select:hover:not(:disabled) { border-color: var(--border-strong); }
.hp-model-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.hp-model-select:disabled { opacity: 0.55; cursor: not-allowed; }

.hp-coins {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 4px;
  height: 28px; padding: 0 12px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-soft); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
/* 图标包裹：svg() 生成的 <span class="ic"> 默认是 inline，svg 落在文字基线上会偏下、
   与相邻文字不居中。统一用 inline-flex 居中，svg 转 block 去掉基线间隙。 */
.ic { display: inline-flex; align-items: center; justify-content: center; }
.ic svg { display: block; }
.hp-coins .ic { color: #F59E0B; }
/* token 消耗徽标：复用金币胶囊外观，图标用紫色区分（数字 · 预估美元成本） */
.hp-tokens .ic { color: #9963FF; }

/* 语言切换器（右上角地球下拉）：桌面显示当前语言名，窄屏收成纯图标 */
.hp-lang-btn { width: auto; gap: 5px; padding: 0 9px; }
.hp-lang-cur { font-size: 12px; font-weight: 600; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-lang-dropdown { min-width: 160px; max-height: 320px; overflow-y: auto; }
.hp-lang-item {
  display: block; padding: 9px 12px; border-radius: 8px;
  font-size: 12.5px; color: var(--text-soft); white-space: nowrap; transition: background 0.15s;
}
.hp-lang-item:hover { background: var(--accent-soft); color: var(--accent-deep); }
.hp-lang-item.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }

/* Panel host (phase-switched) */
.hp-panel-host { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }

/* ── Create hero (blank workbench) ──────────────────────────────── */
.hp-hero { margin: auto; max-width: 560px; padding: 40px 28px; text-align: center; }
.hp-hero-badge {
  width: 66px; height: 66px; margin: 0 auto 22px; border-radius: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-gradient); color: #fff; border: none; box-shadow: var(--brand-glow);
}
.hp-hero h1 { font-size: 26px; margin: 0 0 12px; color: var(--text); letter-spacing: -0.01em; }
.hp-hero p { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin: 0 auto 24px; max-width: 440px; }
/* 三步流程条：答题 → 大纲 → 设计 */
.hp-hero-steps {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 6px 8px; margin: 0 0 26px;
}
.hp-hero-step { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.hp-hero-step-ic {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.hp-hero-step-arrow { display: inline-flex; align-items: center; color: var(--border-strong); }
.hp-hero-examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 22px; }
.hp-hero-chip {
  padding: 8px 14px; border-radius: var(--radius-pill); font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-soft);
  transition: all 0.15s; cursor: pointer;
}
.hp-hero-chip:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.hp-hero-tip { font-size: 11.5px; color: var(--text-muted); }

/* ── Generic panel (questions / outline / templates) ────────────── */
.hp-panel { padding: 12px 32px 32px; max-width: 760px; width: 100%; margin: 0 auto; }
.hp-panel h1 { font-size: 22px; margin: 0 0 22px; color: var(--text); line-height: 1.3; }
.hp-panel-sub { color: var(--text-muted); margin: -14px 0 22px; font-size: 13px; }

.hp-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; color: var(--text-muted); font-size: 13px; text-align: center; margin: auto; }
.hp-empty .big { font-size: 15px; font-weight: 600; color: var(--text); }
.hp-empty .dim { opacity: 0.7; margin-top: 4px; }
.hp-empty-actions { margin-top: 14px; }
.hp-empty-btn { display: inline-block; padding: 8px 18px; border-radius: 8px; background: var(--brand-gradient); color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; }
.hp-empty-btn:hover { opacity: 0.9; }
.hp-spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: hp-spin 0.8s linear infinite; user-select: none; -webkit-user-select: none; pointer-events: none; }
@keyframes hp-spin { to { transform: rotate(360deg); } }

/* Questions */
.hp-question { margin-bottom: 22px; }
.hp-q-title { font-size: 14px; font-weight: 650; color: var(--text); margin-bottom: 4px; }
.hp-q-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
/* 页数题的积分能力提示：选超了会被后端下调，这里事先告知（琥珀色，区别于普通 hint）*/
.hp-q-afford {
  display: inline-flex; align-items: center; gap: 5px; margin-bottom: 10px;
  padding: 4px 10px; border-radius: 8px; background: #FFF6E6; color: #96620A;
  font-size: 12px; font-weight: 550;
}
.hp-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.hp-chip {
  padding: 8px 14px; border-radius: var(--radius-pill); font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-soft); transition: all 0.15s;
}
.hp-chip:hover { border-color: var(--border-strong); }
.hp-chip.selected { background: #F6F4FE; color: #6A55D6; border-color: rgba(70, 45, 225, 0.22); box-shadow: none; font-weight: 550; }
.hp-other-input, .hp-text-input {
  border: 1px solid var(--border); border-radius: var(--radius-btn);
  background: var(--surface); color: var(--text); font-size: 12.5px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.hp-other-input { height: 34px; padding: 0 12px; min-width: 180px; flex: 1; }
.hp-text-input { display: block; width: 100%; min-height: 72px; padding: 10px 12px; resize: vertical; margin-top: 8px; line-height: 1.5; }
.hp-other-input:focus, .hp-text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* Outline */
.hp-outline-list { display: flex; flex-direction: column; gap: 8px; }
.hp-outline-row {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.hp-outline-row .num { font-size: 13px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; min-width: 22px; }
.hp-outline-text { flex: 1; min-width: 0; }
.hp-outline-text .title { font-size: 13.5px; font-weight: 650; color: var(--text); }
.hp-outline-text .msg { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.hp-outline-row .layout {
  font-size: 10.5px; color: var(--text-muted); background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; white-space: nowrap; flex-shrink: 0;
}
/* ── 大纲可编辑态：行内输入框做成「看着像文本、聚焦才显边框」，拖拽手柄 + 单页 AI 重写按钮 ── */
.hp-outline-row.editable { cursor: default; }
.hp-outline-row.editable.dragging { opacity: .45; }
.hp-outline-row.editable.dragover { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.hp-outline-row.regenerating { opacity: .6; pointer-events: none; }
.hp-ol-grip { color: var(--text-muted); cursor: grab; user-select: none; font-size: 14px; line-height: 1.4; padding-top: 1px; }
.hp-ol-grip:active { cursor: grabbing; }
.hp-ol-title, .hp-ol-msg {
  display: block; width: 100%; border: 1px solid transparent; border-radius: 6px;
  background: transparent; padding: 2px 6px; margin-left: -6px; font-family: inherit; resize: none;
}
.hp-ol-title { font-size: 13.5px; font-weight: 650; color: var(--text); }
.hp-ol-msg { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.hp-ol-title:hover, .hp-ol-msg:hover { border-color: var(--border); }
.hp-ol-title:focus, .hp-ol-msg:focus { outline: none; border-color: var(--accent); background: var(--surface-alt); }
.hp-ol-regen {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-soft); cursor: pointer;
}
.hp-ol-regen:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.hp-ol-regen:disabled { opacity: .5; cursor: not-allowed; }
/* ── 出题等待骨架屏：题卡形态的占位 + 微光扫过动画 ── */
.hp-q-skel-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); margin: 4px 0 14px; }
.hp-q-skel { padding: 14px 0 18px; border-bottom: 1px solid var(--border); }
.hp-skel-line, .hp-skel-chip {
  position: relative; overflow: hidden; background: var(--surface-alt); border-radius: 6px;
}
.hp-skel-line::after, .hp-skel-chip::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 7%, transparent), transparent);
  animation: hp-skel-sweep 1.4s infinite;
}
@keyframes hp-skel-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.hp-skel-line { height: 14px; width: 80%; }
.hp-skel-line.w60 { width: 60%; }
.hp-skel-chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.hp-skel-chip { height: 30px; width: 96px; border-radius: var(--radius-pill, 15px); }
.hp-skel-chip.w2 { width: 132px; }
.hp-skel-chip.w3 { width: 72px; }

/* Templates */
/* 明确的可滚动选择面板：更高的内嵌区 + 右侧常显滚动条（overflow:scroll 恒显轨道 + 淡色轨道背景），
   一眼可辨「可滚动挑选更多模板」 */
.hp-tpl-scroll {
  max-height: 68vh; overflow-y: scroll; margin-top: 10px; padding: 14px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-alt, #FAFAFB);
  /* 不设 scrollbar-width/color：新版 Chrome 一旦设置标准属性就会接管并忽略下面 ::-webkit-scrollbar 的宽度 */
}
.hp-tpl-scroll::-webkit-scrollbar { width: 11px; }
.hp-tpl-scroll::-webkit-scrollbar-track { background: rgba(17,17,17,0.06); border-radius: 6px; margin: 6px 2px; }
.hp-tpl-scroll::-webkit-scrollbar-thumb { background: rgba(17,17,17,0.32); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
.hp-tpl-scroll::-webkit-scrollbar-thumb:hover { background: rgba(17,17,17,0.46); background-clip: padding-box; }
.hp-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
/* 模板列表底部状态：加载中转圈 / 还有更多（可点，等同触底加载）/ 已到底 */
.hp-tpl-foot {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 0 6px; font-size: 12px; color: var(--text-muted);
}
.hp-tpl-more { cursor: pointer; user-select: none; }
.hp-tpl-more:hover { color: var(--accent); }
.hp-tpl-more .ic { animation: hp-tpl-bob 1.4s ease-in-out infinite; }
@keyframes hp-tpl-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
.hp-tpl-end { opacity: 0.7; }
.hp-tpl-card {
  position: relative; text-align: left; padding: 0; overflow: hidden; border-radius: 14px;
  background: var(--surface); border: 2px solid var(--border); transition: all 0.15s;
}
.hp-tpl-card:hover { border-color: var(--border-strong); }
/* 选中态：右下角对勾徽标（强调色实心圆 + 白色对勾）*/
.hp-tpl-card.selected::after {
  content: ''; position: absolute; right: 8px; bottom: 8px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%; background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 13px 13px; background-position: center; background-repeat: no-repeat;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.hp-tpl-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.hp-tpl-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--surface-alt); }
.hp-tpl-skip {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; margin-top: 16px;
  padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 2px dashed var(--border-strong); transition: all 0.15s;
}
.hp-tpl-skip:hover { border-color: var(--accent); }
.hp-tpl-skip.selected { border-style: solid; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.hp-tpl-skip .skip-icon { font-size: 24px; }
.hp-tpl-skip .skip-label { font-size: 13.5px; font-weight: 650; color: var(--text); }
.hp-tpl-skip .skip-note { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Continue floating bar ──────────────────────────────────────── */
/* 阶段推进按钮：底部居中悬浮（不随面板滚动） */
.hp-continue-wrap { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 30; }
.hp-continue-wrap[hidden] { display: none; }
.hp-continue {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 22px; border-radius: var(--radius-pill);
  background: var(--brand-gradient); color: #fff; box-shadow: var(--shadow-pop); transition: all 0.15s;
}
.hp-continue:not(:disabled):hover { filter: brightness(1.06); box-shadow: var(--brand-glow); transform: translateY(-1px); }
.hp-continue:disabled { background: var(--border-strong); }
/* 推进中：外观与 disabled 一致，但仍可点击——点它会给「正在生成」提示并校对后端进度 */
.hp-continue.is-busy { background: var(--border-strong); cursor: progress; }
.hp-continue.is-busy:hover { filter: none; box-shadow: var(--shadow-pop); transform: none; }
.hp-continue.is-ready { animation: hp-pulse 1.8s ease-in-out infinite; }
@keyframes hp-pulse { 0%, 100% { box-shadow: var(--shadow-pop); } 50% { box-shadow: 0 8px 30px var(--accent-glow), 0 0 0 4px var(--accent-glow); } }
.hp-continue-label { font-size: 13.5px; font-weight: 650; }
.hp-continue-sub { font-size: 11px; opacity: 0.75; }

/* ── Stage ──────────────────────────────────────────────────────── */
.hp-stage-wrap { display: flex; align-items: center; justify-content: center; flex: 1; min-height: 0; padding: 12px 20px; }
.hp-frame {
  width: 100%; max-width: 880px; aspect-ratio: 16/9; position: relative; overflow: hidden;
  border-radius: var(--radius-stage); background: #fff; box-shadow: var(--shadow-stage);
}
.hp-frame iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 720px; border: none; transform-origin: top left; }
.hp-frame.pending { background: var(--surface); display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 48px rgba(17,17,17,0.1); }
.hp-pending { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; text-align: center; }

.hp-fullscreen {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(4px); color: var(--text-soft);
  font-size: 14px; display: inline-flex; align-items: center; justify-content: center; transition: all 0.15s; z-index: 2;
}
.hp-fullscreen:hover { background: #fff; color: var(--accent-deep); }

/* Pager */
.hp-pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 4px 0 2px; flex-shrink: 0; }
.hp-pager[hidden] { display: none; }
.hp-pager-nav {
  width: 28px; height: 28px; border-radius: 50%; background: var(--surface);
  border: 1px solid var(--border); color: var(--text-soft); font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.hp-pager-nav:not(:disabled):hover { background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent-soft); }
.hp-pager-nav:disabled { opacity: 0.35; }
.hp-pager-counter { font-size: 12px; font-weight: 600; color: var(--text-soft); font-variant-numeric: tabular-nums; min-width: 48px; text-align: center; }

/* Filmstrip */
.hp-film { display: flex; gap: 6px; overflow-x: auto; padding: 4px 20px 12px; flex-shrink: 0; }
.hp-film-item {
  flex-shrink: 0; background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-thumb); padding: 0; overflow: hidden; cursor: pointer; transition: all 0.15s; display: block;
}
.hp-film-item:hover { border-color: var(--accent-soft); }
.hp-film-item.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.hp-film-item.pending { cursor: default; }
.hp-film-thumb { position: relative; width: 128px; aspect-ratio: 16/9; overflow: hidden; background: #fff; }
.hp-film-thumb iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 720px; border: none; pointer-events: none; transform-origin: top left; }
.hp-film-thumb.pending { display: flex; align-items: center; justify-content: center; background: var(--surface-alt); }

/* ── 舞台工具栏（快捷编辑入口 + 就地编辑开关）── */
.hp-toolbar { display: flex; align-items: center; gap: 10px; padding: 8px 20px 0; flex-shrink: 0; }
.hp-tb-group { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-btn); padding: 3px; }
.hp-tb-btn {
  width: 30px; height: 30px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted); background: transparent; border: none; cursor: pointer; transition: all 0.15s;
}
.hp-tb-btn:hover:not(:disabled) { color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.hp-tb-btn:active:not(:disabled) { transform: translateY(0); }
.hp-tb-spacer { flex: 1; }
.hp-ie-badge { font-size: 11.5px; color: var(--text-muted); }
.hp-ie-badge[hidden] { display: none; }
.hp-ie-badge.dirty { color: var(--danger); font-weight: 600; }
.hp-tb-toggle {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; color: var(--text-soft); background: var(--surface);
  border: 1px solid var(--border-strong); cursor: pointer; transition: all 0.15s;
}
.hp-tb-toggle:hover { border-color: var(--accent); color: var(--text); }
.hp-tb-toggle.on { background: var(--cta); border-color: var(--cta); color: #fff; }
.hp-tb-toggle:disabled { opacity: 0.5; cursor: not-allowed; }
.hp-tb-btn2 {
  height: 30px; padding: 0 12px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600;
  color: var(--text-soft); background: var(--surface); border: 1px solid var(--border-strong); cursor: pointer; transition: all 0.15s;
}
.hp-tb-btn2:hover { border-color: var(--danger); color: var(--danger); }
.hp-tb-btn2:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── 快捷编辑弹窗 ── */
.qe-overlay { position: fixed; inset: 0; background: rgba(17,17,17,0.34); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 260; animation: qe-fade 0.14s ease-out; }
@keyframes qe-fade { from { opacity: 0; } to { opacity: 1; } }
.qe-card { width: min(460px, 92vw); background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-pop); padding: 16px; animation: qe-pop 0.16s cubic-bezier(0.16,1,0.3,1); }
@keyframes qe-pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.qe-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.qe-title { font-size: 15px; font-weight: 700; color: var(--text); }
.qe-meta { font-size: 12px; color: var(--cta); background: var(--accent-soft); padding: 2px 8px; border-radius: var(--radius-pill); }
.qe-close { margin-left: auto; width: 26px; height: 26px; border: none; background: transparent; font-size: 20px; line-height: 1; color: var(--text-muted); cursor: pointer; border-radius: 6px; }
.qe-close:hover { background: var(--accent-soft); color: var(--text); }
.qe-pos { display: flex; gap: 16px; margin-bottom: 10px; font-size: 12.5px; color: var(--text-soft); }
.qe-pos label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.qe-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.qe-chip {
  font-size: 12px; color: var(--text-soft); background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 5px 11px; cursor: pointer; transition: all 0.15s;
}
.qe-chip:hover { border-color: var(--accent); color: var(--text); background: var(--surface); }
.qe-textarea {
  width: 100%; resize: vertical; min-height: 70px; padding: 10px 12px; font-size: 13px; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-btn); font-family: inherit; background: var(--surface);
}
.qe-textarea:focus { outline: none; border-color: var(--accent); }
.qe-footer { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.qe-status { flex: 1; font-size: 12px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.qe-done { color: var(--done); font-weight: 700; }
.qe-submit {
  padding: 8px 18px; border-radius: var(--radius-btn); border: none; background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity 0.15s;
}
.qe-submit:hover { background: var(--accent-deep); }
.qe-submit:disabled { opacity: 0.6; cursor: default; }
.qe-hint { margin-top: 8px; font-size: 11px; color: var(--text-muted); }

/* Share dialog */
.hp-share-card { width: min(440px, 92vw); }
.hp-share-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.hp-share-row-text { flex: 1; }
.hp-share-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.hp-share-hint { margin-top: 3px; font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.hp-share-toggle {
  flex: none; width: 42px; height: 24px; border: none; border-radius: 999px; background: var(--border-strong);
  position: relative; cursor: pointer; padding: 0; transition: background 0.15s;
}
.hp-share-toggle.on { background: var(--accent); }
.hp-share-knob {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: left 0.15s;
}
.hp-share-toggle.on .hp-share-knob { left: 20px; }
.hp-share-link-box { padding: 12px 0; border-bottom: 1px solid var(--border); }
.hp-share-sublabel { font-size: 12px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.hp-share-link-row { display: flex; gap: 8px; }
.hp-share-link-input {
  flex: 1; min-width: 0; padding: 8px 11px; font-size: 12.5px; color: var(--text-soft);
  border: 1px solid var(--border-strong); border-radius: var(--radius-btn); background: var(--surface-alt);
}
.hp-share-link-input:focus { outline: none; border-color: var(--accent); }
.hp-share-copy {
  flex: none; padding: 8px 14px; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-btn); background: var(--surface);
}
.hp-share-copy:hover { border-color: var(--accent); color: var(--accent); }
.hp-share-pwd-box { padding: 12px 0 4px; }
.hp-share-pwd-input {
  width: 100%; padding: 9px 12px; font-size: 13px; color: var(--text); font-family: inherit;
  border: 1px solid var(--border-strong); border-radius: var(--radius-btn); background: var(--surface);
}
.hp-share-pwd-input:focus { outline: none; border-color: var(--accent); }

/* Toast */
.hp-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 0);
  background: var(--accent); color: #fff; padding: 10px 18px; border-radius: var(--radius-btn);
  font-size: 12.5px; box-shadow: var(--shadow-pop); z-index: 300; max-width: 80vw; animation: hp-toast-in 0.18s ease-out;
}
.hp-toast.err { background: var(--danger); }
@keyframes hp-toast-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Fullscreen preview modal */
/* 整行布局：[‹] [幻灯片] [›]，箭头占固定宽、幻灯片 flex 收缩，箭头恒在两侧留白里不压白底 */
.hp-modal { position: fixed; inset: 0; background: rgba(17,17,17,0.82); display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 18px; z-index: 200; }
.hp-modal[hidden] { display: none; }
.hp-modal-frame { flex: 0 1 1280px; min-width: 0; max-width: 100%; max-height: 84vh; aspect-ratio: 16/9; background: #0f0f12; border-radius: 12px; overflow: hidden; position: relative; box-shadow: var(--shadow-stage); }
.hp-modal-frame .hp-modal-buf { position: absolute; top: 0; left: 0; width: 1280px; height: 720px; border: none; transform-origin: top left; }
/* 双缓冲：仅 active 缓冲可见，空闲缓冲在后台加载新页；load 完成才切 active → 翻页无白闪 */
.hp-modal-frame .hp-modal-buf { opacity: 0; z-index: 0; pointer-events: none; }
.hp-modal-frame .hp-modal-buf.active { opacity: 1; z-index: 1; pointer-events: auto; }
.hp-modal-close, .hp-modal-nav {
  display: flex; align-items: center; justify-content: center;
  border: none; padding: 0; cursor: pointer; line-height: 1;
  color: #fff; background: rgba(255,255,255,0.16);
}
.hp-modal-close svg, .hp-modal-nav svg { display: block; }
.hp-modal-close:hover, .hp-modal-nav:hover { background: rgba(255,255,255,0.28); }
.hp-modal-nav:disabled { opacity: 0.35; cursor: default; }
.hp-modal-close { position: absolute; top: 18px; right: 24px; width: 40px; height: 40px; border-radius: 50%; font-size: 22px; z-index: 2; }
.hp-modal-nav { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; font-size: 26px; }

/* ── Mobile floating action button ──────────────────────────────── */
.hp-fab {
  position: fixed; right: 16px; bottom: 18px; z-index: 120;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: #fff; box-shadow: var(--shadow-pop);
  display: none; align-items: center; justify-content: center;
}
.hp-fab:hover { background: var(--accent-deep); }
.hp-fab svg { display: block; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hp-root { grid-template-columns: 1fr; }
  .hp-rail { display: none; }
  .hp-side { border-right: none; }
  .hp-resizer { display: none; }
  .hp-content {
    position: fixed; inset: 0; z-index: 60;
    transform: translateX(100%); transition: transform 0.28s ease;
  }
  body.hp-show-preview .hp-content { transform: none; }
  body.hp-has-session .hp-fab { display: inline-flex; }
  .hp-frame { max-width: 100%; }
  /* 主 CTA 改为「底部常驻条」（移动端主流做法：CTA 贴底 + iOS 安全区内边距），
     不再悬在内容中间压住问卷选项；顶部加渐隐遮罩让列表滚动到底时不硬切。
     遮罩层 pointer-events:none，只有按钮本身可点，避免挡住下方内容的点击。 */
  .hp-continue-wrap {
    left: 0; right: 0; bottom: 0; transform: none;
    display: flex; justify-content: center; pointer-events: none;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, var(--surface) 62%, rgba(255, 255, 255, 0));
  }
  .hp-continue { pointer-events: auto; width: 100%; max-width: 440px; justify-content: center; }
  /* 对话 FAB 需按当前视图避让底部元素，否则会压住可点击控件：
     ① 对话栏视图（默认）底部是输入框卡片，实测约 140–146px 高
        （foot padding 10+16 + card border 2 + padding 18 + textarea 44 + 发送行 34），
        故 CSS 兜底抬到 168px；实际位置由 JS positionFab 按输入框实测高度动态设置（多行会更高）；
     ② 内容视图（hp-show-preview）底部是 CTA 条(64px)或胶片(74px)，落回 84px 即可。 */
  .hp-fab { bottom: calc(168px + env(safe-area-inset-bottom, 0px)); }
  body.hp-show-preview .hp-fab { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

  /* 全屏预览：整行布局不变，窄屏只把间距/按钮缩小，箭头仍在幻灯片两侧且可点 */
  .hp-modal { gap: 8px; padding: 0 8px; }
  .hp-modal-nav { width: 40px; height: 40px; font-size: 24px; }
  .hp-modal-close { top: 12px; right: 12px; width: 36px; height: 36px; font-size: 20px; }

  /* 窄屏：语言切换器收成纯地球图标，省出顶栏横向空间 */
  .hp-lang-btn { width: 32px; padding: 0; }
  .hp-lang-cur { display: none; }
  /* 窄屏：左栏顶栏出现「控件」按钮，模型/语言/金币收进它的弹层，标题不再被挤 */
  .hp-ctrl-menu { display: inline-flex; }

  /* 窄屏：画布就地编辑依赖鼠标拖拽，触屏体验差且工具栏拥挤 —— 隐藏「就地编辑」入口，
     手机端只保留快捷工具（弹窗，触屏友好）与对话。:not(.on) 只命中入口，不影响其它。*/
  .hp-toolbar { padding: 8px 12px 0; gap: 6px; flex-wrap: wrap; }
  .hp-tb-toggle:not(.on) { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   ChatGPT 风格体验层（整块覆盖，可整块回退）
   目标：大字号呼吸感、对话区去盒子化（助手消息裸文本、用户消息中性灰胶囊）、
   大圆角输入框、面板居中限宽。品牌色仍按 docs/brand-design-system.md。
   ═══════════════════════════════════════════════════════════════════ */

/* 1) 基础排版：13px→14px，行高放松 */
body { font-size: 14px; line-height: 1.6; }

/* 2) 对话面板：白底、去分隔线压迫感 */
.hp-side { background: #FFFFFF; }
.hp-side-head { border-bottom: 1px solid transparent; padding: 16px 18px 10px; }
.hp-side-body { padding: 18px 18px 10px; gap: 14px; }
.hp-side-foot { background: #FFFFFF; padding: 10px 16px 16px; }

/* 3) 消息：ChatGPT 式 —— 助手裸文本、用户中性灰胶囊 */
.hp-bubble { font-size: 14px; line-height: 1.65; max-width: 88%; }
.hp-msg.assistant .hp-bubble {
  background: transparent; border: none; padding: 2px 0;
  color: var(--text); border-radius: 0;
}
.hp-msg.user .hp-bubble {
  background: var(--surface-alt); color: var(--text);
  border-radius: 18px; border-bottom-right-radius: 6px; padding: 10px 14px;
}

/* 4) 过程事件：从「卡片」弱化为浅灰行内条，退居背景 */
.hp-event { border: none; background: var(--surface-alt); border-radius: 10px; font-size: 12.5px; }

/* 5) 输入框：ChatGPT 式大圆角 + 轻投影 + 内嵌渐变发送钮（结构不动，纯观感） */
.hp-input-card {
  border-radius: 24px; padding: 12px 14px 10px;
  border-color: var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.hp-input-card:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow), 0 2px 12px rgba(0,0,0,0.06); }
.hp-input-card textarea { font-size: 14px; line-height: 1.55; min-height: 44px; }
.hp-send { width: 34px; height: 34px; }

/* 6) 右侧内容面板：居中限宽 + 标题层级放大，接近 ChatGPT 主栏的阅读宽度 */
.hp-panel { max-width: 820px; margin: 0 auto; }
.hp-panel h1 { font-size: 22px; line-height: 1.35; }
.hp-panel-host { padding: 16px 32px; }
/* 窄屏底部留白：必须写在上面那条 padding 之后（同特异性、后者生效），
   否则底部常驻 CTA 条会压住最后一题；左右也收窄到 16px 更适合手机宽度 */
@media (max-width: 860px) {
  /* 顶部留白收紧：顶栏与「Pick a visual style」之间原有 16+12=28px 空档，手机上偏空 */
  .hp-panel-host { padding: 6px 12px 96px; }
  .hp-panel { padding-top: 6px; }

  /* 模板选择（手机）：滚动区"隐形化"——去掉边框/底色/内边距，把宽度全让给卡片，
     每张模板显示更大；单列排布，不用 auto-fill 以免挤成两列过小。 */
  .hp-tpl-scroll {
    /* 底部留白放在「滚动内容内部」而不是限制容器高度：列表因此能一直延伸到屏幕底部
       （模板从半透明 CTA 条下方穿过，暗示还有内容），同时保证滚到底时最后一行能完全露出。 */
    padding: 0 0 92px; border: none; background: transparent; margin-top: 8px;
    max-height: 56vh; /* 兜底：不支持 :has() 时按视口比例限高，避免溢出到底部 CTA 之下 */
  }
  /* 模板页不再用 host 的底部内边距压高度（那会在列表下方留出一块空白） */
  .hp-panel-host:has(.hp-tpl-scroll) { padding-bottom: 0; }
  .hp-tpl-scroll::-webkit-scrollbar { width: 0; } /* 手机用原生手势滚动，滚动条不占宽度 */
  /* 两列排布：单列时每张卡占满屏宽、一屏只看得到 1.5 张，挑选效率低；两列约 162px/张，
     16:10 下高约 101px，一屏可见 8–10 张，浏览与对比都更快。 */
  .hp-tpl-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* 高度自适应：让模板区填满标题与底部 CTA 之间的剩余空间（固定 vh 会因标题折行而溢出）。
     :has() 限定只在模板阶段改变 .hp-panel 的布局，不影响问卷/大纲等其它面板。 */
  /* 模板页左右内边距压到 8px（默认 32px 在 375 宽下要吃掉 64px），卡片宽度 287→335px */
  .hp-panel:has(.hp-tpl-scroll) { display: flex; flex-direction: column; flex: 1; min-height: 0; padding-left: 8px; padding-right: 8px; }
  .hp-panel:has(.hp-tpl-scroll) .hp-tpl-scroll { flex: 1 1 auto; min-height: 0; max-height: none; }
}

/* 7) 问卷：题目与选项放大、圆角胶囊化，触达面积更接近 ChatGPT 的选项卡 */
.hp-q-title { font-size: 15px; font-weight: 650; }
.hp-q-hint { font-size: 12.5px; }
.hp-chip { font-size: 13.5px; padding: 9px 16px; border-radius: var(--radius-pill); }
.hp-chip-row { gap: 10px; }
.hp-other-input { font-size: 13.5px; border-radius: var(--radius-pill); padding: 8px 16px; }

/* 8) 左侧会话轨：白底弱边，悬停浅灰（ChatGPT 侧栏观感） */
.hp-rail { background: #FAFAFA; }
.hp-rail-item:hover { background: rgba(0, 0, 0, 0.05); }

/* 9) 大纲行：去边框改分隔线线性列表，悬停浮现操作（更接近文档列表的轻盈感） */
.hp-outline-row {
  border: none; border-bottom: 1px solid var(--border);
  border-radius: 0; padding: 16px 4px; background: transparent;
}
.hp-outline-row.editable.dragover { border-radius: 10px; }
.hp-outline-list { gap: 0; }
.hp-ol-title { font-size: 15px; }
.hp-ol-msg { font-size: 13px; }
.hp-ol-grip, .hp-ol-regen { opacity: 0; transition: opacity 0.15s; }
.hp-outline-row:hover .hp-ol-grip, .hp-outline-row:hover .hp-ol-regen { opacity: 1; }

/* 9b) 大纲行再优化：压缩行高让一屏看到更多页；整行悬停反馈让边界与可编辑性更明确；
   layout 技术标签（cover/problem/...）弱化为次要信息；列表底部留白避免被 CTA 浮条压住。 */
.hp-outline-row {
  padding: 11px 10px; border-radius: 8px;
  transition: background 0.12s, border-color 0.12s;
}
.hp-outline-row:hover { background: var(--surface-alt); }
.hp-outline-row .num { font-size: 12.5px; min-width: 26px; opacity: 0.8; }
.hp-outline-row .layout {
  font-size: 10px; padding: 1px 7px; opacity: 0.55; background: transparent;
  border-color: var(--border); text-transform: lowercase;
}
.hp-outline-row:hover .layout { opacity: 0.85; }
.hp-ol-msg { margin-top: 1px; }
/* 底部浮动 CTA 约 50px 高 + 22px 间距，这里留足空间，最后一页不再被遮住 */
.hp-outline-list { padding-bottom: 92px; }

/* 10) 快捷编辑工具条：按钮组水平居中（Edit on canvas 仍靠右）；窄屏回退流式布局防重叠 */
/* 居中的按钮组是 absolute（脱离文档流），若工具栏无高度会塌陷、组悬空压住下方舞台。
   显式 min-height 撑出按钮组的高度，令舞台从其下方开始，避免遮挡幻灯片顶部。 */
.hp-toolbar { position: relative; justify-content: flex-end; min-height: 38px; }
/* transform 产生独立堆叠上下文，需显式抬高 z-index，否则组内二级菜单/tooltip 被后续舞台盖住 */
.hp-toolbar .hp-tb-group { position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 60; }

/* 11) 舞台放大：JS 按可用宽高取最大 16:9（scaleStage），此处收紧周边高度挤出空间 */
.hp-frame { max-width: 1280px; }
.hp-stage-wrap { padding: 6px 14px; }
.hp-toolbar { padding: 6px 16px 0; }
.hp-pager { padding: 3px 0 1px; }
.hp-film { padding: 3px 16px 8px; }
.hp-film-thumb { width: 104px; }

/* 手机端舞台/胶片：必须写在上面这组顶层规则之后（同特异性、后者生效），否则会被它们覆盖。
   16:9 在竖屏由宽度决定尺寸，故左右留白压到最小让画面尽可能大（scaleStage 窄屏也只按宽度算）；
   舞台保持垂直居中（竖屏看 16:9 必然有上下留白，居中比靠上更平衡）；
   缩略图放大以利用富余的垂直空间，胶片右侧给悬浮对话按钮让位，末张不被压住。 */
@media (max-width: 860px) {
  /* 快捷编辑工具条居中：@media(max-width:1100px) 把它从「绝对定位居中」改回普通流并靠左。
     只加 justify-content:center 还不够——工具条里的 .hp-tb-spacer(flex:1) 会把按钮组顶到左边。
     窄屏本就禁用画布编辑（toggleInlineEdit 遇 isNarrowScreen 直接 return），右侧编辑态徽标
     不会出现，spacer 失去意义，隐藏它按钮组才能真正居中。 */
  .hp-toolbar { justify-content: center; }
  .hp-tb-spacer { display: none; }
  .hp-stage-wrap { padding: 4px 6px 6px; }
  .hp-frame { max-width: none; }
  /* slides/done 阶段没有底部 CTA 浮条（它只在问卷/大纲/模板阶段显示），
     此时那 96px 底部留白是纯浪费——胶片下方白白空出一大块。 */
  .hp-panel-host:has(.hp-stage-wrap) { padding-bottom: 6px; }

  /* 竖屏下 16:9 舞台只能占 191px 高，若让舞台区 flex:1 吸收剩余空间再居中，
     上下会各留 160px 死白（占屏 40%）。改为：舞台按内容高度，富余空间全部交给胶片，
     缩略图两列自动换行成网格 —— 一屏能看到更多页，浏览与跳页都更快。 */
  .hp-stage-wrap { flex: 0 0 auto; }
  .hp-film {
    flex: 1 1 auto; min-height: 0;
    flex-wrap: wrap; align-content: flex-start;
    overflow-x: hidden; overflow-y: auto;
    padding: 8px 8px 10px; gap: 10px;
  }
  .hp-film-item { width: calc(50% - 5px); }
  .hp-film-thumb { width: 100%; }
}

/* 12) 切页在途反馈：旧页压暗 + 中心转圈，点击即刻可感知（dist 请求可能需数秒） */
.hp-frame.is-loading iframe { opacity: 0.35; transition: opacity 0.2s; }
.hp-frame.is-loading::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px;
  margin: -17px 0 0 -17px; border-radius: 50%; z-index: 5;
  border: 3px solid rgba(70, 45, 225, 0.2); border-top-color: var(--accent);
  animation: hp-skel-sweep-spin 0.8s linear infinite;
}
@keyframes hp-skel-sweep-spin { to { transform: rotate(360deg); } }

/* 13) 思考气泡升级：文字微光扫过（ChatGPT 风）+ 耗时计数 + 长等待安抚副行 */
.hp-thinking .hp-think-text {
  background: linear-gradient(90deg, var(--text-muted) 35%, var(--text) 50%, var(--text-muted) 65%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: hp-think-shimmer 2.2s linear infinite;
}
@keyframes hp-think-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.hp-think-elapsed { font-size: 11px; color: var(--text-muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.hp-think-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.hp-think-sub[hidden] { display: none; }

/* 14) 思考气泡排版：spinner 顶部对齐 + 文本区（正文与秒表同一文本流内换行，安抚副行独占一行） */
.hp-msg.assistant .hp-bubble.hp-thinking {
  display: flex; align-items: flex-start; gap: 9px;
  background: transparent; border: none; padding: 3px 0;
  color: var(--text-soft); max-width: 100%;
}
/* 首行 line-height 固定为 20px，spinner 在这 20px 行高里垂直居中：(20-13)/2=3.5px；
   仍用 flex-start，长文案换行/长等待副行出现时 spinner 依旧贴首行而非整体居中 */
.hp-think-body { flex: 1; min-width: 0; line-height: 20px; }
.hp-thinking .hp-spin-inline { margin-top: 3.5px; }
/* 正文 + 秒表在同一段落里行内流动：长文案自然换行，秒表紧跟末尾，不再各占一行 */
.hp-think-text { display: inline; }
.hp-think-elapsed { white-space: nowrap; }
.hp-think-sub { display: block; }

/* 15) 导出进度卡：底部居中悬浮，品牌渐变进度条 + 秒表 + 提示行 */
.hp-export-progress {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 3000; width: min(420px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
  animation: hp-in 0.2s ease-out;
}
.hp-ep-row { display: flex; align-items: center; gap: 8px; }
.hp-ep-text { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; }
.hp-ep-elapsed { font-size: 11px; color: var(--text-muted); white-space: nowrap; word-break: keep-all; font-variant-numeric: tabular-nums; }
.hp-ep-bar { height: 6px; border-radius: 3px; background: var(--surface-alt); margin-top: 10px; overflow: hidden; }
.hp-ep-fill { height: 100%; width: 4%; border-radius: 3px; background: var(--brand-gradient); transition: width 0.5s ease; }
.hp-ep-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }

/* ── 16. 生成中的「停止」按钮（发送按钮双态） ───────────────
   近黑实底 + 白色圆角方块（ChatGPT 式）。红色警示感太强——停止生成是
   普通操作不是危险操作，深色中性底更符合语义，也不与页面里的错误红混淆。 */
.hp-send.stop { background: #16181D; }
.hp-send.stop:not(:disabled):hover { background: #2B2E36; filter: none; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }

/* ── 17. 全局即时 tooltip（JS 挂 body 顶层，免疫滚动容器裁切与层叠遮挡） ── */
.hp-tip {
  position: fixed; z-index: 3500;
  background: rgba(17, 24, 39, 0.94); color: #fff;
  font-size: 11px; line-height: 1; padding: 6px 9px; border-radius: 6px;
  white-space: nowrap; pointer-events: none;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.18);
  animation: hp-tipfade 0.12s ease-out;
}
.hp-tip::after {
  content: ''; position: absolute; left: var(--tip-ax, 50%); margin-left: -5px;
  border: 5px solid transparent;
}
.hp-tip.above::after { top: 100%; border-top-color: rgba(17, 24, 39, 0.94); }
.hp-tip.below::after { bottom: 100%; border-bottom-color: rgba(17, 24, 39, 0.94); }
@keyframes hp-tipfade { from { opacity: 0; } to { opacity: 1; } }


/* ── 18. 工具栏二级菜单（图片/图表/动画） ─────────────── */
.hp-qe-menu {
  position: absolute; top: calc(100% + 8px); z-index: 55;
  min-width: 180px; background: var(--surface, #fff); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(17, 24, 39, 0.12);
  padding: 6px; animation: hp-tip-in 0.14s ease-out;
}
.hp-qe-menu-head { font-size: 11px; color: var(--text-muted); padding: 6px 10px 4px; }
.hp-qe-menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border: none; background: transparent; border-radius: 8px;
  font-size: 13px; color: var(--text); cursor: pointer; text-align: left; transition: background 0.12s;
}
.hp-qe-menu-item:hover { background: var(--accent-soft); color: var(--accent); }
.hp-qe-menu-item .ic { color: var(--text-muted); flex-shrink: 0; }
.hp-qe-menu-item:hover .ic { color: var(--accent); }
.hp-qe-menu.chart { min-width: 316px; }
.hp-qe-chart-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 2px; }
.hp-qe-chart-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 4px 8px; border: 1px solid transparent; background: transparent; border-radius: 10px;
  font-size: 11.5px; color: var(--text); cursor: pointer; transition: all 0.12s;
}
.hp-qe-chart-item .ic { color: var(--text-muted); }
.hp-qe-chart-item:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.hp-qe-chart-item:hover .ic { color: var(--accent); }

/* ── 19. 真全屏放映：幻灯片顶满屏、隐藏关闭/翻页按钮（键盘方向键翻页、Esc 退出、点击下一页） ── */
.hp-modal:fullscreen { background: #000; padding: 0; gap: 0; }
.hp-modal:fullscreen .hp-modal-frame {
  flex: 0 0 auto;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  max-height: none; border-radius: 0; box-shadow: none;
}
.hp-modal:fullscreen .hp-modal-close,
.hp-modal:fullscreen .hp-modal-nav { display: none; }
.hp-modal-clicklayer { display: none; }
.hp-modal:fullscreen .hp-modal-clicklayer { display: block; position: absolute; inset: 0; cursor: pointer; }

/* ── 20. 导出菜单分组（静态/动态文件） ─────────────── */
.hp-export-dd { min-width: 210px; }
.hp-export-dd .hp-dd-head { font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 7px 12px 3px; }
.hp-export-dd .hp-dd-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.hp-export-dd button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; }
.hp-export-dd button .ic { color: var(--text-muted); flex-shrink: 0; }
.hp-export-dd button:hover .ic { color: var(--accent); }
.hp-beta { margin-left: auto; font-size: 10px; font-weight: 600; color: var(--text-muted); background: var(--surface-alt, #f1f1f4); border: 1px solid var(--border); padding: 2px 7px; border-radius: 999px; }
/* 会员皇冠标识（下载为会员专属）：非会员每个格式右侧显示 */
.hp-dd-crown { display: inline-flex; align-items: center; color: #F5A623; }
/* 皇冠填充金黄（CROWN_SVG 是填充型路径，svg() 助手默认 fill:none 描边会发灰，这里覆盖为实心金色） */
.hp-dd-crown svg { fill: #F5A623; stroke: #F5A623; stroke-width: 1.2; }
.hp-dd-crown.push { margin-left: auto; }

/* 开通会员弹窗 */
.hp-upgrade-card { width: min(400px, 92vw); text-align: center; padding: 30px 26px 26px; }
.hp-upgrade-crown {
  width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FFD86B, #F5A623); color: #fff;
  box-shadow: 0 8px 22px rgba(245, 166, 35, 0.35);
}
.hp-upgrade-title { font-size: 19px; font-weight: 700; margin: 0 0 8px; color: var(--text); }
.hp-upgrade-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; margin: 0 0 24px; }
.hp-upgrade-actions { display: flex; gap: 10px; justify-content: center; }
.hp-upgrade-cancel { padding: 10px 18px; border-radius: 10px; background: var(--surface-alt); color: var(--text-soft); border: none; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.hp-upgrade-cancel:hover { background: var(--border); }
.hp-upgrade-cta { padding: 10px 24px; border-radius: 10px; background: var(--brand-gradient); color: #fff; font-weight: 700; font-size: 13.5px; text-decoration: none; box-shadow: var(--brand-glow); display: inline-flex; align-items: center; }
.hp-upgrade-cta:hover { filter: brightness(1.04); }

/* ── 21. 对话流精修(参照 ChatGPT):过程事件极轻量化、正文呼吸感 ─────── */
/* 事件从"灰底卡片"降为无底色步骤行:小绿勾 + 灰字,退居叙事背景 */
.hp-event { background: transparent; border: none; padding: 1px 0; gap: 8px; align-items: flex-start; font-size: 13px; }
.hp-ev-icon { width: 17px; height: 17px; border-radius: 50%; background: transparent !important; color: var(--done); margin-top: 1px; }
/* 完成态:黑色实心圆 + 白色对勾(ChatGPT 已完成步骤风) */
.hp-ev-icon.done { background: var(--text) !important; color: #fff; }
.hp-ev-icon.done svg { width: 10px; height: 10px; }
.hp-ev-icon.active .hp-spin-inline { width: 12px; height: 12px; border-width: 2px; }
.hp-ev-label { font-weight: 550; color: var(--text-soft); font-size: 13px; }
.hp-ev-detail { color: var(--text-muted); font-size: 12px; margin-top: 1px; line-height: 1.5; }
.hp-ev-count { background: var(--surface-alt); color: var(--text-muted); font-size: 10.5px; padding: 1px 7px; border-radius: 999px; }
.hp-ev-bullets { margin: 4px 0 0; padding-left: 2px; list-style: none; color: var(--text-muted); font-size: 12px; line-height: 1.55; }
.hp-ev-bullets li { position: relative; padding-left: 12px; margin-top: 3px; }
.hp-ev-bullets li::before { content: ''; position: absolute; left: 0; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--border); }
/* 正文与用户气泡:更接近 ChatGPT 的排版密度 */
.hp-msg.assistant .hp-bubble { font-size: 14px; line-height: 1.7; color: var(--text); }
.hp-msg.user .hp-bubble { font-size: 14px; background: var(--surface-alt); border-radius: 18px; border-bottom-right-radius: 6px; }
/* 思考行:纯行内 shimmer,无框无底(ChatGPT "Thinking…" 风) */
.hp-msg.assistant .hp-bubble.hp-thinking { background: transparent; border: none; padding: 2px 0; }
/* 事件之间的节奏收紧 */
.hp-event + .hp-event { margin-top: 2px; }

/* ── 22. 积分不足的「去充值」按钮(聊天流内) ── */
.hp-recharge-btn {
  display: inline-flex; align-items: center; margin-top: 8px; padding: 6px 16px;
  background: var(--brand-gradient, var(--accent)); color: #fff !important;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; text-decoration: none;
}
.hp-recharge-btn:hover { filter: brightness(1.08); }
/* 积分不足卡片（聊天流内，仿钱包插画版式）*/
.hp-points-card {
  margin-top: 6px; padding: 20px 18px 16px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--surface); text-align: center;
  box-shadow: 0 4px 16px rgba(20, 20, 50, 0.05);
}
.hp-points-illus { line-height: 0; margin-bottom: 8px; }
.hp-points-illus svg { display: inline-block; }
.hp-points-title { font-size: 15px; font-weight: 700; color: var(--text); }
.hp-points-desc { margin-top: 4px; font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.hp-points-cta {
  display: inline-flex; align-items: center; justify-content: center; margin-top: 14px;
  padding: 9px 22px; border-radius: 999px; background: var(--brand-gradient, var(--accent));
  color: #fff !important; font-size: 13px; font-weight: 700; text-decoration: none;
}
.hp-points-cta:hover { filter: brightness(1.08); }
/* 一次性充值报价按钮（蓝色，带「仅此一次」角标）*/
.hp-points-cta-wrap { position: relative; display: inline-block; margin-top: 16px; }
.hp-points-cta.blue {
  margin-top: 0; padding: 11px 26px; border-radius: 12px;
  background: linear-gradient(180deg, #5AA0FF 0%, #2F6BE0 100%);
  font-size: 14px; box-shadow: 0 5px 14px rgba(47, 107, 224, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.hp-points-cta.blue:hover { filter: brightness(1.05); }
.hp-points-once {
  position: absolute; top: -11px; right: -13px; transform: rotate(7deg);
  background: #FFE0B8; color: #B85C08; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 10px 10px 10px 2px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.09); white-space: nowrap;
}
.hp-points-plans { display: block; margin-top: 14px; font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
.hp-points-plans:hover { text-decoration: underline; }

/* ── 24. 进度卡执行轨迹（脱敏宏观步骤）─────────── */
.hp-prog-trace {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 3px;
}
.hp-trace-line { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; overflow-wrap: anywhere; }
.hp-trace-line.latest {
  color: var(--text-soft);
  background: linear-gradient(90deg, var(--text-soft) 30%, var(--accent) 50%, var(--text-soft) 70%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: hp-think-shimmer 2.2s linear infinite;
}

/* ── 25. 对话附件 + 输入框自动增高 ─────────── */
#hp-input { resize: none; overflow-y: auto; max-height: 160px; }
.hp-attach {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.hp-attach:hover { background: var(--surface-alt); color: var(--text); }
.hp-att-chip[hidden] { display: none; } /* display:inline-flex 会压过 hidden 属性的 UA 规则,必须显式补回 */
/* 卡片式附件(与首页一致):类型图标 + 名称 + 类型·大小 + 圆形× */
.hp-att-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  margin: 2px 2px 8px; padding: 8px 30px 8px 8px; max-width: 100%;
  border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); box-shadow: 0 1px 3px rgba(20,20,50,0.05);
}
.hp-att-chip .hp-att-ico {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #EF5B3C; color: #fff; font-weight: 700; font-size: 13px;
}
.hp-att-chip .hp-att-ico.pdf { background: #E03A3A; }
.hp-att-chip .hp-att-ico.doc { background: #2B6CE8; }
.hp-att-chip .hp-att-ico.txt { background: #6B7280; }
.hp-att-chip .hp-att-ico.loading { background: var(--surface-alt); }
.hp-att-chip .hp-att-spin { width: 17px; height: 17px; border-radius: 50%; border: 2.2px solid var(--border); border-top-color: var(--accent); animation: hp-spin 0.7s linear infinite; }
.hp-att-chip .hp-att-info { min-width: 0; }
.hp-att-chip .hp-att-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.hp-att-chip .hp-att-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.hp-att-remove {
  position: absolute; top: 7px; right: 7px;
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: rgba(0,0,0,0.06); color: var(--text-muted);
  font-size: 14px; line-height: 1; cursor: pointer; padding: 0; flex-shrink: 0;
}
.hp-att-remove:hover { background: rgba(0,0,0,0.12); color: var(--text); }
.hp-msg-att {
  display: flex; width: fit-content; align-items: center; gap: 5px; margin: 0 0 6px;
  padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,0.06);
  font-size: 11.5px; color: var(--text-muted); max-width: 100%;
}
.hp-msg-att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 26. 快捷编辑:上传图预览卡 ─────────── */
.qe-imgprev {
  position: relative; margin: 2px 0 10px; border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; background: var(--surface-alt);
  display: flex; align-items: center; justify-content: center; max-height: 160px;
}
.qe-imgprev img { max-width: 100%; max-height: 160px; object-fit: contain; display: block; }
.qe-imgprev-x {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff;
  font-size: 14px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.qe-imgprev-x:hover { background: rgba(0,0,0,0.75); }

/* ── 27. 缩略图拖拽重排反馈 ─────────── */
.hp-film-item[draggable="true"] { cursor: grab; }
.hp-film-item.dragging { opacity: 0.45; cursor: grabbing; }
.hp-film-item.dragover { outline: 2px solid var(--accent); outline-offset: 2px; }
.hp-film-item.dragover .hp-film-thumb { box-shadow: 0 0 0 2px var(--accent-glow); }

/* ── 28. 全屏预览相邻页预热(离屏隐藏,仅为暖浏览器缓存) ─────────── */
.hp-modal-preload { position: absolute; width: 0; height: 0; overflow: hidden; opacity: 0; pointer-events: none; left: -9999px; }
.hp-modal-preload iframe { width: 1280px; height: 720px; border: 0; }

/* ── 29. 问卷「跳过,AI 自动决定」按钮 ─────────── */
.hp-q-skip-row { margin-top: 22px; display: flex; justify-content: center; }
.hp-q-skip {
  padding: 10px 22px; font-size: 14px; font-weight: 550;
  color: var(--text-soft); background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.hp-q-skip:hover:not(:disabled) { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-glow); }
.hp-q-skip:disabled { opacity: 0.5; cursor: default; }

/* ── 升级套餐弹窗（复用 /home 的 .expenses-alter 组件）───────────────
   这些规则原本在 styles/desk/master.css 里，而本页是独立 SPA、不加载那张表，
   故把弹窗外壳的必要样式搬过来（套餐卡片本身的样式来自 pricing.css）。 */

/* pricing 组件是按主站环境写的，依赖 Bootstrap 的 flex 工具类；本页没引 Bootstrap，
   套餐卡片会散架成竖排。只补它实际用到的 8 个类，比为此引入整个 Bootstrap 划算。 */
.expenses-alter .d-flex { display: flex; }
.expenses-alter .d-none { display: none; }
.expenses-alter .justify-content-center { justify-content: center; }
.expenses-alter .justify-content-between { justify-content: space-between; }
.expenses-alter .align-items-center { align-items: center; }
.expenses-alter .align-items-baseline { align-items: baseline; }
.expenses-alter .text-center { text-align: center; }
.expenses-alter .font-weight-bold { font-weight: 700; }
.expenses-alter {
  position: fixed; inset: 0; z-index: 400;
  display: flex; padding: 20px 10px;
  background-color: rgba(0, 0, 0, 0.5);
}
.expenses-alter.d-none { display: none; }
.expenses-content {
  position: relative; width: 100%; max-width: 1100px; max-height: 100%;
  overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none;
  padding: 30px; margin: auto; border-radius: 10px; background-color: #fff;
}
.expenses-content::-webkit-scrollbar { display: none; }
.expenses-content .close { position: absolute; top: 18px; right: 18px; width: 26px; cursor: pointer; }
.expenses-content .advantage { gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.expenses-content .advantage .item { color: rgba(0,0,0,0.75); padding-right: 20px; border-right: 1px solid #DEDFE5; }
.expenses-content .advantage .item:last-child { padding-right: 0; border: unset; }
.expenses-content .advantage .icon { width: 20px; margin-right: 6px; }
.expenses-content .subscription { margin-top: 14px; font-size: 13px; color: rgba(0,0,0,0.5); }
@media (max-width: 860px) {
  .expenses-content { padding: 20px 12px; }
  .expenses-content .advantage { gap: 10px; font-size: 12px; }
  .expenses-content .advantage .item { padding-right: 10px; }
}

/* SPA 内的升级弹窗要一屏放下：pricing.css 是按整页 /pricing 写的（48px 标题、40px 间距），
   放进弹窗里过高需滚动。这里整体收紧字号/间距（仅本页 app.css 生效，不影响 /pricing 与 /home）。 */
.expenses-content { padding: 22px; }
.expenses-alter #expenses .title { font-size: 24px; }
.expenses-alter #expenses .controls { gap: 10px; margin-top: 14px; }
.expenses-alter #expenses .currency-switch .currency-current { padding: 7px 12px; min-width: 76px; font-size: 13px; }
.expenses-alter #expenses .currency-switch .currency-menu { max-height: 200px; }
.expenses-alter #expenses .switch .item { padding: 7px 16px; line-height: 18px; }
.expenses-alter #expenses .list { margin-top: 18px; gap: 16px; }
.expenses-alter #expenses .list .item { padding: 16px; }
.expenses-alter #expenses .list .item:hover { top: 0; }
.expenses-alter #expenses .list .name { font-size: 16px; line-height: 20px; }
.expenses-alter #expenses .list .introduce { font-size: 13px; margin-top: 4px; }
.expenses-alter #expenses .list .price { margin-top: 6px; }
.expenses-alter #expenses .list .price .amount { font-size: 26px; }
.expenses-alter #expenses .list .price .time { font-size: 15px; }
.expenses-alter #expenses .list .button { padding: 10px 0; margin-top: 14px; }
.expenses-alter #expenses .list .detail { margin-top: 14px; padding-top: 14px; }
.expenses-alter #expenses .list .subtitle { font-size: 14px; margin-bottom: 8px; }
.expenses-alter #expenses .list .rule { margin-bottom: 8px; }
.expenses-alter #expenses .list .rule .text { font-size: 13px; }
.expenses-content .advantage { margin-top: 12px; }
.expenses-content .subscription { margin-top: 8px; }

/* ── 30. 手机端触达面积（放在文件末尾，确保不被前面任何规则覆盖）───────
   走查发现桌面尺寸的图标按钮在手机上普遍只有 26–34px，明显低于可用性下限
   （Apple HIG 建议 44px，Material 48px），手指容易点不中。这里统一抬到 40px 上下：
   既显著改善点击成功率，又不至于把窄屏顶栏/工具条挤爆（已实测各阶段布局不溢出）。 */
@media (max-width: 860px) {
  .hp-home { width: 40px; height: 40px; }
  .hp-icon-btn { width: 40px; height: 40px; }
  .hp-send { width: 40px; height: 40px; }
  .hp-attach { width: 40px; height: 40px; }
  .hp-tb-btn { width: 40px; height: 40px; }
  .hp-pager-nav { width: 38px; height: 38px; }
  .hp-ol-regen { width: 34px; height: 34px; }
  /* 输入类同样抬高，便于点选与输入 */
  .hp-other-input { height: 40px; }

  /* 大纲行（手机）：
     ① layout 技术标签(cover/problem/…)在 375 宽下要吃掉约 80px，导致标题与要点被截断，
        且这些英文枚举对用户没有阅读价值 —— 窄屏直接隐藏，把宽度全部还给正文；
     ② 拖拽手柄与「单页重写」按钮原本靠 :hover 浮现，触屏没有 hover ⇒ 永远不可见（可用性 bug），
        窄屏改为常显（降低对比度，不喧宾夺主）；
     ③ 要点框放宽到 3 行起，减少滚动条出现；
     ④ 列表底部留白，最后一页不被底部 CTA 条压住。 */
  /* 面板左右内边距：桌面 32px 在 375 宽下要吃掉 64px（标题输入框只剩 161px），统一收到 10px；
     叠加 host 的 12px 后总边距 22px，手机上观感合适，正文可用宽度显著增加。 */
  .hp-panel { padding-left: 10px; padding-right: 10px; }

  /* 顶栏控件：原「控件」弹层里如今只剩语言切换，滑块图标语义不符且要点两次才能改语言。
     隐藏该按钮与弹层，由 placeControls 把语言按钮直接内联到顶栏（地球图标，一次点开语言列表）。 */
  .hp-ctrl-btn, .hp-ctrl-pop { display: none; }
  .hp-lang-btn { width: 40px; height: 40px; }

  /* 顶部占位收紧：标题两行 + 提示条三行原本吃掉约 350px，正文可见区被压缩 */
  .hp-panel h1 { font-size: 19px; margin-bottom: 14px; }
  .hp-panel-sub { margin: -8px 0 14px; }

  .hp-outline-row .layout { display: none; }
  .hp-ol-grip, .hp-ol-regen { opacity: 0.55; }
  .hp-outline-row:hover .hp-ol-grip, .hp-outline-row:hover .hp-ol-regen { opacity: 1; }
  .hp-ol-msg { min-height: 3.6em; }
  .hp-outline-list { padding-bottom: 96px; }

  /* 全屏预览（手机）：原本左右箭头作为 flex 项各占 40px + gap，把画面挤到只有 263px，
     比普通视图(339px)还小，失去"全屏"意义。改为绝对定位叠在画面上，画面吃满可用宽度。 */
  .hp-modal { gap: 0; padding: 0 8px; }
  .hp-modal-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; background: rgba(255, 255, 255, 0.24); }
  .hp-modal-nav:hover { background: rgba(255, 255, 255, 0.36); }
  .hp-modal-nav.prev { left: 10px; }
  .hp-modal-nav.next { right: 10px; }
}

/* ── 大纲「可操作感」强化 ────────────────────────────────────────────────
   问题：改字/拖序/重写三种能力全藏在 hover 之后（grip 与 regen 的 opacity 为 0），
   一眼看去就是一段只读文本，用户根本不知道能直接编辑。
   做法：① 顶部用图例把三种操作摆到明面；② 手柄与重写按钮常驻（弱显，悬停转实）；
        ③ 悬停整行时输入框显出边框与底色，直白地"变成"表单；④ 拖拽给出插入位置指示。
   置于文件末尾，避免被前面同名规则覆盖。 */
.hp-ol-legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  margin-bottom: 14px; padding: 9px 12px;
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: 10px;
}
.hp-ol-lg-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.hp-ol-lg-item {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 3px 10px 3px 8px; white-space: nowrap;
}
.hp-ol-lg-item svg { flex-shrink: 0; opacity: .75; }
.hp-ol-lg-grip { font-size: 12px; line-height: 1; letter-spacing: -1px; opacity: .75; }
.hp-ol-lg-note {
  font-size: 11.5px; color: var(--text-muted); line-height: 1.5;
  flex: 1 1 240px; min-width: 0;
}

/* 拖拽手柄：做成贯穿整行的竖向导轨，常驻可见。原来是一个悬停才出现、垂直方向还和
   序号错位的小点阵，既扫不到也不像"能抓的东西"。 */
.hp-outline-row.editable { align-items: stretch; }
.hp-ol-grip {
  align-self: stretch; display: flex; align-items: center; justify-content: center;
  width: 16px; flex-shrink: 0; margin-left: -4px; padding: 0;
  border-radius: 6px; letter-spacing: -1px; opacity: .5;
  color: var(--text-muted); background: transparent;
  transition: opacity .12s, color .12s, background .12s;
}
.hp-outline-row:hover .hp-ol-grip { opacity: 1; color: var(--text-soft); background: var(--surface); }

/* 重写按钮：边框常驻（不再靠透明度藏起来），一眼就是个可点的按钮 */
.hp-ol-regen {
  align-self: center; opacity: .8;
  transition: opacity .12s, color .12s, background .12s, border-color .12s;
}
.hp-outline-row:hover .hp-ol-regen { opacity: 1; color: var(--text); background: var(--surface); }

/* 序号与标题同一基线：行改成 stretch 后要把这两块顶到上边 */
.hp-outline-row .num { align-self: flex-start; padding-top: 5px; }
.hp-outline-text { align-self: flex-start; }
.hp-outline-row .layout { align-self: flex-start; margin-top: 5px; }

/* 整行悬停：左侧强调条，明确"这是一个可以抓起来的对象" */
.hp-outline-row { position: relative; }
.hp-outline-row.editable::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px;
  border-radius: 2px; background: var(--accent); opacity: 0; transition: opacity .12s;
}
.hp-outline-row.editable:hover::before { opacity: .55; }

/* 输入框：静止态就长得像输入框（白底 + 浅边），不必等 hover。
   页面底色是 #F9F9F9，白底方框本身就是最直白的"这里能打字"信号。 */
.hp-ol-title, .hp-ol-msg {
  cursor: text; caret-color: var(--accent);
  background: var(--surface); border-color: var(--border);
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.hp-outline-row:hover .hp-ol-title, .hp-outline-row:hover .hp-ol-msg {
  border-color: #DEDEE2;
}
.hp-ol-title:focus, .hp-ol-msg:focus {
  border-color: var(--accent) !important; background: var(--surface) !important;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.hp-ol-title::placeholder, .hp-ol-msg::placeholder { color: var(--text-muted); opacity: .6; }

/* 拖拽：被拖的行淡出并抬起，落点行给一条清晰的插入指示线 */
.hp-outline-row.editable.dragging {
  opacity: .5; background: var(--surface); box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}
.hp-outline-row.editable.dragover {
  background: var(--surface-alt);
  box-shadow: inset 0 2px 0 0 var(--accent);
  border-color: transparent;
}

@media (max-width: 768px) {
  /* 触屏没有 hover：输入框与操作按钮直接常显，否则移动端完全看不出可编辑 */
  .hp-ol-legend { gap: 6px 10px; padding: 8px 10px; margin-bottom: 12px; }
  .hp-ol-lg-item { font-size: 11px; padding: 3px 9px 3px 7px; }
  .hp-ol-lg-note { flex-basis: 100%; font-size: 11px; }
  .hp-ol-grip, .hp-ol-regen { opacity: .9; }
  .hp-outline-row.editable::before { opacity: .35; }
}

/* 要点框由 JS 按内容撑高（olGrow），移动端不再需要固定 min-height；
   保留 rows=2 作为空态下限即可，避免空框占三行。 */
@media (max-width: 768px) {
  .hp-ol-msg { min-height: 0; }
}

/* ── 模板面板：官方 / 我的 页签 ────────────────────────────────
   放在文件末尾：此前多次遇到「规则写在前面被后面的顶层规则盖掉」的问题。 */
.hp-tpl-tabs { display: flex; gap: 8px; margin: 2px 0 14px; }
.hp-tpl-tab {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text-muted);
  padding: 7px 15px; border-radius: var(--radius-pill); cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.hp-tpl-tab:hover { color: var(--text-soft); border-color: var(--text-muted); }
/* 选中态刻意用「次级强调」而非主 CTA 的品牌渐变/紫实色：这一屏的主动作是
   「选一张卡 → 点生成幻灯片」，页签只是切换视图，不该与底部主 CTA 争注意力。
   这组 token 与右上角语言切换的激活态(.hp-lang-item.active)同源，全站语汇统一。 */
.hp-tpl-tab.active { color: var(--accent-deep); border-color: transparent; background: var(--accent-soft); }
.hp-tpl-tab-n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700;
  background: var(--surface-alt); color: var(--text-muted);
}
.hp-tpl-tab.active .hp-tpl-tab-n { background: rgba(70, 45, 225, 0.14); color: var(--accent-deep); }
.hp-tpl-empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 34px 16px; text-align: center;
  font-size: 13px; color: var(--text-muted); line-height: 1.6;
}
/* 空态里的「去添加模板」是这个页签下唯一的可行动作，用主 CTA 的品牌渐变 */
.hp-tpl-empty-btn {
  display: inline-block; padding: 8px 18px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600; color: #fff; text-decoration: none;
  background: var(--brand-gradient); box-shadow: var(--brand-glow);
}
.hp-tpl-empty-btn:hover { filter: brightness(1.06); }
@media (max-width: 768px) {
  .hp-tpl-tabs { margin: 2px 0 10px; }
  .hp-tpl-tab { font-size: 12px; padding: 6px 13px; }
}

/* ── 大纲行再迭代：双输入框合并为单卡片 ────────────────────────────
   之前每行是「标题框 + 要点框」两个常驻描边的盒子，8 页就是 16 个方框，
   整屏表单感过重；layout 标签与重写按钮又悬在行中大片空白右侧，和内容脱节。
   合并为一页一卡：卡片是唯一边界，行内文字静止时呈文本态（hover 淡底、聚焦整卡
   高亮），标签与按钮对齐到标题行。置于文件末尾覆盖前面各轮同名规则。 */
.hp-outline-list { gap: 10px; }
.hp-outline-row {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px 12px 8px;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.hp-outline-row:hover { background: var(--surface); border-color: #D8D8DE; box-shadow: 0 2px 10px rgba(0, 0, 0, .04); }
/* 聚焦哪张卡，哪张卡整体亮起：编辑边界一目了然，行内不再各自描边发光 */
.hp-outline-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.hp-outline-row.editable::before { left: -1px; top: 10px; bottom: 10px; }

.hp-ol-title, .hp-ol-msg { background: transparent; border-color: transparent; }
.hp-outline-row:hover .hp-ol-title, .hp-outline-row:hover .hp-ol-msg { border-color: transparent; background: transparent; }
.hp-ol-title:hover, .hp-ol-msg:hover { background: var(--surface-alt); border-color: transparent; }
.hp-ol-title:focus, .hp-ol-msg:focus {
  border-color: transparent !important; background: var(--surface-alt) !important; box-shadow: none;
}

/* layout 标签与重写按钮：都对齐到标题行，不再吊在行高中央 */
.hp-outline-row .layout {
  align-self: flex-start; margin-top: 6px; opacity: .7;
  background: var(--surface-alt); border-color: transparent; border-radius: var(--radius-pill);
  padding: 2px 9px; font-size: 10px; letter-spacing: .02em;
}
.hp-ol-regen { align-self: flex-start; margin-top: 3px; }

/* 顶部提示：从描边灰盒降级为一行说明文字，减少页面上的「框」 */
.hp-ol-legend { background: transparent; border: none; border-radius: 0; padding: 0 2px; margin-bottom: 16px; }
.hp-ol-lg-note { font-size: 12px; }

/* 卡片自带留白，拖拽指示线改在卡片边缘也依旧清晰 */
.hp-outline-row.editable.dragover {
  background: var(--surface-alt); border-color: var(--accent); box-shadow: inset 0 2px 0 0 var(--accent);
}
@media (max-width: 768px) {
  .hp-outline-row { padding: 11px 12px 11px 6px; }
}

/* ── 输入框上方的「积分不足」驻留卡 ──────────────────────────────
   白底 + 近黑描边为主体（黑框卡）：黑字标题 + 灰字说明 + 近黑胶囊 CTA
   （与生成中的停止按钮同一深色语言）。余额不够就一直驻留（渲染处按
   S.points 自检撤卡），与普通错误条的 6s 自动消失不同。 */
.hp-chat-error.points {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: var(--surface); border: 1.5px solid #16181D; color: var(--text);
  border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.hp-cep-title { font-size: 14px; font-weight: 700; color: var(--text); }
.hp-cep-desc { font-size: 12px; color: var(--text-muted); line-height: 1.55; }
.hp-cep-cta {
  margin-top: 8px; padding: 7px 16px; border-radius: var(--radius-pill);
  font-size: 12.5px; font-weight: 650; color: #fff; text-decoration: none;
  background: #16181D;
}
.hp-cep-cta:hover { background: #2B2E36; }

/* ── 更换模板弹层（done 态工具栏入口）────────────────────────────
   复用模板网格与卡片样式，弹层只做壳：标题 + 页签 + 网格滚动区 + 覆盖警告 + 主 CTA */
.hp-tb-retheme { display: inline-flex; align-items: center; gap: 6px; }
.hp-rt-mask {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(15, 15, 26, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.hp-rt-card {
  width: min(720px, 94vw); max-height: 86vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 16px; padding: 18px 20px 16px;
  box-shadow: 0 20px 60px rgba(20, 20, 50, 0.28);
}
.hp-rt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.hp-rt-title { font-size: 16px; font-weight: 700; color: var(--text); }
.hp-rt-x {
  display: inline-flex; padding: 6px; border-radius: 8px;
  color: var(--text-muted); background: transparent; border: none; cursor: pointer;
}
.hp-rt-x:hover { background: var(--surface-alt); color: var(--text); }
.hp-rt-card .hp-tpl-scroll { flex: 1 1 auto; min-height: 200px; }
.hp-rt-warn { font-size: 12px; color: var(--text-muted); line-height: 1.55; margin: 10px 2px 10px; }
.hp-rt-apply {
  align-self: stretch; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 650; color: #fff;
  background: var(--brand-gradient); box-shadow: var(--brand-glow); border: none; cursor: pointer;
}
.hp-rt-apply:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.hp-rt-apply:not(:disabled):hover { filter: brightness(1.06); }
@media (max-width: 768px) {
  .hp-rt-card { padding: 14px; }
  /* 换模板已在 ≤1100px 独占一行，不再藏文字 */
}

/* ── 工具栏与舞台的间隙 ──────────────────────────────────────────
   图标条底边原与舞台顶边完全贴合（实测同为 128px），「更换模板」按钮离舞台仅 9px，
   视觉上粘在页面上。留出 10px 缓冲；按钮与图标条顶线对齐，不再吊在行中偏下。 */
.hp-toolbar { padding-bottom: 10px; }
.hp-tb-retheme { align-self: flex-start; margin-top: 4px; }

/* swal2弹窗样式 */
.swal2-popup {
	width: 416px !important;
	font-size: 13px !important;
	padding: 26px !important;
	border-radius: 10px;
}
.swal2-confirm {
	    background: linear-gradient(90deg, #9963FF 0%, #2664FF 100%) !important;
}
.swal2-loader {
	border-color: #5764FF rgba(0, 0, 0, 0) #5764FF rgba(0, 0, 0, 0);
}
@media (max-width: 576px) {
	.swal2-popup {
		width: 340px !important;
	}
}
@media (max-width: 1100px) {
    /* 平板起：工具栏改为纵向，快捷图标一行、「切换模板」独占下一行，避免挤没文字 */
    .hp-toolbar {
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      min-height: 0;
      gap: 8px;
    }
    .hp-toolbar .hp-tb-group { position: static; transform: none; }
    .hp-tb-spacer { display: none; }
    .hp-tb-retheme { align-self: center; margin-top: 0; }
  }

/* 后台只读预览：输入区改为提示条 */
.hp-admin-ro-foot {
  padding: 12px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.hp-admin-ro-tip {
  font-size: 12px;
  line-height: 1.45;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 10px 12px;
}
body.hp-admin-readonly .hp-rail-new { display: none; }
