/* ==========================================================================
   哄女生对话 · 哄哄 —— 公共样式
   风格：薄荷奶绿柔和（奶白底 + 薄荷绿主 + 奶油黄/蜜桃点缀 · 柔和大圆角/轻投影/气泡/清新治愈）
   布局：左右对半分屏 —— 左半粘性（品牌 + 大标题 + 哄女生输入卡），右半滚动（哄人场景卡片区）。
   与其它同系列项目（单列/宫格/瀑布流/IM/居中卡/手账/斜切）刻意彻底区分。
   ========================================================================== */

/* ------------------------------ 设计变量 ------------------------------ */
:root {
  --bg: #fbfdfb;
  --bg-soft: #eef8f2;

  --mint: #7fd1ae;
  --mint-deep: #5bbfa0;
  --mint-strong: #46b190;
  --mint-ink: #2f6f5c;

  /* 柔和点缀 */
  --cream: #ffe6ad;   /* 奶油黄 */
  --peach: #ffcdb6;   /* 蜜桃 */

  --ink: #33413c;
  --ink-2: #5f7069;
  --ink-3: #9bafa6;

  --card: #ffffff;
  --line: #e6f1ec;
  --line-strong: #c9e8da;

  --grad: linear-gradient(135deg, #8fdcbb 0%, #5bbfa0 100%);
  --grad-soft: linear-gradient(160deg, #f4fcf8 0%, #e7f6ef 100%);

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --r-pill: 999px;

  --shadow-sm: 0 4px 14px rgba(70, 177, 144, .10);
  --shadow: 0 12px 30px rgba(70, 177, 144, .14);
  --shadow-lg: 0 22px 46px rgba(55, 150, 120, .20);

  --maxw: 1180px;

  --font: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-title: 'Quicksand', 'Nunito', var(--font);
}

/* ------------------------------ 基础 ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }

/* 关键避坑：display:flex 会覆盖 hidden，这里让 hidden 永远赢 */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  font-family: var(--font);
  font-size: 15px; line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* 对话模式：锁视口，只让 chat-list 内部滚动，页脚隐藏 */
body.mode-chat { height: 100vh; height: 100dvh; overflow: hidden; }
body.mode-chat .site-footer { display: none; }

a { color: var(--mint-deep); }
h1, h2, h3 { font-family: var(--font-title); font-weight: 800; letter-spacing: .2px; }

/* ------------------------------ 气泡柔光背景 ------------------------------ */
.bubblebg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(127,209,174,.16), transparent 42%),
    radial-gradient(circle at 92% 88%, rgba(91,191,160,.14), transparent 46%),
    radial-gradient(circle at 82% 12%, rgba(255,230,173,.16), transparent 40%),
    var(--bg);
}
.bubblebg .bubble { position: absolute; border-radius: 50%; opacity: .5;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.9), rgba(127,209,174,.30) 70%);
  box-shadow: inset 0 0 22px rgba(255,255,255,.6);
}
.bubblebg .b1 { width: 190px; height: 190px; top: 8%;  left: 4%; }
.bubblebg .b2 { width: 120px; height: 120px; top: 62%; left: 8%;  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.9), rgba(255,230,173,.34) 70%); }
.bubblebg .b3 { width: 240px; height: 240px; top: 30%; right: 5%; }
.bubblebg .b4 { width: 96px;  height: 96px;  bottom: 10%; right: 16%; background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.9), rgba(255,205,182,.34) 70%); }
.bubblebg .b5 { width: 70px;  height: 70px;  top: 16%; left: 44%; opacity: .4; }

/* ------------------------------ 顶栏 ------------------------------ */
.topbar {
  position: relative; z-index: 3; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px clamp(16px, 4vw, 40px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand-mark {
  display: grid; place-items: center; width: 44px; height: 44px; font-size: 22px;
  border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm);
  border: 1px solid var(--line-strong);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-title); font-size: 18px; color: var(--ink); }
.brand-text em { font-style: normal; font-size: 11px; letter-spacing: .5px; color: var(--mint-deep); }
.site-nav { display: flex; align-items: center; gap: 8px; }
.nav-btn {
  appearance: none; border: 1px solid var(--line-strong); background: #fff; color: var(--mint-ink);
  font-family: inherit; font-weight: 700; font-size: 13px; padding: 8px 16px; border-radius: var(--r-pill);
  text-decoration: none; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .16s, box-shadow .16s, background .16s, color .16s;
}
.nav-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); background: var(--bg-soft); color: var(--mint-strong); }

/* ------------------------------ 舞台 ------------------------------ */
.stage { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; width: 100%; }
body.mode-chat .stage { display: flex; }
.landing { width: 100%; }

/* ------------------------------ 左右分屏 ------------------------------ */
.split {
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: clamp(8px, 2vw, 20px) clamp(16px, 4vw, 40px) 52px;
  display: flex; align-items: flex-start; gap: clamp(20px, 3vw, 40px);
}
.split-left {
  flex: 0 0 43%; max-width: 43%;
  position: sticky; top: 16px; align-self: flex-start;
}
.split-right { flex: 1 1 auto; min-width: 0; }

/* ------------------------------ HERO ------------------------------ */
.hero { padding: 4px 2px 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; margin: 0 0 14px; padding: 6px 15px;
  font-size: 12.5px; font-weight: 700; color: var(--mint-ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-pill); box-shadow: var(--shadow-sm);
}
.hero-title { margin: 0 0 14px; font-size: clamp(28px, 3.4vw, 44px); line-height: 1.2; color: var(--ink); }
.hero-title b { color: var(--mint-deep); position: relative; white-space: nowrap; }
.hero-title b::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 10px; z-index: -1;
  background: linear-gradient(90deg, var(--cream), var(--peach)); border-radius: 6px; opacity: .7;
}
.hero-sub { margin: 0 0 22px; max-width: 22em; color: var(--ink-2); font-size: 15px; }

/* ------------------------------ 关系阶段 ------------------------------ */
.stage-bar { margin-bottom: 18px; }
.stage-bar-title { display: block; font-family: var(--font-title); font-weight: 800; color: var(--ink); font-size: 14px; margin-bottom: 11px; }
.stage-bar-title b { color: var(--mint-deep); }
.state-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.state-chip {
  appearance: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 13px; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 7px 15px;
  box-shadow: var(--shadow-sm);
  transition: transform .16s, box-shadow .16s, color .16s, background .16s;
}
.state-chip:hover { transform: translateY(-2px); color: var(--mint-strong); }
.state-chip.is-active { color: #fff; background: var(--grad); border-color: transparent; box-shadow: var(--shadow); }

/* ------------------------------ 哄女生输入卡（清新气泡卡） ------------------------------ */
.composer-slot { margin-top: 4px; }
.composer { width: 100%; }
.composer-card {
  position: relative;
  padding: 22px 20px 16px;
  background: var(--grad-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
}
.composer-sticker {
  position: absolute; top: -16px; right: 18px; display: grid; place-items: center;
  width: 46px; height: 46px; font-size: 23px; background: #fff; border-radius: 50%;
  box-shadow: var(--shadow); border: 1px solid var(--line-strong);
}
.composer-head { margin-bottom: 8px; }
.composer-label { font-family: var(--font-title); font-weight: 800; color: var(--ink); font-size: 15px; }
.composer-input {
  display: block; width: 100%; padding: 12px 14px; resize: none; outline: none;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: #fff;
  font-family: inherit; font-size: 15px; line-height: 1.7; color: var(--ink); max-height: 160px;
  transition: border-color .16s, box-shadow .16s;
}
.composer-input:focus { border-color: var(--mint); box-shadow: 0 0 0 4px rgba(127,209,174,.18); }
.composer-input::placeholder { color: var(--ink-3); }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.composer-stage { font-size: 13px; color: var(--mint-ink); padding: 5px 13px; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-pill); }
.composer-stage b { color: var(--mint-strong); }
.composer-actions { display: flex; align-items: center; gap: 10px; }
.stop-btn {
  appearance: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 13px; color: var(--mint-ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 9px 15px;
  box-shadow: var(--shadow-sm); transition: transform .16s;
}
.stop-btn:hover { transform: translateY(-1px); }
.send-btn {
  appearance: none; cursor: pointer; font-family: var(--font-title); font-weight: 800; font-size: 14.5px; color: #fff;
  background: var(--grad); border: none; border-radius: var(--r-pill); padding: 11px 22px;
  box-shadow: var(--shadow); transition: transform .16s, box-shadow .16s, filter .16s;
}
.send-btn:hover { transform: translateY(-2px); filter: brightness(1.03); box-shadow: var(--shadow-lg); }
.send-btn:active { transform: translateY(0); }
.send-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }
.composer-tip { margin: 12px 6px 0; font-size: 12px; color: var(--ink-3); text-align: center; }

/* ------------------------------ 哄人场景（右半） ------------------------------ */
.scenes { }
.sec-title { display: flex; align-items: center; gap: 9px; margin: 0 0 6px; font-size: clamp(19px, 2.2vw, 23px); color: var(--ink); }
.sec-title::before { content: ""; flex: none; width: 10px; height: 22px; border-radius: 5px; background: var(--grad); }
.sec-sub { margin: 0 0 18px; color: var(--ink-3); font-size: 13px; }
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.cat-tab {
  appearance: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 13px; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 7px 15px;
  box-shadow: var(--shadow-sm); transition: transform .16s, color .16s, background .16s, border-color .16s;
}
.cat-tab:hover { transform: translateY(-2px); color: var(--mint-strong); }
.cat-tab.is-active { color: var(--mint-ink); background: var(--bg-soft); border-color: var(--line-strong); }

.starters { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.starter {
  position: relative; display: block; width: 100%; text-align: left; cursor: pointer; font-family: inherit; color: var(--ink);
  padding: 17px 16px 16px; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.starter:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--mint); }
.starter-tag {
  display: inline-block; margin-bottom: 10px; padding: 4px 12px; font-size: 11.5px; font-weight: 800; color: var(--mint-ink);
  border-radius: var(--r-pill); background: var(--bg-soft);
}
.starter:nth-child(5n+2) .starter-tag { background: #fff5db; color: #a9821f; }
.starter:nth-child(5n+3) .starter-tag { background: #ffeee4; color: #c07048; }
.starter:nth-child(5n+4) .starter-tag { background: #e9f7f0; color: var(--mint-ink); }
.starter strong { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.5; }

/* ------------------------------ 哄哄擅长 ------------------------------ */
.feats { margin-top: 40px; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 14px; margin-top: 16px; }
.feat {
  display: flex; align-items: flex-start; gap: 12px; padding: 17px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.feat-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; font-size: 22px; background: var(--bg-soft); border-radius: 14px; }
.feat-body strong { display: block; font-size: 15px; color: var(--ink); margin-bottom: 3px; font-family: var(--font-title); }
.feat-body p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }

/* ------------------------------ FAQ ------------------------------ */
.faq { margin-top: 40px; }
.faq .sec-title { margin-bottom: 16px; }
.faq-item { margin-bottom: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px;
  cursor: pointer; appearance: none; border: none; background: transparent; font-family: var(--font-title); font-weight: 800; font-size: 14.5px; color: var(--ink); text-align: left;
}
.faq-arrow { flex: none; display: grid; place-items: center; width: 26px; height: 26px; font-weight: 900; color: var(--mint-ink); background: var(--bg-soft); border-radius: 9px; transition: transform .22s; }
.faq-item.is-open .faq-arrow { transform: rotate(135deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-item.is-open .faq-a { max-height: 320px; }
.faq-a p { margin: 0; padding: 0 18px 16px; font-size: 13.5px; color: var(--ink-2); }

/* ------------------------------ 对话视图 ------------------------------ */
.chatview { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 28px); }
body.mode-chat .chatview { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.chatview-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 0 10px; }
.chatview-back, .chatview-clear {
  appearance: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 13px; color: var(--mint-ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 7px 15px;
  box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s;
}
.chatview-back:hover, .chatview-clear:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.chatview-state { font-size: 13px; color: var(--ink-2); }
.chatview-state b { color: var(--mint-deep); }
.chat-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 2px 18px; display: flex; flex-direction: column; gap: 16px; }

/* 运行时消息气泡（app.js 动态插入的类） */
.msg { display: flex; gap: 11px; align-items: flex-start; }
.msg-user { flex-direction: row-reverse; }
.msg-avatar { flex: none; display: grid; place-items: center; width: 40px; height: 40px; font-size: 20px; background: #fff; border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-sm); }
.msg-body { max-width: min(80%, 560px); }
.msg-user .msg-body { text-align: right; }
.msg-name { font-family: var(--font-title); font-size: 11.5px; color: var(--ink-3); margin: 2px 6px 4px; }
.msg-text { display: inline-block; text-align: left; padding: 12px 15px; border-radius: 6px 18px 18px 18px; background: #fff; border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); color: var(--ink); }
.msg-user .msg-text { border-radius: 18px 6px 18px 18px; background: var(--grad); border-color: transparent; color: #fff; }
.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(--mint-deep); }
.msg-user .msg-text strong { color: #fff; }
.msg-note { color: var(--ink-3); font-size: 12.5px; } .msg-error { color: #e26d5c; }
.typing { display: inline-flex; gap: 5px; padding: 2px 0; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); animation: typing 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
body.mode-chat .composer-slot#slotChat { flex: none; padding: 8px 0 14px; background: linear-gradient(0deg, var(--bg), transparent); }

/* ------------------------------ 页脚 ------------------------------ */
.site-footer {
  flex: none; position: relative; z-index: 1; margin-top: auto;
  padding: 28px clamp(16px, 4vw, 40px) 32px; text-align: center;
  background: #fff; border-top: 1px solid var(--line-strong);
}
.footer-tagline { margin: 0 0 6px; font-weight: 700; color: var(--ink); font-size: 13.5px; font-family: var(--font-title); }
.footer-company { margin: 0 0 10px; color: var(--ink-2); font-size: 13px; }
.footer-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-bottom: 10px; font-size: 12.5px; color: var(--ink-2); }
.footer-contact a { color: var(--ink-2); text-decoration: none; } .footer-contact a:hover { color: var(--mint-deep); }
.footer-beian { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 12px; }
.footer-beian a { color: var(--ink-3); text-decoration: none; } .footer-beian a:hover { color: var(--mint-deep); text-decoration: underline; }

/* ------------------------------ Toast ------------------------------ */
.toast-wrap { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 11px 20px; font-size: 13.5px; font-weight: 800; color: #fff; background: var(--grad); border-radius: var(--r-pill); box-shadow: var(--shadow-lg); animation: toastIn .3s ease; }
.toast.out { animation: toastOut .5s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }

/* ------------------------------ 关于页顶栏（about.html 复用） ------------------------------ */
.site-header {
  position: relative; z-index: 3; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--line-strong); background: #fff;
}

/* ------------------------------ 响应式：窄屏上下堆叠 ------------------------------ */
@media (max-width: 820px) {
  .split { flex-direction: column; gap: 26px; }
  .split-left { position: static; flex: none; max-width: 100%; width: 100%; }
  .hero-sub { max-width: none; }
}
@media (max-width: 560px) {
  .starters { grid-template-columns: 1fr; }
  .brand-text em { display: none; }
  .msg-body { max-width: 86%; }
}

/* ------------------------------ 无障碍：减少动效 ------------------------------ */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
