/* ============ 设计变量 ============ */
:root {
  --bg: #f4f2ed;
  --bg-2: #eceae4;
  --surface: #ffffff;
  --surface-2: #faf8f5;
  --line: #e8e3db;
  --line-soft: #f0ece5;
  --text: #26241f;
  --text-2: #56514a;
  --muted: #918b81;
  --brand: #e8703a;
  --brand-soft: #fdf1ea;
  --blue: #4b6cb7;
  --green: #2f8f6b;
  --pink: #d9536f;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --sh-1: 0 1px 2px rgba(50, 40, 30, .04), 0 4px 14px rgba(50, 40, 30, .05);
  --sh-2: 0 8px 30px rgba(50, 40, 30, .10);
  --sh-3: 0 18px 50px rgba(40, 32, 24, .16);
  /* 四面板可调尺寸（拖拽条写入，localStorage 恢复） */
  --rail-w: 220px;
  --feed-w: 360px;
  --feed-h: 340px;
  --dim3-h: 440px;
  --workspace-h: calc(100dvh - 76px);
}

* { box-sizing: border-box; }

html {
  height: 100%;
  scroll-behavior: smooth;
}
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(1200px 600px at 12% -10%, #fffdfa 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #fdf3ec 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.shell {
  display: flex; flex-direction: column;
  min-height: 100dvh; height: auto; overflow: visible;
}

/* ============ 顶栏 ============ */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 0 18px; height: 66px; flex: none;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(140deg, #ffd9c2, #ffb894);
  box-shadow: 0 4px 12px rgba(232, 112, 58, .28);
}
.brand-text h1 { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: .3px; }
.brand-text p { margin: 1px 0 0; font-size: 10.5px; color: var(--muted); letter-spacing: 1.4px; text-transform: uppercase; }

.clockbar { display: flex; gap: 8px; flex: none; }
.clock-card {
  min-width: 62px; padding: 6px 12px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: var(--sh-1);
}
.clock-card .k { font-size: 9px; color: var(--muted); letter-spacing: 1.2px; }
.clock-card .v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock-card .v.sm { font-size: 13px; }
.clock-card.time .v { font-size: 19px; letter-spacing: .5px; }

.metrics { display: flex; gap: 6px; flex: none; }
.metric {
  padding: 5px 13px; border-radius: 13px; background: var(--surface-2);
  border: 1px solid var(--line-soft); text-align: center; min-width: 62px;
}
.metric b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--brand); }
.metric span { font-size: 10px; color: var(--muted); }

.actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }

.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 7px 14px; border-radius: 12px; cursor: pointer; font-size: 13px; font-family: inherit;
  transition: transform .12s, box-shadow .12s, background .12s, border-color .12s;
  white-space: nowrap;
}
.btn:hover { border-color: #d8d2c8; transform: translateY(-1px); box-shadow: var(--sh-1); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, #f0824f, #e05f28); border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(224, 95, 40, .3);
}
.btn.primary:hover { box-shadow: 0 6px 18px rgba(224, 95, 40, .4); }
.btn.pulse-attn, #cAdvance.pulse-attn, #btnAdvance.pulse-attn {
  animation: attnPulse 0.9s ease-in-out 3;
  box-shadow: 0 0 0 3px rgba(232, 112, 58, .35), 0 4px 14px rgba(224, 95, 40, .35);
}
@keyframes attnPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.btn.soft { background: var(--brand-soft); border-color: #f7ddd0; color: #b8511f; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.icon { padding: 7px 10px; }

.speeder { display: flex; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 12px; padding: 2px; }
.speeder button {
  border: none; background: transparent; padding: 5px 10px; border-radius: 9px; cursor: pointer;
  font-size: 12px; color: var(--muted); font-family: inherit; transition: .12s;
}
.speeder button.on { background: var(--surface); color: var(--brand); font-weight: 700; box-shadow: var(--sh-1); }

.mode-badge {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; background: #f3f1ec; border: 1px solid var(--line-soft); color: var(--text-2);
}
.mode-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.mode-badge.live { background: #eaf6f0; border-color: #cfe9de; color: #1f7a58; }
.mode-badge.live i { background: var(--green); animation: pulse 1.8s infinite; }
.mode-badge.sim i { background: #c9c2b6; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }

/* ============ 工作区（三栏 + 竖向分隔条） ============ */
.workspace {
  flex: none; min-height: var(--workspace-h); height: var(--workspace-h);
  display: grid; gap: 0; padding: 10px 14px 0;
  grid-template-columns: var(--rail-w) 6px minmax(0, 1fr) 6px var(--feed-w);
}

.split-v {
  width: 6px; margin: 0 4px; cursor: col-resize; position: relative; z-index: 5;
  border-radius: 4px; background: transparent; align-self: stretch;
}
.split-v::after {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 3px; height: 36px; border-radius: 3px; background: var(--line);
  transition: background .15s, height .15s;
}
.split-v:hover::after, .split-v.dragging::after { background: var(--brand); height: 48px; }

.split-h {
  height: 8px; margin: 4px 14px 0; cursor: row-resize; position: relative; z-index: 5;
  flex: none; border-radius: 4px;
}
.split-h::after {
  content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 3px; border-radius: 3px; background: var(--line);
  transition: background .15s, width .15s;
}
.split-h:hover::after, .split-h.dragging::after { background: var(--brand); width: 64px; }
body.resizing-col { cursor: col-resize !important; user-select: none; }
body.resizing-row { cursor: row-resize !important; user-select: none; }
body.is-resizing { user-select: none; }
body.is-resizing .dim3-band { transition: none; }

/* ============ 底部横带 · 故事 + 三维差异空间 ============ */
.dim3-band {
  flex: none; height: var(--dim3-h); min-height: 40px; max-height: none;
  margin: 0 14px 16px; padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
  transition: height .12s ease;
}
.dim3-band.collapsed { height: 40px !important; }
.dim3-band.collapsed .dim3-body { display: none; }
.dim3-band.collapsed #dim3Toggle { transform: rotate(-90deg); }
.dim3-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 14px; border-bottom: 1px solid var(--line-soft); flex: none; flex-wrap: wrap;
}
.story-dim3-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; justify-content: flex-end;
}
.dim3-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dim3-chips button {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2);
  border-radius: 999px; padding: 3px 10px; font-size: 11px; cursor: pointer; font-family: inherit;
}
.dim3-chips button.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.story-dim3-body.dim3-body {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr); gap: 0;
  padding: 0; align-items: stretch;
  flex: 1; min-height: 0; overflow: hidden;
}
.story-dim3.town-only .story-dim3-body { grid-template-columns: 1fr; }
.story-dim3.town-only #dim3Col { display: none; }
.story-dim3.town-only #dim3Chips { display: none; }
.story-col {
  min-width: 0; min-height: 0; overflow: auto;
  padding: 10px 14px 14px; border-right: 1px solid var(--line-soft);
}
.story-dim3.town-only .story-col { border-right: none; }
.dim3-col {
  min-width: 0; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 14px 12px;
}
.dim3-canvas-wrap { flex: 1; min-width: 0; min-height: 140px; position: relative; cursor: grab; }
.dim3-canvas-wrap:active { cursor: grabbing; }
.dim3-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font-size: 11.5px; color: var(--text); box-shadow: var(--sh-1); min-width: 150px;
}
.dim3-side { flex: none; display: flex; flex-direction: column; gap: 6px; overflow: auto; max-height: 42%; }
.dim3-stat {
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  padding: 6px 10px;
}
.dim3-stat .k { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 2px; }
.dim3-stat b { font-size: 16px; font-variant-numeric: tabular-nums; color: var(--brand); }
.dim3-stat.wide b { font-size: 13px; color: var(--text); }
.dim3-rows { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.dim3-rows .r { display: flex; justify-content: space-between; font-size: 12px; }
.dim3-rows .neg { color: #a83232; }
.dim3-rows .pos { color: #2f7d46; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden;
  display: flex; flex-direction: column; min-height: 0;
}

/* ---- 左栏：居民 ---- */
.rail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; flex: none;
}
.rail-head h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .5px; }
.pill {
  background: var(--brand-soft); color: var(--brand); border-radius: 999px;
  padding: 1px 9px; font-size: 11px; font-weight: 700;
}
.rail-body { overflow-y: auto; padding: 0 10px 12px; display: flex; flex-direction: column; gap: 8px; }

.person {
  display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center;
  padding: 10px; border-radius: var(--r-md); cursor: pointer;
  border: 1px solid transparent; transition: .14s;
}
.person:hover { background: var(--surface-2); border-color: var(--line); transform: translateX(2px); }
.person.active { background: var(--brand-soft); border-color: #f6dccf; }
.p-avatar {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  font-size: 20px; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(60,45,30,.12);
}
.p-info { min-width: 0; }
.p-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.p-name .talking { font-size: 10px; color: var(--brand); }
.p-meta { font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-act { font-size: 11.5px; color: var(--text-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-bar { height: 3px; border-radius: 3px; background: #f0ece5; margin-top: 5px; overflow: hidden; }
.p-bar > i { display: block; height: 100%; border-radius: 3px; }

/* ---- 中：舞台 ---- */
.stage { background: linear-gradient(180deg, #fffdfb, #fbf9f5); }
.stage-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft); flex: none;
}
.stage-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(232,112,58,.16); animation: pulse 2s infinite; }
.today {
  font-size: 12px; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--line-soft); border-radius: 999px; padding: 5px 13px;
  max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.map-shell { flex: 1; min-height: 0; position: relative; padding: 12px; }
canvas#map { width: 100%; height: 100%; display: block; border-radius: var(--r-md); }
.map-hint {
  position: absolute; right: 22px; bottom: 20px; font-size: 11px; color: var(--muted);
  background: rgba(255,255,255,.8); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-soft);
  pointer-events: none;
}
.cmdbar {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  border-top: 1px solid var(--line-soft); flex: none;
}
.cmd-ico { font-size: 15px; }
.cmdbar input {
  flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 9px 14px;
  font-size: 13px; font-family: inherit; background: var(--surface-2); color: var(--text);
  transition: .14s;
}
.cmdbar input:focus { outline: none; border-color: #f0b79b; background: #fff; box-shadow: 0 0 0 3px rgba(232,112,58,.1); }

/* ---- 右：动态流 ---- */
.seg { display: flex; gap: 4px; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); flex: none; }
.seg button {
  flex: 1; border: none; background: transparent; padding: 8px 6px; border-radius: 12px;
  cursor: pointer; font-size: 12.5px; color: var(--muted); font-family: inherit; transition: .14s;
}
.seg button:hover { background: var(--surface-2); color: var(--text-2); }
.seg button.on { background: var(--text); color: #fff; font-weight: 600; box-shadow: var(--sh-1); }

.feed-body { flex: 1; min-height: 0; overflow-y: auto; }
.pane { display: none; padding: 12px; }
.pane.on { display: block; }
.pane-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.hint { font-size: 11px; color: var(--muted); }

/* 对话卡片 */
.talk-card {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px;
  margin-bottom: 10px; background: var(--surface-2);
}
.talk-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.stack-avatars { display: flex; }
.stack-avatars span {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px;
  border: 2px solid #fff; margin-left: -7px;
}
.stack-avatars span:first-child { margin-left: 0; }
.talk-place { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.talk-topic {
  font-size: 11px; background: #fff; border: 1px solid var(--line); color: var(--text-2);
  border-radius: 999px; padding: 1px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.turn { display: flex; gap: 8px; margin-bottom: 9px; animation: rise .28s ease; }
.turn:last-child { margin-bottom: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.turn .av {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; flex: 0 0 26px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(60,45,30,.12);
}
.turn .body { min-width: 0; }
.turn .who { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.turn .bubble {
  font-size: 13.2px; line-height: 1.6; background: #fff; border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px; padding: 8px 12px; word-break: break-word;
}
.empty { text-align: center; color: var(--muted); font-size: 12px; padding: 40px 12px; }
.empty .big { font-size: 30px; display: block; margin-bottom: 8px; opacity: .5; }

/* 关系图 */
.graph-box { display: grid; place-items: center; padding: 4px 0 8px; }
#graph { width: 100%; max-width: 320px; height: 300px; }
.legend { display: flex; gap: 12px; justify-content: center; font-size: 11px; color: var(--muted); flex-wrap: wrap; margin-bottom: 12px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.dot.close { background: #e05a4f; }
.dot.neutral { background: #b9b3aa; }
.dot.far { background: #5b8fd6; }

.rel-list { display: grid; gap: 7px; }
.rel-row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2);
}
.rel-row .names { font-size: 12.5px; font-weight: 600; }
.rel-row .score { font-size: 11px; color: var(--muted); }
.rel-bar { grid-column: 1/-1; height: 4px; background: #efebe4; border-radius: 4px; overflow: hidden; }
.rel-bar > i { display: block; height: 100%; border-radius: 4px; }

/* 日志时间线 */
.logs { position: relative; padding-left: 16px; }
.logs::before { content: ''; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 1.5px; background: var(--line); }
.log-item { position: relative; font-size: 12.2px; padding: 6px 0 6px 6px; color: var(--text-2); line-height: 1.5; }
.log-item::before {
  content: ''; position: absolute; left: -15.5px; top: 12px; width: 7px; height: 7px;
  border-radius: 50%; background: #cfc8bd; border: 2px solid #fff;
}
.log-item.level-talk::before { background: var(--brand); }
.log-item.level-relation::before { background: var(--pink); }
.log-item.level-reflect::before { background: var(--green); }
.log-item.level-system::before { background: var(--blue); }
.log-item.level-event::before { background: #e0a52b; }
.log-item.level-error::before { background: #c0392b; }
.log-item .t { color: var(--muted); margin-right: 6px; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.log-item.level-event { font-weight: 600; color: #9c6a1c; }
.log-item.level-error { color: #c0392b; }

/* ============ 抽屉 ============ */
.drawer {
  position: fixed; top: 0; right: -460px; width: 440px; max-width: 94vw; height: 100vh;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--sh-3);
  transition: right .26s cubic-bezier(.22,.8,.3,1); z-index: 60; display: flex; flex-direction: column;
}
.drawer.open { right: 0; }
.drawer-hero { position: relative; padding: 22px 22px 20px; color: #fff; flex: none; }
.drawer-hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(140deg, var(--hero-a, #ff9d6e) 0%, var(--hero-b, #c74f22) 100%);
}
.drawer-hero::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(200px 120px at 85% 10%, rgba(255,255,255,.28), transparent 70%);
}
.drawer-hero > * { position: relative; z-index: 1; }
.hero-avatar {
  width: 62px; height: 62px; border-radius: 20px; display: grid; place-items: center; font-size: 32px;
  background: rgba(255,255,255,.22); border: 2px solid rgba(255,255,255,.5); margin-bottom: 12px;
  box-shadow: 0 6px 18px rgba(120,50,20,.2);
}
.hero-meta h3 { margin: 0; font-size: 20px; font-weight: 700; }
.hero-meta p { margin: 4px 0 0; font-size: 12.5px; opacity: .92; }
.drawer-close {
  position: absolute; top: 16px; right: 16px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.22); color: #fff; cursor: pointer; font-size: 14px;
}
.drawer-close:hover { background: rgba(255,255,255,.36); }
.drawer-body { padding: 18px 20px 30px; overflow-y: auto; flex: 1; font-size: 13px; }

.sec { margin-bottom: 22px; }
.sec > h4 {
  margin: 0 0 10px; font-size: 11px; color: var(--muted); font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
}
.kv { display: flex; gap: 8px; font-size: 12.8px; margin-bottom: 6px; line-height: 1.6; }
.kv .k { color: var(--muted); flex: 0 0 52px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag2 { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.tag2.like { background: #eaf6f0; border-color: #d3ebe0; color: #1f7a58; }
.tag2.hate { background: #fdeef0; border-color: #f7dade; color: #b23c55; }

.radar-box { display: grid; place-items: center; margin: 4px 0 2px; }

.plan-item {
  display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 7px 0;
  border-bottom: 1px dashed var(--line-soft); font-size: 12.5px;
}
.plan-item:last-child { border-bottom: none; }
.plan-item .tm { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; }

.rel-card { border: 1px solid var(--line); border-radius: 14px; padding: 11px; margin-bottom: 8px; background: var(--surface-2); }
.rel-card .top { display: flex; justify-content: space-between; align-items: center; font-size: 12.8px; font-weight: 600; }
.rel-card .badge { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; }
.badge.close { background: #fdeceb; color: #c0392b; }
.badge.mid { background: #f2f0ea; color: #7a746a; }
.badge.far { background: #eaf1fb; color: #3567a8; }
.rel-card .imp { font-size: 11.8px; color: var(--muted); margin-top: 6px; font-style: italic; }

.mem-item { display: grid; grid-template-columns: 8px 1fr; gap: 9px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); }
.mem-item:last-child { border-bottom: none; }
.mem-item .pin { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; }
.pin.observation { background: #9aa5b1; }
.pin.conversation { background: var(--brand); }
.pin.reflection { background: var(--green); }
.pin.plan { background: #6b5b95; }
.pin.event { background: #e0a52b; }
.mem-item .txt { font-size: 12.5px; line-height: 1.55; }
.mem-item .mt { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.say-row { display: flex; gap: 7px; margin-top: 4px; }
.say-row input {
  flex: 1; border: 1px solid var(--line); border-radius: 11px; padding: 8px 12px;
  font-family: inherit; font-size: 12.5px; background: var(--surface-2);
}
.say-row input:focus { outline: none; border-color: #f0b79b; background: #fff; }

.scrim { position: fixed; inset: 0; background: rgba(35,28,20,.28); opacity: 0; pointer-events: none; transition: .2s; z-index: 55; }
.scrim.on { opacity: 1; pointer-events: auto; }

/* ============ 弹窗 ============ */
.modal { position: fixed; inset: 0; display: none; place-items: center; z-index: 80; padding: 20px; }
.modal.open { display: grid; }
.modal::before { content: ''; position: absolute; inset: 0; background: rgba(35,28,20,.34); backdrop-filter: blur(3px); }
.modal-card {
  position: relative; width: 480px; max-width: 100%; background: var(--surface);
  border-radius: 24px; overflow: hidden; box-shadow: var(--sh-3); animation: pop .2s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 20px 22px 14px; border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 { margin: 0; font-size: 16.5px; }
.modal-head .sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.modal-body { padding: 18px 22px 22px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 9px 13px;
  font-family: inherit; font-size: 13px; background: var(--surface-2); color: var(--text);
}
.field input:focus { outline: none; border-color: #f0b79b; background: #fff; box-shadow: 0 0 0 3px rgba(232,112,58,.1); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.presets { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.presets .fl { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.chip {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px;
  padding: 4px 11px; font-size: 11.5px; cursor: pointer; font-family: inherit; color: var(--text-2);
}
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.row.end { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 18px; }

.pick-list { display: grid; gap: 7px; margin-bottom: 14px; max-height: 240px; overflow-y: auto; }
.pick {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-radius: 14px; padding: 9px 13px; cursor: pointer; font-size: 13px; background: var(--surface-2);
}
.pick.on { border-color: var(--brand); background: var(--brand-soft); }
.pick .ic { font-size: 17px; }
.pick .nm { font-weight: 600; }
.pick .st { margin-left: auto; font-size: 11px; color: var(--muted); }
.pick input { accent-color: var(--brand); }

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #ded8cf; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #cbc4b8; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 响应式 ============ */
@media (max-width: 1360px) {
  :root { --rail-w: 200px; --feed-w: 320px; }
  .metrics { display: none; }
}
@media (max-width: 1180px) {
  .workspace {
    height: auto;
    min-height: calc(100dvh - 76px);
    grid-template-columns: var(--rail-w) 6px minmax(0, 1fr);
    grid-template-rows: minmax(320px, 52vh) 8px var(--feed-h);
  }
  #splitFeed, #panelFeed { grid-column: 1 / -1; }
  #panelFeed { min-height: 220px; height: var(--feed-h); max-height: none; }
  #splitFeed { height: 8px; width: auto; cursor: row-resize; margin: 4px 0; }
  #splitFeed::after { width: 48px; height: 3px; }
  :root { --dim3-h: 520px; }
  .story-dim3-body.dim3-body { grid-template-columns: 1fr; }
  .story-col { border-right: none; border-bottom: 1px solid var(--line-soft); max-height: 58%; }
  .dim3-col { min-height: 200px; }
}
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 12px; }
  .actions { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(360px, 55vh) auto;
    padding: 10px 12px 0;
    height: auto;
  }
  #splitRail, #splitFeed { display: none; }
  .rail { max-height: 220px; }
  .brand-text p { display: none; }
  :root { --dim3-h: 560px; }
}

/* ============ 故事面板 ============ */
.story-import {
  margin: 0 12px 12px; padding: 12px; border: 1px solid var(--line-soft);
  border-radius: var(--r-md); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px;
}
.story-import textarea {
  width: 100%; resize: vertical; font: inherit; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff;
}
.story-import textarea:focus { outline: none; border-color: #f0b79b; box-shadow: 0 0 0 3px rgba(232,112,58,.1); }

.story-list { padding: 4px 12px 20px; display: flex; flex-direction: column; gap: 12px; }
.story-card {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
  overflow: hidden; box-shadow: var(--sh-1);
}
.story-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer;
  background: linear-gradient(90deg, color-mix(in srgb, var(--sc, #e8703a) 12%, transparent), transparent 70%);
}
.story-head:hover { background: var(--surface); }
.story-head .ic { font-size: 19px; }
.story-head .tt { flex: 1; min-width: 0; }
.story-head .tt b { display: block; font-size: 13px; }
.story-head .tt span { font-size: 11px; color: var(--muted); }
.story-prog { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-2); }
.story-prog .bar { width: 54px; height: 5px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.story-prog .bar i { display: block; height: 100%; border-radius: 99px; background: var(--sc, #e8703a); }
.story-actions { display: flex; gap: 6px; }
.mini-btn {
  border: 1px solid var(--line); background: #fff; color: var(--text-2); font-size: 11px;
  border-radius: 8px; padding: 3px 8px; cursor: pointer;
}
.mini-btn:hover { border-color: var(--brand); color: var(--brand); }
.mini-btn.warn { color: var(--pink); }
.mini-btn.on { background: var(--brand-soft); border-color: #f0b79b; color: #c7561f; }

.story-body { border-top: 1px dashed var(--line-soft); padding: 10px 12px 14px; display: none; }
.story-card.open .story-body { display: block; }
.storyline { position: relative; padding-left: 20px; }
.storyline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line-soft); }
.chapter { position: relative; margin-bottom: 12px; }
.chapter:last-child { margin-bottom: 0; }
.chapter .dot {
  position: absolute; left: -20px; top: 4px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid var(--line); box-sizing: border-box;
}
.chapter.published .dot { border-color: var(--sc, #e8703a); }
.chapter.current .dot { background: var(--sc, #e8703a); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sc, #e8703a) 18%, transparent); }
.chapter .ch-head { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.chapter .ch-head b { font-size: 12.5px; }
.chapter .ch-head .src { font-size: 10.5px; color: var(--muted); }
.chapter .ch-head .badge {
  font-size: 10px; border-radius: 99px; padding: 1px 7px; background: var(--brand-soft); color: #c7561f;
}
.chapter.locked .ch-head b { color: var(--muted); font-weight: 600; }
.chapter .ch-text { font-size: 12px; line-height: 1.65; color: var(--text-2); margin: 4px 0 8px; }
.chapter.locked .ch-text { color: var(--muted); font-style: italic; }

.vars { background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 9px; }
.vars .vars-title { font-size: 10.5px; color: var(--muted); margin-bottom: 6px; letter-spacing: .4px; }
.var-row { display: flex; gap: 6px; margin-bottom: 5px; align-items: center; }
.var-row input {
  font: inherit; font-size: 12px; border: 1px solid var(--line); border-radius: 7px;
  padding: 3px 7px; color: var(--text); background: var(--surface-2);
}
.var-row input.k { width: 76px; color: var(--text-2); }
.var-row input.v { flex: 1; min-width: 0; }
.var-row .del { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.var-row .del:hover { color: var(--pink); }
.vars .add-var { border: none; background: none; color: var(--brand); font-size: 11.5px; cursor: pointer; padding: 2px 0; }
.vars .vars-save { margin-top: 6px; }

/* ============ 立绘头像 ============ */
.p-avatar, .turn .av, .hero-avatar, .stack-avatars span, .pick .ic {
  position: relative; overflow: hidden;
}
.ava-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 22%; border-radius: inherit; z-index: 1;
}
.pick .ic {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px;
  display: inline-grid; place-items: center; font-size: 15px;
  background: var(--surface); border: 1.5px solid var(--line-soft);
}
.pick .ic .ava-img { border-radius: 50%; }
.hero-avatar .ava-img { object-position: center 18%; }

/* ============ 模式切换徽章（可点击） ============ */
button.mode-badge {
  font: inherit; font-size: 12px; cursor: pointer; transition: box-shadow .15s, transform .15s;
}
button.mode-badge:hover { box-shadow: 0 2px 10px rgba(60,45,30,.14); transform: translateY(-1px); }
button.mode-badge:active { transform: none; }
#mTokenBox b { color: #8a6d3b; }

/* ============ 导演模式（v0.4） ============ */
.dir-box { padding: 4px 2px 20px; }
.dir-title { font-size: 12px; font-weight: 600; color: #b8511f; margin: 16px 0 10px; padding-top: 12px; border-top: 1px dashed #eee5da; }
.dir-title:first-child { margin-top: 4px; border-top: none; padding-top: 0; }
.btn.wide { width: 100%; justify-content: center; }
.btn.danger.soft { background: #fdecea; border-color: #f3c3c0; color: #a33; }
.btn.success.soft { background: #eaf5ec; border-color: #c3e0c9; color: #2f7d46; }
.btn.pink.soft { background: #fdeaf3; border-color: #f2c4da; color: #b0447c; }
.row.btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.field select {
  width: 100%; padding: 8px 10px; border: 1px solid #e7e0d6; border-radius: 8px;
  background: #fdfcf9; font-size: 12.5px; color: #444; font-family: inherit;
}
.field select:focus { outline: none; border-color: #f0b79b; background: #fff; box-shadow: 0 0 0 3px rgba(232,112,58,.1); }
.dir-log { max-height: 220px; overflow-y: auto; }
.dir-item { font-size: 12px; color: var(--text-2); padding: 5px 0; border-bottom: 1px dashed #f0e9df; line-height: 1.5; }
.dir-item .t { color: var(--muted); font-size: 10.5px; margin-right: 6px; font-variant-numeric: tabular-nums; }

/* ============ v0.5 主题换肤：红楼梦 ============ */
body[data-theme="honglou"] {
  --bg: #f3ecdc;
  --bg-2: #ece2cc;
  --surface: #fffdf6;
  --surface-2: #faf5e9;
  --line: #e2d6bc;
  --line-soft: #eee4cf;
  --text: #33291a;
  --text-2: #5a4c36;
  --muted: #9c8d72;
  --brand: #a83232;
  --brand-soft: #f9e9e4;
}
body[data-theme="honglou"] .logo { background: linear-gradient(135deg, #a83232, #c9a227); }
body[data-theme="honglou"] .btn.primary { background: var(--brand); }
body[data-theme="honglou"] .live-dot { background: var(--brand); }

/* 客串人物标记 */
.person.is-npc .p-avatar { outline: 1.5px dashed var(--muted); outline-offset: 2px; }
.person.is-npc .p-name::after { content: '客串'; font-size: 10px; color: var(--muted); margin-left: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 0 4px; }

/* ============ 命运线页签 ============ */
.fate-list { display: flex; flex-direction: column; gap: 10px; }
.fate-node { border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 10px 12px; background: var(--surface-2); }
.fate-node.locked { opacity: .55; }
.fate-node.current { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.fate-node.changed { background: #fbf3e4; }
.f-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.f-idx { font-size: 11px; color: var(--brand); font-weight: 600; white-space: nowrap; }
.f-head b { flex: 1; }
.badge { font-size: 10.5px; border-radius: 7px; padding: 1px 7px; white-space: nowrap; }
.badge.on { background: var(--brand-soft); color: var(--brand); }
.badge.done { background: var(--line-soft); color: var(--muted); }
.badge.div { background: #fdf1d7; color: #9a6b0d; }
.f-text { font-size: 12px; line-height: 1.65; color: var(--text-2); margin-top: 6px; }
.f-text.muted { color: var(--muted); }
.verdict { font-size: 12.5px; line-height: 1.8; color: var(--text-2); background: var(--surface-2); border-left: 3px solid var(--brand); border-radius: 8px; padding: 8px 10px; }

/* ============ v0.6 剧本馆（红楼故事页签） ============ */
.theater-now { margin-bottom: 12px; }
.now-card { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--r-sm); padding: 12px 14px; background: var(--surface-2); }
.now-head { display: flex; align-items: center; gap: 8px; font-size: 14.5px; margin-bottom: 6px; }
.now-meta { font-size: 12px; color: var(--muted); margin-top: 8px; }
.theater-list { display: flex; flex-direction: column; gap: 8px; }
.score-chip { font-size: 10.5px; border-radius: 8px; padding: 1px 8px; font-weight: 700; white-space: nowrap; }
.score-chip.ok { background: #e7f3e9; color: #2f7d46; }
.score-chip.mid { background: #fdf1d7; color: #9a6b0d; }
.score-chip.low { background: #fbe9e4; color: #b4381f; }
.arch-drawer { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); padding: 12px 14px; box-shadow: 0 4px 18px rgba(0,0,0,.06); }
.arch-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13.5px; }
.arch-drawer .sec { margin: 10px 0; }
.arch-drawer .sec h4 { margin: 0 0 6px; font-size: 12.5px; color: var(--brand); }
.conv-item { font-size: 12px; line-height: 1.6; padding: 6px 0; border-bottom: 1px dashed var(--line-soft); }
.conv-item .cv-x { color: var(--text-2); margin-top: 2px; }
.dir-item i, .f-text i.up { color: #2f7d46; font-style: normal; }
.dir-item i.down { color: #b4381f; }
.factor-list { display: flex; flex-direction: column; gap: 6px; }
.factor-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 6px 10px; background: var(--surface-2); }
.factor-row .fa { font-weight: 600; min-width: 72px; }
.factor-row .fm i { font-style: normal; color: var(--muted); }
.factor-row .fr { color: var(--text-2); flex: 1; }

/* ============ v0.7 预测器 · 多维曲线 · 往期回顾 ============ */
.predict-box { margin-top: 10px; border: 1px solid var(--brand); border-radius: var(--r-sm); background: var(--surface); padding: 12px 14px; box-shadow: 0 4px 18px rgba(0,0,0,.06); }
.predict-box .sec h4 { margin: 8px 0 4px; font-size: 12.5px; color: var(--brand); }
.past-archives { display: flex; flex-direction: column; gap: 12px; }
.past-sec { border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: var(--surface-2); padding: 10px 12px; }
.past-sec .verdict { margin: 6px 0; }
.mood-btn, .rel-btn { margin-left: 3px; font-size: 10px; padding: 0 5px; }
.rel-chip { white-space: nowrap; }

/* ============ v0.8 引路人：岔路口 · 命门 · 对照卡 · 图鉴 · 蝴蝶 ============ */
.badge.crit { background: linear-gradient(135deg, #f5e6b8, #e8c96a); color: #7a5a10; border: 1px solid #c9a227; font-weight: 700; }
.fate-node.critical { border-color: #c9a227; box-shadow: 0 0 0 1.5px rgba(201,162,39,.45); }
.fate-node.critical.current { border-color: #a83232; box-shadow: 0 0 0 2px rgba(168,50,50,.35), 0 0 0 4px rgba(201,162,39,.35); }
.now-card.critical { border-left-color: #c9a227; }
.fate-node.affected {
  animation: fatePulse 1.6s ease-in-out infinite;
  border-color: var(--brand);
}
@keyframes fatePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168,50,50,.35); }
  50% { box-shadow: 0 0 0 4px rgba(168,50,50,.18); }
}
.forks { margin-bottom: 8px; }
.fork-row { display: flex; flex-wrap: wrap; gap: 6px; }
.fork-chip {
  position: relative; border: 1px solid var(--brand); background: var(--surface);
  color: var(--brand); border-radius: var(--r-sm); padding: 7px 12px; font-size: 12.5px;
  cursor: pointer; font-family: inherit; line-height: 1.35; text-align: left;
  transition: background .15s, color .15s, box-shadow .15s;
}
.fork-chip:hover { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(168,50,50,.25); }
.fork-chip .fork-hint {
  display: block; font-size: 10.5px; opacity: .75; margin-top: 2px; font-weight: 400; max-width: 200px;
}
.fork-chip:hover .fork-hint { opacity: .95; }
.adv-vars { margin-top: 6px; border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 6px 8px; background: var(--surface); }
.adv-vars summary { cursor: pointer; font-size: 11.5px; color: var(--muted); user-select: none; padding: 2px 0; }
.adv-vars[open] summary { margin-bottom: 6px; color: var(--text-2); }
.var-row .impact { font-size: 10px; color: #c9a227; white-space: nowrap; min-width: 28px; text-align: center; }
.var-row .impact-tip { font-size: 11px; color: var(--muted); cursor: help; }
.var-row.hot-row { opacity: .72; }
.var-row.hot-row .v { background: var(--line-soft); cursor: not-allowed; }
.butterfly-card {
  margin-bottom: 8px; padding: 8px 10px; border-radius: var(--r-sm);
  background: linear-gradient(135deg, #fbf3e4, #fff8ee); border: 1px solid #e8c96a;
}
.bf-title { font-size: 11.5px; font-weight: 700; color: #9a6b0d; margin-bottom: 4px; }
.bf-pair { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 12px; padding: 3px 0; border-bottom: 1px dashed rgba(201,162,39,.35); }
.bf-pair:last-child { border-bottom: 0; }
.bf-o { color: var(--muted); }
.bf-o::first-letter { color: #a83232; font-weight: 700; }
.bf-arrow { color: #c9a227; font-weight: 700; }
.bf-n { color: var(--text); font-weight: 600; }
.bf-note { width: 100%; font-size: 11px; color: var(--brand); font-style: italic; padding-left: 10px; }
.cmp-head { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.cmp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.cmp-l, .cmp-r { font-size: 12px; line-height: 1.55; padding: 6px 8px; border-radius: 6px; }
.cmp-l { background: var(--line-soft); color: var(--text-2); }
.cmp-r { background: #fbf3e4; color: var(--text); border-left: 2px solid var(--brand); }
.verdict-inline { font-weight: 600; }
.aff-row { display: flex; flex-wrap: wrap; gap: 6px; }
.aff-chip { font-size: 11px; padding: 2px 8px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand); }
.ending-atlas { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.end-cell { border-radius: var(--r-sm); padding: 10px 8px; text-align: center; border: 1px solid var(--line); min-height: 64px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.end-cell b { font-size: 12.5px; }
.end-cell span { font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.end-cell.lit { background: linear-gradient(160deg, #fff8ee, #f5e6b8); border-color: #c9a227; box-shadow: 0 1px 6px rgba(201,162,39,.25); }
.end-cell.lit b { color: #7a5a10; }
.end-cell.dim { background: var(--surface-2); opacity: .55; }
.end-cell.dim b { font-size: 22px; color: var(--muted); }

/* ============ v0.9 时光长河 · 操控台 ============ */
.console-box { display: flex; flex-direction: column; gap: 4px; }
.cons-play { flex-wrap: wrap; }
.cons-sec { margin: 6px 0 10px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: var(--surface-2); }
#cAuto.on { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.digest-list { display: flex; flex-direction: column; gap: 6px; max-height: 160px; overflow: auto; }
.digest-card { font-size: 12px; line-height: 1.5; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-soft); }
.digest-card.unread { border-color: var(--brand); background: #fbf3e4; }
.digest-card b { display: block; margin-bottom: 2px; color: var(--brand); }
.time-tree { display: flex; flex-direction: column; gap: 10px; max-height: 280px; overflow: auto; padding: 4px 0; }
.tt-branch { border-left: 3px solid var(--line); padding-left: 8px; opacity: .75; }
.tt-branch.on { border-left-color: var(--brand); opacity: 1; }
.tt-br-label { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.tt-nodes { display: flex; flex-direction: column; gap: 4px; }
.tt-node {
  display: flex; align-items: center; gap: 6px; text-align: left;
  border: 1px solid var(--line-soft); background: var(--surface); border-radius: 8px;
  padding: 6px 8px; font-size: 11.5px; cursor: pointer; font-family: inherit; color: var(--text);
}
.tt-node:hover { border-color: var(--brand); }
.tt-node.active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); background: #fff8ee; }
.tt-node.pin { border-color: #a83232; }
.tt-node span { color: var(--brand); font-weight: 600; white-space: nowrap; }
.tt-node i { font-style: normal; color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cause-card { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--brand); border-radius: var(--r-sm); background: var(--surface); }
.compare-box { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.grow-rels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
#digestBadge { background: var(--brand); color: #fff; }
