/* ==========================================================================
   相亲高手 · WarmMatch —— 公共样式
   风格：落日赤陶暖色系（暖奶油底 + 落日橙/赤陶主色 + 焦糖/暖棕）
   布局：Bento 宫格工作台 —— 顶栏 + 大小不一的功能格子（输入/阶段/话题/三步/擅长）。
   信息架构刻意区别于「情场高手/撩妹高手」及本项目早期的纵向落地页。
   ========================================================================== */

/* ------------------------------ 设计变量 ------------------------------ */
:root {
  --bg-1: #fff7f0;
  --bg-2: #ffece0;
  --bg-3: #fbe3d2;

  --sunset: #f97316;
  --terra: #c2410c;
  --terra-deep: #9a3412;
  --caramel: #b45309;
  --gold: #d4a24e;
  --rouge: #e5484d;

  --ink: #7c4a2d;
  --ink-2: #a1774f;
  --ink-3: #c2a184;

  --card: #fffdfb;
  --paper: #fffdf6;
  --paper-line: #f0dcc6;
  --line: #f2d9c2;
  --line-strong: #e9bd97;

  --grad: linear-gradient(120deg, #fb923c 0%, #f97316 45%, #c2410c 100%);
  --grad-soft: linear-gradient(160deg, #fffaf4, #fff0e2);

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --r-pill: 999px;

  --shadow-sm: 0 6px 16px rgba(194, 65, 12, .10);
  --shadow: 0 14px 34px rgba(194, 65, 12, .14);
  --shadow-lg: 0 22px 50px rgba(154, 52, 18, .20);

  --dashw: 1120px;

  --font: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
          system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-title: 'Songti SC', 'STSong', 'Source Han Serif SC', 'Noto Serif SC',
                var(--font);
}

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

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: linear-gradient(165deg, var(--bg-1) 0%, var(--bg-2) 55%, var(--bg-3) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.mode-chat { height: 100vh; height: 100dvh; overflow: hidden; }
body.mode-chat .site-footer { display: none; }

a { color: var(--terra); }
h1, h2, h3 { font-family: var(--font-title); font-weight: 700; letter-spacing: .5px; }

/* ------------------------------ 暖色背景 ------------------------------ */
.warmbg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.warmbg .sun {
  position: absolute; top: -140px; right: -120px; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(251,146,60,.5) 0%, rgba(251,146,60,.14) 45%, transparent 70%); filter: blur(6px);
}
.warmbg .glow {
  position: absolute; left: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,162,78,.28) 0%, transparent 68%);
}
.warmbg .rays {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,0) 0 46px, rgba(255,241,224,.32) 46px 48px); opacity: .5;
}

/* ------------------------------ 顶栏 ------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 5; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px clamp(16px, 4vw, 34px);
  background: rgba(255, 250, 244, .82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-strong);
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; font-size: 21px;
  border-radius: 13px; background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(194, 65, 12, .28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-title); font-size: 19px; color: var(--terra-deep); letter-spacing: 1px; }
.brand-text em { font-style: normal; font-size: 11px; letter-spacing: 4px; color: var(--gold); text-transform: uppercase; }
.site-nav { display: flex; align-items: center; gap: 9px; }
.nav-btn {
  appearance: none; border: 1px solid var(--line-strong); background: var(--card); color: var(--terra);
  font-family: inherit; font-weight: 600; font-size: 13.5px; padding: 8px 16px; border-radius: var(--r-pill);
  text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
}
.nav-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); background: #fff3e8; }

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

.dash { width: 100%; max-width: var(--dashw); margin: 0 auto; padding: clamp(16px, 3vw, 30px) clamp(14px, 3vw, 30px) 44px; }
.dash-head { margin-bottom: 18px; }
.empty-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 5px 14px;
  font-size: 12.5px; font-weight: 600; color: var(--caramel);
  background: #fdeede; border: 1px solid var(--line-strong); border-radius: var(--r-pill);
}
.empty-title { margin: 0; font-size: clamp(25px, 4.4vw, 38px); line-height: 1.22; color: var(--terra-deep); }
.empty-title b {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}

/* ============================================================
   Bento 宫格
   ============================================================ */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 178px;
  gap: 14px;
}
.tile {
  position: relative;
  display: flex; flex-direction: column; min-height: 0;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.tile-input  { grid-column: span 4; grid-row: span 2; background: transparent; border: none; box-shadow: none; padding: 0; overflow: visible; justify-content: center; }
.tile-stage  { grid-column: span 2; grid-row: span 2; }
.tile-topics { grid-column: span 2; grid-row: span 2; }
.tile-flow   { grid-column: span 2; grid-row: span 2; }
.tile-feats  { grid-column: span 2; grid-row: span 2; }

.tile-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex: none; }
.tile-title {
  position: relative; padding-left: 13px;
  font-family: var(--font-title); font-weight: 700; color: var(--terra-deep); font-size: 15px;
}
.tile-title::before {
  content: ""; position: absolute; left: 0; top: .18em; bottom: .18em; width: 4px; border-radius: 3px; background: var(--grad);
}
.tile-hint { font-size: 12px; color: var(--ink-2); }
.tile-hint b { color: var(--terra); }

/* ------------------------------ 信笺红娘台（输入框） ------------------------------ */
.composer { width: 100%; }
.composer-card {
  position: relative; padding: 30px 20px 16px;
  background: repeating-linear-gradient(var(--paper) 0 30px, var(--paper-line) 30px 31px);
  background-color: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 6px 6px 14px 14px;
  box-shadow: var(--shadow);
}
.composer-card::before {
  content: ""; position: absolute; left: 16px; top: 8px; bottom: 8px; width: 2px;
  background: repeating-linear-gradient(var(--rouge) 0 6px, transparent 6px 12px); opacity: .55;
}
.composer-tape {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%) rotate(-2deg);
  width: 108px; height: 22px; background: rgba(249, 168, 92, .5); border: 1px dashed rgba(194, 65, 12, .35); border-radius: 3px;
}
.composer-head { display: flex; align-items: center; gap: 10px; padding-left: 14px; margin-bottom: 8px; }
.composer-ava {
  display: grid; place-items: center; width: 34px; height: 34px; font-size: 19px;
  background: var(--grad-soft); border: 1px solid var(--line-strong); border-radius: 10px;
}
.composer-title { font-family: var(--font-title); font-weight: 700; color: var(--terra-deep); font-size: 15px; }
.composer-input {
  display: block; width: 100%; padding: 6px 14px; resize: none; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 15px; line-height: 30px; color: var(--ink); max-height: 160px;
}
.composer-input::placeholder { color: var(--ink-3); }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-left: 14px; margin-top: 8px; }
.composer-stage {
  font-size: 13px; color: var(--ink-2); padding: 4px 12px; background: #fdeede; border: 1px solid var(--line); border-radius: var(--r-pill);
}
.composer-stage b { color: var(--terra); }
.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(--terra);
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 8px 14px; transition: background .15s;
}
.stop-btn:hover { background: #fff3e8; }
.send-btn {
  appearance: none; cursor: pointer; display: grid; place-items: center; width: 46px; height: 46px;
  font-size: 19px; font-weight: 700; color: #fff; background: var(--grad); border: none; border-radius: 50%;
  box-shadow: 0 10px 20px rgba(194,65,12,.34); transition: transform .15s, filter .15s;
}
.send-btn:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.05); }
.send-btn:active { transform: translateY(0); }
.send-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.composer-tip { margin: 10px 4px 0; font-size: 12px; color: var(--ink-3); text-align: center; }

/* ------------------------------ 关系阶段（阶段格内竖排） ------------------------------ */
.state-chips { display: flex; flex-direction: column; gap: 7px; overflow-y: auto; min-height: 0; }
.state-chip {
  display: flex; align-items: center; gap: 8px; appearance: none; cursor: pointer; text-align: left;
  font-family: inherit; font-weight: 600; font-size: 13.5px; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px;
  transition: color .16s, background .16s, border-color .16s, box-shadow .16s;
}
.state-chip::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); transition: background .16s, transform .16s;
}
.state-chip:hover { color: var(--terra); border-color: var(--line-strong); }
.state-chip.is-active { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 8px 16px rgba(194,65,12,.26); }
.state-chip.is-active::before { background: #fff; transform: scale(1.15); }

/* ------------------------------ 话题格 ------------------------------ */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-bottom: 10px; border-bottom: 1px solid var(--line); flex: none; }
.cat-tab {
  appearance: none; cursor: pointer; position: relative; font-family: inherit; font-weight: 600; font-size: 13px; color: var(--ink-2);
  background: transparent; border: none; padding: 6px 2px 9px; transition: color .18s;
}
.cat-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px; background: transparent; transition: background .18s; }
.cat-tab:hover { color: var(--terra); }
.cat-tab.is-active { color: var(--terra-deep); }
.cat-tab.is-active::after { background: var(--grad); }

.tile-topics .starters { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0; flex: 1 1 auto; padding-right: 4px; }
.starter {
  display: flex; align-items: center; gap: 10px; text-align: left; flex: none;
  padding: 10px 12px; cursor: pointer; font-family: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--sunset); border-radius: var(--r-sm);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.starter:hover { transform: translateX(3px); box-shadow: var(--shadow-sm); border-left-color: var(--terra); }
.starter-tag {
  flex: none; display: grid; place-items: center; min-width: 38px; height: 24px; padding: 0 8px;
  font-size: 11px; font-weight: 700; color: var(--terra); background: #fdeede; border-radius: 7px;
}
.starter strong { font-weight: 600; font-size: 13.5px; line-height: 1.4; }

/* ------------------------------ 三步格（竖向时间线） ------------------------------ */
.flow-steps { list-style: none; margin: 0; padding: 0; position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.flow-steps::before { content: ""; position: absolute; left: 18px; top: 10px; bottom: 10px; width: 2px; background: repeating-linear-gradient(var(--gold) 0 8px, transparent 8px 14px); }
.flow-step { position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 0 0 14px; }
.flow-step:last-child { padding-bottom: 0; }
.flow-dot {
  z-index: 1; display: grid; place-items: center; width: 38px; height: 38px;
  font-family: var(--font-title); font-size: 16px; font-weight: 800; color: #fff; background: var(--grad); border-radius: 50%;
  box-shadow: 0 6px 14px rgba(194,65,12,.3);
}
.flow-body { padding-top: 2px; }
.flow-body strong { display: block; font-size: 14.5px; color: var(--terra-deep); margin-bottom: 2px; }
.flow-body p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

/* ------------------------------ 擅长格 ------------------------------ */
.feat-grid { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; flex: 1 1 auto; padding-right: 4px; }
.feat { display: flex; align-items: flex-start; gap: 11px; flex: none; }
.feat-icon {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; font-size: 20px;
  background: var(--grad-soft); border: 1px solid var(--line-strong); border-radius: 10px;
}
.feat-body strong { display: block; font-size: 14px; color: var(--terra-deep); margin-bottom: 2px; }
.feat-body p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

/* ------------------------------ FAQ（宫格下方，全宽） ------------------------------ */
.faq { margin-top: 28px; }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: clamp(18px, 3vw, 22px); color: var(--terra-deep); }
.sec-title::before { content: ""; width: 18px; height: 18px; border-radius: 6px; background: var(--grad); box-shadow: 0 4px 10px rgba(194,65,12,.28); }
.faq-item { margin-bottom: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; transition: border-color .18s, box-shadow .18s; }
.faq-item.is-open { border-color: var(--line-strong); 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: 700; font-size: 14.5px; color: var(--terra-deep); text-align: left;
}
.faq-arrow { flex: none; display: grid; place-items: center; width: 24px; height: 24px; font-weight: 900; color: var(--terra); background: #fdeede; border-radius: 7px; transition: transform .22s; }
.faq-item.is-open .faq-arrow { transform: rotate(135deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .28s 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: 860px; margin: 0 auto; padding: 0 clamp(14px, 4vw, 32px); }
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 2px 10px; }
.chatview-back, .chatview-clear {
  appearance: none; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 13px; color: var(--terra);
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 7px 14px; transition: transform .15s, box-shadow .15s;
}
.chatview-back:hover, .chatview-clear:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.chatview-state { font-size: 13px; color: var(--ink-2); }
.chatview-state b { color: var(--terra); }
.chat-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 2px 18px; display: flex; flex-direction: column; gap: 16px; }
.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: var(--grad-soft); border: 1px solid var(--line-strong); border-radius: 12px; }
.msg-user .msg-avatar { background: #fdeede; }
.msg-body { max-width: min(80%, 620px); }
.msg-user .msg-body { text-align: right; }
.msg-name { 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: 4px 16px 16px 16px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--ink); }
.msg-user .msg-text { border-radius: 16px 4px 16px 16px; background: #fff3e8; border-color: var(--line-strong); color: var(--terra-deep); }
.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(--terra); }
.msg-note { color: var(--ink-3); font-size: 12.5px; } .msg-error { color: var(--rouge); }
.typing { display: inline-flex; gap: 5px; padding: 2px 0; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--sunset); 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-2), transparent); }

/* ------------------------------ 页脚 ------------------------------ */
.site-footer {
  flex: none; position: relative; z-index: 1;
  padding: 24px clamp(16px, 4vw, 34px) 30px; text-align: center;
  background: rgba(255, 250, 244, .6); border-top: 1px solid var(--line-strong);
}
.footer-tagline { margin: 0 0 6px; font-weight: 600; color: var(--terra-deep); font-size: 13.5px; }
.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(--terra); }
.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(--terra); 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: 10px 18px; font-size: 13.5px; font-weight: 600; 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, 34px); background: rgba(255, 250, 244, .78);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-strong);
}

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .tile { grid-column: auto !important; grid-row: auto !important; overflow: visible; }
  .tile-input { justify-content: flex-start; }
  .tile-stage .state-chips,
  .tile-topics .starters,
  .flow-steps,
  .feat-grid { overflow: visible; }
  .tile-stage .state-chips { flex-direction: row; flex-wrap: wrap; }
  .tile-stage .state-chip { flex: none; }
}
@media (max-width: 600px) {
  .brand-text em { display: none; }
  .msg-body { max-width: 86%; }
  .composer-foot { flex-wrap: wrap; }
}

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