/* ===================================================================
 * Parallel Me — 干花薰衣草版
 * 浅紫纸底 + 干薰衣草紫 + 深茄黑墨字
 * -------------------------------------------------------------------
 * 目录(按行号跳转):
 *   :root tokens .................. L7
 *   装饰层 grain/vignette ........... L80
 *   顶栏 topbar .................... L95
 *   视图通用 view/section ........... L200
 *   1 · 输入 input view ............. L261
 *   按钮 buttons ................... L408
 *   2 · 决策建模 model view ......... L464
 *   3 · 分支地图 map view ........... L524
 *   4 · 剧场详情 detail view ........ L645
 *     ├─ 卡片 card ................ L736
 *     ├─ 时间线 timeline ........... (在 detail 内)
 *     ├─ 评分 / 滑块 .............. (在 detail 内)
 *     └─ 对话 chat ................ (在 detail 内)
 *   5 · 行动计划 action view ........ L1119
 *   Toast .......................... L1150
 *   抽屉 drawer .................... L1175
 *   抽屉二级分组(备份) ............ L1278
 *   历史列表 ........................ L1298
 *   图片下载按钮 .................... L1384
 *   加载层 loader ................... L1413
 *   滚动条 ......................... L1583
 *   动画 / 响应式 ................... L1592 / L1602
 *   空状态 / chat loading ........... L1634
 *   后续追加(L1695+)
 *
 * 取色偏低饱和、偏暖,避免发光发亮的科技 AI 紫
 * ================================================================= */

:root {
  /* 纸面 — 带一点紫调的米纸,而不是冷紫白 */
  --bg-0: #f1ecf3;       /* 整页底色,薰衣草纸 */
  --bg-1: #faf6fb;       /* 卡片底,温润紫白 */
  --bg-2: #ece4f0;       /* 第二层 */
  --bg-3: #ddd1e4;       /* 抬高/输入框 */
  --bg-warm: #f3ebf5;

  /* 字色:深茄墨,而非纯黑或冷蓝紫 */
  --ink: #28203a;
  --ink-soft: #524466;
  --ink-dim: #877a99;
  --ink-faint: #b3a8c4;

  /* 主色 — 干薰衣草紫,不是霓虹紫 */
  --lilac: #8e72b3;          /* 主调,dusty lavender */
  --lilac-deep: #6d558f;     /* 深一档 */
  --lilac-soft: #c8b6dd;     /* 浅 */
  --lilac-bg: #ebe2f2;       /* 极浅,做底 */
  --lilac-line: #d3c4e2;
  --lilac-faint: rgba(142, 114, 179, 0.12);

  /* 中性边线 — 紫纸的纹理感 */
  --line: #e1d8ea;
  --line-soft: #ebe4f0;
  --line-strong: #d1c4dc;

  /* 状态色 — 与浅紫底协调,降一档饱和 */
  --warm: #b07c4a;           /* 提醒(暖琥珀,偏棕) */
  --danger: #ad5276;         /* 玫紫,与主调同源 */
  --ok: #6f8a82;             /* 灰青,低饱和 */

  --warm-soft: rgba(176, 124, 74, 0.14);
  --danger-soft: rgba(173, 82, 118, 0.14);
  --ok-soft: rgba(111, 138, 130, 0.14);

  --shadow-sm: 0 1px 2px rgba(50, 35, 75, 0.04);
  --shadow:    0 6px 20px rgba(70, 50, 100, 0.08);
  --shadow-lg: 0 16px 40px rgba(70, 50, 100, 0.12);

  --radius: 12px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  /* 字体 — 系统亲和 + 一个可选衬线点缀 */
  --sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
  --serif:
    "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong",
    "Times New Roman", Georgia, serif;
  --mono:
    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  letter-spacing: 0;
}

::selection { background: var(--lilac-soft); color: var(--ink); }

/* ============ 装饰层:极淡的氛围(不抢戏) ============ */
.grain {
  display: none;             /* 浅色版不需要颗粒 */
}
.vignette {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 18% 10%, rgba(190, 165, 215, 0.16), transparent 55%),
    radial-gradient(ellipse 80% 60% at 88% 92%, rgba(210, 190, 225, 0.18), transparent 60%);
}

main, .topbar { position: relative; z-index: 1; }

/* ============ 顶栏 ============ */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 36px;
  border-bottom: 1px solid var(--line);
  background: rgba(241, 236, 243, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--lilac);
  border-radius: 50%;
  animation: none;
  box-shadow: 0 0 0 4px var(--lilac-faint);
}
.brand-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.brand-sub {
  color: var(--ink-dim);
  font-size: 13px;
  letter-spacing: 0;
  font-weight: 400;
}

.steps {
  display: flex;
  gap: 24px;
  font-size: 13.5px;
  color: var(--ink-dim);
}
.steps .step {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.25s ease;
  position: relative;
}
.steps .step em {
  font-style: normal;
  font-size: 13.5px;
}
.steps .step:hover { color: var(--ink-soft); }
.steps .step.done { color: var(--ink-faint); }
.steps .step.current { color: var(--lilac-deep); font-weight: 500; }
.steps .step.current::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -7px;
  height: 2px;
  background: var(--lilac);
  border-radius: 1px;
}

.topbar-right { display: flex; gap: 8px; align-items: center; justify-self: end; }
.ai-badge {
  font-size: 8px;
  color: var(--ink-faint);
  margin-right: 4px;
  user-select: none;
  filter: none;
}
.ai-badge.loading { color: var(--warm); animation: blink 1.2s ease-in-out infinite; filter: none; }
.ai-badge.ok { color: var(--ok); filter: none; }
.ai-badge.error { color: var(--danger); filter: none; }
.ai-badge.off { color: var(--ink-faint); filter: none; }
@keyframes blink { 50% { opacity: 0.3; } }

.reset-btn {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0;
  transition: 0.2s;
}
.reset-btn:hover {
  border-color: var(--lilac);
  color: var(--lilac-deep);
  background: var(--lilac-faint);
}

/* ============ 视图通用 ============ */
.view {
  padding: 64px 36px 88px;
  min-height: calc(100vh - 70px);
  position: relative;
}
.hidden { display: none !important; }

.container { max-width: 1080px; margin: 0 auto; }

/* 幕标 — 改得朴素一点 */
.act-mark {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--lilac-deep);
  text-align: center;
  margin: 0 0 14px;
  text-transform: uppercase;
  opacity: 0.85;
}
.act-mark::before, .act-mark::after {
  content: ' · ';
  color: var(--lilac-soft);
  letter-spacing: 0;
}

.view-title {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-align: center;
  margin: 0 0 12px;
  line-height: 1.25;
  color: var(--ink);
}
.view-title em {
  font-style: normal;
  color: var(--lilac-deep);
  padding: 0 2px;
}
.view-sub {
  color: var(--ink-soft);
  text-align: center;
  margin: 0 auto 48px;
  max-width: 580px;
  font-size: 14.5px;
  line-height: 1.7;
}
.view-sub em {
  color: var(--warm);
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.hint {
  color: var(--ink-dim);
  font-size: 13px;
}

/* ============ 1. 序幕 / 输入 ============ */
.view-input {
  display: flex; align-items: center; justify-content: center;
  padding-top: 56px;
}

.hero {
  width: 100%;
  max-width: 720px;
  text-align: center;
  animation: rise 0.7s cubic-bezier(0.16, 0.84, 0.3, 1) both;
}
@keyframes rise {
  0%   { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--lilac-deep);
  margin: 0 0 24px;
  text-transform: uppercase;
}
.hero-eyebrow .rule {
  display: inline-block;
  width: 40px; height: 1px;
  background: var(--lilac-line);
  vertical-align: middle;
}

.hero-tag {
  font-family: var(--sans);
  font-style: normal;
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0 0 16px;
  letter-spacing: 0;
}

.hero-title {
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 500;
  margin: 0 0 44px;
  letter-spacing: -0.005em;
  line-height: 1.2;
  color: var(--ink);
}
.hero-title em {
  font-style: normal;
  color: var(--lilac-deep);
  padding: 0 2px;
}

.input-wrap {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 26px 20px;
  text-align: left;
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow);
}
.input-wrap::before, .input-wrap::after { display: none; }
.input-wrap:focus-within {
  border-color: var(--lilac);
  box-shadow: 0 0 0 4px var(--lilac-faint), var(--shadow);
}

.decision-input {
  width: 100%;
  background: transparent;
  border: 0;
  resize: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  outline: none;
  margin-bottom: 14px;
  letter-spacing: 0;
}
.decision-input::placeholder {
  color: var(--ink-faint);
  font-style: normal;
  font-family: var(--sans);
}

.input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
  margin-top: 4px;
}
.suggestions {
  display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center;
}
.suggest-label {
  color: var(--ink-dim);
  font-family: var(--sans);
  font-style: normal;
  font-size: 12.5px;
  letter-spacing: 0;
  margin-right: 4px;
}
.chip {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0;
  transition: 0.18s;
  transform: none;
}
.chip:hover {
  border-color: var(--lilac);
  color: var(--lilac-deep);
  background: var(--lilac-bg);
  transform: none;
}

.hero-foot {
  margin-top: 32px;
  color: var(--ink-dim);
  font-family: var(--sans);
  font-style: normal;
  font-size: 12.5px;
  letter-spacing: 0;
}

/* ============ 按钮 ============ */
.primary-btn {
  position: relative;
  background: var(--lilac);
  color: #fff;
  border: 0;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s ease;
  box-shadow: 0 4px 14px rgba(142, 114, 179, 0.22);
}
.primary-btn::before { display: none; }
.primary-btn:hover {
  background: var(--lilac-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(142, 114, 179, 0.32);
}
.primary-btn:active { transform: translateY(0); }
.btn-arrow { transition: transform 0.2s; }
.primary-btn:hover .btn-arrow { transform: translateX(3px); }

.ghost-btn {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 13.5px;
  letter-spacing: 0;
  cursor: pointer;
  transition: 0.2s;
}
.ghost-btn:hover {
  border-color: var(--lilac);
  color: var(--lilac-deep);
  background: var(--lilac-bg);
}

.action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 40px;
  flex-wrap: wrap;
}

/* ============ 2. 决策建模 — 雷达 ============ */
.radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.radar-cell {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  animation: rise 0.5s ease both;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: var(--shadow-sm);
}
.radar-cell::before {
  content: '';
  position: absolute;
  left: 0; top: 18px; bottom: 18px;
  width: 3px;
  background: var(--lilac);
  border-radius: 2px;
}
.radar-cell:nth-child(1)::before { background: var(--lilac); }
.radar-cell:nth-child(2)::before { background: #b294d4; }
.radar-cell:nth-child(3)::before { background: var(--warm); }
.radar-cell:nth-child(4)::before { background: #7c5fa3; }
.radar-cell:nth-child(5)::before { background: var(--danger); }
.radar-cell:nth-child(6)::before { background: var(--ok); }

.radar-cell:hover {
  transform: translateY(-2px);
  border-color: var(--lilac-line);
  box-shadow: var(--shadow);
}
.radar-cell:nth-child(1) { animation-delay: 0.04s; }
.radar-cell:nth-child(2) { animation-delay: 0.10s; }
.radar-cell:nth-child(3) { animation-delay: 0.16s; }
.radar-cell:nth-child(4) { animation-delay: 0.22s; }
.radar-cell:nth-child(5) { animation-delay: 0.28s; }
.radar-cell:nth-child(6) { animation-delay: 0.34s; }

.radar-label {
  font-family: var(--sans);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  margin-bottom: 8px;
  text-transform: none;
}
.radar-label::before { content: ''; }
.radar-value {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  line-height: 1.65;
}

/* ============ 3. 戏单 / 分支地图 ============ */
.branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 22px;
}
.branch-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 24px 22px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: rise 0.55s ease both;
  box-shadow: var(--shadow-sm);
}
.branch-card:nth-child(1) { animation-delay: 0.04s; }
.branch-card:nth-child(2) { animation-delay: 0.14s; }
.branch-card:nth-child(3) { animation-delay: 0.24s; }
.branch-card:nth-child(4) { animation-delay: 0.34s; }

.branch-card::before {
  content: '';
  position: absolute;
  inset: auto auto auto 0;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--brand-color, var(--lilac));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.branch-card::after { display: none; }
.branch-card:hover {
  transform: translateY(-3px);
  border-color: var(--lilac-line);
  box-shadow: var(--shadow);
}

.branch-tag {
  display: inline-block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-color, var(--lilac-deep));
  margin: 4px 0 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--lilac-bg);
}
.branch-card.branch-B .branch-tag { background: rgba(173, 82, 118, 0.10); }
.branch-card.branch-C .branch-tag { background: rgba(111, 138, 130, 0.10); }
.branch-card.branch-D .branch-tag { background: rgba(176, 124, 74, 0.10); }
.branch-tag::before, .branch-tag::after { content: ''; }

/* hidden 分支(D)在视觉上要"和前 3 条不一样":
   一条隐约的下划/竖线提示它是另一种东西,而不是又一张戏单 */
.branch-card.branch-D {
  background:
    linear-gradient(180deg, rgba(176,124,74,0.04) 0%, transparent 30%),
    var(--bg-1);
}
.branch-card.branch-D::before {
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--warm) 50%, transparent 100%);
}
.branch-card.branch-D .branch-name {
  font-style: italic;
  letter-spacing: 0.01em;
}

.branch-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
  text-align: left;
  line-height: 1.4;
  color: var(--ink);
}

.branch-summary {
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 14px;
  font-style: normal;
  margin: 0 0 18px;
  min-height: 46px;
  text-align: left;
  line-height: 1.7;
  max-width: 100%;
}

.branch-stats {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0;
}
.branch-stats b {
  color: var(--ink);
  font-weight: 500;
  font-style: normal;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0;
}

.branch-A { --brand-color: var(--lilac); }
.branch-B { --brand-color: var(--danger); }
.branch-C { --brand-color: var(--ok); }
.branch-D { --brand-color: var(--warm); }

/* ============ 4. 剧场详情 ============ */
.detail-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 960px) {
  .detail-layout { grid-template-columns: 1fr; }
}

.detail-side, .detail-main {
  display: flex; flex-direction: column; gap: 18px;
}

/* 场景图 */
.branch-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--lilac-bg), var(--bg-warm));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
  box-shadow: var(--shadow-sm);
}
.branch-image::after { display: none; }
.branch-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: none;
  animation: rise 0.6s ease;
}
.branch-image-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans);
  font-style: normal;
  color: var(--ink-dim);
  font-size: 13px;
  letter-spacing: 0;
  background: none;
  animation: dim 2.4s ease-in-out infinite;
}
@keyframes dim {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}
.branch-image.error .branch-image-placeholder {
  animation: none;
  color: var(--danger);
}

.branch-pill {
  display: inline-block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 12px;
  background: var(--lilac-bg);
  border: 0;
  border-radius: 999px;
  color: var(--lilac-deep);
  width: fit-content;
}
.detail-title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 8px 0 6px;
  line-height: 1.3;
  color: var(--ink);
}
.detail-summary {
  color: var(--ink-soft);
  font-family: var(--sans);
  font-style: normal;
  font-size: 14.5px;
  margin: 0 0 6px;
  line-height: 1.75;
  padding: 12px 14px;
  border-left: 3px solid var(--lilac);
  background: var(--lilac-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ============ 卡片 ============ */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.card::before { display: none; }
.card.warn { border: 1px solid rgba(173, 82, 118, 0.32); }
.card.warn::before { display: none; }

.card-title {
  font-family: var(--sans);
  font-style: normal;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 0;
}
.card-title .kicker {
  font-family: var(--mono);
  font-style: normal;
  font-size: 11px;
  color: var(--lilac-deep);
  letter-spacing: 0;
  margin-right: 8px;
  text-transform: lowercase;
  font-weight: 500;
}
.card-sub {
  color: var(--ink-dim);
  font-family: var(--sans);
  font-style: normal;
  font-size: 13px;
  margin: 0 0 14px;
  position: relative; z-index: 1;
}

/* 评分 */
.score-list { list-style: none; margin: 0; padding: 0; position: relative; z-index: 1; }
.score-list li {
  display: grid;
  grid-template-columns: 100px 1fr 36px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-family: var(--sans);
  font-size: 13.5px;
  border-bottom: 1px solid var(--line-soft);
}
.score-list li:last-child { border-bottom: 0; }
.score-list .score-label { color: var(--ink-soft); }
.score-bar {
  height: 6px;
  background: var(--bg-3);
  position: relative;
  overflow: hidden;
  border-radius: 3px;
}
.score-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--lilac-soft), var(--lilac));
  transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  border-radius: 3px;
}
.score-num {
  text-align: right;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.verdict {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 0;
  background: var(--lilac-bg);
  border-radius: var(--radius-sm);
  color: var(--lilac-deep);
  font-family: var(--sans);
  font-style: normal;
  font-size: 13.5px;
  line-height: 1.75;
  position: relative; z-index: 1;
}
.verdict::before { content: ''; }

/* 风险滑块 */
.sliders { display: flex; flex-direction: column; gap: 14px; position: relative; z-index: 1; }
.slider-row {
  display: grid;
  grid-template-columns: 88px 1fr 32px;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 13px;
}
.slider-row label { color: var(--ink-soft); }
.slider-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--bg-3);
  outline: none;
  padding: 0;
  margin: 0;
  border-radius: 2px;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  background: var(--lilac);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(142, 114, 179, 0.35);
}
.slider-row input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--lilac);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
}
.slider-num {
  text-align: right;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.risk-meter {
  height: 6px;
  background: var(--bg-3);
  margin-top: 16px;
  overflow: hidden;
  border-radius: 3px;
  position: relative; z-index: 1;
}
.risk-fill {
  height: 100%;
  background: var(--ok);
  width: 30%;
  transition: width 0.5s ease, background 0.5s ease;
  box-shadow: none;
  border-radius: 3px;
}
.risk-fill.warn { background: var(--warm); box-shadow: none; }
.risk-fill.danger { background: var(--danger); box-shadow: none; }

.risk-tip {
  margin: 12px 0 0;
  font-family: var(--sans);
  font-style: normal;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
  min-height: 36px;
  position: relative; z-index: 1;
}
.risk-tip.warn { color: var(--warm); }
.risk-tip.danger { color: var(--danger); }
.risk-tip.ok { color: var(--ok); }

/* 时间线 */
.timeline {
  list-style: none; margin: 0; padding: 0;
  position: relative; z-index: 1;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--lilac-line);
  border-radius: 1px;
}
.timeline li {
  position: relative;
  padding: 0 0 22px 26px;
  animation: rise 0.5s ease both;
}
.timeline li:last-child { padding-bottom: 4px; }
.timeline li::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--lilac);
  box-shadow: 0 0 0 2px var(--bg-0);
}
.timeline li.warn::before   { border-color: var(--warm); }
.timeline li.danger::before { border-color: var(--danger); }
.timeline-day {
  font-family: var(--sans);
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--lilac-deep);
  margin-bottom: 4px;
  text-transform: uppercase;
  font-weight: 500;
}
.timeline-event {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
}
.timeline-meta {
  color: var(--ink-dim);
  font-family: var(--sans);
  font-style: normal;
  font-size: 12.5px;
  margin-top: 4px;
}

/* 对话 */
.chat-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
  position: relative; z-index: 1;
}
.chat-tab {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0;
  transition: 0.18s;
}
.chat-tab:hover { border-color: var(--lilac-line); color: var(--ink); }
.chat-tab.active {
  background: var(--lilac-bg);
  border-color: var(--lilac);
  color: var(--lilac-deep);
  font-weight: 500;
}

.chat-box {
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px;
  max-height: 320px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 12px;
  min-height: 180px;
  position: relative; z-index: 1;
}

.bubble {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.75;
  animation: bubbleIn 0.35s ease;
  position: relative;
}
.bubble.future {
  align-self: flex-start;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-top-left-radius: 4px;
  font-style: normal;
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 14px;
}
.bubble.me {
  align-self: flex-end;
  background: var(--lilac);
  color: #fff;
  border: 0;
  border-top-right-radius: 4px;
  padding: 10px 14px;
}
.bubble .who {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-dim);
  margin-bottom: 4px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}
.bubble.future .who { color: var(--lilac-deep); }
.bubble.me .who { color: rgba(255,255,255,0.75); }

.chat-input {
  display: flex; gap: 8px;
  position: relative; z-index: 1;
}
.chat-input input {
  flex: 1;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: 0.2s;
}
.chat-input input:focus {
  border-color: var(--lilac);
  box-shadow: 0 0 0 3px var(--lilac-faint);
}
.chat-input input::placeholder {
  color: var(--ink-faint);
  font-style: normal;
  font-family: var(--sans);
}
.chat-input button {
  background: var(--lilac);
  color: #fff;
  border: 0;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: 0;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 2px 8px rgba(142, 114, 179, 0.22);
}
.chat-input button:hover { background: var(--lilac-deep); }

.chat-quick {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px;
  position: relative; z-index: 1;
}
.chat-quick .chip { font-size: 11.5px; }

/* 反事实 */
.card.warn .card-title { color: var(--danger); }
.card.warn .card-title .kicker { color: var(--ink-dim); }
.card.warn p {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.8;
  font-size: 14px;
  position: relative; z-index: 1;
  padding: 12px 14px;
  background: rgba(173, 82, 118, 0.07);
  border-left: 3px solid var(--danger);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.card.warn p::before {
  content: '⚠ ';
  color: var(--danger);
  font-weight: 700;
  margin-left: 0;
  margin-right: 6px;
}

/* ============ 5. 行动计划 ============ */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}
.plan-grid ul {
  margin: 0; padding: 0;
  list-style: none;
  position: relative; z-index: 1;
}
.plan-grid li {
  position: relative;
  padding: 10px 0 10px 22px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
}
.plan-grid li:last-child { border-bottom: 0; }
.plan-grid li::before {
  content: '○';
  position: absolute;
  left: 0; top: 10px;
  color: var(--lilac);
  font-size: 13px;
}
.card.warn li { color: var(--ink); }
.card.warn li::before { color: var(--danger); content: '!'; font-weight: 700; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  border: 0;
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 99;
  box-shadow: var(--shadow-lg);
}
.toast::before { content: ''; }
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ 抽屉 ============ */
.drawer {
  position: fixed; inset: 0; z-index: 200;
  display: flex; justify-content: flex-end;
}
.drawer.hidden { display: none !important; }
.drawer-mask {
  position: absolute; inset: 0;
  background: rgba(40, 30, 60, 0.32);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
.drawer-panel {
  position: relative;
  width: 420px; max-width: 92vw;
  height: 100%;
  background: var(--bg-1);
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 32px 28px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: drawerIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes drawerIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.drawer-panel h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0;
  margin: 0 0 6px;
  color: var(--ink);
}
.drawer-sub {
  color: var(--ink-dim);
  font-family: var(--sans);
  font-style: normal;
  font-size: 13px;
  margin: 0 0 22px;
}
.drawer-panel label {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin: 14px 0 6px;
  text-transform: none;
  font-weight: 500;
}
.drawer-panel input[type="text"],
.drawer-panel input[type="password"] {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.drawer-panel input:focus {
  border-color: var(--lilac);
  box-shadow: 0 0 0 3px var(--lilac-faint);
}
.drawer-toggles {
  display: flex; flex-direction: column; gap: 10px;
  margin: 22px 0 24px;
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-top: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}
.toggle {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-family: var(--sans) !important;
  font-style: normal !important;
  font-size: 13.5px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--ink) !important;
  margin: 0 !important;
  cursor: pointer;
  font-weight: 400 !important;
}
.toggle input { accent-color: var(--lilac); }
.drawer-actions {
  display: flex; gap: 8px;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

/* ============ 抽屉内的二级分组(备份) ============ */
.drawer-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
}
.drawer-section h4 {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--ink);
  margin: 0 0 6px;
}
.drawer-section .drawer-actions {
  margin-top: 14px;
  padding-top: 0;
  border-top: 0;
  justify-content: flex-start;
}

/* ============ 历史抽屉:列表 ============ */
.history-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
}
.history-empty {
  margin-top: 18px;
  color: var(--ink-dim);
  font-size: 13px;
  font-style: italic;
}
.history-item {
  position: relative;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.history-item:hover {
  border-color: var(--lilac-soft);
  transform: translateY(-1px);
}
.history-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}
.history-topic {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--lilac-deep);
  letter-spacing: 0.5px;
}
.history-when {
  font-size: 12px;
  color: var(--ink-faint);
  font-family: var(--mono);
}
.history-input {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}
.history-branches {
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.history-delete {
  background: transparent;
  border: 0;
  color: var(--ink-faint);
  font-size: 18px;
  line-height: 1;
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.history-delete:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ============ 分支图悬浮下载按钮 ============ */
.image-download-btn {
  position: absolute;
  right: 10px; bottom: 10px;
  z-index: 2;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(40, 32, 22, 0.55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.image-download-btn.hidden { display: none !important; }
.branch-image:hover .image-download-btn:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}
.image-download-btn:hover {
  background: rgba(40, 32, 22, 0.85);
}

/* ============ 加载层 ============ */
.loading {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  background: rgba(241, 236, 243, 0.88);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.25s ease;
}
.loading.hidden { display: none !important; }
/* —— 加载动效:墨晕 ——
   设计语言:
   - 这是一款衬线、纸感、人文气质的产品,不是 SaaS spinner
   - 隐喻:一滴墨在宣纸上洇开、收回,周围一圈不规则的手写圆,有一道扫光在沿圆缓慢扫描
   - 只有 3 个元素:墨晕 / 手写环 / 扫描弧,留白比动作多
   - 节奏:全部 4–7 秒级,慢到能让人真的"等待"
*/
.loader-ink {
  position: relative;
  width: 116px; height: 116px;
  margin-bottom: 32px;
  mix-blend-mode: multiply;
  animation: ink-float 6.5s ease-in-out infinite;
}
@keyframes ink-float {
  0%, 100% { transform: translateY(0);    }
  50%      { transform: translateY(-3px); }
}

/* —— 手写感圆环 ——
   两层不规则圆叠加 + 各自异速旋转 + morph,边缘永远在变,像两笔墨痕重叠
*/
.ink-ring {
  position: absolute;
  inset: 0;
  border: 1.2px solid var(--lilac-deep);
  border-radius: 58% 42% 53% 47% / 47% 53% 47% 53%;
  opacity: 0.55;
  animation: ink-ring-rotate 13s ease-in-out infinite,
             ink-ring-morph  9s ease-in-out infinite;
}
.loader-ink::before {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px dashed var(--lilac-line);
  border-radius: 52% 48% 49% 51% / 50% 51% 49% 50%;
  opacity: 0.55;
  animation: ink-ring-rotate 26s linear infinite reverse,
             ink-ring-morph  14s ease-in-out infinite reverse;
}
@keyframes ink-ring-rotate {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes ink-ring-morph {
  0%, 100% { border-radius: 58% 42% 53% 47% / 47% 53% 47% 53%; }
  33%      { border-radius: 50% 50% 47% 53% / 53% 47% 53% 47%; }
  66%      { border-radius: 47% 53% 56% 44% / 49% 52% 48% 51%; }
}

/* —— 扫描弧 ——
   conic-gradient 一段从透明到深紫到透明的扇形,
   径向 mask 把内圈挖空,只剩一道极细的弧光沿环走
*/
.ink-sweep {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 220deg,
    rgba(109, 85, 143, 0.0)  240deg,
    rgba(109, 85, 143, 0.7)  340deg,
    rgba(109, 85, 143, 0.0)  360deg);
  -webkit-mask: radial-gradient(circle, transparent 64%, #000 66%, #000 99%, transparent 100%);
          mask: radial-gradient(circle, transparent 64%, #000 66%, #000 99%, transparent 100%);
  animation: ink-sweep 5.2s linear infinite;
}
@keyframes ink-sweep {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* —— 中心墨晕 ——
   双层径向渐变叠加(深核 + 外晕),呼吸 + 极慢飘移,模仿墨在纸上洇开的不均匀
*/
.ink-bloom {
  position: absolute;
  top: 50%; left: 50%;
  width: 64px; height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%,
      rgba(109, 85, 143, 0.85)  0%,
      rgba(109, 85, 143, 0.45) 22%,
      rgba(142, 114, 179, 0.18) 50%,
      rgba(142, 114, 179, 0)   78%),
    radial-gradient(circle at 60% 40%,
      rgba(173, 82, 118, 0.25)  0%,
      rgba(173, 82, 118, 0)    55%);
  filter: blur(0.6px);
  animation: ink-bloom 5.4s ease-in-out infinite;
}
@keyframes ink-bloom {
  0%, 100% { transform: scale(0.7)  translate(0, 0);    opacity: 0.65; }
  35%      { transform: scale(1.05) translate(0.5px, -1px); opacity: 1; }
  65%      { transform: scale(0.95) translate(-0.5px, 1px); opacity: 0.95; }
}

@media (prefers-reduced-motion: reduce) {
  .loader-ink,
  .loader-ink::before,
  .ink-ring,
  .ink-sweep,
  .ink-bloom {
    animation-duration: 14s;
    animation-timing-function: ease-in-out;
  }
}

/* 文案:衬线感更强,字距收紧,跟动效更协调 */

.loader-text {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
  margin: 0 0 10px;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  animation: loader-text-fade 3.2s ease-in-out infinite;
}
@keyframes loader-text-fade {
  0%, 100% { opacity: 0.78; }
  50%      { opacity: 1;    }
}
.loader-ellipsis {
  display: inline-flex;
  margin-left: 6px;
  gap: 3px;
}
.loader-ellipsis i {
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  color: var(--lilac-deep);
  opacity: 0.18;
  animation: ellipsis-fade 1.8s ease-in-out infinite;
}
.loader-ellipsis i:nth-child(2) { animation-delay: 0.24s; }
.loader-ellipsis i:nth-child(3) { animation-delay: 0.48s; }
@keyframes ellipsis-fade {
  0%, 80%, 100% { opacity: 0.18; }
  40%           { opacity: 1;    }
}
.loader-sub {
  color: var(--ink-dim);
  font-family: var(--sans);
  font-size: 12px;
  margin: 0;
  letter-spacing: 0.08em;
  opacity: 0.7;
  font-feature-settings: "tnum" 1;
}

/* ============ 滚动条 ============ */
.chat-box::-webkit-scrollbar { width: 6px; }
.chat-box::-webkit-scrollbar-thumb {
  background: var(--lilac-line);
  border-radius: 3px;
}
.chat-box::-webkit-scrollbar-thumb:hover { background: var(--lilac-soft); }
.chat-box::-webkit-scrollbar-track { background: transparent; }

/* ============ 通用动画 ============ */
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr 1fr;
    padding: 14px 18px;
    gap: 10px;
  }
  .steps {
    grid-column: 1 / -1;
    order: 3;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    overflow-x: auto;
    width: 100%;
  }
  .steps .step em { font-size: 12px; }
  .topbar-right { justify-self: end; }
  .view { padding: 44px 18px 72px; }
  .hero-title { font-size: 34px; }
  .view-title { font-size: 26px; }
  .input-row { flex-direction: column; align-items: stretch; }
  .input-row .primary-btn { justify-content: center; }
  .branch-grid { gap: 16px; }
  .detail-layout { gap: 22px; }
}

@media (max-width: 720px) {
  .drawer-panel { width: 100%; padding: 24px 18px; }
  .hero-title { font-size: 28px; }
}

/* ============ 优化追加:空状态 / 对话 loading / 输入禁用 ============ */
.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--ink-dim);
  font-style: italic;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg-warm);
}

.bubble.typing {
  opacity: 0.7;
}
.bubble.typing .bubble-text {
  display: inline-block;
  letter-spacing: 4px;
  animation: typing-pulse 1.2s ease-in-out infinite;
}
@keyframes typing-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* 系统提示气泡:与"未来的我"区分开,提示用户启用 AI / 重试 */
.bubble.system {
  background: transparent;
  border: 1px dashed var(--line);
  font-style: italic;
  color: var(--ink-soft);
  opacity: 0.85;
}
.bubble.system .who {
  color: var(--ink-soft);
  letter-spacing: 0.18em;
  font-size: 11px;
  text-transform: uppercase;
}

/* 风险提示 loading 态:闪一下,表示真在调 AI */
.risk-tip.loading {
  color: var(--ink-soft);
  animation: typing-pulse 1.4s ease-in-out infinite;
}

/* 行动计划 loading 占位行 */
.plan-loading {
  font-style: italic;
  color: var(--ink-soft);
  opacity: 0.75;
  list-style: none;
  padding: 6px 0;
  animation: typing-pulse 1.4s ease-in-out infinite;
}

.chat-input input:disabled,
.chat-input button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ============================================================
 * 内联编辑 —— 屏幕上的每段话都是你的草稿
 * ============================================================ */
.editable {
  cursor: text;
  border-radius: 4px;
  padding: 2px 5px;
  margin: -2px -5px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.editable:hover {
  background: var(--lilac-faint);
  box-shadow: inset 0 -1px 0 var(--lilac);
}
.editable:hover::after {
  content: '✎';
  position: absolute;
  top: 50%;
  right: -16px;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--lilac);
  opacity: 0.6;
  pointer-events: none;
  font-family: var(--sans);
}
.editable.editing,
.editable[contenteditable="true"]:focus {
  background: #fff;
  outline: 2px solid var(--lilac);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px var(--lilac-faint);
}
.editable.editing::after,
.editable[contenteditable="true"]:focus::after { display: none; }
.editable-multi { white-space: pre-wrap; }

.editable-num {
  display: inline-block;
  min-width: 26px;
  text-align: right;
}
.score-input {
  width: 40px;
  border: 1px solid var(--lilac);
  background: #fff;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  text-align: right;
  padding: 1px 5px;
  border-radius: 3px;
  outline: none;
  -moz-appearance: textfield;
}
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 列表 + 加一条 */
.plan-grid li.add-row {
  cursor: pointer;
  color: var(--ink-dim);
  font-style: italic;
  border-bottom: 0;
  padding-left: 22px;
  transition: color 0.18s, background 0.18s;
  border-radius: var(--radius-sm);
}
.plan-grid li.add-row::before {
  content: '＋';
  color: var(--lilac);
  font-style: normal;
  top: 9px;
}
.plan-grid li.add-row:hover {
  color: var(--lilac-deep);
  background: var(--lilac-bg);
}

/* ============================================================
 * API 入门提示条 —— 第一眼柔和地告诉用户:这里有 AI
 * ============================================================ */
.api-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, #efe5f3, var(--bg-1));
  border: 1px solid var(--lilac-line);
  border-radius: var(--radius);
  padding: 12px 16px 12px 18px;
  margin: 0 0 22px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  animation: rise 0.55s ease both;
  position: relative;
}
.api-banner::before {
  content: '✦';
  color: var(--lilac);
  font-size: 14px;
  margin-right: 2px;
}
.api-banner-text {
  flex: 1;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.api-banner-text b {
  color: var(--lilac-deep);
  font-weight: 500;
}
.api-banner .ghost-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  font-size: 12.5px;
}
.api-banner-close {
  background: transparent;
  border: 0;
  color: var(--ink-faint);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 999px;
  transition: 0.18s;
}
.api-banner-close:hover { color: var(--ink); background: var(--bg-3); }

/* ============================================================
 * 重写按钮(温暖琥珀色,提示是高代价动作)
 * ============================================================ */
.regen-btn {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0;
  cursor: pointer;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.regen-btn::before {
  content: '↻';
  font-size: 14px;
  color: var(--warm);
}
.regen-btn:hover {
  border-color: var(--warm);
  color: var(--warm);
  background: var(--warm-soft);
}
.regen-btn:hover::before { color: var(--warm); }
.regen-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 内嵌的小型重写按钮(放在卡片标题旁边,不抢戏) */
.regen-btn.regen-inline {
  margin-left: auto;
  padding: 3px 10px;
  font-size: 11px;
  border-radius: 999px;
  letter-spacing: 0;
}
.regen-btn.regen-inline::before {
  font-size: 12px;
}

/* 反事实卡片内的"换一句"加载态 */
#counterfactual.loading {
  opacity: 0.65;
  font-style: italic;
  animation: typing-pulse 1.4s ease-in-out infinite;
}

/* ============================================================
 * 未来人格抽屉 —— 让用户改写未来自己说的话
 * ============================================================ */
.future-edit-strip {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  position: relative;
  z-index: 1;
}
.future-edit-strip summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-dim);
  user-select: none;
  outline: none;
  list-style: none;
}
.future-edit-strip summary::before {
  content: '▸ ';
  color: var(--lilac);
  font-family: var(--mono);
}
.future-edit-strip[open] summary::before { content: '▾ '; }
.future-edit-strip[open] summary {
  color: var(--lilac-deep);
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 8px;
}
.future-edit-strip .fe-block {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.7;
}
.future-edit-strip .fe-label {
  font-size: 11.5px;
  color: var(--ink-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
.future-edit-strip .fe-text {
  display: block;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--sans);
  font-size: 13px;
}
