/* ==========================================================================
   测心 · 样式
   调性：深夜直播间的冷静判断。深底、紫为主、金为辅、留白充足。
   ========================================================================== */

:root {
  --bg: #0d0b14;
  --bg-2: #121020;
  --card: #191527;
  --card-2: #211b32;
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.13);
  --txt: #f1edfb;
  --txt-2: #a49cbd;
  --txt-3: #6e6787;
  --acc: #a875ff;
  --acc-soft: rgba(168, 117, 255, 0.14);
  --gold: #ffc061;
  --gold-soft: rgba(255, 192, 97, 0.13);
  --danger: #ff6b81;
  --danger-soft: rgba(255, 107, 129, 0.12);
  --ok: #4fe0b0;
  --ok-soft: rgba(79, 224, 176, 0.12);
  --r: 16px;
  --r-sm: 11px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.75);
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

/* 关键：任何带 display 声明的组件都会覆盖 hidden 属性，这里统一兜住 */
[hidden] { display: none !important; }

/* ---------- 兼容兜底：老内核的 flex gap ----------
   flex 布局的 gap 要到 Chrome 84 才支持。QQ 浏览器、部分安卓内置浏览器
   内核低于这个版本时，gap 会被整条忽略 —— 选项标签、弹窗按钮、卡片按钮
   会全部粘成一坨，看着就是「这网站坏了」。
   检测在 app.js 里做：不支持就给 <html> 挂上 .no-flexgap，这里补间距。 */
.no-flexgap .chips { margin: -4px; }
.no-flexgap .chips > * { margin: 4px; }
.no-flexgap .c-actions > * + * { margin-left: 8px; }
.no-flexgap .sheet-actions > * + * { margin-left: 10px; }
.no-flexgap .chat-form > * + * { margin-left: 8px; }
.no-flexgap .chat-quick > * + * { margin-left: 8px; }
.no-flexgap .topbar > * + * { margin-left: 12px; }
.no-flexgap .brand > * + * { margin-left: 11px; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;      /* 老内核兜底：不认 dvh */
  min-height: 100dvh;
  background-image:
    radial-gradient(760px 420px at 12% -6%, rgba(168, 117, 255, 0.16), transparent 62%),
    radial-gradient(620px 380px at 96% 4%, rgba(255, 192, 97, 0.08), transparent 60%);
  background-attachment: fixed;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg { width: 100%; height: 100%; display: block; }

/* ---------- 启动态 ---------- */
.boot {
  position: fixed;
  /* inset 的等价写法：老内核（QQ 浏览器 X5 等）不认 inset，会整块错位 */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding: 30px 20px;
  overflow-y: auto;
  background: var(--bg);
  z-index: 90;
  transition: opacity 0.45s ease;
}
/* 首尾各撑一份 auto 边距：内容少时垂直居中，
   内容多（比如失败说明）时也不会被顶部裁掉，能一路滚着看完 */
.boot > :first-child { margin-top: auto; }
.boot > :last-child { margin-bottom: auto; }
.boot.gone { opacity: 0; pointer-events: none; }
.boot-heart { width: 62px; height: 62px; color: var(--acc); flex: none; }
.boot-heart .beat {
  stroke-dasharray: 46;
  animation: beat 1.5s ease-in-out infinite;
}
@keyframes beat {
  0%, 100% { stroke-dashoffset: 46; opacity: 0.35; }
  45% { stroke-dashoffset: 0; opacity: 1; }
}
.boot p { margin: 0; color: var(--txt-3); font-size: 13px; letter-spacing: 0.06em; }

/* ---------- 外框 ---------- */
.app {
  max-width: 580px;
  margin: 0 auto;
  padding: 0 16px calc(96px + env(safe-area-inset-bottom));
}

/* ---------- 顶栏 ---------- */
/* 署名条与品牌行同一吸顶容器，避免滚动时正文从中间穿过去 */
.topwrap {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: env(safe-area-inset-top, 0px) 0 0;
  background: linear-gradient(to bottom, rgba(13, 11, 20, 0.97) 70%, rgba(13, 11, 20, 0));
  backdrop-filter: blur(10px);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 4px 14px;
  margin-bottom: 4px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(140deg, #a875ff, #7a45e0 55%, #4d2a9c);
  box-shadow: 0 6px 18px -6px rgba(168, 117, 255, 0.75);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 17px; letter-spacing: 0.14em; }
.brand-text small { font-size: 11px; color: var(--txt-3); letter-spacing: 0.05em; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: var(--txt-3);
  white-space: nowrap;
}
.status i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--txt-3);
  transition: background 0.3s;
}
.status.ok i { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status.ok { color: var(--txt-2); }
.status.bad i { background: var(--danger); }
.status.bad { color: var(--danger); }

/* ---------- 视图 ---------- */
.view { display: none; padding-top: 8px; animation: rise 0.34s ease both; }
.view.is-active { display: block; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.lead { margin: 6px 2px 20px; }
.lead h2 {
  margin: 0 0 7px;
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: 0.01em;
}
.lead p { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--txt-2); }

/* ---------- 上传区 ---------- */
.drop {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 30px 20px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.017);
  text-align: center;
  transition: border-color 0.2s, background 0.2s, transform 0.12s;
}
.drop:hover, .drop:focus-visible { border-color: var(--acc); background: var(--acc-soft); outline: none; }
.drop.over { border-color: var(--acc); background: var(--acc-soft); transform: scale(1.008); }
.drop-icon { width: 34px; height: 34px; color: var(--acc); opacity: 0.85; }
.drop-title { margin: 0; font-size: 13.5px; color: var(--txt-2); }
.drop-sub { margin: 0; font-size: 11.5px; color: var(--txt-3); }
kbd {
  padding: 1px 5px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  font-family: inherit;
}

/* ---------- 缩略图 ---------- */
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 9px;
  margin-top: 12px;
}
.thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb b {
  position: absolute;
  top: 5px; right: 5px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
}

/* 老内核没有 aspect-ratio：用 padding 撑出同样的 3:4，别让缩略图塌成一条线 */
@supports not (aspect-ratio: 3 / 4) {
  .thumb::before { content: ""; display: block; padding-top: 133.33%; }
  .thumb img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
}

/* ---------- 折叠补充 ---------- */
.fold {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.017);
  overflow: hidden;
}
.fold > summary {
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--txt-2);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: "";
  width: 7px; height: 7px;
  border-right: 1.6px solid var(--txt-3);
  border-bottom: 1.6px solid var(--txt-3);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.22s;
}
.fold[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.fold > summary span { color: var(--txt-3); font-size: 12px; }
.fold-body { padding: 2px 16px 18px; }

/* ---------- 字段 ---------- */
.field { margin-top: 18px; }
.field:first-child { margin-top: 0; }
.field > label {
  display: block;
  margin-bottom: 9px;
  font-size: 12.5px;
  color: var(--txt-3);
  letter-spacing: 0.04em;
}
textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.28);
  color: var(--txt);
  font-size: 13.5px;
  line-height: 1.65;
  resize: vertical;
  transition: border-color 0.2s;
}
textarea:focus { outline: none; border-color: var(--acc); }
textarea::placeholder { color: var(--txt-3); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroller {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.chips.scroller::-webkit-scrollbar { display: none; }
.chip {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.024);
  color: var(--txt-2);
  font-size: 12.5px;
  white-space: nowrap;
  transition: all 0.18s;
}
.chip:hover { border-color: var(--line-2); color: var(--txt); }
.chip.on {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(168, 117, 255, 0.9), rgba(122, 69, 224, 0.9));
  color: #fff;
  box-shadow: 0 5px 16px -7px rgba(168, 117, 255, 0.9);
}

/* ---------- 主按钮 ---------- */
.go {
  width: 100%;
  margin-top: 20px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--r);
  background: linear-gradient(135deg, #b47cff, #7a45e0 58%, #5b2fb8);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  box-shadow: 0 12px 30px -12px rgba(122, 69, 224, 0.95);
  transition: transform 0.14s, box-shadow 0.2s, opacity 0.2s;
}
.go svg { width: 18px; height: 18px; flex: none; }
.go:hover { transform: translateY(-1px); box-shadow: 0 16px 34px -12px rgba(122, 69, 224, 1); }
.go:active { transform: translateY(0) scale(0.99); }
.go[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- 搜索 ---------- */
.search {
  position: relative;
  margin-bottom: 14px;
}
.search svg {
  position: absolute;
  left: 13px; top: 50%;
  width: 17px; height: 17px;
  transform: translateY(-50%);
  color: var(--txt-3);
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.28);
  color: var(--txt);
  font-size: 13.5px;
}
.search input:focus { outline: none; border-color: var(--acc); }
.search input::placeholder { color: var(--txt-3); }

/* ---------- 输出区 ---------- */
.out { margin-top: 20px; }
.out:empty { margin-top: 0; }

/* 仪式感加载 */
.scan {
  display: grid;
  justify-items: center;
  gap: 15px;
  padding: 34px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.scan-heart { width: 42px; height: 42px; color: var(--acc); }
.scan-heart .beat-y {
  stroke-dasharray: 46;
  animation: beat 1.35s ease-in-out infinite;
}
.scan-stage { margin: 0; font-size: 13.5px; color: var(--txt-2); letter-spacing: 0.04em; }
.scan-hint {
  min-height: 16px;
  margin: -7px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--txt-3);
}
.scan-bar {
  width: 168px; height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.scan-bar i {
  display: block; height: 100%; width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--acc), var(--gold), transparent);
  animation: sweep 1.3s ease-in-out infinite;
}
@keyframes sweep {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(300%); }
}

/* 卡片通用 */
.card {
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--txt-3);
  text-transform: uppercase;
}
.card-head::before {
  content: "";
  width: 3px; height: 12px;
  border-radius: 2px;
  background: var(--acc);
}
.card.gold .card-head::before { background: var(--gold); }
.card.danger .card-head::before { background: var(--danger); }
.card.danger { border-color: rgba(255, 107, 129, 0.22); }
.fadein { animation: rise 0.4s ease both; }

/* 定性 */
.verdict-text {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  font-weight: 600;
}
.temp {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.temp-label { font-size: 11.5px; color: var(--txt-3); white-space: nowrap; }
.temp-track {
  flex: 1;
  display: flex;
  gap: 4px;
}
.temp-track i {
  flex: 1; height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.temp-track i.on { background: var(--acc); }
.temp-track i.on.hot { background: var(--danger); }
.temp-track i.on.warm { background: var(--gold); }
.temp-num { font-size: 12.5px; color: var(--txt-2); font-variant-numeric: tabular-nums; }

/* 列表 */
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.list li {
  position: relative;
  padding-left: 19px;
  font-size: 13.5px;
  line-height: 1.68;
  color: var(--txt-2);
}
.list li::before {
  content: "";
  position: absolute;
  left: 2px; top: 9px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--acc);
}
.card.gold .list li::before { background: var(--gold); }
.card.danger .list li::before { background: var(--danger); }
.card.danger .list li { color: var(--txt); }

/* 回法卡 */
.reply { margin-top: 12px; }
.reply-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.badge {
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.badge.soft { background: var(--ok-soft); color: var(--ok); }
.badge.mid { background: var(--acc-soft); color: var(--acc); }
.badge.hard { background: var(--danger-soft); color: var(--danger); }
.reply-label { font-size: 12px; color: var(--txt-3); }
.reply-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.72;
  color: var(--txt);
  letter-spacing: 0.01em;
}
.reply-copy {
  margin-top: 12px;
  padding: 8px 15px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--txt-2);
  transition: all 0.18s;
}
.reply-copy:hover { border-color: var(--acc); color: var(--acc); }
.reply-copy.done { border-color: var(--ok); color: var(--ok); }

/* 下一步 */
.next-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--txt-2);
}

/* 要票：话术行 */
.tier { margin-top: 12px; }
.tier-head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 10px;
}
.tier-name { font-size: 14px; font-weight: 600; }
.tier-note { font-size: 11.5px; color: var(--txt-3); }
.line {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 13px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.22);
  font-size: 14px;
  line-height: 1.68;
}
.line p { margin: 0; flex: 1; }
.line button {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--txt-3);
  transition: all 0.18s;
}
.line button svg { width: 15px; height: 15px; }
.line button:hover { border-color: var(--acc); color: var(--acc); }
.line button.done { border-color: var(--ok); color: var(--ok); }

/* ---------- 话术库 ---------- */
.lib { display: grid; gap: 12px; margin-top: 4px; }
.lib-card { padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.lib-card h3 { margin: 0 0 5px; font-size: 15px; letter-spacing: 0.01em; }
.lib-scene { margin: 0 0 13px; font-size: 12.5px; color: var(--txt-3); }
.lib-part-label { font-size: 11.5px; letter-spacing: 0.1em; color: var(--txt-3); margin-bottom: 8px; }
.lib-say { display: grid; gap: 8px; }
.lib-say .line { margin-top: 0; }
.lib-dont { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.lib-dont ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.lib-dont li {
  position: relative;
  padding-left: 17px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--txt-3);
}
.lib-dont li::before {
  content: "\00d7";
  position: absolute;
  left: 2px;
  color: var(--danger);
  font-weight: 700;
}
.empty { padding: 44px 0; text-align: center; color: var(--txt-3); font-size: 13.5px; }

/* ---------- 底栏 ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 580px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(13, 11, 20, 0.9);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  z-index: 50;
}
.tab {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 0;
  color: var(--txt-3);
  font-size: 11px;
  transition: color 0.2s;
}
.tab svg { width: 21px; height: 21px; }
.tab em { font-style: normal; letter-spacing: 0.06em; }
.tab.is-active { color: var(--acc); }

/* ---------- 提示条 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  max-width: 88vw;
  padding: 11px 18px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(30, 25, 46, 0.96);
  backdrop-filter: blur(12px);
  color: var(--txt);
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s, transform 0.24s;
  z-index: 80;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 错误块 ---------- */
.err {
  padding: 16px 18px;
  border: 1px solid rgba(255, 107, 129, 0.3);
  border-radius: var(--r);
  background: var(--danger-soft);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--txt);
}
.err b { color: var(--danger); }
.err .err-act {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 107, 129, 0.4);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--danger);
}

.raw {
  margin-top: 10px;
  font-size: 12px;
  color: var(--txt-3);
}
.raw > summary { cursor: pointer; padding: 6px 0; }
.raw pre {
  margin: 8px 0 0;
  padding: 12px;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.4);
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow: auto;
  color: var(--txt-2);
}

/* ==========================================================================
   人格画像 / 动机 / 维护策略
   ========================================================================== */

.field > label .tip { margin-left: 6px; color: var(--txt-3); font-size: 11.5px; }

.notice {
  padding: 13px 15px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--acc);
  border-radius: var(--r-sm);
  background: rgba(168, 117, 255, 0.06);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--txt-2);
}
.notice b { color: var(--acc); }

/* ---- 画像主卡 ---- */
.card.hero { border-color: rgba(168, 117, 255, 0.28); }
.hero-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.hero-type {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.03em;
  background: linear-gradient(100deg, #cbb0ff, #a875ff 45%, #ffc061);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.conf {
  flex: none;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.conf-高 { background: var(--ok-soft); color: var(--ok); }
.conf-中 { background: var(--gold-soft); color: var(--gold); }
.conf-低 { background: rgba(255, 255, 255, 0.07); color: var(--txt-3); }
.hero-tag {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--txt-2);
}
.hero-line {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.7;
  color: var(--txt-2);
}
.hero-line b {
  display: block;
  margin-bottom: 3px;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--txt-3);
}

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.tags span {
  padding: 4px 11px;
  border: 1px solid rgba(168, 117, 255, 0.3);
  border-radius: 999px;
  background: rgba(168, 117, 255, 0.09);
  font-size: 12px;
  color: #c9b2f5;
}

/* ---- 动机强度 ---- */
.needs { display: grid; gap: 13px; }
.need-top { display: flex; align-items: center; gap: 10px; }
.need-name { flex: none; width: 62px; font-size: 13px; color: var(--txt); }
.need-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.need-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7a45e0, #a875ff);
  animation: grow 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes grow { from { transform: scaleX(0); transform-origin: left; } }
.need-num {
  flex: none;
  width: 14px;
  text-align: right;
  font-size: 12px;
  color: var(--txt-3);
  font-variant-numeric: tabular-nums;
}
.need-why { margin: 5px 0 0 72px; font-size: 11.5px; color: var(--txt-3); }

/* ---- 关系阶段 ---- */
.stage-chip {
  display: inline-block;
  padding: 6px 15px;
  margin-bottom: 11px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.07);
}
.stage-chip.phase-升温期 { background: var(--ok-soft); color: var(--ok); }
.stage-chip.phase-稳定期 { background: var(--acc-soft); color: var(--acc); }
.stage-chip.phase-倦怠期 { background: var(--gold-soft); color: var(--gold); }
.stage-chip.phase-危险期 { background: var(--danger-soft); color: var(--danger); }

.alert-card { animation: alertIn 0.5s ease both; }
@keyframes alertIn {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 129, 0.4); }
  100% { box-shadow: 0 0 0 12px rgba(255, 107, 129, 0); }
}
.alert-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 107, 129, 0.2);
  font-size: 12px;
  line-height: 1.65;
  color: var(--txt-3);
}

/* ---- 维护策略 ---- */
.maint-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.maint-row:last-of-type { border-bottom: 0; }
.maint-row span {
  flex: none;
  width: 66px;
  font-size: 12px;
  color: var(--txt-3);
  line-height: 1.7;
}
.maint-row p { margin: 0; flex: 1; font-size: 13.5px; line-height: 1.7; color: var(--txt); }
.maint-block { margin-top: 14px; }
.maint-block h4 {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--txt-3);
}
.card.gold .maint-block .list li::before { background: var(--gold); }

/* ==========================================================================
   人格图谱
   ========================================================================== */

.p-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
}
.p-card[open] { border-color: rgba(168, 117, 255, 0.3); }
.p-card > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 17px;
  cursor: pointer;
  list-style: none;
}
.p-card > summary::-webkit-details-marker { display: none; }
.p-title { flex: 1; min-width: 0; }
.p-title h3 { margin: 0 0 4px; font-size: 15.5px; letter-spacing: 0.02em; }
.p-title p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--txt-3); }
.p-card > summary::after {
  content: "";
  flex: none;
  width: 7px; height: 7px;
  margin-right: 3px;
  border-right: 1.6px solid var(--txt-3);
  border-bottom: 1.6px solid var(--txt-3);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.22s;
}
.p-card[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.p-body {
  padding: 2px 17px 18px;
  border-top: 1px solid var(--line);
  animation: rise 0.3s ease both;
}
.p-body .tags { margin-top: 14px; }
.p-body .tags span {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.045);
  color: var(--txt-2);
}
.p-block { margin-top: 15px; }
.p-block h4 {
  margin: 0 0 7px;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--txt-3);
}
.p-block p { margin: 0; font-size: 13px; line-height: 1.72; color: var(--txt-2); }
.p-block .list li { font-size: 13px; }
.p-block.ask {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--acc-soft);
}
.p-block.ask h4 { color: var(--acc); }
.p-block.ask p { color: var(--txt); }
.p-block.red {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--danger-soft);
}
.p-block.red h4 { color: var(--danger); }
.p-block.red p { color: var(--txt); }

/* ==========================================================================
   今日维护
   ========================================================================== */

.summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 16px 18px;
  margin-top: 6px;
  border: 1px solid rgba(168, 117, 255, 0.26);
  border-radius: var(--r);
  background: linear-gradient(135deg, rgba(168, 117, 255, 0.14), rgba(255, 192, 97, 0.06));
}
.summary:empty { display: none; }
.summary strong {
  font-size: 30px;
  line-height: 1;
  background: linear-gradient(120deg, #cbb0ff, #ffc061);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.summary .sum-txt { font-size: 14px; color: var(--txt-2); }
.summary .sum-sub { margin-left: auto; font-size: 12px; color: var(--txt-3); }

.ghost-btn {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  color: var(--txt-2);
  font-size: 13.5px;
  transition: all 0.18s;
}
.ghost-btn svg { width: 17px; height: 17px; }
.ghost-btn:hover { border-color: var(--acc); color: var(--acc); background: var(--acc-soft); }

.privacy {
  margin: 16px 0 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--txt-3);
}
.signature {
  margin: 0;
  padding: 10px 0 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  color: var(--txt-3);
  opacity: 0.78;
}

/* ---- 名单卡片 ---- */
.contacts { display: grid; gap: 12px; margin-top: 16px; }
.contact {
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}
.contact.lv-late { border-color: rgba(255, 107, 129, 0.32); }
.contact.lv-due { border-color: rgba(255, 192, 97, 0.28); }
.c-head { display: flex; align-items: flex-start; gap: 11px; }
.c-id { flex: 1; min-width: 0; }
.c-name {
  margin: 0 0 5px;
  font-size: 16px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.c-type {
  padding: 2px 9px;
  border: 1px solid rgba(168, 117, 255, 0.32);
  border-radius: 999px;
  background: rgba(168, 117, 255, 0.1);
  font-size: 11px;
  font-weight: 400;
  color: #c9b2f5;
}
.c-meta { margin: 0; font-size: 12px; line-height: 1.6; color: var(--txt-3); }
.c-level {
  flex: none;
  padding: 3px 10px;
  border-radius: 7px;
  font-size: 11.5px;
  white-space: nowrap;
}
.lv-late .c-level { background: var(--danger-soft); color: var(--danger); }
.lv-due .c-level { background: var(--gold-soft); color: var(--gold); }
.lv-soon .c-level { background: rgba(255, 255, 255, 0.06); color: var(--txt-3); }
.lv-new .c-level { background: var(--acc-soft); color: var(--acc); }
.lv-ok .c-level { background: rgba(255, 255, 255, 0.06); color: var(--txt-3); }

.c-tip {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.7;
  color: var(--txt-2);
}
.c-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.c-actions button {
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--txt-2);
  transition: all 0.18s;
}
.c-actions button:hover { border-color: var(--acc); color: var(--acc); }
.c-actions button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(168, 117, 255, 0.92), rgba(122, 69, 224, 0.92));
  color: #fff;
}
.c-actions button.primary:hover { color: #fff; filter: brightness(1.1); }
.c-actions button.del-btn {
  margin-left: auto;
  border-color: rgba(255, 107, 129, 0.28);
  color: rgba(255, 107, 129, 0.9);
}
.c-actions button.del-btn:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.c-out:empty { display: none; }
.c-out { margin-top: 14px; }
.c-out .card { box-shadow: none; padding: 14px 15px; }
.c-out .line { font-size: 13.5px; }

.empty-state {
  padding: 30px 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  text-align: center;
  margin-top: 16px;
}
.empty-state h3 { margin: 0 0 8px; font-size: 15px; }
.empty-state p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--txt-3); }

/* ==========================================================================
   分段控件
   ========================================================================== */

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
}
.seg button {
  padding: 10px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--txt-3);
  transition: all 0.2s;
}
.seg button.on {
  background: rgba(168, 117, 255, 0.17);
  color: #cbb0ff;
}
.seg-panel { display: none; }
.seg-panel.is-on { display: block; animation: rise 0.3s ease both; }

/* ==========================================================================
   底部抽屉表单
   ========================================================================== */

/* 四边写法而非 inset：QQ 浏览器等老内核不认 inset，会整块错位 */
.sheet { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100; }
.sheet-mask {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(6, 5, 10, 0.72);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.24s ease both;
}
@keyframes fadeIn { from { opacity: 0; } }
.sheet-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 580px;
  max-height: 88vh;       /* 老内核兜底 */
  max-height: 88dvh;
  overflow-y: auto;
  padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  border-top: 1px solid var(--line-2);
  background: var(--bg-2);
  animation: sheetUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes sheetUp { from { transform: translate(-50%, 100%); } }
.sheet-grab {
  width: 38px; height: 4px;
  margin: 6px auto 16px;
  border-radius: 999px;
  background: var(--line-2);
}
.sheet-panel h3 { margin: 0 0 20px; font-size: 17px; letter-spacing: 0.04em; }
.sheet-panel .field:first-of-type { margin-top: 0; }
.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.sheet-actions button {
  flex: 1;
  padding: 14px;
  border-radius: 13px;
  font-size: 14.5px;
  transition: all 0.18s;
}
.sheet-actions .ghost {
  flex: 0 0 auto;
  padding: 14px 20px;
  border: 1px solid var(--line-2);
  color: var(--txt-2);
}
.sheet-actions .ghost:hover { border-color: var(--acc); color: var(--acc); }
.sheet-actions .ghost:first-child:not(:last-child) { color: var(--danger); border-color: rgba(255, 107, 129, 0.3); }
.sheet-actions .primary {
  background: linear-gradient(135deg, #b47cff, #7a45e0 58%, #5b2fb8);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 26px -12px rgba(122, 69, 224, 0.95);
}

input[type="text"], input[type="date"] {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.28);
  color: var(--txt);
  font-size: 13.5px;
  transition: border-color 0.2s;
}
input[type="text"]:focus, input[type="date"]:focus { outline: none; border-color: var(--acc); }
input::placeholder { color: var(--txt-3); }
input[type="date"] { color-scheme: dark; }

/* ==========================================================================
   维护智能体入口
   ========================================================================== */

.agent-entry {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 17px;
  margin-top: 14px;
  border: 1px solid rgba(168, 117, 255, 0.3);
  border-radius: var(--r);
  background: linear-gradient(120deg, rgba(168, 117, 255, 0.13), rgba(122, 69, 224, 0.05));
  text-align: left;
  transition: all 0.2s;
}
.agent-entry:hover { border-color: var(--acc); transform: translateY(-1px); }
.ae-icon {
  flex: none;
  width: 38px; height: 38px;
  padding: 8px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(140deg, #b47cff, #7a45e0 60%, #4d2a9c);
  box-shadow: 0 6px 16px -7px rgba(168, 117, 255, 0.9);
}
.ae-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ae-text strong { font-size: 14px; letter-spacing: 0.01em; }
.ae-text small { font-size: 12px; color: var(--txt-3); }
.ae-arrow { flex: none; width: 17px; height: 17px; color: var(--txt-3); }

/* ==========================================================================
   对话面板
   ========================================================================== */

.chat {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 580px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background-image: radial-gradient(620px 340px at 50% -8%, rgba(168, 117, 255, 0.14), transparent 62%);
  animation: chatIn 0.28s ease both;
}
@keyframes chatIn { from { opacity: 0; transform: translate(-50%, 10px); } }

.chat-top {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: max(12px, env(safe-area-inset-top)) 14px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 11, 20, 0.86);
  backdrop-filter: blur(12px);
}
.chat-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-title strong { font-size: 15px; letter-spacing: 0.05em; }
.chat-title small { font-size: 11.5px; color: var(--txt-3); }
.chat-icon {
  flex: none;
  width: 34px; height: 34px;
  padding: 7px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--txt-2);
  transition: all 0.18s;
}
.chat-icon:hover { border-color: var(--acc); color: var(--acc); }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-overflow-scrolling: touch;
}

.msg { max-width: 88%; font-size: 14px; line-height: 1.72; }
.msg.user {
  align-self: flex-end;
  padding: 11px 15px;
  border-radius: 15px 15px 4px 15px;
  background: linear-gradient(135deg, #8b5cf6, #6d33d6);
  color: #fff;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.ai {
  align-self: flex-start;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 15px 15px 15px 4px;
  background: var(--card);
  color: var(--txt);
  word-break: break-word;
}
/* 失败气泡上的「再试一次」——重发同一句话，不用主播重打 */
.msg.ai .chat-retry { margin-top: 11px; }
.msg.ai .chat-retry .err-act {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid rgba(255, 107, 129, 0.4);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--danger);
  background: transparent;
  transition: background 0.18s;
}
.msg.ai .chat-retry .err-act:hover { background: var(--danger-soft); }
.msg.ai .chat-retry .err-act:disabled { opacity: 0.5; }
.msg.ai .quote {
  display: block;
  margin: 9px 0;
  padding: 11px 13px;
  border-left: 2px solid var(--acc);
  border-radius: 0 10px 10px 0;
  background: rgba(168, 117, 255, 0.11);
  color: #e2d6ff;
  cursor: pointer;
  transition: background 0.18s;
  font-size: 14.5px;
}
.msg.ai .quote:hover { background: rgba(168, 117, 255, 0.19); }
.msg.ai .quote::after {
  content: "点一下复制";
  display: block;
  margin-top: 5px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: rgba(226, 214, 255, 0.45);
}
.msg.ai .quote.done { background: var(--ok-soft); border-left-color: var(--ok); color: var(--ok); }
.msg.ai .quote.done::after { content: "已复制"; color: rgba(79, 224, 176, 0.6); }
.msg.sys {
  align-self: center;
  max-width: 92%;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  line-height: 1.6;
  color: var(--txt-3);
  text-align: center;
}

.typing { display: inline-flex; gap: 4px; align-items: center; height: 20px; }
.typing i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--acc);
  opacity: 0.4;
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: 0.18s; }
.typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.28; } 30% { opacity: 1; } }

.chat-quick {
  display: flex;
  gap: 8px;
  padding: 6px 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-quick::-webkit-scrollbar { display: none; }
.chat-quick:empty { display: none; }
.chat-quick button {
  flex: none;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--txt-2);
  white-space: nowrap;
  transition: all 0.18s;
}
.chat-quick button:hover { border-color: var(--acc); color: var(--acc); }

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 8px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(13, 11, 20, 0.9);
  backdrop-filter: blur(12px);
}
.chat-form textarea {
  flex: 1;
  max-height: 132px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  font-size: 14px;
  line-height: 1.6;
  resize: none;
}
.chat-form textarea:focus { border-color: var(--acc); }
.chat-send {
  flex: none;
  width: 44px; height: 44px;
  padding: 11px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #b47cff, #6d33d6);
  box-shadow: 0 8px 20px -9px rgba(122, 69, 224, 1);
  transition: all 0.18s;
}
.chat-send:hover { filter: brightness(1.1); }
.chat-send[disabled] { opacity: 0.45; box-shadow: none; }

/* ==========================================================================
   便签纸
   ========================================================================== */

.note-add {
  padding: 15px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  transition: border-color 0.2s;
}
.note-add:focus-within { border-color: rgba(168, 117, 255, 0.45); }
.note-add textarea {
  width: 100%;
  min-height: 46px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 14.5px;
  line-height: 1.7;
  resize: none;
}
.note-add textarea:focus { outline: none; border: 0; }
.note-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.note-bar .chips { gap: 6px; }
.note-bar .chip { padding: 6px 12px; font-size: 12px; }
.note-save {
  flex: none;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #b47cff, #7a45e0 60%, #5b2fb8);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: 0 8px 20px -10px rgba(122, 69, 224, 1);
  transition: all 0.18s;
}
.note-save:hover { filter: brightness(1.1); }
.note-save[disabled] { opacity: 0.45; box-shadow: none; cursor: not-allowed; }

.notes { display: grid; gap: 10px; margin-top: 14px; }
.note {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid rgba(168, 117, 255, 0.85);
  border-radius: 12px;
  background: var(--card);
  transition: transform 0.16s, border-color 0.2s;
}
.note.k-like { border-left-color: var(--ok); }
.note.k-avoid { border-left-color: var(--danger); background: rgba(255, 107, 129, 0.045); }
.note.pinned { background: rgba(168, 117, 255, 0.08); }
.note.k-avoid.pinned { background: rgba(255, 107, 129, 0.08); }

.note-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--txt);
  white-space: pre-wrap;
  word-break: break-word;
}
.note-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
  font-size: 11.5px;
  color: var(--txt-3);
}
.note-kind {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  letter-spacing: 0.04em;
}
.note.k-like .note-kind { background: var(--ok-soft); color: var(--ok); }
.note.k-avoid .note-kind { background: var(--danger-soft); color: var(--danger); }
.note-acts { margin-left: auto; display: flex; gap: 6px; }
.note-acts button {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--txt-3);
  transition: all 0.16s;
}
.note-acts button:hover { border-color: var(--acc); color: var(--acc); }
.note.pinned .note-acts button[data-pin] { border-color: rgba(168, 117, 255, 0.5); color: var(--acc); }

/* ==========================================================================
   聊天导航（一步步带着聊）
   ========================================================================== */

.lead-note {
  margin-top: 10px !important;
  padding: 9px 13px;
  border-radius: 10px;
  background: var(--acc-soft);
  border: 1px solid rgba(168, 117, 255, 0.2);
  font-size: 12.5px !important;
  color: var(--txt-2);
}

.gd { display: grid; gap: 12px; }

.gd-top {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 16px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r) var(--r) 0 0;
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(168, 117, 255, 0.13), transparent);
}
.gd-who {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.gd-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--acc-soft);
  border: 1px solid rgba(168, 117, 255, 0.3);
  color: var(--acc);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.gd-count { margin-left: auto; font-size: 11.5px; color: var(--txt-3); }

/* 层级进度轨 */
.gd-rail {
  display: flex;
  gap: 5px;
  padding: 0 16px 14px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--r) var(--r);
  background: rgba(0, 0, 0, 0.22);
}
.gd-rail i {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}
.gd-rail i.done { background: var(--acc); opacity: 0.55; }
.gd-rail i.now {
  background: var(--gold);
  box-shadow: 0 0 10px rgba(255, 192, 97, 0.55);
}

.gd-aim {
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  font-size: 13px;
  line-height: 1.7;
  color: var(--txt-2);
}
.gd-aim b { display: block; margin-top: 4px; font-size: 14.5px; color: var(--txt); font-weight: 600; }

/* 这一句：全卡片的视觉重心 */
.gd-say {
  position: relative;
  padding: 18px 16px 15px;
  border: 1px solid rgba(255, 192, 97, 0.3);
  border-radius: var(--r);
  background: linear-gradient(170deg, rgba(255, 192, 97, 0.11), rgba(168, 117, 255, 0.05));
}
.gd-say-tag {
  display: block;
  margin-bottom: 9px;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--gold);
}
.gd-say p {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--txt);
  word-break: break-word;
}
.gd-say .copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd089, #ffb03a);
  color: #2a1c00;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s;
}
.gd-say .copy svg { width: 15px; height: 15px; }
.gd-say .copy:hover { filter: brightness(1.07); }
.gd-hook {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed var(--line-2);
  font-size: 12px;
  line-height: 1.65;
  color: var(--txt-3);
}
.gd-hook b { color: var(--ok); font-weight: 500; }

.gd-meta { display: grid; gap: 9px; }
.gd-row {
  display: flex;
  gap: 11px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  font-size: 13px;
  line-height: 1.7;
  color: var(--txt-2);
}
.gd-row > span {
  flex: none;
  width: 62px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--txt-3);
  padding-top: 1px;
}
.gd-row p { margin: 0; flex: 1; }
.gd-row.warn { border-color: rgba(255, 107, 129, 0.24); background: rgba(255, 107, 129, 0.05); }
.gd-row.warn > span { color: var(--danger); }
.gd-row.watch ul { flex: 1; margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.gd-row.watch li { position: relative; padding-left: 15px; }
.gd-row.watch li::before {
  content: '';
  position: absolute;
  left: 2px; top: 8px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--acc);
}
.gd-row.harvest { border-style: dashed; }
.gd-row.harvest button {
  flex: none;
  align-self: center;
  padding: 6px 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12px;
  color: var(--txt-2);
  transition: all 0.16s;
}
.gd-row.harvest button:hover { border-color: var(--acc); color: var(--acc); }

/* 分支：对方大概会怎么回 */
.gd-branches {
  padding: 15px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.24);
}
.gd-branches h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
}
.gd-branches > p { margin: 0 0 12px; font-size: 12px; color: var(--txt-3); }
.gd-branch {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 13px 15px;
  text-align: left;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--card);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--txt);
  transition: all 0.18s;
}
.gd-branch:hover { border-color: var(--acc); background: var(--acc-soft); transform: translateX(2px); }
.gd-branch small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--txt-3); }
.gd-branch.free { border-style: dashed; color: var(--txt-2); }

.gd-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gd-foot button {
  padding: 9px 15px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--txt-2);
  transition: all 0.16s;
}
.gd-foot button:hover { border-color: var(--acc); color: var(--acc); }
.gd-foot button[disabled] { opacity: 0.4; cursor: not-allowed; }
.gd-foot button[disabled]:hover { border-color: var(--line-2); color: var(--txt-2); }

/* 走过的路 */
.gd-path {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  overflow: hidden;
}
.gd-path > summary {
  padding: 12px 15px;
  font-size: 12.5px;
  color: var(--txt-2);
  cursor: pointer;
  list-style: none;
}
.gd-path > summary::-webkit-details-marker { display: none; }
.gd-path > summary::after {
  content: '';
  float: right;
  width: 7px; height: 7px;
  margin-top: 5px;
  border-right: 1.6px solid var(--txt-3);
  border-bottom: 1.6px solid var(--txt-3);
  transform: rotate(45deg);
  transition: transform 0.22s;
}
.gd-path[open] > summary::after { transform: rotate(-135deg); }
.gd-path ol { margin: 0; padding: 0 15px 15px; list-style: none; display: grid; gap: 11px; }
.gd-path li {
  padding-left: 14px;
  border-left: 2px solid rgba(168, 117, 255, 0.4);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--txt-2);
}
.gd-path li b { display: block; font-size: 11.5px; color: var(--txt-3); font-weight: 500; }
.gd-path li i { display: block; font-style: normal; margin-top: 3px; color: var(--txt); }

@media (min-width: 560px) {
  .lead h2 { font-size: 23px; }
  .app { padding-left: 20px; padding-right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
