/* 产品站 v2 · 纸墨风格（克制配色 / 衬线标题 / 细分割线） */
:root {
  --paper: #f7f5f1;
  --paper-2: #fffefb;
  --ink: #1c1c1a;
  --ink-soft: #55534e;
  --ink-faint: #8f8c84;
  --line: rgba(28, 28, 26, .12);
  --line-strong: rgba(28, 28, 26, .22);
  --accent: #2f4a3f;
  --serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  --shadow: 0 18px 50px -12px rgba(28, 28, 26, .22), 0 2px 8px -2px rgba(28, 28, 26, .08);
}

* { box-sizing: border-box; }

/* hidden 属性必须能压住后面的 display:flex/grid 声明 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

/* ---------- 主视觉：一张图 / 一段视频 / 动图 ---------- */

.hero {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  padding-bottom: clamp(72px, 12vh, 96px);
  background:
    radial-gradient(120% 90% at 50% 0%, #fffefb 0%, #f2efe9 100%);
}

.hero-media {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: var(--shadow);
  display: block;
}

video.hero-media { background: #000; }

.hero-fallback {
  text-align: center;
  max-width: 34rem;
  padding: 2rem;
}

.hero-fallback h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: .04em;
  margin: 0 0 .9rem;
}

.hero-fallback p {
  color: var(--ink-soft);
  font-size: clamp(.95rem, 2.4vw, 1.05rem);
  line-height: 1.9;
  margin: 0;
}

/* 左上角品牌：衬线 + 字距 + 可选装饰 */
.hero-brand {
  position: fixed;
  top: clamp(16px, 3vw, 30px);
  left: clamp(18px, 3.4vw, 42px);
  font-family: var(--serif);
  font-size: clamp(.95rem, 2.2vw, 1.16rem);
  font-weight: 600;
  letter-spacing: .22em;
  color: var(--ink);
  z-index: 5;
  pointer-events: none;
}

.brand-line { display: inline-flex; align-items: center; gap: .52em; }

.brand-logo {
  height: 1.6em;
  width: auto;
  max-width: 4.5em;
  object-fit: contain;
  display: block;
}

/* 朱红小印章 */
.brand-seal {
  display: inline-grid;
  place-items: center;
  padding: .18em .3em;
  background: #b3402f;
  color: #fff;
  border-radius: 3px;
  font-size: .6em;
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1.25;
  box-shadow: 0 1px 2px rgba(179, 64, 47, .28);
}

/* 竖线 + 短横线的编辑感装饰 */
.brand-rule .brand-line::before {
  content: '';
  width: 1px;
  height: 1.15em;
  background: currentColor;
  opacity: .45;
  flex: none;
}
.brand-rule .brand-line::after {
  content: '';
  width: 2.6em;
  height: 1px;
  background: currentColor;
  opacity: .26;
  margin-left: .15em;
  flex: none;
}

/* 品牌副标题 */
.brand-sub {
  display: block;
  margin-top: .38rem;
  font-family: var(--sans);
  font-size: .64em;
  font-weight: 400;
  letter-spacing: .2em;
  color: var(--ink-faint);
}

/* 页脚备案：与参照站 h9ss.com 同一套排版（无衬线 12px / 行高 18px / #888 / 图标 20×20） */
.hero-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 18px;
  letter-spacing: normal;
  color: #888;
  z-index: 4;
  pointer-events: none;
}

.hero-foot.font-serif {
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--ink-faint);
}

.hero-foot .foot-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  flex: none;
}

/* ---------- 悬浮客服按钮 ---------- */

.cs-fab {
  position: fixed;
  right: clamp(16px, 3vw, 34px);
  bottom: clamp(16px, 3vw, 34px);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .68rem 1.1rem .68rem .9rem;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: var(--ink);
  color: #f4f2ee;
  font-family: var(--sans);
  font-size: .88rem;
  letter-spacing: .06em;
  cursor: pointer;
  box-shadow: 0 10px 26px -8px rgba(28, 28, 26, .5);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.cs-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -10px rgba(28, 28, 26, .55); }
.cs-fab:active { transform: translateY(0) scale(.98); }
.cs-fab svg { width: 19px; height: 19px; flex: none; }

.cs-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #b3402f;
  color: #fff;
  font-size: .7rem;
  line-height: 19px;
  text-align: center;
  font-weight: 600;
}

/* ---------- 聊天面板 ---------- */

.cs-panel {
  position: fixed;
  z-index: 70;
  right: clamp(12px, 3vw, 34px);
  bottom: clamp(12px, 3vw, 34px);
  width: min(392px, calc(100vw - 24px));
  height: min(620px, calc(100dvh - 24px));
  display: flex;
  flex-direction: column;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: cs-in .22s cubic-bezier(.2, .8, .3, 1);
}

@keyframes cs-in {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: none; }
}

.cs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .78rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}

.cs-head-left { display: flex; align-items: center; gap: .5rem; min-width: 0; }

.cs-head-name {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .06em;
  white-space: nowrap;
}

/* 客服头像（有图显示图，没图显示首字） */
.cs-ava-wrap { position: relative; flex: none; display: inline-flex; }

.cs-ava {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.cs-ava-ph {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft, rgba(47, 74, 63, .1));
  color: var(--accent);
  font-family: var(--serif);
  font-size: .82rem;
  font-weight: 600;
}

.cs-ava-wrap .cs-dot { position: absolute; right: -1px; bottom: -1px; box-shadow: 0 0 0 2px var(--paper-2); }

/* 我的资料面板 */
.cs-me {
  padding: .85rem .9rem .9rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.cs-me-title {
  margin: 0 0 .6rem;
  font-size: .76rem;
  letter-spacing: .08em;
  color: var(--ink-soft);
}

.cs-me-row { display: flex; align-items: center; gap: .6rem; }

.cs-me-ava {
  width: 42px;
  height: 42px;
  flex: none;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  background: #fff;
  color: var(--ink-faint);
  font-size: 1.1rem;
  transition: border-color .15s ease;
}
.cs-me-ava:hover { border-color: var(--ink); }
.cs-me-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cs-me-row input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: .44rem .6rem;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-family: var(--sans);
  font-size: .85rem;
  color: var(--ink);
  outline: none;
}
.cs-me-row input[type="text"]:focus { border-color: var(--ink); }

.cs-me-actions { display: flex; align-items: center; gap: .6rem; margin-top: .7rem; }

.cs-me-save {
  padding: .4rem .95rem;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: #f6f4f0;
  font-size: .8rem;
  letter-spacing: .08em;
  cursor: pointer;
}

.cs-me-skip {
  border: 0;
  background: none;
  color: var(--ink-faint);
  font-size: .78rem;
  cursor: pointer;
  padding: .2rem;
}
.cs-me-skip:hover { color: var(--ink); }

.cs-head-sub {
  font-size: .72rem;
  color: var(--ink-faint);
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9b6ae;
  flex: none;
  transition: background .3s ease;
}

.cs-dot.on { background: #3f7d5c; box-shadow: 0 0 0 3px rgba(63, 125, 92, .16); }

.cs-x {
  border: 0;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0 .2rem;
}
.cs-x:hover { color: var(--ink); }

.cs-msgs {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem .9rem .4rem;
  display: flex;
  flex-direction: column;
  gap: .68rem;
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(28, 28, 26, .022) 27px 28px);
}

.cs-row { display: flex; }
.cs-row.me { justify-content: flex-end; }

.cs-bubble {
  max-width: 78%;
  padding: .56rem .76rem;
  border-radius: 4px;
  font-size: .875rem;
  line-height: 1.68;
  word-break: break-word;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.cs-row.me .cs-bubble {
  background: var(--ink);
  color: #f6f4f0;
  border-color: var(--ink);
}

.cs-bubble img,
.cs-bubble video {
  display: block;
  max-width: 100%;
  max-height: 300px;
  border-radius: 3px;
  margin: 2px 0;
}

.cs-bubble audio { width: 214px; max-width: 100%; display: block; margin: 2px 0; }

.cs-msg-time {
  font-size: .64rem;
  color: var(--ink-faint);
  margin-top: .3rem;
  letter-spacing: .04em;
}
.cs-row.me .cs-msg-time { text-align: right; color: rgba(255, 255, 255, .5); }

.cs-sys {
  align-self: center;
  font-size: .7rem;
  color: var(--ink-faint);
  letter-spacing: .05em;
  padding: .3rem .6rem;
}

.cs-tip {
  padding: .45rem .9rem;
  font-size: .74rem;
  color: #8a3a2c;
  background: rgba(179, 64, 47, .06);
  border-top: 1px solid rgba(179, 64, 47, .16);
}

/* ---------- 输入区 ---------- */

.cs-composer {
  display: flex;
  align-items: flex-end;
  gap: .4rem;
  padding: .6rem .7rem calc(.6rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}

.cs-tools { display: flex; gap: .1rem; flex: none; align-items: flex-end; }

.cs-tool {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.cs-tool svg { width: 19px; height: 19px; }
.cs-tool:hover { background: rgba(28, 28, 26, .055); color: var(--ink); }
.cs-tool.rec { color: #b3402f; background: rgba(179, 64, 47, .1); animation: rec-pulse 1.1s infinite; }

@keyframes rec-pulse {
  50% { opacity: .45; }
}

.cs-composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 108px;
  padding: .44rem .2rem;
  border: 0;
  background: none;
  resize: none;
  font-family: var(--sans);
  font-size: .875rem;
  line-height: 1.6;
  color: var(--ink);
  outline: none;
}

.cs-composer textarea::placeholder { color: var(--ink-faint); }

.cs-send {
  flex: none;
  padding: .44rem .9rem;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: #f6f4f0;
  font-size: .82rem;
  letter-spacing: .08em;
  cursor: pointer;
  transition: opacity .15s ease;
}
.cs-send:disabled { opacity: .38; cursor: default; }

/* ---------- 上传进度 ---------- */

.cs-prog {
  align-self: flex-end;
  max-width: 78%;
  padding: .5rem .76rem;
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  font-size: .78rem;
  color: var(--ink-soft);
  letter-spacing: .05em;
}

/* ---------- 移动端全屏 ---------- */

@media (max-width: 560px) {
  .cs-panel {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
  .cs-fab-text { display: none; }
  .cs-fab { padding: .78rem; }
  .hero { padding-bottom: clamp(84px, 14vh, 104px); }
}
