/* =========================================================
   星聊 官网样式
   - 主题色用 CSS 变量定义
   - 自动适配浅色 / 深色（prefers-color-scheme）
   - 移动端优先，桌面多列
   - 不引用任何外部资源
   ========================================================= */

/* ---------- 主题变量 ---------- */
:root {
  /* 品牌色（蓝紫渐变） */
  --brand-1: #4F6BFF;
  --brand-2: #7C5CFF;
  --brand-grad: linear-gradient(135deg, var(--brand-1), var(--brand-2));

  /* 浅色主题 */
  --bg: #F6F7FB;
  --bg-elev: #FFFFFF;
  --bg-alt: #EEF1FA;
  --text: #12162A;
  --text-soft: #4A5170;
  --text-muted: #767E9C;
  --border: rgba(18, 22, 42, 0.09);
  --shadow-sm: 0 1px 2px rgba(18, 22, 42, 0.05), 0 6px 16px rgba(18, 22, 42, 0.05);
  --shadow-lg: 0 10px 30px rgba(79, 107, 255, 0.16), 0 2px 6px rgba(18, 22, 42, 0.05);
  --shadow-brand: 0 12px 26px rgba(79, 107, 255, 0.32);
  --header-bg: rgba(246, 247, 251, 0.82);
  --glow-1: rgba(79, 107, 255, 0.30);
  --glow-2: rgba(124, 92, 255, 0.26);

  /* 尺寸 */
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --maxw: 1120px;
  --header-h: 64px;

  /* 动效 */
  --ease: cubic-bezier(0.22, 0.68, 0.35, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C0F1A;
    --bg-elev: #151A2B;
    --bg-alt: #111626;
    --text: #EDF0FA;
    --text-soft: #B4BBD4;
    --text-muted: #868EAB;
    --border: rgba(255, 255, 255, 0.10);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30), 0 6px 16px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
    --shadow-brand: 0 12px 26px rgba(79, 107, 255, 0.38);
    --header-bg: rgba(12, 15, 26, 0.78);
    --glow-1: rgba(79, 107, 255, 0.28);
    --glow-2: rgba(124, 92, 255, 0.24);
  }
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
               "Noto Sans CJK SC", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; }
svg { display: block; }

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

p { margin: 0; }

ul, ol { margin: 0; padding: 0; }

:focus-visible {
  outline: 2px solid var(--brand-1);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

.muted { color: var(--text-muted); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease),
              background-color 0.22s var(--ease), border-color 0.22s var(--ease);
}

.btn-primary {
  color: #fff;
  background: var(--brand-grad);
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(79, 107, 255, 0.42);
}

.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 107, 255, 0.5);
  background: rgba(79, 107, 255, 0.07);
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  transition: background-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
              border-color 0.25s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 19px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #fff;
  background: var(--brand-grad);
  box-shadow: 0 6px 14px rgba(79, 107, 255, 0.32);
  flex: none;
}

.brand-name { letter-spacing: 0.02em; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--text-soft);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(79, 107, 255, 0.09);
}

.site-nav a.is-active { color: var(--brand-1); }

.site-nav .nav-cta {
  color: #fff;
  background: var(--brand-grad);
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(79, 107, 255, 0.28);
}

.site-nav .nav-cta:hover {
  color: #fff;
  background: var(--brand-grad);
  transform: translateY(-1px);
}

/* 汉堡按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 56px 0 68px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: -220px -120px auto -120px;
  height: 640px;
  background:
    radial-gradient(46% 42% at 22% 34%, var(--glow-1) 0%, transparent 70%),
    radial-gradient(42% 40% at 76% 24%, var(--glow-2) 0%, transparent 72%);
  filter: blur(6px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  gap: 40px;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
}

.hero-title {
  margin-top: 16px;
  font-size: clamp(46px, 13vw, 76px);
  font-weight: 900;
  letter-spacing: -0.03em;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  margin-top: 16px;
  max-width: 30em;
  color: var(--text-soft);
  font-size: clamp(16px, 4.4vw, 18px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.hero-note {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  list-style: none;
}

.hero-points li {
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text-soft);
  font-size: 13px;
}

/* 手机模型（纯 CSS） */
.hero-visual {
  display: flex;
  justify-content: center;
}

.phone {
  position: relative;
  width: min(300px, 82vw);
  aspect-ratio: 9 / 17.5;
  padding: 10px;
  border-radius: 38px;
  background: linear-gradient(160deg, rgba(79, 107, 255, 0.28), rgba(124, 92, 255, 0.14) 55%, rgba(124, 92, 255, 0.05));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.phone-notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 86px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  z-index: 2;
}

.phone-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 26px 12px 12px;
  border-radius: 30px;
  background: var(--bg-elev);
  overflow: hidden;
}

.chat-topbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.chat-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-grad);
  flex: none;
}

.chat-lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.chat-lines i {
  display: block;
  height: 6px;
  border-radius: 4px;
  background: var(--border);
}

.chat-lines i:first-child { width: 62%; background: rgba(79, 107, 255, 0.35); }
.chat-lines i:last-child { width: 40%; }

.chat-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
  padding: 14px 0;
}

.bubble {
  max-width: 84%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.5;
}

.bubble-in {
  align-self: flex-start;
  background: var(--bg-alt);
  color: var(--text-soft);
  border-bottom-left-radius: 5px;
}

.bubble-out {
  align-self: flex-end;
  color: #fff;
  background: var(--brand-grad);
  border-bottom-right-radius: 5px;
}

.typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border-bottom-left-radius: 5px;
  background: var(--bg-alt);
}

.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: blink 1.2s infinite;
}

.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.chat-inputbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.chat-input {
  flex: 1;
  height: 26px;
  border-radius: 999px;
  background: var(--bg-alt);
}

.chat-send {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-grad);
  flex: none;
}

/* ---------- 通用区块 ---------- */
.section {
  padding: 68px 0;
  scroll-margin-top: calc(var(--header-h) + 10px);
}

.section-alt { background: var(--bg-alt); }

.section-head {
  max-width: 640px;
  margin-bottom: 36px;
}

.section-tag {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--brand-1);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.section-title {
  font-size: clamp(26px, 6.4vw, 36px);
  font-weight: 800;
}

.section-desc {
  margin-top: 12px;
  color: var(--text-soft);
}

/* ---------- 功能卡片 ---------- */
.grid {
  display: grid;
  gap: 16px;
}

.card {
  position: relative;
  padding: 24px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease),
              border-color 0.28s var(--ease);
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--brand-grad);
  opacity: 0;
  transition: opacity 0.28s var(--ease);
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(79, 107, 255, 0.4);
  box-shadow: var(--shadow-lg);
}

.card:hover::after { opacity: 1; }

.card-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 15px;
  border-radius: 14px;
  color: #fff;
  background: var(--brand-grad);
  box-shadow: 0 8px 18px rgba(79, 107, 255, 0.26);
  transition: transform 0.28s var(--ease);
}

.card:hover .card-icon { transform: scale(1.06) rotate(-4deg); }

.card h3 {
  font-size: 18px;
  font-weight: 700;
}

.card p {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 15px;
}

/* ---------- 使用步骤 ---------- */
.steps {
  display: grid;
  gap: 14px;
  list-style: none;
  counter-reset: step;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.step:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-lg);
}

.step-num {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  color: #fff;
  background: var(--brand-grad);
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(79, 107, 255, 0.28);
}

.step-body h3 {
  font-size: 17px;
  font-weight: 700;
}

.step-body p {
  margin-top: 5px;
  color: var(--text-soft);
  font-size: 15px;
}

.steps-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
}

.steps-cta .muted { font-size: 14px; }

/* ---------- 常见问题（details/summary） ---------- */
.faq {
  display: grid;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  overflow: hidden;
}

.faq-item:hover { border-color: rgba(79, 107, 255, 0.4); }

.faq-item[open] {
  border-color: rgba(79, 107, 255, 0.45);
  box-shadow: var(--shadow-lg);
}

.faq-item summary {
  position: relative;
  display: block;
  padding: 18px 54px 18px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 22px;
  width: 9px;
  height: 9px;
  margin-top: -6px;
  border-right: 2px solid var(--brand-1);
  border-bottom: 2px solid var(--brand-1);
  transform: rotate(45deg);
  transition: transform 0.25s var(--ease);
}

.faq-item[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -2px;
}

.faq-body {
  padding: 0 20px 20px;
  color: var(--text-soft);
  font-size: 15px;
  animation: fadeIn 0.28s var(--ease);
}

.faq-body p + p { margin-top: 8px; }

.faq-body ul {
  margin-top: 8px;
  padding-left: 20px;
  list-style: disc;
}

.faq-body li { margin-top: 4px; }

.faq-body li::marker { color: var(--brand-1); }

.faq-body strong { color: var(--text); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 20px;
  padding: 54px 0 28px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: grid;
  gap: 28px;
}

.footer-brand .brand-name {
  display: inline-block;
  font-size: 20px;
  font-weight: 800;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.footer-desc {
  margin-top: 10px;
  max-width: 34em;
  color: var(--text-soft);
  font-size: 14.5px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-links a {
  color: var(--text-soft);
  font-size: 15px;
  transition: color 0.2s var(--ease);
}

.footer-links a:hover { color: var(--brand-1); }

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.footer-contact span { color: var(--text-muted); }

.footer-contact a {
  color: var(--brand-1);
  font-weight: 600;
  word-break: break-all;
}

.footer-contact a:hover { text-decoration: underline; }

.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* ---------- 入场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

/* 尊重系统「减弱动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   响应式：移动端优先，向上逐级增强
   ========================================================= */

/* 平板 / 小桌面 */
@media (min-width: 720px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
  }
}

/* 桌面 */
@media (min-width: 980px) {
  .hero {
    padding: 84px 0 96px;
  }

  .hero-inner {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 56px;
  }

  .hero-visual { justify-content: flex-end; }

  .grid-3 { grid-template-columns: repeat(3, 1fr); }

  .steps { grid-template-columns: repeat(2, 1fr); }

  .faq { gap: 14px; }

  .section { padding: 88px 0; }

  .footer-inner {
    grid-template-columns: 1.6fr 1fr 1fr;
  }
}

/* 移动端导航折叠 */
@media (max-width: 719px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: calc(var(--header-h) + 8px);
    right: 20px;
    left: 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elev);
    box-shadow: var(--shadow-lg);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease),
                visibility 0.22s var(--ease);
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .site-nav a { padding: 12px 14px; }

  .site-nav .nav-cta { text-align: center; margin-top: 4px; }

  .header-inner { position: relative; }
}
