/* ==========================================================================
   怼一下对话 · DuiyixiaChat —— 公共样式
   风格：孟菲斯撞色波普（纯白/米白底 + 番茄红/亮黄/电蓝/墨黑粗描边 +
         圆点/波浪/锯齿/斜纹几何装饰 + 粗黑边框 + 硬偏移阴影）
   布局：斜切分屏 —— clip-path 把落地页斜切成两块，左品牌+大标题+输入卡，
         右斜切色块内放回怼场景卡。与同系列其它项目刻意彻底区分。
   ========================================================================== */

/* ------------------------------ 设计变量 ------------------------------ */
:root {
  --paper: #fbf7ee;   /* 米白底 */
  --paper-2: #ffffff;

  --red: #ff4d4d;     /* 番茄红 */
  --yellow: #ffd21f;  /* 亮黄 */
  --blue: #2f6bff;    /* 电蓝 */
  --blue-deep: #1f4fd6;
  --ink: #111111;     /* 墨黑 */
  --ink-2: #3a3a3a;
  --ink-3: #7b7b7b;

  --card: #ffffff;
  --line: #111111;

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-pill: 999px;

  /* 硬偏移阴影（孟菲斯招牌） */
  --hard: 6px 6px 0 var(--ink);
  --hard-sm: 4px 4px 0 var(--ink);
  --hard-red: 6px 6px 0 var(--red);
  --hard-blue: 6px 6px 0 var(--blue);
  --hard-yellow: 6px 6px 0 var(--yellow);

  --maxw: 1120px;

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

/* 关键避坑：确保 [hidden] 永远隐藏，即使别处给了 display */
[hidden] { display: none !important; }

/* ------------------------------ 基础 ------------------------------ */
*, *::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: 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(--blue-deep); }
h1, h2, h3 { font-family: var(--font-title); font-weight: 900; letter-spacing: .2px; }

/* ------------------------------ 孟菲斯几何背景 ------------------------------ */
.popbg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(var(--ink) 1.4px, transparent 1.5px) 0 0 / 30px 30px,
    var(--paper);
  background-blend-mode: normal;
}
.popbg::before { content: ""; position: absolute; inset: 0; background: var(--paper); opacity: .82; }
.pop { position: absolute; }
/* 圆点方块 */
.pop-dots { top: 84px; left: 3%; width: 120px; height: 84px;
  background: radial-gradient(var(--red) 3px, transparent 3.5px) 0 0 / 22px 22px; opacity: .85; transform: rotate(-6deg); }
/* 波浪线 */
.pop-wave { bottom: 16%; left: 5%; width: 160px; height: 26px;
  background: repeating-linear-gradient(90deg, transparent 0 4px, transparent 4px 8px);
  border-bottom: 5px solid var(--blue);
  -webkit-mask: radial-gradient(circle at 8px -4px, transparent 12px, #000 13px) 0 0 / 24px 26px repeat-x;
          mask: radial-gradient(circle at 8px -4px, transparent 12px, #000 13px) 0 0 / 24px 26px repeat-x;
  opacity: .8; }
/* 锯齿 */
.pop-zig { top: 26%; right: 4%; width: 150px; height: 22px;
  background: linear-gradient(135deg, var(--yellow) 25%, transparent 25%) -10px 0,
              linear-gradient(225deg, var(--yellow) 25%, transparent 25%) -10px 0;
  background-size: 20px 22px; opacity: .9; transform: rotate(4deg); }
/* 空心圈 */
.pop-ring { bottom: 10%; right: 8%; width: 66px; height: 66px; border: 7px solid var(--red); border-radius: 50%; opacity: .8; }
.pop-blob { top: 12%; right: 22%; font-size: 30px; color: var(--blue); transform: rotate(12deg); opacity: .9; }
.pop-blob2 { bottom: 26%; left: 40%; font-size: 16px; color: var(--yellow); opacity: .9; }

/* ------------------------------ 顶栏 ------------------------------ */
.topbar {
  position: relative; z-index: 3; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px clamp(16px, 4vw, 34px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px; font-size: 24px;
  border-radius: 12px; background: var(--yellow); border: 3px solid var(--ink);
  box-shadow: var(--hard-sm); transform: rotate(-5deg);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--font-title); font-size: 21px; font-weight: 900; color: var(--ink); }
.brand-text em { font-style: normal; font-size: 10.5px; letter-spacing: 3px; color: var(--blue); font-weight: 800; }
.site-nav { display: flex; align-items: center; gap: 10px; }
.nav-btn {
  appearance: none; border: 3px solid var(--ink); background: #fff; color: var(--ink);
  font-family: inherit; font-weight: 800; font-size: 13px; padding: 8px 15px; border-radius: var(--r-pill);
  text-decoration: none; cursor: pointer; box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.nav-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); background: var(--paper); }
.nav-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.nav-btn-solid { background: var(--blue); color: #fff; }
.nav-btn-solid:hover { background: var(--blue-deep); }

/* ------------------------------ 舞台 ------------------------------ */
.stage { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; width: 100%; }
body.mode-chat .stage { display: flex; }
.landing { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: clamp(10px, 2.4vw, 22px) clamp(16px, 4vw, 30px) 46px; }

/* ------------------------------ 斜切分屏 ------------------------------ */
.split {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 45% 55%;
  border: 3px solid var(--ink); border-radius: var(--r-lg);
  box-shadow: 8px 8px 0 var(--ink);
  background: #fff; overflow: hidden;
}
/* 斜切色块：只裁背景，不裁内容 */
.split-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(rgba(255,255,255,.14) 2px, transparent 2.5px) 0 0 / 26px 26px,
    var(--blue);
  clip-path: polygon(49% 0, 100% 0, 100% 100%, 41% 100%);
}
/* 分屏两侧内容层 */
.split-left  { position: relative; z-index: 1; padding: clamp(22px, 3vw, 40px) clamp(20px, 2.6vw, 36px) clamp(22px, 3vw, 34px); }
.split-right { position: relative; z-index: 1; padding: clamp(22px, 3vw, 38px) clamp(22px, 2.4vw, 34px) clamp(22px, 3vw, 36px);
  padding-left: clamp(30px, 3.4vw, 52px); color: #fff; }

/* ------------------------------ HERO（左半） ------------------------------ */
.hero { }
.eyebrow {
  display: inline-block; margin: 0 0 14px; padding: 5px 14px;
  font-size: 12.5px; font-weight: 900; color: var(--ink);
  background: var(--yellow); border: 3px solid var(--ink); border-radius: var(--r-pill);
  box-shadow: 3px 3px 0 var(--ink); transform: rotate(-2deg);
}
.hero-title { margin: 0 0 14px; font-size: clamp(28px, 4.4vw, 46px); line-height: 1.12; color: var(--ink); }
.hero-title b { position: relative; color: var(--red); white-space: nowrap; }
.hero-title b::after { content: ""; position: absolute; left: -2px; right: -2px; bottom: 2px; height: 12px; z-index: -1;
  background: var(--yellow); transform: skewX(-10deg); }
.hero-sub { margin: 0; max-width: 26em; color: var(--ink-2); font-size: 15px; }

/* 输入卡挂载点 */
.composer-slot { margin-top: 22px; }

/* 关系阶段 */
.stage-bar { margin-top: 22px; }
.stage-bar-title { display: block; font-family: var(--font-title); font-weight: 900; color: var(--ink); font-size: 14px; margin-bottom: 10px; }
.stage-bar-title b { color: var(--blue-deep); }
.state-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.state-chip {
  appearance: none; cursor: pointer; font-family: inherit; font-weight: 800; font-size: 13px; color: var(--ink);
  background: #fff; border: 3px solid var(--ink); border-radius: var(--r-pill); padding: 6px 13px;
  box-shadow: 2px 2px 0 var(--ink); transition: transform .12s, box-shadow .12s, color .12s, background .12s;
}
.state-chip:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.state-chip.is-active { color: #fff; background: var(--red); box-shadow: 3px 3px 0 var(--ink); }

/* HERO 脚注（撑起左列） */
.hero-foot { display: flex; align-items: center; gap: 12px; margin-top: 26px; padding-top: 18px; border-top: 3px dashed var(--ink); }
.hero-mascot { flex: none; display: grid; place-items: center; width: 52px; height: 52px; font-size: 27px;
  background: var(--red); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-6deg); }
.hero-foot-text { font-family: var(--font-title); font-weight: 900; font-size: 14px; color: var(--ink); letter-spacing: .3px; }

/* ------------------------------ 输入卡（孟菲斯撞色卡） ------------------------------ */
.composer { width: 100%; }
.composer-card {
  position: relative;
  padding: 22px 18px 14px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 6px 6px 0 var(--red);
}
.composer-sticker { position: absolute; top: -18px; right: -12px; display: grid; place-items: center;
  width: 46px; height: 46px; font-size: 24px; background: var(--yellow); border: 3px solid var(--ink); border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink); transform: rotate(9deg); }
.composer-head { margin-bottom: 6px; }
.composer-label { font-family: var(--font-title); font-weight: 900; color: var(--ink); font-size: 15px; }
.composer-input {
  display: block; width: 100%; padding: 8px 4px; resize: none; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 15px; line-height: 1.7; 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: 10px;
  border-top: 3px dashed var(--ink); padding-top: 12px; }
.composer-stage { font-size: 13px; font-weight: 700; color: var(--ink); padding: 4px 12px; background: var(--yellow); border: 3px solid var(--ink); border-radius: var(--r-pill); }
.composer-stage b { color: var(--ink); }
.composer-actions { display: flex; align-items: center; gap: 10px; }
.stop-btn {
  appearance: none; cursor: pointer; font-family: inherit; font-weight: 800; font-size: 13px; color: var(--ink);
  background: #fff; border: 3px solid var(--ink); border-radius: var(--r-pill); padding: 8px 14px; box-shadow: 2px 2px 0 var(--ink); transition: transform .12s;
}
.stop-btn:hover { transform: translate(-1px, -1px); }
.send-btn {
  appearance: none; cursor: pointer; font-family: var(--font-title); font-weight: 900; font-size: 14.5px; color: #fff;
  background: var(--blue); border: 3px solid var(--ink); border-radius: var(--r-pill); padding: 9px 20px;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .12s, box-shadow .12s;
}
.send-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.send-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.send-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--ink); }
.composer-tip { margin: 10px 4px 0; font-size: 12px; color: var(--ink-3); text-align: center; }

/* ------------------------------ 回怼场景（右半色块内） ------------------------------ */
.scenes { }
.sec-title { margin: 0 0 6px; font-size: clamp(19px, 3vw, 24px); color: #fff; font-weight: 900; }
.sec-title.dark { color: var(--ink); }
.sec-sub { margin: 0 0 16px; color: rgba(255,255,255,.85); font-size: 13px; font-weight: 700; }
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cat-tab {
  appearance: none; cursor: pointer; font-family: inherit; font-weight: 800; font-size: 12.5px; color: #fff;
  background: transparent; border: 3px solid #fff; border-radius: var(--r-pill); padding: 5px 13px; transition: transform .12s, color .12s, background .12s;
}
.cat-tab:hover { transform: translateY(-1px); }
.cat-tab.is-active { color: var(--ink); background: var(--yellow); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }

.starters { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.starter {
  position: relative; display: block; width: 100%; text-align: left; cursor: pointer; font-family: inherit; color: var(--ink);
  padding: 14px 13px 13px; background: #fff; border: 3px solid var(--ink); border-radius: var(--r-md);
  box-shadow: 4px 4px 0 var(--ink); transition: transform .14s, box-shadow .14s;
}
.starter:nth-child(3n)   { transform: rotate(-1deg); }
.starter:nth-child(3n+2) { transform: rotate(1deg); }
.starter:hover { transform: translate(-2px, -2px) rotate(0deg); box-shadow: 6px 6px 0 var(--yellow); }
.starter-tag {
  display: inline-block; margin-bottom: 9px; padding: 3px 11px; font-size: 11.5px; font-weight: 900; color: var(--ink);
  border: 3px solid var(--ink); border-radius: var(--r-pill); background: var(--yellow);
}
.starter:nth-child(4n+1) .starter-tag { background: var(--red); color: #fff; }
.starter:nth-child(4n+2) .starter-tag { background: var(--yellow); }
.starter:nth-child(4n+3) .starter-tag { background: var(--blue); color: #fff; }
.starter:nth-child(4n)   .starter-tag { background: #fff; }
.starter strong { display: block; font-size: 14px; font-weight: 800; line-height: 1.45; }

/* ------------------------------ 通栏（嘴替擅长 / FAQ） ------------------------------ */
.belt { margin-top: 30px; }
.belt-inner { }
.sec-title.dark { position: relative; display: inline-block; margin-bottom: 16px; padding-bottom: 4px; }
.sec-title.dark::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 8px; background: var(--red); transform: skewX(-12deg); z-index: -1; }

.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.feat {
  display: flex; align-items: flex-start; gap: 12px; padding: 16px;
  background: #fff; border: 3px solid var(--ink); border-radius: var(--r-md); box-shadow: 5px 5px 0 var(--ink);
}
.feat-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; font-size: 22px; background: #fff; border: 3px solid var(--ink); border-radius: 12px; }
.feat-red .feat-icon { background: var(--red); } .feat-yellow .feat-icon { background: var(--yellow); }
.feat-blue .feat-icon { background: var(--blue); } .feat-ink .feat-icon { background: var(--ink); }
.feat-body strong { display: block; font-size: 15px; color: var(--ink); margin-bottom: 3px; font-family: var(--font-title); font-weight: 900; }
.feat-body p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }

/* ------------------------------ FAQ ------------------------------ */
.faq-item { margin-bottom: 12px; background: #fff; border: 3px solid var(--ink); border-radius: var(--r-md); overflow: hidden; box-shadow: 4px 4px 0 var(--ink); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px;
  cursor: pointer; appearance: none; border: none; background: transparent; font-family: var(--font-title); font-weight: 900; 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(--ink); background: var(--yellow); border: 3px solid var(--ink); border-radius: 8px; transition: transform .2s; }
.faq-item.is-open .faq-arrow { transform: rotate(135deg); background: var(--red); color: #fff; }
.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 16px 15px; font-size: 13.5px; color: var(--ink-2); }

/* ------------------------------ 对话视图 ------------------------------ */
.chatview { width: 100%; max-width: 820px; 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: 800; font-size: 13px; color: var(--ink);
  background: #fff; border: 3px solid var(--ink); border-radius: var(--r-pill); padding: 6px 14px; box-shadow: 2px 2px 0 var(--ink); transition: transform .12s, box-shadow .12s;
}
.chatview-back:hover, .chatview-clear:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.chatview-state { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.chatview-state b { color: var(--blue-deep); }
.chat-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 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: 42px; height: 42px; font-size: 21px; background: #fff; border: 3px solid var(--ink); border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); }
.msg-ai .msg-avatar { background: var(--yellow); }
.msg-user .msg-avatar { background: var(--blue); }
.msg-body { max-width: min(82%, 560px); }
.msg-user .msg-body { text-align: right; }
.msg-name { font-family: var(--font-title); font-weight: 900; 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 14px 14px 14px; background: #fff; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); color: var(--ink); }
.msg-user .msg-text { border-radius: 14px 4px 14px 14px; background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.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(--blue-deep); }
.msg-note { color: var(--ink-3); font-size: 12.5px; } .msg-error { color: var(--red); font-weight: 700; }
.typing { display: inline-flex; gap: 5px; padding: 2px 0; }
.typing i { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: typing 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { background: var(--yellow); animation-delay: .2s; } .typing i:nth-child(3) { background: var(--blue); animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); opacity: .55; } 30% { transform: translateY(-6px); opacity: 1; } }
body.mode-chat .composer-slot#slotChat { flex: none; padding: 8px 0 14px; background: linear-gradient(0deg, var(--paper), transparent); }

/* ------------------------------ 页脚 ------------------------------ */
.site-footer {
  flex: none; position: relative; z-index: 1; margin-top: auto;
  padding: 26px clamp(16px, 4vw, 30px) 30px; text-align: center;
  background: var(--ink); color: #fff; border-top: 4px solid var(--red);
}
.footer-tagline { margin: 0 0 6px; font-weight: 900; color: #fff; font-size: 13.5px; font-family: var(--font-title); }
.footer-company { margin: 0 0 10px; color: rgba(255,255,255,.82); font-size: 13px; }
.footer-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-bottom: 10px; font-size: 12.5px; color: rgba(255,255,255,.82); }
.footer-contact a { color: rgba(255,255,255,.82); text-decoration: none; } .footer-contact a:hover { color: var(--yellow); }
.footer-beian { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 12px; }
.footer-beian a { color: rgba(255,255,255,.62); text-decoration: none; } .footer-beian a:hover { color: var(--yellow); 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: 900; color: #fff; background: var(--ink); border: 3px solid var(--ink); border-radius: var(--r-pill); box-shadow: 4px 4px 0 var(--red); 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, 30px); border-bottom: 3px solid var(--ink); background: #fff;
}

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 880px) {
  /* 斜切分屏在窄屏改为上下堆叠，取消对角裁切避免错位 */
  .split { grid-template-columns: 1fr; }
  .split-bg { display: none; }
  .split-right { background:
      radial-gradient(rgba(255,255,255,.14) 2px, transparent 2.5px) 0 0 / 26px 26px,
      var(--blue);
    border-top: 3px solid var(--ink); padding-left: clamp(20px, 4vw, 30px); }
}
@media (max-width: 520px) {
  .starters { grid-template-columns: 1fr; }
  .brand-text em { display: none; }
  .msg-body { max-width: 86%; }
  .split { box-shadow: 5px 5px 0 var(--ink); }
}

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