/* ==========================================================================
   情场高手 LoveTalk · 样式
   深夜玫瑰风：暗紫底 / 玫瑰霞光 / 玻璃气泡 / 暖金点缀
   —— 与宠物系的暖米白、数字人系的青蓝极光刻意区分
   ========================================================================== */

/* ----------------------------- 设计变量 ----------------------------- */
:root {
  /* 底色 · 深夜紫（压得更黑，霓虹才亮得起来） */
  --bg: #0a0610;
  --bg-2: #150b1e;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-soft: rgba(255, 255, 255, 0.028);
  --surface-strong: rgba(255, 255, 255, 0.085);
  --line: rgba(255, 120, 170, 0.16);
  --line-strong: rgba(255, 141, 180, 0.55);
  /* 霓虹网格线 */
  --grid-line: rgba(255, 93, 143, 0.09);

  /* 文字 */
  --ink: #f3ecf3;
  --ink-2: #c3b2c6;
  --ink-3: #8f7f96;

  /* 主色 · 玫瑰 */
  --brand: #ff5d8f;
  --brand-strong: #ff3d78;
  --brand-soft: rgba(255, 93, 143, 0.16);

  /* 辅色 · 暖金 */
  --gold: #ffc46b;
  --gold-soft: rgba(255, 196, 107, 0.16);

  /* 点缀 · 丁香紫 */
  --lilac: #a97bff;

  --grad: linear-gradient(120deg, #ff5d8f, #ff8fb1 45%, #a97bff);

  /* 阴影 */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --maxw: 880px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ----------------------------- 背景 ----------------------------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.halo {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: drift 48s ease-in-out infinite alternate;
}

.halo-1 {
  width: 46vw; height: 46vw;
  left: -10vw; top: -12vw;
  background: radial-gradient(circle, #ff5d8f, transparent 68%);
}

.halo-2 {
  width: 42vw; height: 42vw;
  right: -8vw; top: 6vh;
  background: radial-gradient(circle, #a97bff, transparent 68%);
  animation-delay: -16s;
}

.halo-3 {
  width: 40vw; height: 40vw;
  left: 32vw; bottom: -16vw;
  background: radial-gradient(circle, #ffc46b, transparent 70%);
  opacity: 0.32;
  animation-delay: -30s;
}

/*
 * 霓虹网格 + 点阵双层。
 * 网格给"科技/夜色"骨架，点阵补细节；
 * 都用径向遮罩向四周淡出，避免整屏铺满显廉价。
 */
.heart-field {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1px);
  background-size: 56px 56px, 56px 56px, 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 42%, #000 8%, transparent 80%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 42%, #000 8%, transparent 80%);
}

/* 顶部一条渐变发光线，像仪表盘状态条 */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 5;
  background: var(--grad);
  box-shadow: 0 0 18px rgba(255, 93, 143, 0.7);
  pointer-events: none;
}

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(3%, -3%, 0) scale(1.1); }
  100% { transform: translate3d(-3%, 2%, 0) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .halo { animation: none; }
}

/* --------------------------- 占位提示条 --------------------------- */
.config-banner {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--gold-soft);
  border-bottom: 1px solid rgba(255, 196, 107, 0.3);
  color: var(--gold);
  font-size: 13px;
}

.config-banner .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex: none;
}

.config-banner code {
  background: rgba(0, 0, 0, 0.28);
  padding: 1px 6px;
  border-radius: 5px;
}

.banner-close {
  margin-left: auto;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-size: 15px;
  opacity: 0.7;
}
.banner-close:hover { opacity: 1; }

/* ----------------------------- 顶栏 ----------------------------- */
.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 32px);
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  font-size: 24px;
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 13px;
  background: var(--brand-soft);
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 22px rgba(255, 93, 143, 0.4), inset 0 0 16px rgba(255, 93, 143, 0.2);
  animation: pulse-glow 3.2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 93, 143, 0.32), inset 0 0 14px rgba(255, 93, 143, 0.16); }
  50%      { box-shadow: 0 0 34px rgba(255, 93, 143, 0.62), inset 0 0 20px rgba(255, 93, 143, 0.3); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark { animation: none; }
}

.brand-text { display: inline-flex; flex-direction: column; line-height: 1.25; }

.brand-text strong {
  font-size: 18px;
  letter-spacing: 0.5px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* 不支持 background-clip:text 时退回纯色，否则标题会整个消失 */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-text strong { color: var(--brand); -webkit-text-fill-color: var(--brand); }
}

.brand-text em {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--ink-3);
  text-transform: uppercase;
}

.site-nav { display: flex; gap: 8px; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .2s, color .2s, transform .2s, background .2s;
}

.nav-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface-strong);
  transform: translateY(-1px);
}

/* ----------------------------- 对话区 ----------------------------- */
.chat {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
  min-height: 0;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 20px;
  scroll-behavior: smooth;
}

/* 空状态 */
.empty { padding: clamp(16px, 5vh, 48px) 0 8px; }

.empty-title {
  margin: 0 0 12px;
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.2;
  letter-spacing: -0.5px;
  /* background-size 放大到 200% 才有空间让渐变流动 */
  background: var(--grad);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: gradient-flow 7s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(255, 93, 143, 0.28));
}

@keyframes gradient-flow {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .empty-title { animation: none; }
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .empty-title { color: var(--ink); -webkit-text-fill-color: var(--ink); }
}

.empty-sub {
  margin: 0 0 24px;
  color: var(--ink-2);
  max-width: 46em;
}

.starters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.starter {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  text-align: left;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .2s, background .2s, box-shadow .2s;
}

/* 顶部渐变高光条 */
.starter::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s;
  z-index: 2;
}

/*
 * 斜向扫光：一道半透明白光从左下扫到右上。
 * 默认停在卡片外（-120%），hover 时滑过去。
 */
.starter::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -120%;
  width: 60%;
  height: 220%;
  background: linear-gradient(
    100deg,
    transparent,
    rgba(255, 255, 255, 0.16) 45%,
    rgba(255, 255, 255, 0.28) 50%,
    rgba(255, 255, 255, 0.16) 55%,
    transparent
  );
  transform: rotate(14deg);
  transition: left .65s cubic-bezier(.22, .61, .36, 1);
  pointer-events: none;
  z-index: 1;
}

.starter:hover,
.starter:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface);
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(255, 93, 143, 0.3),
              0 0 0 1px rgba(255, 141, 180, 0.28);
  outline: none;
}

.starter:hover::before,
.starter:focus-visible::before { transform: scaleX(1); }

.starter:hover::after,
.starter:focus-visible::after { left: 130%; }

.starter > * { position: relative; z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  .starter, .starter::before, .starter::after { transition: none; }
  .starter:hover, .starter:focus-visible { transform: none; }
}

.starter-tag {
  align-self: flex-start;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  letter-spacing: 1px;
}

.starter strong { font-weight: 600; font-size: 14px; }

/* 消息气泡 */
.msg {
  display: flex;
  gap: 12px;
  margin: 18px 0;
  animation: msg-in .24s ease both;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .msg { animation: none; }
}

.msg-avatar {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  font-size: 17px;
}

.msg-body { min-width: 0; flex: 1; }

.msg-name {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 5px;
}

.msg-text {
  border-radius: var(--radius-md);
  padding: 12px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.msg-text p { margin: 0 0 8px; }
.msg-text p:last-child { margin-bottom: 0; }
.msg-text ul { margin: 6px 0; padding-left: 20px; }
.msg-text li { margin: 3px 0; }
.msg-text strong { color: var(--gold); }

/* 用户消息：右对齐 + 渐变描边 */
.msg-user { flex-direction: row-reverse; }
.msg-user .msg-name { text-align: right; }
.msg-user .msg-text {
  background: var(--brand-soft);
  border-color: transparent;
  position: relative;
}

/* 用 mask 挖空中心只留 1px 边环，不干扰气泡自身的半透明底色 */
.msg-user .msg-text::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

@supports not ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .msg-user .msg-text { border-color: var(--line-strong); }
  .msg-user .msg-text::after { display: none; }
}

.msg-error { color: #ff8f9e; margin: 0; }
.msg-note { color: var(--ink-3); font-size: 12px; margin: 8px 0 0; }

/* 等待动画 */
.typing { display: inline-flex; gap: 4px; align-items: center; height: 20px; }
.typing i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }

@keyframes blink {
  0%, 60%, 100% { opacity: .25; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-3px); }
}

/* ----------------------------- 输入区 ----------------------------- */
.composer { padding: 0 0 16px; }

.composer-inner {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(20, 10, 28, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color .2s, box-shadow .2s;
  isolation: isolate;
}

/*
 * 聚焦时的流动霓虹光环。
 *
 * ⚠️ 关键：动的是 conic-gradient 的**起始角度**，不是元素本身。
 * 早先用 transform: rotate() 转整个伪元素，结果一个 800px 宽的矩形绕中心旋转，
 * 扫过的范围远超输入框（父级没有 overflow:hidden），会在整页拖出一道斜线。
 * 改成用 @property 注册角度变量后逐帧插值，元素位置纹丝不动。
 */
@property --ring-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.composer-inner::before {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  padding: 1.5px;
  /* 带 0deg 兜底：浏览器不支持 @property 时退化为静态霓虹环，而不是整条消失 */
  background: conic-gradient(
    from var(--ring-angle, 0deg),
    transparent 0deg,
    #ff5d8f 60deg,
    #a97bff 130deg,
    #ffc46b 200deg,
    transparent 280deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .3s;
  animation: ring-spin 3.5s linear infinite;
  pointer-events: none;
}

.composer-inner:focus-within::before { opacity: 1; }

@keyframes ring-spin {
  to { --ring-angle: 360deg; }
}

.composer-inner:focus-within {
  border-color: transparent;
  box-shadow: 0 0 28px rgba(255, 93, 143, 0.28);
}

/* 不支持 mask-composite 时退回实线高亮描边 */
@supports not ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .composer-inner::before { display: none; }
  .composer-inner:focus-within {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 3px rgba(255, 93, 143, 0.15);
  }
}

@media (prefers-reduced-motion: reduce) {
  .composer-inner::before { animation: none; }
}

.composer-input {
  flex: 1;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
  max-height: 160px;
  padding: 6px 0;
}

.composer-input::placeholder { color: var(--ink-3); }
.composer-input:disabled { opacity: .6; }

.send-btn {
  flex: none;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: var(--grad);
  background-size: 150% auto;
  box-shadow: 0 4px 16px rgba(255, 93, 143, 0.35);
  transition: background-position .4s, box-shadow .2s, transform .2s;
}

.send-btn:hover:not(:disabled) {
  background-position: right center;
  box-shadow: 0 6px 22px rgba(255, 93, 143, 0.5);
  transform: translateY(-1px);
}

.send-btn:disabled { opacity: .5; cursor: not-allowed; }

.stop-btn {
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  background: var(--surface-strong);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.stop-btn:hover { color: var(--ink); }

.composer-tip {
  margin: 10px 2px 0;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
}

/* ----------------------------- 页脚 ----------------------------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 22px clamp(16px, 4vw, 32px) 28px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
  background: rgba(0, 0, 0, 0.18);
}

.footer-tagline { margin: 0 0 8px; }

.footer-company { margin: 0 0 8px; color: var(--ink-2); font-weight: 600; }

.footer-contact,
.footer-beian {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
}

.footer-beian { margin-top: 8px; }

.footer-contact a,
.footer-beian a {
  color: inherit;
  text-decoration: none;
  transition: color .2s;
}

.footer-contact a:hover,
.footer-beian a:hover { color: var(--brand); text-decoration: underline; }

/* ----------------------------- Toast ----------------------------- */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(30, 18, 40, 0.94);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  animation: toast-in .2s ease both;
}

.toast.out { opacity: 0; transition: opacity .5s; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----------------------------- 响应式 ----------------------------- */
@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .starters { grid-template-columns: 1fr; }
  .site-header { padding: 12px 16px; }
  .brand-text em { display: none; }
  .msg { gap: 9px; margin: 14px 0; }
  .msg-avatar { width: 30px; height: 30px; font-size: 15px; }
  .halo { filter: blur(70px); opacity: .38; }
  .heart-field { background-size: 24px 24px; }
}

/* ==========================================================================
   视觉强化补充
   ========================================================================== */

/* 光晕加大加亮，让底色不发闷 */
.halo { opacity: 0.62; filter: blur(100px); }
.halo-3 { opacity: 0.4; }

/* 顶栏按钮：hover 霓虹辉光 */
.nav-btn:hover {
  border-color: var(--line-strong);
  box-shadow: 0 0 18px rgba(255, 93, 143, 0.28);
}

/* 引导语标签：加辉光描边 */
.starter-tag {
  border: 1px solid rgba(255, 93, 143, 0.3);
  box-shadow: 0 0 12px rgba(255, 93, 143, 0.18);
}

/* AI 头像：霓虹环 + 呼吸 */
.msg:not(.msg-user) .msg-avatar {
  border-color: var(--line-strong);
  box-shadow: 0 0 18px rgba(255, 93, 143, 0.35);
}

/* 发送按钮：默认就带辉光，hover 更亮 */
.send-btn { letter-spacing: 1px; }

/* 空状态副标题留白优化 */
.empty-sub { font-size: 15.5px; }

/*
 * 滚动条：细窄霓虹条，替换掉系统默认的粗灰条。
 * 只作用于对话区，不改全局。
 */
.chat-list::-webkit-scrollbar { width: 8px; }
.chat-list::-webkit-scrollbar-track { background: transparent; }
.chat-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 93, 143, 0.5), rgba(169, 123, 255, 0.5));
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.chat-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 93, 143, 0.8), rgba(169, 123, 255, 0.8));
  background-clip: content-box;
}

/* 页脚：顶部加一条渐变分隔线 */
.site-footer {
  border-top: 0;
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

/* ==========================================================================
   丰富内容区：状态选择器 / 分类 / 步骤 / 亮点 / FAQ
   ========================================================================== */

/* 顶部小标签 */
.empty-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink-2);
  font-size: 12px;
  letter-spacing: .5px;
}

.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px #4ade80;
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

/* 通用小节标题 */
.sec-title {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--ink);
  position: relative;
  padding-left: 12px;
}

.sec-title::before {
  content: "";
  position: absolute;
  left: 0; top: .3em; bottom: .3em;
  width: 3px;
  border-radius: 2px;
  background: var(--grad);
}

/* -------------------- 情感状态选择器 -------------------- */
.state-picker {
  margin: 0 0 22px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.state-picker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.state-picker-title { font-size: 13.5px; color: var(--ink-2); }

.state-picker-hint { font-size: 12px; color: var(--ink-3); }
.state-picker-hint b { color: var(--brand); font-weight: 600; }

.state-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.state-chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s, box-shadow .2s;
}

.state-chip:hover { border-color: var(--line-strong); color: var(--ink); }

.state-chip.is-active {
  border-color: transparent;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 4px 14px rgba(255, 93, 143, 0.4);
}

/* -------------------- 场景分类 -------------------- */
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.cat-tab {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
}

.cat-tab:hover { color: var(--ink-2); }

.cat-tab.is-active {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: rgba(255, 93, 143, 0.3);
}

/* -------------------- 使用步骤 -------------------- */
.how { margin-top: 34px; }

.how-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.how-step {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.how-num {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 3px 12px rgba(255, 93, 143, 0.4);
}

.how-step strong { display: block; margin-bottom: 4px; font-size: 14.5px; }
.how-step p { margin: 0; color: var(--ink-2); font-size: 13px; }

/* -------------------- 能力亮点 -------------------- */
.feats { margin-top: 34px; }

.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.feat {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.feat:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 93, 143, 0.16);
}

.feat-icon { font-size: 20px; }
.feat strong { display: block; margin: 8px 0 5px; font-size: 14.5px; }
.feat p { margin: 0; color: var(--ink-2); font-size: 13px; }

/* -------------------- FAQ -------------------- */
.faq { margin-top: 34px; }

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.faq-q:hover { color: var(--brand); }

.faq-arrow {
  flex: none;
  color: var(--ink-3);
  transition: transform .25s;
  font-size: 16px;
}

.faq-item.is-open .faq-arrow { transform: rotate(45deg); color: var(--brand); }

/* 用 grid-template-rows 做高度过渡，避免写死 max-height */
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
}

.faq-item.is-open .faq-a { grid-template-rows: 1fr; }

.faq-a > p {
  overflow: hidden;
  margin: 0;
  padding: 0 16px;
  color: var(--ink-2);
  font-size: 13.5px;
}

.faq-item.is-open .faq-a > p { padding-bottom: 14px; }

@media (prefers-reduced-motion: reduce) {
  .faq-a { transition: none; }
  .live-dot { animation: none; }
  .feat:hover { transform: none; }
}

@media (max-width: 600px) {
  .state-picker-head { flex-direction: column; gap: 4px; }
  .how-steps, .feat-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   布局重构：落地视图 / 对话视图 分离
   ========================================================================== */

/* 舞台：两个视图的容器 */
.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* -------------------- 落地视图（整页滚动） -------------------- */
.landing { flex: 1; }

.landing-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px) 56px;
}

/* 落地页里各区块之间给足呼吸空间（原来全挤在一个滚动条里） */
.landing .empty { padding-top: clamp(20px, 6vh, 56px); }
.landing .state-picker { margin-top: 30px; margin-bottom: 26px; }
.landing .cat-tabs { margin-top: 6px; }
.landing .how,
.landing .feats,
.landing .faq { margin-top: 52px; }

/* -------------------- 对话视图（内部滚动，输入框固定底部） -------------------- */
.chatview {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
  min-height: 0;
}

.chatview-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-3);
}

.chatview-state { margin-left: auto; }
.chatview-state b { color: var(--brand); font-weight: 600; }

.chatview-back,
.chatview-clear {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .2s, color .2s, box-shadow .2s;
}

.chatview-back:hover,
.chatview-clear:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: 0 0 16px rgba(255, 93, 143, 0.22);
}

/* -------------------- 输入框：两种形态 -------------------- */
.composer-slot { display: contents; }

/*
 * 落地页形态：独立醒目的大卡片，与周围内容拉开距离。
 * 这是"对话框单独打出来"的核心 —— 不再和内容挤在同一个滚动容器里。
 */
.stage[data-mode="landing"] .composer {
  margin: 26px 0 4px;
  padding: 6px;
  border-radius: calc(var(--radius-md) + 8px);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45),
              0 0 60px rgba(255, 93, 143, 0.1);
}

.stage[data-mode="landing"] .composer-inner {
  padding: 14px 12px 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(12, 6, 18, 0.82);
}

/* 落地页里输入框更高，鼓励多写背景信息 */
.stage[data-mode="landing"] .composer-input { min-height: 58px; }

.stage[data-mode="landing"] .composer-tip {
  margin: 10px 6px 4px;
  text-align: left;
}

/* 对话页形态：固定在底部，紧凑 */
.stage[data-mode="chat"] .composer {
  padding: 0 0 14px;
  flex: none;
}

/* -------------------- 页脚在对话视图下隐藏，避免挤压 -------------------- */
.stage[data-mode="chat"] ~ .site-footer { display: none; }

@media (max-width: 600px) {
  .stage[data-mode="landing"] .composer { margin-top: 20px; }
  .chatview-head { flex-wrap: wrap; gap: 8px; }
  .chatview-state { margin-left: 0; width: 100%; order: 3; }
}

/* ==========================================================================
   两种模式的页面滚动行为
   --------------------------------------------------------------------------
   落地页内容比视口高，需要整页自然滚动；
   对话页要把输入框钉在底部、消息区内部滚动，需要固定视口高度。
   原先 html,body 统一 height:100%，落地页内容溢出后页脚被钉在视口底部、
   叠在场景卡上面 —— 必须按模式区分。
   ========================================================================== */
body.mode-landing {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
}

body.mode-chat {
  height: 100%;
  overflow: hidden;
}

/* 落地模式下 html 也要放开，否则 body 仍被父级限死 */
html:has(body.mode-landing) { height: auto; min-height: 100%; }

/* 不支持 :has() 的浏览器兜底：允许 html 滚动 */
@supports not selector(html:has(body)) {
  html { height: auto; min-height: 100%; }
}
