/* ===================================================================
   AI 伴侣 · 紫夜玫瑰（Violet Noir）主题
   —— 深紫夜色 + 玫瑰粉唇色 + 玻璃光晕
   =================================================================== */

:root {
  --bg: #0d0616;
  --bg-grad:
    radial-gradient(1000px 700px at 82% -12%, rgba(168, 85, 247, .26) 0%, transparent 62%),
    radial-gradient(900px 640px at -12% 108%, rgba(255, 77, 157, .20) 0%, transparent 58%),
    radial-gradient(760px 560px at 48% 118%, rgba(120, 60, 255, .18) 0%, transparent 62%);

  --surface: rgba(32, 18, 50, .74);
  --surface-2: rgba(48, 28, 74, .52);
  --sidebar: rgba(18, 10, 30, .78);
  --glass-hi: rgba(255, 255, 255, .08);
  --glass-line: rgba(255, 255, 255, .10);

  --text: #f4ecff;
  --text-soft: #c3b4e2;
  --text-faint: #a091c2;

  --primary: #b06bff;
  --primary-2: #ff5f9e;      /* 唇色玫瑰 */
  --primary-3: #ffd6e6;      /* 玫瑰金高光 */
  --primary-soft: rgba(176, 107, 255, .16);

  --border: rgba(168, 120, 255, .20);
  --border-strong: rgba(255, 107, 168, .45);

  --bubble-ai: linear-gradient(158deg, rgba(56, 32, 84, .92), rgba(34, 19, 54, .94));
  --bubble-user: linear-gradient(135deg, #a855f7 0%, #d95cff 45%, #ff5f9e 100%);

  --shadow: 0 10px 30px rgba(8, 2, 18, .48);
  --shadow-lg: 0 28px 70px rgba(40, 8, 80, .60);
  --glow-pink: 0 8px 26px rgba(255, 95, 158, .30);
  --glow-violet: 0 8px 26px rgba(168, 85, 247, .30);

  --radius: 18px;
  --radius-sm: 13px;

  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
}

[data-theme="light"] {
  --bg: #fdf9ff;
  --bg-grad:
    radial-gradient(1000px 700px at 84% -14%, rgba(186, 140, 255, .34) 0%, transparent 60%),
    radial-gradient(900px 640px at -10% 106%, rgba(255, 150, 195, .30) 0%, transparent 58%),
    radial-gradient(760px 560px at 48% 118%, rgba(214, 190, 255, .40) 0%, transparent 62%);

  --surface: rgba(255, 255, 255, .88);
  --surface-2: rgba(249, 243, 255, .92);
  --sidebar: rgba(255, 252, 255, .86);
  --glass-hi: rgba(255, 255, 255, .90);
  --glass-line: rgba(150, 110, 210, .16);

  --text: #2a1c3f;
  --text-soft: #6c5a8f;
  --text-faint: #9c8ab9;

  --primary: #8b3ff0;
  --primary-2: #ff4f94;
  --primary-3: #ffd0e2;
  --primary-soft: rgba(139, 63, 240, .10);

  --border: rgba(160, 120, 220, .22);
  --border-strong: rgba(255, 79, 148, .45);

  --bubble-ai: linear-gradient(158deg, #ffffff, #fdf6ff);
  --bubble-user: linear-gradient(135deg, #8b3ff0 0%, #c956ff 48%, #ff4f94 100%);

  --shadow: 0 10px 30px rgba(120, 70, 200, .10);
  --shadow-lg: 0 26px 64px rgba(120, 70, 200, .22);
  --glow-pink: 0 8px 24px rgba(255, 79, 148, .22);
  --glow-violet: 0 8px 24px rgba(139, 63, 240, .20);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  position: relative;
}

/* 极光流动背景 */
body::before {
  content: '';
  position: fixed; inset: -22%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(176, 107, 255, .30), transparent) 20% 24% / 46% 46% no-repeat,
    radial-gradient(closest-side, rgba(255, 95, 158, .24), transparent) 80% 16% / 44% 44% no-repeat,
    radial-gradient(closest-side, rgba(110, 55, 255, .22), transparent) 56% 86% / 54% 54% no-repeat;
  filter: blur(34px);
  animation: aurora 28s ease-in-out infinite alternate;
}
[data-theme="light"] body::before { opacity: .55; }
@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2.5%, -2.5%, 0) scale(1.07); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.03); }
}

/* 细腻噪点，让玻璃有质感 */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }

/* 滚动条：细粉紫 */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(176, 107, 255, .55), rgba(255, 95, 158, .55));
  border-radius: 99px; border: 2px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(176, 107, 255, .85), rgba(255, 95, 158, .85));
  background-clip: padding-box;
}

/* ============ 布局 ============ */
.app {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: clamp(282px, 25vw, 340px) 1fr;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

/* ============ 侧边栏 ============ */
.sidebar {
  position: relative;
  background: var(--sidebar);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 12px 10px 10px;
  gap: 8px;
}
/* 侧栏右缘的一线玫瑰光 */
.sidebar::after {
  content: ''; position: absolute; top: 0; right: 0; width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent, rgba(255, 95, 158, .55), rgba(176, 107, 255, .35), transparent);
  opacity: .65; pointer-events: none;
}

.sidebar__head { display: flex; align-items: center; justify-content: space-between; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand__logo {
  width: 36px; height: 36px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff; font-size: 17px;
  background: linear-gradient(135deg, #8b3ff0 0%, #c956ff 45%, #ff5f9e 100%);
  box-shadow: 0 6px 20px rgba(219, 88, 200, .45), inset 0 1px 0 rgba(255, 255, 255, .35);
  animation: logobreathe 4.5s ease-in-out infinite;
}
@keyframes logobreathe {
  0%, 100% { box-shadow: 0 6px 20px rgba(219, 88, 200, .40), inset 0 1px 0 rgba(255, 255, 255, .35); }
  50%      { box-shadow: 0 8px 30px rgba(255, 95, 158, .62), inset 0 1px 0 rgba(255, 255, 255, .45); }
}
.brand__txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand__name {
  font-family: var(--font-serif);
  font-weight: 700; font-size: 17px; letter-spacing: .06em;
  background: linear-gradient(100deg, var(--text) 20%, #ff9ec4 60%, var(--primary) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand__sub { font-size: 10.5px; color: var(--text-faint); letter-spacing: .16em; margin-top: 2px; }

.sidebar__search { flex: none; }
.sidebar__search input {
  width: 100%; padding: 9px 13px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); outline: none;
  font-size: 13px; transition: .2s;
}
.sidebar__search input::placeholder { color: var(--text-faint); }
.sidebar__search input:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(255, 95, 158, .12), var(--glow-pink);
  background: var(--surface);
}

/* —— 关键修复：两区各自滚动，人设区吃剩余高度，历史区可折叠 —— */
.sidebar__section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.sidebar__section--grow {
  flex: 0 0 auto;
  max-height: 30%;
  min-height: 0;
  transition: max-height .22s ease;
}
/* 历史为空时只留标题 + 一句提示，把空间全部让给人设列表 */
.sidebar__section--grow.is-empty { max-height: 58px; }
.sidebar__section--grow.collapsed { max-height: 26px; min-height: 26px; }
.sidebar__section--grow.collapsed .history-list { display: none; }

.sidebar__label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11px; color: var(--text-faint);
  letter-spacing: .12em; margin: 2px 6px 6px; flex: none;
}
.sidebar__label > span:first-child { display: flex; align-items: center; gap: 5px; }
.sidebar__label > span:first-child::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 0 8px rgba(255, 95, 158, .8);
}

.gender-filter { display: flex; gap: 4px; }
.sidebar__label-actions { display: flex; align-items: center; gap: 6px; }
.gender-filter button {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px; color: var(--text-soft);
  background: var(--surface-2); border: 1px solid var(--border); transition: .18s;
}
.gender-filter button:hover { color: var(--primary-3); border-color: var(--border-strong); }
.gender-filter button.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; border-color: transparent; box-shadow: var(--glow-violet);
}

/* 人设 / 历史 两个列表都独立滚动 */
.persona-list, .history-list {
  display: flex; flex-direction: column; gap: 6px;
  min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 1px 4px 6px 1px;
}
.persona-list { flex: 1 1 auto; }
.history-list { flex: 1 1 auto; }

/* 人设区底部「还有更多」胶囊提示：独立占位，绝不遮挡卡片 */
.sidebar__section--personas { position: relative; }
.list-more {
  position: static; flex: none; align-self: center; margin-top: 3px;
  display: flex; align-items: center; justify-content: center;
  padding: 3px 10px; border-radius: 999px; pointer-events: none;
  font-size: 10px; letter-spacing: .08em; color: #ffd6e6; white-space: nowrap;
  background: linear-gradient(135deg, rgba(74, 24, 78, .96), rgba(44, 16, 48, .96));
  border: 1px solid rgba(255, 95, 158, .50);
  box-shadow: 0 4px 16px rgba(20, 4, 24, .55), 0 0 14px rgba(255, 95, 158, .22);
  animation: fadeup .3s ease;
}
[data-theme="light"] .list-more {
  color: #b81f63; background: rgba(255, 246, 250, .97);
  border-color: rgba(255, 79, 148, .38);
  box-shadow: 0 4px 14px rgba(255, 79, 148, .18);
}
/* 隐藏时保留占位（用 visibility 而不是 display），避免列表高度跳动 */
.list-more[hidden] { opacity: 0; visibility: hidden; }
@keyframes fadeup { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.persona-group {
  display: flex; align-items: center; gap: 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  color: var(--primary-2); padding: 7px 6px 2px;
}
.persona-group::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(255, 95, 158, .45), transparent);
}
.persona-group:first-child { padding-top: 1px; }

.persona-chip {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 9px; text-align: left;
  padding: 5px 9px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--surface-2);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
  width: 100%; flex: none;
}
.persona-chip::before {
  content: ''; position: absolute; left: 0; top: 50%; width: 3px; height: 0;
  transform: translateY(-50%); border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  transition: height .22s ease;
}
.persona-chip:hover {
  transform: translateX(2px);
  border-color: var(--border);
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(8, 2, 18, .35);
}
.persona-chip:hover::before { height: 52%; }
.persona-chip.active {
  background: linear-gradient(100deg, rgba(176, 107, 255, .26), rgba(255, 95, 158, .16));
  border-color: var(--border-strong);
  box-shadow: var(--glow-pink), inset 0 1px 0 rgba(255, 255, 255, .10);
}
.persona-chip.active::before { height: 70%; }
.persona-chip.custom { border-style: dashed; }

.persona-chip__emoji {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  display: grid; place-items: center; font-size: 17px;
  background: linear-gradient(150deg, var(--glass-hi), transparent);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: .2s;
}
.persona-chip.active .persona-chip__emoji {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 14px rgba(255, 95, 158, .45);
  border-color: rgba(255, 140, 190, .55);
}
.persona-chip__meta { display: flex; flex-direction: column; min-width: 0; gap: 0; }
.persona-chip__name { font-weight: 600; font-size: 13px; letter-spacing: .01em; line-height: 1.35; }
.persona-chip__sub { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }

.history-item {
  position: relative; flex: none;
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid transparent;
  cursor: pointer; transition: .18s;
}
.history-item:hover { border-color: var(--border); background: var(--surface); transform: translateX(2px); }
.history-item.active {
  background: linear-gradient(100deg, rgba(176, 107, 255, .22), rgba(255, 95, 158, .12));
  border-color: var(--border-strong);
}
.history-item__emoji { font-size: 17px; flex: none; }
.history-item__meta { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.history-item__title { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item__preview { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item__time { font-size: 10px; color: var(--text-faint); flex: none; }
.history-item__del {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  opacity: 0; font-size: 12px; padding: 4px 6px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  transition: .15s;
}
.history-item:hover .history-item__del { opacity: 1; }
.history-item__del:hover { color: #ff6b8a; border-color: rgba(255, 107, 138, .6); }

.sidebar__foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: none; }
.ghost-btn {
  padding: 9px 6px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); font-size: 12px; font-weight: 500; transition: .18s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ghost-btn:hover {
  border-color: var(--border-strong); color: var(--primary-3);
  background: var(--surface); box-shadow: var(--glow-pink);
}
.link-btn { font-size: 11.5px; color: var(--primary-2); font-weight: 600; letter-spacing: .02em; }
.link-btn:hover { text-shadow: 0 0 12px rgba(255, 95, 158, .8); }
.fold-btn {
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  font-size: 10px; color: var(--text-faint); background: var(--surface-2);
  border: 1px solid var(--border); transition: .18s;
}
.fold-btn:hover { color: var(--primary-2); border-color: var(--border-strong); }
.sidebar__section--grow.collapsed .fold-btn { transform: rotate(180deg); }

.icon-btn {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  font-size: 15px; color: var(--text-soft); background: var(--surface-2);
  border: 1px solid var(--border); transition: .18s;
}
.icon-btn:hover { color: var(--primary-3); border-color: var(--border-strong); box-shadow: var(--glow-pink); }
.empty-mini { font-size: 11.5px; color: var(--text-faint); text-align: center; padding: 16px 10px; line-height: 1.7; }

/* ============ 主聊天区 ============ */
.chat { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
/* 主区氛围光斑：右上玫瑰、左下紫罗兰 */
.chat::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(440px 340px at 78% 14%, rgba(255, 95, 158, .14), transparent 70%),
    radial-gradient(560px 420px at 20% 92%, rgba(168, 85, 247, .14), transparent 72%),
    radial-gradient(320px 240px at 50% 50%, rgba(200, 130, 255, .06), transparent 75%);
}

.chat__head {
  display: flex; align-items: center; gap: 12px; padding: 13px 22px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  position: relative; flex: none;
}
.chat__head::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 95, 158, .45), rgba(176, 107, 255, .35), transparent);
}
.chat__peer { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }

.avatar {
  position: relative; isolation: isolate;
  width: 44px; height: 44px; flex: none; border-radius: 14px;
  display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(150deg, rgba(176, 107, 255, .30), rgba(255, 95, 158, .22));
  border: 1px solid rgba(255, 150, 200, .32);
  box-shadow: 0 6px 20px rgba(168, 85, 247, .30), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.avatar::before {
  content: ''; position: absolute; inset: -3px; border-radius: 17px; z-index: -1;
  background: conic-gradient(from 0deg, rgba(176, 107, 255, 0), rgba(255, 95, 158, .75), rgba(176, 107, 255, 0) 70%);
  filter: blur(7px); opacity: .85;
  animation: spin 7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.chat__peer-name {
  font-family: var(--font-serif); font-weight: 700; font-size: 17px; letter-spacing: .03em;
}
.chat__peer-scene { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* 亲密度徽章（聊天头部） */
.affinity {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 5px;
  font-size: 10.5px; color: var(--text-soft); letter-spacing: .02em;
}
.affinity__lv {
  font-weight: 800; color: #fff; padding: 1px 7px; border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #d95cff);
  box-shadow: 0 3px 10px rgba(255, 95, 158, .35);
}
.affinity__name { color: var(--primary-3); font-weight: 600; }
.affinity__bar {
  width: 64px; height: 4px; border-radius: 999px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
}
.affinity__bar i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-2), var(--primary));
  transition: width .5s cubic-bezier(.22, 1, .36, 1);
}

.messages {
  flex: 1; overflow-y: auto; min-height: 0;
  padding: 26px clamp(14px, 4vw, 52px);
  display: flex; flex-direction: column; gap: 16px;
  scroll-behavior: smooth;
}

/* 空状态 */
.empty { margin: auto; text-align: center; color: var(--text-soft); max-width: 380px; padding: 20px; }
.empty__art {
  font-size: 54px; margin-bottom: 14px; line-height: 1;
  filter: drop-shadow(0 0 24px rgba(255, 95, 158, .55));
  animation: heartthrob 2.6s ease-in-out infinite;
}
@keyframes heartthrob {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 18px rgba(255, 95, 158, .40)); }
  50%      { transform: scale(1.08); filter: drop-shadow(0 0 34px rgba(255, 95, 158, .75)); }
}
.empty h2 {
  font-family: var(--font-serif); font-size: 21px; color: var(--text);
  margin-bottom: 10px; letter-spacing: .04em;
}
.empty h2 em {
  font-style: normal;
  background: linear-gradient(100deg, #ff9ec4, var(--primary));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.empty p { font-size: 13.5px; line-height: 1.85; }

/* 消息气泡 */
.msg { display: flex; gap: 10px; max-width: min(760px, 92%); align-items: flex-end; animation: rise .26s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg--user { align-self: flex-end; flex-direction: row-reverse; animation-name: riseRight; }
.msg--ai { animation-name: riseLeft; }
@keyframes riseRight { from { opacity: 0; transform: translate(8px, 4px); } to { opacity: 1; transform: none; } }
@keyframes riseLeft { from { opacity: 0; transform: translate(-8px, 4px); } to { opacity: 1; transform: none; } }
.msg__avatar {
  width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center;
  font-size: 17px; background: var(--surface); border: 1px solid var(--glass-line);
  box-shadow: 0 4px 12px rgba(8, 2, 18, .30);
}
.msg--user .msg__avatar { background: var(--primary-soft); border-color: var(--border); }

.bubble {
  padding: 12px 16px; border-radius: 18px; line-height: 1.78; font-size: 15px;
  word-break: break-word;
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start;
}
.msg--ai .bubble {
  background: var(--bubble-ai); border: 1px solid var(--glass-line);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(10px);
}
.msg--ai .bubble::before {
  content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(255, 95, 158, .65), rgba(176, 107, 255, .15));
}
.msg--user .bubble {
  background: var(--bubble-user); color: #fff; border: none;
  border-bottom-right-radius: 6px;
  box-shadow: var(--glow-pink), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.bubble__text { display: block; width: 100%; white-space: normal; }
/* Markdown 元素排版（配合 markdown.js 渲染） */
.bubble__text > :first-child { margin-top: 0; }
.bubble__text > :last-child { margin-bottom: 0; }
.bubble__text p { margin: 0 0 .55em; }
.bubble__text h1, .bubble__text h2, .bubble__text h3,
.bubble__text h4, .bubble__text h5, .bubble__text h6 {
  margin: .9em 0 .45em; font-weight: 700; line-height: 1.4; letter-spacing: .01em;
}
.bubble__text h1 { font-size: 1.32em; }
.bubble__text h2 { font-size: 1.22em; }
.bubble__text h3 { font-size: 1.12em; }
.bubble__text h4, .bubble__text h5, .bubble__text h6 { font-size: 1.02em; color: var(--primary-2); }
.bubble__text strong { font-weight: 700; color: var(--primary-2); }
.bubble__text em { font-style: italic; opacity: .92; }
.bubble__text del { opacity: .6; }
.bubble__text a { color: var(--primary-3); text-decoration: underline; text-underline-offset: 3px; word-break: break-all; }
.bubble__text ul, .bubble__text ol { margin: .3em 0 .6em; padding-left: 1.35em; }
.bubble__text li { margin: .18em 0; }
.bubble__text li::marker { color: var(--primary-2); }
.bubble__text blockquote {
  margin: .5em 0; padding: .35em .85em;
  border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0;
  background: var(--surface-2); color: var(--text-dim); font-style: italic;
}
.bubble__text code {
  padding: .12em .38em; border-radius: 6px; font-size: .9em;
  background: var(--surface-2); border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.bubble__text pre {
  width: 100%; margin: .5em 0; padding: 11px 13px; overflow-x: auto;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
  white-space: pre; /* 代码块保留原始换行 */
}
.bubble__text pre code { padding: 0; border: none; background: none; white-space: pre; }
.bubble__text hr { margin: .7em 0; border: none; border-top: 1px solid var(--border); }
.bubble__text table { width: 100%; margin: .5em 0; border-collapse: collapse; font-size: .92em; }
.bubble__text th, .bubble__text td { padding: 6px 9px; border: 1px solid var(--border); text-align: left; }
.bubble__text th { background: var(--surface-2); font-weight: 600; }
.bubble__cursor {
  display: none; width: 7px; height: 15px; vertical-align: -3px; margin-left: 3px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  border-radius: 2px; animation: blink 1s steps(2) infinite;
}
.bubble.streaming .bubble__cursor { display: inline-block; }
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* 窥探内心：虚线「心声」气泡 */
.msg--thought .bubble {
  background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface));
  border: 1px dashed var(--border-strong);
  box-shadow: none;
}
.msg--thought .bubble::before { display: none; }
.msg--thought .bubble__text { font-style: italic; color: var(--text-soft); }
.thought__tag {
  display: inline-block; font-style: normal; font-size: 10px; font-weight: 700;
  color: var(--primary-3); letter-spacing: .06em; margin-bottom: 4px;
  padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
}

/* 系统提示条（升级播报）：居中胶囊 */
.msg--sys { align-self: center; max-width: 100%; animation: none; }
.syspill {
  font-size: 11.5px; color: var(--primary-3); letter-spacing: .02em; text-align: center;
  padding: 6px 16px; border-radius: 999px;
  background: var(--primary-soft); border: 1px solid var(--border);
  animation: pop .4s cubic-bezier(.22, 1.4, .36, 1) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }

/* ============ 输入区 ============ */
.composer {
  padding: 12px clamp(14px, 4vw, 52px) 16px; flex: none;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}
.composer__peer { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-faint); margin-bottom: 8px; }
.composer__peer .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary-2); box-shadow: 0 0 10px rgba(255, 95, 158, .9);
}
.composer__peer.typing .dot { animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: .3; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }

/* 心动币工具栏（签到 / 窥探内心 / 长文模式） */
.composer__tools {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.gtool {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--text-soft); letter-spacing: .02em;
  padding: 5px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: border-color .18s ease, color .18s ease, transform .18s ease, background .18s ease;
}
.gtool:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.gtool:disabled { opacity: .45; cursor: not-allowed; }
.gtool__cost {
  font-style: normal; font-size: 10px; color: var(--primary-3);
  padding: 0 5px; border-radius: 999px; background: var(--primary-soft);
}
.gtool--gems { font-weight: 700; color: var(--text); cursor: pointer; }
.gtool--gems b { color: var(--primary-2); font-variant-numeric: tabular-nums; }
.gtool.is-locked { opacity: .55; }
.gtool.is-on {
  border-color: var(--primary); color: #fff;
  background: linear-gradient(135deg, var(--primary), #d95cff);
  box-shadow: 0 4px 14px rgba(255, 95, 158, .35);
}
.gtool.is-on .gtool__cost { color: #fff; background: rgba(255, 255, 255, .22); }

.composer__box {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; padding: 7px 7px 7px 17px;
  box-shadow: var(--shadow);
  transition: box-shadow .22s ease, border-color .22s ease;
}
.composer__box:focus-within {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(255, 95, 158, .12), 0 14px 40px rgba(168, 85, 247, .26);
}
#input {
  flex: 1; border: none; outline: none; resize: none; background: transparent;
  font-size: 15px; line-height: 1.55; max-height: 160px; padding: 9px 0;
  /* 一行文字的真实高度（line-height 23.25 + 上下 padding 18）≈ 41px。
     兜底作用：即使 JS 高度计算失误，输入框也不会塌成一条线。 */
  min-height: 41px;
}
#input::placeholder { color: var(--text-faint); }
.send-btn {
  width: 42px; height: 42px; flex: none; border-radius: 15px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #d95cff 50%, var(--primary-2) 100%);
  box-shadow: 0 8px 22px rgba(255, 95, 158, .40), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .16s ease, box-shadow .16s ease;
}
.send-btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 12px 30px rgba(255, 95, 158, .60); }
.send-btn:active { transform: scale(.97); }
.send-btn.is-stop {
  background: linear-gradient(135deg, #ff5c7a, #ff8f6b);
  box-shadow: 0 8px 22px rgba(255, 92, 122, .50);
}
.composer__hint { font-size: 11.5px; color: var(--text-faint); margin-top: 6px; height: 15px; letter-spacing: .02em; }

/* ============ 弹窗 ============ */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal__mask { position: absolute; inset: 0; background: rgba(8, 3, 16, .62); backdrop-filter: blur(6px); }
[data-theme="light"] .modal__mask { background: rgba(60, 30, 90, .32); }
.modal__panel {
  position: relative; width: min(540px, 100%); max-height: 90vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, .05);
  backdrop-filter: blur(26px) saturate(160%);
  animation: pop .22s ease;
}
@keyframes pop { from { transform: scale(.96) translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 17px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
  background: var(--surface); backdrop-filter: blur(20px);
}
.modal__head h3 { font-family: var(--font-serif); font-size: 17px; letter-spacing: .04em; }
.modal__body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal__foot { display: flex; align-items: center; gap: 10px; padding: 15px 20px; border-top: 1px solid var(--border); }
.modal__foot .spacer { flex: 1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--text-soft); font-weight: 500; letter-spacing: .02em; }
.field input, .field textarea, .field select {
  padding: 10px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2);
  outline: none; font-size: 14px; width: 100%; transition: .18s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(255, 95, 158, .10);
}
.field textarea { resize: vertical; }
.field--switch {
  flex-direction: row; align-items: flex-start; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer;
}
.field--switch > span { font-size: 13px; color: var(--text); font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.field--switch > span small { font-weight: 400; color: var(--text-faint); font-size: 11.5px; line-height: 1.55; }
.field--switch input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--primary-2); flex: none; }

.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.sliders {
  display: flex; flex-direction: column; gap: 9px;
  background: var(--surface-2); padding: 11px 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.sliders label { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-soft); }
.sliders input[type=range] { flex: 1; accent-color: var(--primary-2); }
.primary-btn {
  padding: 10px 20px; border-radius: var(--radius-sm); color: #fff; font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: var(--glow-pink); transition: .16s;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(255, 95, 158, .55); }
.note { font-size: 11.5px; color: var(--text-faint); line-height: 1.7; }

/* ============ Toast ============ */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  padding: 12px 22px; border-radius: 14px; font-size: 13.5px; font-weight: 500; z-index: 100;
  backdrop-filter: blur(16px);
  max-width: 90vw; animation: pop .2s ease;
}
.toast[hidden] { display: none; }
.toast--info { background: rgba(38, 22, 58, .95); color: #fff; border: 1px solid var(--border); }
.toast--ok {
  background: linear-gradient(135deg, rgba(124, 58, 237, .95), rgba(255, 95, 158, .95));
  color: #fff; box-shadow: var(--glow-pink);
}
.toast--error { background: rgba(200, 55, 80, .95); color: #fff; box-shadow: 0 8px 26px rgba(200, 55, 80, .45); }

/* 移动端遮罩 */
.scrim { position: fixed; inset: 0; background: rgba(6, 2, 14, .55); backdrop-filter: blur(3px); z-index: 35; }
.scrim[hidden] { display: none; }
.only-mobile { display: none; }

/* ============ 响应式 ============ */
/* 中等宽度（平板 / 预览侧栏面板）：仍然左右分栏，只把侧栏压窄，避免左侧直接消失 */
@media (min-width: 561px) and (max-width: 900px) {
  .app { grid-template-columns: clamp(206px, 32vw, 262px) 1fr; }
  .sidebar { padding: 10px 8px 8px; gap: 7px; }
  .brand__sub { display: none; }
  .brand__name { font-size: 15.5px; }
  .persona-chip__sub { display: none; }
  .persona-chip { padding: 7px 8px; }
  .persona-chip__name { font-size: 12.5px; }
  .gender-filter button { padding: 2px 7px; font-size: 11px; }
  .chat__head { padding: 11px 14px; }
  .chat__peer-name { font-size: 16px; }
  .messages { padding: 18px 16px; }
  .composer { padding: 10px 16px 14px; }
  .ghost-btn { font-size: 11px; padding: 8px 4px; }
  /* 窄侧栏里筛选按钮换到第二行等宽排列，避免竖着堆成四行 */
  .sidebar__label { flex-wrap: wrap; }
  .gender-filter { flex: 1 1 100%; margin-top: 3px; }
  .gender-filter button { flex: 1; text-align: center; }
  /* 窄侧栏放不下「图标+文字」横排，改竖排，宽度自适应不裁字 */
  .navlink { flex-direction: column; gap: 3px; padding: 7px 3px; font-size: 11.5px; }
  .navlink__ico { font-size: 15px; }
  .navlink__txt { max-width: 100%; }
}

@media (max-width: 560px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(88vw, 336px); z-index: 40;
    transform: translateX(-105%); transition: transform .26s cubic-bezier(.4, 0, .2, 1);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .only-mobile { display: grid; }
  .chat__head { padding: 11px 14px; }
  .messages { padding: 16px 12px; gap: 12px; }
  .msg { max-width: 94%; }
  .composer { padding: 10px 12px 14px; }
  .modal__panel { align-self: end; width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh; }
}
@media (max-width: 420px) {
  .chat__peer-scene { display: none; }
  .field-row { flex-direction: column; gap: 14px; }
  .bubble { font-size: 14.5px; }
}

@media (prefers-reduced-motion: reduce) {
  body::before, .brand__logo, .avatar::before, .empty__art { animation: none; }
  .msg { animation: none; }
}


/* ===================================================================
   P0 新增：多视图容器 / Q 版设计系统（Landing·引导·问答·报告·隐私）
   =================================================================== */

.view {
  height: 100vh; height: 100dvh;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative; z-index: 1;
}
.view[hidden] { display: none !important; }
.view--chat { overflow: hidden; }

/* ---------- 页面导航条 ---------- */
.pnav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 13px clamp(16px, 5vw, 44px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.pnav__brand {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  color: var(--text); font: inherit; font-size: 16px; font-weight: 800; letter-spacing: .01em;
}
.pnav__logo {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-size: 15px; box-shadow: var(--glow-violet);
}
.pnav__links { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.pnav__link {
  background: none; border: none; cursor: pointer; font: inherit;
  font-size: 13.5px; color: var(--text-soft);
  padding: 7px 13px; border-radius: 999px; transition: .18s;
}
.pnav__link:hover { background: var(--primary-soft); color: var(--text); }
.pnav__link.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }

/* ---------- 通用按钮 ---------- */
.btn {
  appearance: none; border: 1px solid var(--border); cursor: pointer;
  font: inherit; font-size: 14.5px; font-weight: 600;
  padding: 11px 20px; border-radius: 999px;
  background: var(--surface-2); color: var(--text);
  transition: transform .16s ease, box-shadow .18s ease, opacity .18s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn--lg { font-size: 16px; padding: 14px 30px; }
.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent; color: #fff; box-shadow: var(--glow-pink);
}
.btn--ghost { background: var(--surface-2); }
.btn--danger { background: rgba(214, 69, 69, .16); border-color: rgba(214, 69, 69, .5); color: #ff9d9d; }
[data-theme="light"] .btn--danger { color: #b91c1c; }
.linklike {
  background: none; border: none; cursor: pointer; font: inherit;
  font-size: 13px; color: var(--text-faint); text-decoration: underline;
  text-underline-offset: 3px; padding: 4px 2px;
}
.linklike:hover { color: var(--primary); }

/* ---------- Q 版头像 ---------- */
.qava { display: block; width: 100%; height: auto; }
.strip__item {
  width: 46px; height: 46px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--glass-line); background: var(--surface-2);
  display: grid; place-items: center; flex: none;
}

/* ================= Landing ================= */
.lp { padding-bottom: 40px; }
.lp__hero { padding: clamp(40px, 8vw, 78px) 20px 30px; text-align: center; }
.lp__hero-inner { max-width: 760px; margin: 0 auto; }
.lp__kicker {
  display: inline-block; font-size: 12.5px; letter-spacing: .05em;
  color: var(--primary); background: var(--primary-soft);
  padding: 6px 15px; border-radius: 999px; font-weight: 700;
}
.lp__title {
  font-size: clamp(36px, 7vw, 58px); line-height: 1.18; margin: 18px 0 12px;
  font-weight: 800; letter-spacing: -.01em;
}
.lp__title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--primary), var(--primary-2) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lp__sub { color: var(--text-soft); font-size: clamp(15px, 2.2vw, 17px); margin: 0 auto; max-width: 560px; }
.lp__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 26px 0 16px; }
.lp__trust { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.lp__trust span {
  font-size: 12.5px; color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
}
.lp__strip { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; opacity: .95; }

.lp__section { max-width: 1000px; margin: 0 auto; padding: clamp(34px, 6vw, 58px) 20px 0; }
.lp__h2 { font-size: clamp(22px, 3.6vw, 28px); font-weight: 800; text-align: center; margin: 0 0 8px; }
.lp__hint { text-align: center; color: var(--text-faint); font-size: 13.5px; margin: 0 0 20px; }
.lp__fine { text-align: center; color: var(--text-faint); font-size: 12.5px; margin-top: 16px; }

.lp__steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.lpstep {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 18px; text-align: center; box-shadow: var(--shadow);
}
.lpstep__n {
  display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 10px;
  border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 800;
}
.lpstep b { display: block; font-size: 15.5px; }
.lpstep small { color: var(--text-faint); font-size: 12.5px; }

.lp__features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.lpf {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.lpf b { display: block; font-size: 15px; margin-bottom: 6px; }
.lpf p { margin: 0; color: var(--text-soft); font-size: 13.5px; }

.lpsample {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--tc, var(--primary-2));
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  max-width: 640px; margin: 0 auto;
}
.lpsample__ava { width: 72px; flex: none; }
.lpsample__body { flex: 1; min-width: 200px; }
.lpsample__type { font-size: 19px; font-weight: 800; color: var(--tc, var(--primary)); }
.lpsample__tag { color: var(--text-faint); font-size: 13px; margin-bottom: 12px; }
.lpsample__dims { display: grid; gap: 7px; }
.dimrow { display: grid; grid-template-columns: 40px 1fr 34px; align-items: center; gap: 9px; font-size: 12px; }
.dimrow span { color: var(--text-faint); }
.dimrow__bar { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.dimrow__bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}
.dimrow b { text-align: right; font-variant-numeric: tabular-nums; }

.lp__reviews { max-width: 640px; margin: 20px auto 0; text-align: center; }
.lp__reviews > b { font-size: 15px; }
.lp__placeholder {
  color: var(--text-faint); font-size: 13px; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); padding: 16px; margin-top: 10px;
}

.lp__privacy { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.lp__privacy > div {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
}
.lp__privacy b { display: block; font-size: 14px; margin-bottom: 5px; }
.lp__privacy p { margin: 0; color: var(--text-faint); font-size: 12.5px; }
.lp__section--privacy { text-align: center; }
.lp__section--cta { text-align: center; }
.lp__footer {
  display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap;
  margin-top: 50px; padding: 22px 20px; border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: 12.5px;
}

/* ================= 引导 ================= */
.ob { padding-bottom: 40px; }
.ob__bar { max-width: 620px; margin: 0 auto; padding: 26px 20px 6px; text-align: center; }
.ob__steps { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 10px; }
.ob__step {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--text-faint);
  background: var(--surface-2); border: 1px solid var(--border);
}
.ob__step.is-now { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; }
.ob__step.is-done { background: var(--primary-soft); color: var(--primary); border-color: var(--border); }
.ob__steps i { width: 26px; height: 1px; background: var(--border); }
.ob__label { font-size: 12.5px; color: var(--text-faint); letter-spacing: .08em; }
.ob__body { max-width: 620px; margin: 0 auto; padding: 14px 20px; }
.ob__h { font-size: 25px; font-weight: 800; text-align: center; margin: 6px 0 8px; }
.ob__p { text-align: center; color: var(--text-faint); font-size: 13.5px; margin: 0 0 22px; }
.ob__gwrap { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .ob__gwrap { grid-template-columns: 1fr; } }
.gcard {
  position: relative; cursor: pointer; font: inherit; text-align: center;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 20px 14px; transition: .2s; color: var(--text);
}
.gcard:hover { transform: translateY(-2px); border-color: var(--primary); }
.gcard.is-on { border-color: var(--primary-2); box-shadow: var(--glow-pink); }
.gcard__ava { width: 64px; margin: 0 auto 10px; display: block; }
.gcard b { display: block; font-size: 16px; }
.gcard small { color: var(--text-faint); font-size: 12.5px; }
.gcard__emoji { position: absolute; top: 10px; right: 12px; font-size: 15px; opacity: .8; }
.ob__avawrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.avacard {
  cursor: pointer; font: inherit; color: var(--text);
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 8px; transition: .18s;
}
.avacard:hover { transform: translateY(-2px); border-color: var(--primary); }
.avacard.is-on { border-color: var(--primary-2); box-shadow: var(--glow-pink); }
.avacard span { display: block; font-size: 12px; margin-top: 6px; color: var(--text-soft); }
.ob__input {
  width: 100%; max-width: 340px; display: block; margin: 8px auto 0;
  padding: 13px 18px; font: inherit; font-size: 16px; text-align: center;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; outline: none;
}
.ob__input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.ob__consent { display: grid; gap: 9px; margin-bottom: 18px; }
.ob__crow {
  display: grid; grid-template-columns: 78px 1fr; gap: 12px; align-items: baseline;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px;
}
.ob__crow b { color: var(--primary); font-size: 13px; }
.ob__crow span { color: var(--text-soft); }
.ob__agree {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  font-size: 13.5px; padding: 14px; border-radius: var(--radius-sm);
  background: var(--primary-soft); border: 1px solid var(--border);
}
.ob__agree input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--primary-2); flex: none; }
.ob__fine { text-align: center; color: var(--text-faint); font-size: 12px; margin: 12px 0 0; }
.ob__next { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
.ob__foot { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 20px; }

/* ================= 问答 ================= */
.qz { display: flex; flex-direction: column; min-height: 100%; padding-bottom: 24px; }
.qz__head {
  display: flex; align-items: center; gap: 14px;
  padding: 18px clamp(16px, 5vw, 40px) 10px; max-width: 780px;
  width: 100%; margin: 0 auto;
}
.qz__exit { background: none; border: none; cursor: pointer; font: inherit; font-size: 13px; color: var(--text-faint); }
.qz__exit:hover { color: var(--primary); }
.qz__prog { flex: 1; display: flex; align-items: center; gap: 11px; }
.qz__bar { flex: 1; height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.qz__bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width .35s cubic-bezier(.4, 0, .2, 1);
}
.qz__prog span { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qz__me { width: 34px; flex: none; }
.qz__stage { flex: 1; display: grid; place-items: center; padding: 12px 20px 20px; }
.qz__card {
  width: 100%; max-width: 640px; text-align: center;
  animation: qzIn .32s cubic-bezier(.2, .8, .3, 1);
}
.qz__card.is-leaving { animation: qzOut .26s ease forwards; }
@keyframes qzIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes qzOut { to { opacity: 0; transform: translateY(-14px); } }
.qz__dim {
  display: inline-block; font-size: 11.5px; letter-spacing: .1em; color: var(--primary);
  background: var(--primary-soft); padding: 5px 12px; border-radius: 999px; font-weight: 700;
}
.qz__q { font-size: clamp(20px, 3.4vw, 27px); font-weight: 800; margin: 15px 0 6px; line-height: 1.4; }
.qz__hint { color: var(--text-faint); font-size: 13px; margin: 0 0 22px; }
.qz__opts { display: grid; gap: 10px; text-align: left; }
.qzopt {
  display: flex; align-items: center; gap: 13px; cursor: pointer; font: inherit;
  font-size: 14.5px; color: var(--text); text-align: left;
  padding: 15px 18px; min-height: 56px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); transition: .18s;
}
.qzopt:hover { transform: translateX(3px); border-color: var(--primary); }
.qzopt__k {
  display: grid; place-items: center; width: 26px; height: 26px; flex: none;
  border-radius: 8px; font-size: 12.5px; font-weight: 800;
  background: var(--surface-2); color: var(--text-faint); border: 1px solid var(--border);
}
.qzopt.is-on { border-color: var(--primary-2); background: var(--primary-soft); }
.qzopt.is-on .qzopt__k { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; }
.qzopt.is-picked { transform: scale(.985); }
.qz__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  max-width: 780px; width: 100%; margin: 0 auto; padding: 0 clamp(16px, 5vw, 40px);
}
.qz__tip { color: var(--text-faint); font-size: 12px; }

/* ================= 结果 ================= */
.rs { padding-bottom: 46px; }
.rs__analyzing {
  display: grid; place-items: center; gap: 10px; text-align: center;
  min-height: 62vh; padding: 30px; transition: opacity .3s ease;
}
.rs__analyzing b { font-size: 16px; }
.rs__analyzing small { color: var(--text-faint); font-size: 12.5px; }
.rs__analyzing.is-gone { opacity: 0; pointer-events: none; position: absolute; }
.rs__spin {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary-2);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.rs__content { max-width: 820px; margin: 0 auto; padding: 26px 20px 0; animation: fadeUp .4s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.rs__hero {
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--tc, var(--primary-2));
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.rs__ava { width: 88px; flex: none; }
.rs__title { flex: 1; min-width: 220px; }
.rs__eyebrow { font-size: 12px; letter-spacing: .14em; color: var(--text-faint); }
.rs__name { font-size: clamp(28px, 5.4vw, 40px); font-weight: 800; margin: 5px 0 4px; color: var(--tc, var(--primary)); }
.rs__tag { color: var(--text-soft); font-size: 14.5px; margin: 0 0 12px; }
.rs__labels { display: flex; gap: 7px; flex-wrap: wrap; }
.rs__labels span {
  font-size: 12px; padding: 4px 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); border: 1px solid var(--border); font-weight: 600;
}
.rs__radar { display: grid; place-items: center; margin: 22px 0; }
.radar { width: min(360px, 86vw); color: var(--text-soft); overflow: visible; }
.radar__data { animation: radarIn .7s cubic-bezier(.3, .9, .3, 1) both; transform-origin: center; }
@keyframes radarIn { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
.rs__cta { text-align: center; margin-top: 26px; }
.rs__cta2 { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 14px 0 10px; }
.rs__disclaimer {
  margin: 26px auto 0; max-width: 640px; text-align: center;
  color: var(--text-faint); font-size: 12.5px; line-height: 1.7;
  border-top: 1px dashed var(--border); padding-top: 18px;
}

/* ================= 打印 / 导出 PDF =================
   路径：点「导出 PDF 报告」→ 浏览器打印对话框 → 另存为 PDF。
   屏幕端不显示的打印头在此显示；所有交互元素不打印。 */
.rs__printhead { display: none; }
@media print {
  .pnav, #sidebar, #scrim, .rs__cta, .rs__analyzing,
  #toast, #gemChip, .ins__foot, .ins__badge { display: none !important; }
  body { background: #fff; }
  .rs { padding: 0; }
  .rs__content { max-width: 100%; padding: 0; animation: none; }
  /* 墨水友好配色：屏幕端可能是深色主题（浅字深底），打印默认不画背景色，
     浅色文字会直接落在白纸上变成隐形字——这里强制深字浅底 */
  .rs, .rs * { color: #1f1f1f !important; }
  .rs__hero { background: #fff !important; border: 1px solid #ccc !important; border-left: 4px solid var(--tc, #333) !important; box-shadow: none; break-inside: avoid; }
  .ins { background: #fff !important; border-color: #ddd !important; box-shadow: none; }
  .aa { background: #fff !important; border-color: #ddd !important; box-shadow: none; }
  .aaq { background: #fff !important; border-color: #e2e2e2 !important; }
  .aa__badge { display: none !important; }
  .aa__foot .btn { display: none !important; }
  .rs__name { color: #1f1f1f !important; }
  .rs__labels span { background: #f2eef9 !important; color: #4a3a6b !important; border-color: #d9cdee !important; }
  .rs__radar { color: #444; break-inside: avoid; margin: 14px 0; }
  .rs__radar .radar { width: 300px; }
  .ins, .rs__disclaimer { break-inside: avoid; }
  .ins__body, .rs__report { font-size: 13.5px; }
  .ins__body *, .rs__report * { color: #1f1f1f !important; }
  .ins__body strong, .rs__report strong { color: #000 !important; }
  .rs__report h2, .rs__report h3 { break-after: avoid; }
  .rs__disclaimer { color: #555; border-top-color: #999; }
  .rs__printhead {
    display: flex; justify-content: space-between; align-items: baseline;
    border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 20px;
    font-size: 13px; color: #333;
  }
  .rs__printhead b { font-size: 16px; color: #111; }
}

/* ================= 隐私中心 ================= */
.pv { padding-bottom: 46px; }
.pv__hero { max-width: 860px; margin: 0 auto; padding: clamp(30px, 6vw, 50px) 20px 10px; text-align: center; }
.pv__h1 { font-size: clamp(28px, 5.6vw, 40px); font-weight: 800; margin: 0 0 10px; }
.pv__sub { color: var(--text-soft); font-size: 15px; max-width: 560px; margin: 0 auto; }
.pv__stats { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.pvstat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 22px; min-width: 110px;
}
.pvstat b { display: block; font-size: 19px; color: var(--primary); }
.pvstat span { font-size: 12px; color: var(--text-faint); }
.pv__grid, .pvcard {
  max-width: 860px; margin: 16px auto; padding: 22px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.pv__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .pv__grid { grid-template-columns: 1fr; } }
.pvcard--wide { max-width: 860px; }
.pvcard--danger { border-color: rgba(214, 69, 69, .38); }
.pvcard h3 { font-size: 16px; margin: 0 0 12px; color: var(--text); }
.pvlist { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.pvlist li { font-size: 13.5px; color: var(--text-soft); line-height: 1.7; }
.pvlist b { color: var(--text); }
.pvtable { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.pvtr { display: grid; grid-template-columns: 1fr 90px 64px; gap: 10px; background: var(--surface-2); padding: 11px 14px; font-size: 13px; align-items: center; }
.pvtr__size { color: var(--text-faint); font-variant-numeric: tabular-nums; }
.pvtr__state { font-size: 11.5px; color: var(--text-faint); text-align: right; }
.pvtr__state.is-on { color: var(--ok, #12a67a); font-weight: 700; }
.pvbtns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.pvfine { font-size: 12px; color: var(--text-faint); margin: 10px 0 0; }
.pvresult { margin-top: 12px; font-size: 13px; color: var(--text-soft); }
.pvdisc { font-size: 13.5px; color: var(--text-soft); line-height: 1.8; margin: 0; }
.pvprofile { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-soft); }

/* ================= 危机提示卡 ================= */
.crisis {
  border: 1px solid rgba(255, 209, 102, .45); background: rgba(255, 209, 102, .10);
  border-radius: var(--radius-sm); padding: 18px; margin-top: 6px;
}
.crisis__title { font-size: 15px; font-weight: 700; color: #ffd166; margin-bottom: 8px; }
[data-theme="light"] .crisis__title { color: #b45309; }
.crisis__body { font-size: 13.5px; color: var(--text-soft); margin: 0 0 12px; }
.crisis__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.crisis__list li {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 14px;
}
.crisis__num { font-size: 17px; font-weight: 800; color: #ffd166; letter-spacing: .04em; }
[data-theme="light"] .crisis__num { color: #b45309; }
.crisis__list small { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-faint); }
.crisis__extra { font-size: 12.5px; color: var(--text-faint); margin: 12px 0 0; line-height: 1.7; }

/* ================= Markdown 报告排版 ================= */
.md { color: var(--text-soft); }
.md > :first-child { margin-top: 0; }
.md h2 { font-size: 21px; color: var(--text); margin: 26px 0 10px; }
.md h3 { font-size: 16.5px; color: var(--primary); margin: 20px 0 8px; }
.md p { margin: 0 0 12px; line-height: 1.85; font-size: 14px; }
.md ul, .md ol { margin: 0 0 14px; padding-left: 22px; display: grid; gap: 6px; }
.md li { font-size: 14px; line-height: 1.75; }
.md strong { color: var(--text); }
.md blockquote {
  margin: 0 0 14px; padding: 12px 16px; border-left: 3px solid var(--primary-2);
  background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-soft); font-style: italic;
}
.md code {
  padding: .12em .4em; border-radius: 6px; background: var(--surface-2);
  border: 1px solid var(--border); font-size: .9em;
}
.md hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ================= 聊天侧栏新增导航 ================= */
/* 注意：.sidebar__foot 是两列 grid，这行必须显式跨满两列，
   否则它会自动落进第一列，只占侧栏一半宽度（实测 133px / 275px），
   三个按钮再平分后每个只剩 40px，文字被迫换行。 */
.sidebar__nav {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));   /* 三等分，且允许被压缩 */
  gap: 6px;
}
.navlink {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 0; cursor: pointer; font: inherit; font-size: 12px;
  padding: 8px 6px; border-radius: var(--radius-sm);
  background: var(--primary-soft); border: 1px solid var(--border); color: var(--text-soft);
  transition: .16s;
  white-space: nowrap; overflow: hidden;
}
.navlink__ico { flex: none; font-size: 13px; line-height: 1; }
.navlink__txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.navlink:hover { color: var(--primary); border-color: var(--primary); }
.navlink.is-active { color: var(--primary); border-color: var(--primary); background: var(--surface); }

@media (max-width: 560px) {
  .pnav { padding: 11px 14px; gap: 8px; }
  .pnav__link { padding: 6px 9px; font-size: 12.5px; }
  .qz__q { font-size: 20px; }
  .qzopt { padding: 13px 14px; font-size: 14px; }
}


/* ===================================================================
   P1 新增：AI 解读 / 分享海报 / 转化 / 示例画廊 / 每日提示 / 本地统计
   =================================================================== */

/* ---------- AI 深度解读 ---------- */
.ins {
  max-width: 820px; margin: 22px auto; padding: 22px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ================= AI 的答卷 ================= */
.aa {
  max-width: 820px; margin: 22px auto; padding: 22px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.aa__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.aa__head b { font-size: 17px; }
.aa__badge {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--border);
}
.aa__badge--live { color: var(--primary); border-color: var(--primary); }
.aa__badge--local { color: var(--text-faint); }
.aa__loading { color: var(--text-faint); font-size: 13.5px; margin: 0; }
.aa__list { display: grid; gap: 14px; }
.aaq {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 15px; background: var(--surface-2);
}
.aaq__q { font-size: 14px; font-weight: 600; line-height: 1.6; margin-bottom: 9px; }
.aaq__n {
  display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--primary);
  background: var(--primary-soft); border-radius: 6px; padding: 1px 7px; margin-right: 8px;
}
.aaq__pick, .aaq__mine { font-size: 13.5px; line-height: 1.6; display: flex; gap: 8px; align-items: baseline; }
.aaq__pick { color: var(--text); }
.aaq__mine { color: var(--text-faint); margin-top: 5px; }
.aaq__tag {
  flex: none; font-size: 11px; font-weight: 700; color: var(--primary);
  border: 1px solid var(--primary); border-radius: 999px; padding: 1px 8px;
}
.aaq__tag--mine { color: var(--text-faint); border-color: var(--border); }
.aaq__why { font-size: 12.5px; color: var(--text-soft); margin-top: 6px; line-height: 1.6; }
.aaq__why--local { color: var(--text-faint); }
.aa__foot { margin-top: 16px; border-top: 1px dashed var(--border); padding-top: 14px; }
.aa__verdict { display: grid; gap: 8px; }
.aa__vrow { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.aa__vrow span { color: var(--text-faint); font-size: 12.5px; }
.aa__vrow b { color: var(--text); }
.aa__note { font-size: 12.5px; color: var(--text-faint); line-height: 1.7; margin: 12px 0 10px; }
.ins__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ins__head b { font-size: 16px; }
.ins__badge {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-faint);
}
.ins__badge--live {
  background: var(--primary-soft); border-color: var(--primary); color: var(--primary);
  animation: pulse 1.3s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.ins__body { min-height: 40px; }
/* 打字光标只在生成中显示（ins--live），完成后必须消失 */
.ins--live .ins__body::after {
  content: ''; display: inline-block; width: 7px; height: 15px; margin-left: 3px;
  vertical-align: -3px; background: var(--primary-2); border-radius: 2px;
  animation: blink 1s steps(2) infinite;
}
.ins__foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--text-faint);
}

/* ---------- 分享海报弹窗 ---------- */
.share { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.share__mask { position: absolute; inset: 0; background: rgba(8, 3, 16, .7); backdrop-filter: blur(6px); }
.share__panel {
  position: relative; width: min(420px, 100%); max-height: 92vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.share__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.share__head b { font-size: 15px; }
.share__x { background: none; border: none; cursor: pointer; color: var(--text-faint); font-size: 15px; }
.share__body { padding: 16px; overflow-y: auto; }
.share__canvas { width: 100%; height: auto; border-radius: 14px; display: block; }
.share__loading { padding: 40px 10px; text-align: center; color: var(--text-faint); font-size: 13px; }
.share__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-top: 1px solid var(--border);
}
.share__foot small { color: var(--text-faint); font-size: 11.5px; }

/* ---------- 四型示例画廊 ---------- */
.lp__gallery { max-width: 640px; margin: 22px auto 0; text-align: center; }
.lp__gallery > b { font-size: 15px; }
.galwrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.gal {
  background: var(--surface); border: 1px solid var(--border);
  border-top: 3px solid var(--tc, var(--primary-2));
  border-radius: var(--radius-sm); padding: 14px 12px; text-align: left;
}
.gal__t { font-size: 14px; font-weight: 800; color: var(--tc, var(--primary)); }
.gal__d { font-size: 11.5px; color: var(--text-faint); margin: 3px 0 10px; min-height: 32px; }
.gal__bars { display: grid; gap: 5px; }
.gal__bar { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.gal__bar i { display: block; height: 100%; background: var(--tc, var(--primary-2)); border-radius: 999px; }

/* ---------- 每日提示 ---------- */
.tipcard {
  max-width: 520px; margin: 0 auto; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.tipcard__badge {
  display: inline-block; font-size: 11px; letter-spacing: .08em; color: var(--primary);
  background: var(--primary-soft); padding: 4px 11px; border-radius: 999px;
  font-weight: 700; margin-bottom: 10px;
}
.tipcard b { display: block; font-size: 16px; margin-bottom: 7px; }
.tipcard p { margin: 0; font-size: 13.5px; color: var(--text-soft); line-height: 1.85; }

/* ---------- 本地统计 ---------- */
.pvrate { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 14px; }
.pvrate__b {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
}
.pvrate__b b { display: block; font-size: 20px; color: var(--primary); line-height: 1.2; }
.pvrate__b span { font-size: 11.5px; color: var(--text-faint); }
.pvrate__bar { height: 5px; border-radius: 999px; background: var(--border); margin-top: 8px; overflow: hidden; }
.pvrate__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: 999px; }


/* ============ AI 一键生成人设 ============ */
.gen {
  background: linear-gradient(135deg, var(--primary-soft), transparent);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 18px;
}
.gen__head { font-size: 13.5px; font-weight: 700; margin-bottom: 10px; }
.gen__row { display: flex; gap: 8px; }
.gen__row input {
  flex: 1; min-width: 0; padding: 10px 14px; font: inherit; font-size: 13.5px;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; outline: none;
}
.gen__row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.gen__btn { flex: none; padding: 10px 18px; font-size: 13.5px; white-space: nowrap; }
.gen__btn:disabled { opacity: .55; cursor: wait; }
.gen__tip { margin: 9px 0 0; font-size: 11.5px; color: var(--text-faint); line-height: 1.6; }


/* ============ 合规：年龄段选择 / 青少年提示 / 时长提醒 ============ */
.ob__agewrap { display: grid; gap: 10px; }
.ageopt {
  cursor: pointer; font: inherit; text-align: left; color: var(--text);
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; transition: .18s;
}
.ageopt:hover { border-color: var(--primary); }
.ageopt.is-on { border-color: var(--primary-2); box-shadow: var(--glow-pink); background: var(--primary-soft); }
.ageopt b { display: block; font-size: 15px; margin-bottom: 3px; }
.ageopt small { font-size: 12.5px; color: var(--text-faint); line-height: 1.6; }

.minorbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 0 0 10px; padding: 9px 11px; font-size: 11.5px; line-height: 1.6;
  color: var(--text-soft); background: var(--primary-soft);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.minorbar[hidden] { display: none; }
.minorbar b { color: var(--primary); }
.minorbar .linklike { margin-left: auto; font-size: 11px; }

.modal__panel--sm { width: min(430px, 100%); }


/* ============ 军师模式 ============ */
.co { padding-bottom: 50px; }
.co__hero { max-width: 720px; margin: 0 auto; padding: clamp(34px, 6vw, 56px) 20px 10px; text-align: center; }
.co__kicker {
  display: inline-block; font-size: 12px; letter-spacing: .06em; color: var(--primary);
  background: var(--primary-soft); padding: 5px 13px; border-radius: 999px; font-weight: 700;
}
.co__h1 { font-size: clamp(28px, 5.4vw, 42px); font-weight: 800; margin: 14px 0 8px; line-height: 1.25; }
.co__h1 b { background: linear-gradient(90deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.co__sub { color: var(--text-soft); font-size: 15px; margin: 0; }

.co__grid {
  max-width: 940px; margin: 0 auto; padding: 24px 20px 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px;
}
.coscene {
  cursor: pointer; font: inherit; text-align: left; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 20px 18px; transition: .2s; box-shadow: var(--shadow);
}
.coscene:hover { transform: translateY(-3px); border-color: var(--primary); }
.coscene.is-hot { border-left: 4px solid var(--primary-2); }
.coscene__e { display: block; font-size: 30px; margin-bottom: 8px; }
.coscene b { display: block; font-size: 16px; margin-bottom: 4px; }
.coscene small { font-size: 12.5px; color: var(--text-faint); line-height: 1.6; }
/* 带着报告来的置顶入口：横贯一行 + 主题色渐变，和普通场景区分开 */
.coscene--report {
  grid-column: 1 / -1;
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-soft), var(--surface) 55%);
}
.co__note {
  max-width: 640px; margin: 24px auto 0; padding: 0 20px; text-align: center;
  font-size: 12.5px; color: var(--text-faint); line-height: 1.8;
}

.co__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 860px; margin: 0 auto; padding: 26px 20px 6px;
}
.co__back { background: none; border: none; cursor: pointer; font: inherit; font-size: 13px; color: var(--text-faint); }
.co__back:hover { color: var(--primary); }
.co__cur { font-size: 16px; font-weight: 700; }
.co__badge {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-faint);
}
.co__badge--live { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

.co__ask { max-width: 720px; margin: 0 auto; padding: 18px 20px; }
.co__askh { font-size: 19px; font-weight: 700; line-height: 1.6; margin: 0 0 14px; }
.co__ask textarea {
  width: 100%; padding: 14px 16px; font: inherit; font-size: 14.5px; line-height: 1.8; resize: vertical;
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); outline: none;
}
.co__ask textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.co__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.co__actions--out { max-width: 720px; margin: 20px auto 0; }
.co__tip { text-align: center; font-size: 12px; color: var(--text-faint); margin: 14px 0 0; }
/* 报告场景：透明展示军师读到的报告（默认折叠） */
.co__report { margin: 14px 0 0; }
.co__report summary {
  cursor: pointer; font-size: 12.5px; color: var(--text-faint);
  user-select: none; padding: 4px 0;
}
.co__report summary:hover { color: var(--primary); }
.co__report-body {
  margin-top: 8px; padding: 14px 16px; max-height: 280px; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); font-size: 13px; line-height: 1.7;
}

.co__out {
  max-width: 760px; margin: 0 auto; padding: 8px 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.co__typing { color: var(--text-faint); font-size: 14px; padding: 20px 4px; }
.co__out.is-loading::after {
  content: ''; display: inline-block; width: 7px; height: 15px; margin-left: 3px;
  vertical-align: -3px; background: var(--primary-2); border-radius: 2px;
  animation: blink 1s steps(2) infinite;
}
.co__foot {
  max-width: 760px; margin: 12px auto 0; padding: 0 20px;
  font-size: 12px; color: var(--text-faint); text-align: center; min-height: 18px;
}
.co__out blockquote {
  background: var(--surface-2);
}


/* ============ 侧栏折叠（桌面端） ============
   注意：只写 .app.is-collapsed 的列宽，不重写 .app 基础列宽，
   否则会覆盖掉 561–900px 中屏的窄侧栏规则。 */
@media (min-width: 561px) {
  /* 只在用户主动折叠时加 .is-animating 才有列宽过渡。
     常驻 transition 会让「视口变化」也持续触发布局动画，导致测量抖动、观感卡顿。 */
  .app.is-animating { transition: grid-template-columns .26s cubic-bezier(.4, 0, .2, 1); }
  .sidebar { transition: transform .26s cubic-bezier(.4, 0, .2, 1), opacity .2s ease; }
  .app.is-collapsed { grid-template-columns: 0px 1fr; }
  .app.is-collapsed .sidebar {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
  }
  /* 收起后，用聊天区顶部的 ☰ 作为恢复入口 */
  .app.is-collapsed .chat__head .only-mobile { display: grid; }
}


/* ============ 每日提示卡：操作区与来源说明 ============ */
.tipcard__acts {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border);
}
.tipcard__acts .linklike { font-size: 12px; }
.tipcard__acts .linklike:disabled { opacity: .5; cursor: wait; }
.tipcard__src { margin: 8px 0 0; font-size: 11px; color: var(--text-faint); opacity: .8; }


/* ============ 军师模式：示例快捷填入 ============ */
.co__samples { margin-bottom: 12px; }
.co__samples-h {
  display: block; font-size: 12px; color: var(--text-faint); margin-bottom: 8px;
}
.co__samples-list { display: flex; gap: 8px; flex-wrap: wrap; }
.cosample {
  cursor: pointer; font: inherit; text-align: left;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 7px 14px;
  color: var(--text-soft); font-size: 12.5px; line-height: 1.5;
  transition: .18s; max-width: 100%;
}
.cosample b { font-weight: 600; }
.cosample:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }
.cosample.is-on {
  border-color: var(--primary-2);
  background: linear-gradient(135deg, var(--primary-soft), rgba(255, 79, 148, .16));
  color: var(--primary-3);
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(255, 79, 148, .22), 0 4px 16px rgba(255, 79, 148, .28);
}
[data-theme="light"] .cosample.is-on { color: #c0246a; }

/* ================= 测试广场 ================= */
.tp { max-width: 1060px; margin: 0 auto; padding: 26px 20px 60px; }
.tp__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.tp__title { font-size: clamp(24px, 4vw, 30px); font-weight: 800; margin: 0 0 6px; }
.tp__sub { color: var(--text-soft); font-size: 14px; margin: 0; max-width: 620px; }
.tp__me { flex: none; }

.tp__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.ts {
  position: relative; display: flex; flex-direction: column; gap: 7px;
  text-align: left; cursor: pointer; font: inherit;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 18px; padding: 20px 18px 16px;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.ts:hover {
  transform: translateY(-3px);
  border-color: var(--tc, var(--primary));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22), 0 0 0 1px var(--tc, var(--primary)) inset;
}
.ts__badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .4px;
  color: var(--tc, var(--primary));
  background: color-mix(in srgb, var(--tc, var(--primary)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tc, var(--primary)) 40%, transparent);
  border-radius: 999px; padding: 3px 9px;
}
.ts__emoji { font-size: 34px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.ts__title { font-size: 18px; font-weight: 800; color: var(--text); }
.ts__hook { font-size: 13.5px; font-weight: 600; color: var(--tc, var(--primary)); line-height: 1.45; }
.ts__sub { font-size: 12px; color: var(--text-faint); line-height: 1.55; }
.ts__meta { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.ts__meta i {
  font-style: normal; font-size: 11px; color: var(--text-faint);
  background: var(--bg-soft, rgba(255,255,255,.06)); border-radius: 6px; padding: 2px 7px;
}
.ts__state { margin-top: 6px; font-size: 12px; font-weight: 600; }
.ts__state--new { color: var(--text-faint); }
.ts__state--done { color: var(--tc, var(--primary)); }
.ts__lock {
  position: absolute; top: 12px; right: 12px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .3px;
  color: #f6c453; background: rgba(246, 196, 83, .14);
  border: 1px solid rgba(246, 196, 83, .45); border-radius: 999px; padding: 3px 9px;
}
.ts__badge + .ts__lock { top: 44px; }

/* ============ 授权解锁弹窗（license gate） ============ */
.lic { min-height: 100%; display: flex; flex-direction: column; }
.lic__card {
  max-width: 460px; margin: 8vh auto 0; width: 100%;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 20px; padding: 30px 26px; text-align: center;
  box-shadow: var(--shadow);
}
.lic__lock { font-size: 46px; line-height: 1; margin-bottom: 6px; }
.lic__title { font-size: 21px; font-weight: 800; color: var(--text); margin: 6px 0 8px; }
.lic__sub { font-size: 13.5px; color: var(--text-soft); line-height: 1.7; margin: 0 0 18px; }
.lic__field { display: block; text-align: left; margin-bottom: 10px; }
.lic__field span { display: block; font-size: 12.5px; color: var(--text-faint); margin-bottom: 6px; }
.lic__field input {
  width: 100%; font: inherit; font-size: 16px; letter-spacing: 2px; font-weight: 700;
  text-align: center; text-transform: uppercase;
  color: var(--text); background: var(--bg-soft, rgba(255,255,255,.06));
  border: 1.5px solid var(--border); border-radius: 12px; padding: 13px 12px;
}
.lic__field input:focus { outline: none; border-color: var(--primary); }
.lic__err { color: #ff8a8a; font-size: 13px; font-weight: 600; margin: 4px 0 10px; }
.lic__actions { display: flex; gap: 10px; margin-top: 6px; }
.lic__actions .btn { flex: 1; }
.lic__note { font-size: 11.5px; color: var(--text-faint); line-height: 1.6; margin: 16px 0 0; }

.tp__foot {
  margin-top: 26px; padding: 20px; text-align: center;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 18px;
}
.tp__progress b { font-size: 14.5px; }
.tp__pbar { height: 8px; border-radius: 999px; background: var(--border); margin: 10px auto 8px; max-width: 420px; overflow: hidden; }
.tp__pbar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .4s; }
.tp__progress small { display: block; color: var(--text-faint); font-size: 12px; }
.tp__note { color: var(--text-faint); font-size: 12.5px; line-height: 1.7; margin: 16px auto 14px; max-width: 640px; }

/* 结果页按测试定制的眉题/免责（love 之外的主题色由 --tc 控制） */
.rs__eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--tc, var(--primary)); text-transform: uppercase; }

/* 广场分类 tabs */
.tp__tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tptab {
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  color: var(--text-soft); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 999px; padding: 6px 16px;
  transition: color .15s, border-color .15s, background .15s;
}
.tptab:hover { border-color: var(--primary); color: var(--primary); }
.tptab.is-on {
  color: #fff; background: var(--primary); border-color: var(--primary);
}
