/* ==========================================================================
   温柔体贴对话 · WarmReply —— 公共样式
   风格：燕麦奶咖极简（燕麦米/奶咖底 #efe9df/#e6ddcd + 暖褐 #8a6f52 + 焦糖点缀 + 大量留白）
   标题：衬线字体（Noto Serif SC / Source Han Serif SC / Songti SC），克制、安静、高级
   布局：杂志编排（editorial）—— 大号衬线标题非对称排布、栏目式分区、细线分隔、留白多；
        输入卡=杂志「投稿栏」，场景=杂志目录条目（序号+细线）。
   与「手账 / 宫格 / 瀑布流 / IM / 居中卡 / 斜切 / 分屏 / 单列」诸作刻意彻底区分。
   ========================================================================== */

/* ------------------------------ 设计变量 ------------------------------ */
:root {
  --paper: #efe9df;        /* 燕麦米底 */
  --paper-2: #e6ddcd;      /* 奶咖底（略深分区） */
  --cream: #f4efe6;        /* 卡面 */
  --cream-hi: #faf7f1;     /* 更亮卡面 */

  --ink: #38302a;          /* 深咖墨字 */
  --ink-2: #6b5d4f;        /* 次级字 */
  --ink-3: #a3927c;        /* 弱化字 */

  --brown: #8a6f52;        /* 暖褐主色 */
  --brown-deep: #6f583f;   /* 深褐 */
  --caramel: #b7813f;      /* 焦糖点缀 */

  --line: #ddd2bf;         /* 细分隔线 */
  --line-2: #cbbca3;       /* 略强分隔线 */

  --shadow: 0 18px 40px rgba(74, 58, 38, .10);

  --maxw: 940px;

  --font: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* 标题：衬线，安静高级 */
  --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'SimSun', Georgia, 'Times New Roman', serif;
}

/* ------------------------------ 基础 ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
[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.8;
  color: var(--ink);
  background: var(--paper);
  -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(--brown-deep); }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; letter-spacing: .5px; }
b { font-weight: 700; }

/* ------------------------------ 背景（素净纸面） ------------------------------ */
.paperbg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle at 82% 8%, rgba(183, 129, 63, .05), transparent 45%),
    radial-gradient(circle at 10% 92%, rgba(138, 111, 82, .05), transparent 48%),
    var(--paper);
}
/* 极淡纸纹 */
.paperbg::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(138, 111, 82, .05) 0.5px, transparent 0.5px);
  background-size: 6px 6px; opacity: .6;
}

/* ------------------------------ 报头 / 顶栏 ------------------------------ */
.masthead {
  position: relative; z-index: 3; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: var(--maxw); width: 100%; margin: 0 auto;
  padding: 20px clamp(18px, 5vw, 34px) 14px;
}
.masthead-rule {
  flex: none; height: 0; border-top: 2px solid var(--ink);
  max-width: var(--maxw); width: 100%; margin: 0 auto; opacity: .85;
}
.brand { display: inline-flex; align-items: baseline; gap: 11px; text-decoration: none; color: inherit; }
.brand-mark { font-size: 20px; transform: translateY(2px); }
.brand-text { display: inline-flex; align-items: baseline; gap: 10px; }
.brand-text strong { font-family: var(--font-serif); font-size: 22px; letter-spacing: 2px; color: var(--ink); }
.brand-text em { font-style: normal; font-size: 10.5px; letter-spacing: 4px; color: var(--brown); }
.site-nav { display: flex; align-items: center; gap: 20px; }
.nav-btn {
  appearance: none; border: none; background: transparent; color: var(--ink-2);
  font-family: inherit; font-size: 13px; letter-spacing: 1px; padding: 2px 0; cursor: pointer;
  text-decoration: none; position: relative; transition: color .16s;
}
.nav-btn::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -3px; height: 1px; background: var(--brown); transition: right .2s; }
.nav-btn:hover { color: var(--brown-deep); }
.nav-btn:hover::after { right: 0; }

/* ------------------------------ 舞台 / 版心 ------------------------------ */
.stage { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; width: 100%; }
body.mode-chat .stage { display: flex; }
.landing { width: 100%; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: clamp(18px, 4vw, 40px) clamp(18px, 5vw, 34px) 60px; }

.rule-thin { height: 0; border-top: 1px solid var(--line); margin: clamp(30px, 5vw, 52px) 0; }

/* ------------------------------ 刊眉 ------------------------------ */
.issue-line {
  display: flex; align-items: center; gap: 10px; margin: 0 0 clamp(20px, 4vw, 40px);
  font-size: 12px; letter-spacing: 3px; color: var(--brown); text-transform: uppercase;
}
.issue-line span:first-child { font-family: var(--font-serif); font-size: 13px; }
.issue-dot { color: var(--ink-3); }

/* ------------------------------ HERO（非对称编排） ------------------------------ */
.hero {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(20px, 5vw, 56px);
  align-items: end;
}
.hero-eyebrow {
  margin: 0 0 16px; font-size: 12.5px; letter-spacing: 4px; color: var(--caramel);
  text-transform: uppercase;
}
.hero-title {
  margin: 0; font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(30px, 6vw, 58px); line-height: 1.24; color: var(--ink); letter-spacing: 1px;
}
.hero-title span { display: block; }
.hero-line2 { text-indent: 1.4em; }        /* 非对称错位 */
.hero-line3 { text-indent: 2.6em; margin-top: .12em; }
.hero-title b { color: var(--brown); font-weight: 700; position: relative; padding-bottom: 2px; }
.hero-title b::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--caramel); }
.hero-aside { padding-bottom: 8px; border-left: 1px solid var(--line); padding-left: clamp(16px, 3vw, 30px); }
.hero-sub { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; line-height: 1.85; }
.hero-meta { margin: 0; font-family: var(--font-serif); font-size: 13px; letter-spacing: 4px; color: var(--ink-3); }

/* ------------------------------ 栏目通用头 ------------------------------ */
.col-head { margin-bottom: 22px; }
.col-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.col-kicker { display: block; margin-bottom: 8px; font-size: 11.5px; letter-spacing: 3px; color: var(--caramel); text-transform: uppercase; }
.col-title { margin: 0; font-size: clamp(20px, 3.4vw, 28px); line-height: 1.4; color: var(--ink); }
.col-title b { color: var(--brown); margin-left: .4em; }
.col-note { margin: 0; font-size: 13px; color: var(--ink-3); }

/* ------------------------------ 输入「投稿栏」卡 ------------------------------ */
.composer-slot { margin-top: clamp(24px, 4vw, 40px); }
.composer { width: 100%; }
.composer-card {
  position: relative; padding: 24px clamp(18px, 3vw, 28px) 16px;
  background: var(--cream-hi); border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
}
.composer-card::before {   /* 焦糖顶饰细线 */
  content: ""; position: absolute; left: 0; top: 0; width: 64px; height: 3px; background: var(--brown);
}
.composer-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.composer-kicker { font-size: 11px; letter-spacing: 3px; color: var(--caramel); text-transform: uppercase; }
.composer-label { font-family: var(--font-serif); font-weight: 700; font-size: 17px; color: var(--ink); }
.composer-input {
  display: block; width: 100%; padding: 6px 2px; resize: none; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 15.5px; line-height: 1.75; 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; margin-top: 12px;
  border-top: 1px solid var(--line); padding-top: 13px;
}
.composer-stage { font-size: 12.5px; letter-spacing: 1px; color: var(--ink-2); }
.composer-stage b { color: var(--brown-deep); }
.composer-actions { display: flex; align-items: center; gap: 12px; }
.stop-btn {
  appearance: none; cursor: pointer; font-family: inherit; font-size: 13px; color: var(--ink-2);
  background: transparent; border: 1px solid var(--line-2); border-radius: 0; padding: 8px 14px; transition: border-color .16s, color .16s;
}
.stop-btn:hover { border-color: var(--brown); color: var(--brown-deep); }
.send-btn {
  appearance: none; cursor: pointer; font-family: var(--font-serif); font-weight: 700; font-size: 14.5px; letter-spacing: 1px; color: var(--cream-hi);
  background: var(--brown); border: 1px solid var(--brown); border-radius: 0; padding: 10px 22px; transition: background .16s, transform .16s;
}
.send-btn:hover { background: var(--brown-deep); }
.send-btn:active { transform: translateY(1px); }
.send-btn:disabled { opacity: .5; cursor: not-allowed; }
.composer-tip { margin: 12px 2px 0; font-size: 12px; color: var(--ink-3); }

/* ------------------------------ 关系阶段（编排细框行） ------------------------------ */
.stage-bar {}
.state-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.state-chip {
  appearance: none; cursor: pointer; font-family: inherit; font-size: 13.5px; color: var(--ink-2);
  background: transparent; border: 1px solid var(--line-2); border-radius: 0; padding: 8px 18px;
  transition: border-color .16s, color .16s, background .16s;
}
.state-chip:hover { border-color: var(--brown); color: var(--brown-deep); }
.state-chip.is-active { background: var(--brown); border-color: var(--brown); color: var(--cream-hi); }

/* ------------------------------ 场景（杂志目录条目） ------------------------------ */
.cat-tabs {
  display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 6px 0 6px;
  border-bottom: 1px solid var(--line); padding-bottom: 12px;
}
.cat-tab {
  position: relative; appearance: none; cursor: pointer; border: none; background: transparent;
  font-family: inherit; font-size: 14px; letter-spacing: 2px; color: var(--ink-3); padding: 4px 0; transition: color .16s;
}
.cat-tab:hover { color: var(--brown-deep); }
.cat-tab.is-active { color: var(--ink); }
.cat-tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -13px; height: 2px; background: var(--brown); }

.starters { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.starters li { display: contents; }   /* 让 <button> 直接参与排版，分类过滤隐藏时不留空行 */
.starter {
  display: flex; align-items: baseline; gap: clamp(12px, 3vw, 26px); width: 100%; text-align: left;
  background: transparent; border: none; border-bottom: 1px solid var(--line); cursor: pointer;
  padding: 18px 8px; font-family: inherit; color: var(--ink); transition: background .18s, padding-left .18s;
}
.starter:hover { background: var(--cream-hi); padding-left: 16px; }
.starter-no { flex: none; width: 2.2em; font-family: var(--font-serif); font-size: 15px; letter-spacing: 1px; color: var(--brown); }
.starter-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; }
.starter-cat { font-size: 11px; letter-spacing: 3px; color: var(--ink-3); text-transform: uppercase; }
.starter-title { font-family: var(--font-serif); font-weight: 600; font-size: 16.5px; line-height: 1.5; color: var(--ink); }
.starter-go {
  flex: none; align-self: center; font-size: 12.5px; letter-spacing: 1px; color: var(--brown-deep);
  opacity: 0; transform: translateX(-6px); transition: opacity .18s, transform .18s; white-space: nowrap;
}
.starter-go::after { content: " →"; }
.starter:hover .starter-go { opacity: 1; transform: translateX(0); }

/* ------------------------------ 体贴擅长（编排栏） ------------------------------ */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: clamp(18px, 3vw, 34px); }
.feat { border-top: 2px solid var(--ink); padding-top: 14px; }
.feat-no { display: block; font-family: var(--font-serif); font-size: 22px; color: var(--brown); margin-bottom: 8px; letter-spacing: 2px; }
.feat h3 { margin: 0 0 6px; font-size: 16.5px; color: var(--ink); }
.feat p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }

/* ------------------------------ FAQ（编排问答） ------------------------------ */
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 6px;
  cursor: pointer; appearance: none; border: none; background: transparent;
  font-family: var(--font-serif); font-weight: 600; font-size: 16px; color: var(--ink); text-align: left; transition: color .16s;
}
.faq-q:hover { color: var(--brown-deep); }
.faq-arrow { flex: none; font-family: var(--font-serif); font-size: 18px; color: var(--brown); transition: transform .2s; }
.faq-item.is-open .faq-arrow { transform: rotate(45deg); }
.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 6px 18px; font-size: 14px; color: var(--ink-2); line-height: 1.8; }

/* ------------------------------ 对话视图 ------------------------------ */
.chatview { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(18px, 5vw, 34px); }
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: 18px 0 14px; border-bottom: 1px solid var(--line);
}
.chatview-back, .chatview-clear {
  appearance: none; cursor: pointer; font-family: inherit; font-size: 13px; letter-spacing: 1px; color: var(--ink-2);
  background: transparent; border: 1px solid var(--line-2); border-radius: 0; padding: 7px 14px; transition: border-color .16s, color .16s;
}
.chatview-back:hover, .chatview-clear:hover { border-color: var(--brown); color: var(--brown-deep); }
.chatview-state { font-size: 13px; letter-spacing: 1px; color: var(--ink-3); }
.chatview-state b { color: var(--brown-deep); }
.chat-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px 2px 20px; display: flex; flex-direction: column; gap: 22px; }

/* 消息气泡（编排：极简细框 + 衬线署名） */
.msg { display: flex; gap: 14px; 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: 19px;
  background: var(--cream-hi); border: 1px solid var(--line-2);
}
.msg-body { max-width: min(78%, 600px); }
.msg-user .msg-body { text-align: right; }
.msg-name { font-family: var(--font-serif); font-size: 12px; letter-spacing: 2px; color: var(--ink-3); margin: 2px 4px 6px; }
.msg-text {
  display: inline-block; text-align: left; padding: 14px 17px; background: var(--cream-hi);
  border: 1px solid var(--line); border-left: 2px solid var(--brown); color: var(--ink); line-height: 1.8;
}
.msg-user .msg-text { background: var(--paper-2); border-left: 1px solid var(--line); border-right: 2px solid var(--brown); }
.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: 4px 0; }
.msg-text strong { color: var(--brown-deep); }
.msg-note { color: var(--ink-3); font-size: 12.5px; } .msg-error { color: #a6483a; }
.typing { display: inline-flex; gap: 6px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--brown); 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: .45; } 30% { transform: translateY(-5px); opacity: 1; } }
body.mode-chat .composer-slot#slotChat { flex: none; padding: 10px 0 16px; background: linear-gradient(0deg, var(--paper), transparent); }

/* ------------------------------ 页脚 ------------------------------ */
.site-footer {
  flex: none; position: relative; z-index: 1; margin-top: auto;
  padding: 34px clamp(18px, 4vw, 34px) 40px; text-align: center;
  background: var(--paper-2); border-top: 1px solid var(--ink);
}
.footer-tagline { margin: 0 0 8px; font-family: var(--font-serif); font-weight: 700; color: var(--ink); font-size: 14px; letter-spacing: 1px; }
.footer-company { margin: 0 0 12px; color: var(--ink-2); font-size: 13px; letter-spacing: 1px; }
.footer-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-bottom: 12px; font-size: 12.5px; color: var(--ink-2); }
.footer-contact a { color: var(--ink-2); text-decoration: none; } .footer-contact a:hover { color: var(--brown-deep); }
.footer-beian { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 12px; }
.footer-beian a { color: var(--ink-3); text-decoration: none; } .footer-beian a:hover { color: var(--brown-deep); text-decoration: underline; }

/* ------------------------------ Toast ------------------------------ */
.toast-wrap { position: fixed; left: 50%; bottom: 30px; 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; letter-spacing: .5px; color: var(--cream-hi);
  background: var(--brown-deep); border: 1px solid var(--brown-deep); box-shadow: var(--shadow); 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;
  max-width: var(--maxw); width: 100%; margin: 0 auto;
  padding: 20px clamp(18px, 5vw, 34px) 14px; border-bottom: 2px solid var(--ink);
}

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 22px; align-items: start; }
  .hero-aside { border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 18px; }
  .hero-line2 { text-indent: 0.8em; } .hero-line3 { text-indent: 1.4em; }
}
@media (max-width: 560px) {
  .brand-text em { display: none; }
  .msg-body { max-width: 86%; }
  .starter-go { display: none; }
  .starter-title { font-size: 15.5px; }
}

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