/* ============================================================
   RoaChat 官网样式
   ============================================================ */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #8b5cf6;
  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --radius: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 12px 32px -12px rgba(15, 23, 42, .18);
  --shadow-lg: 0 32px 64px -24px rgba(79, 70, 229, .35);
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
  --grad-deep: linear-gradient(160deg, #1e1b4b 0%, #312e81 45%, #4c1d95 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img, svg { display: block; }
button { font-family: inherit; }

/* ============ 通用 ============ */
.section { padding: 96px 24px; max-width: 1180px; margin: 0 auto; }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-title { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.section-sub { color: var(--muted); font-size: 17px; margin-top: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; border-radius: 12px; cursor: pointer; border: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(99, 102, 241, .7); }
.btn-primary:hover { box-shadow: 0 14px 30px -10px rgba(99, 102, 241, .85); transform: translateY(-2px); }
.btn-ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255,255,255,.16); }
.btn-lg { padding: 15px 28px; font-size: 16px; }
.btn-sm { padding: 9px 18px; font-size: 14px; }

/* ============ 导航 ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .25s ease, box-shadow .25s ease, backdrop-filter .25s ease;
}
.nav.scrolled { background: rgba(255,255,255,.86); backdrop-filter: saturate(180%) blur(12px); box-shadow: var(--shadow-sm); }
.nav-inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 68px; display: flex; align-items: center; justify-content: space-between; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--grad); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px -6px rgba(99,102,241,.7);
}
.nav .brand-name { color: #fff; transition: color .25s ease; }
.nav.scrolled .brand-name { color: var(--ink); }

.nav-links { display: flex; gap: 28px; }
.nav-links a { color: rgba(255,255,255,.82); font-size: 15px; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: #fff; }
.nav.scrolled .nav-links a { color: var(--ink-soft); }
.nav.scrolled .nav-links a:hover { color: var(--primary); }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: none; width: 40px; height: 40px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 5px auto; border-radius: 2px; transition: .3s; }
.nav.scrolled .nav-toggle span { background: var(--ink); }

/* ============ Hero ============ */
.hero { position: relative; overflow: hidden; background: var(--grad-deep); color: #fff; padding: 150px 24px 100px; }
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(139,92,246,.35) 0, transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(99,102,241,.4) 0, transparent 45%),
    radial-gradient(circle at 60% 90%, rgba(168,85,247,.25) 0, transparent 40%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.hero-inner { position: relative; max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }

.hero-badge { display: inline-block; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; margin-bottom: 22px; }
.hero-title { font-size: clamp(36px, 5.5vw, 60px); font-weight: 800; line-height: 1.08; letter-spacing: -.03em; }
.hero-title-accent { background: linear-gradient(90deg, #c7d2fe, #e9d5ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: rgba(255,255,255,.78); font-size: 18px; margin-top: 20px; max-width: 520px; }
.hero-actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

.hero-meta { display: flex; gap: 32px; margin-top: 44px; }
.hero-meta-item { display: flex; flex-direction: column; }
.hero-meta-item strong { font-size: 22px; font-weight: 800; }
.hero-meta-item span { font-size: 13px; color: rgba(255,255,255,.6); margin-top: 2px; }

/* 手机 mockup */
.hero-phone { display: flex; justify-content: center; }
.phone {
  position: relative; width: 280px; height: 580px; background: #0b1020; border-radius: 44px;
  padding: 10px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.6), inset 0 0 0 2px rgba(255,255,255,.06);
}
.phone-notch { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 120px; height: 24px; background: #0b1020; border-radius: 999px; z-index: 5; }
.phone-screen { width: 100%; height: 100%; background: #f4f5fb; border-radius: 34px; overflow: hidden; display: flex; flex-direction: column; }

.app-head { display: flex; align-items: center; gap: 10px; padding: 26px 14px 12px; background: #fff; border-bottom: 1px solid #eef0f6; }
.app-head-back { font-size: 22px; color: #6366f1; line-height: 1; }
.app-head-title { flex: 1; display: flex; align-items: center; gap: 10px; }
.app-head-avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.app-head-name { font-size: 14px; font-weight: 700; color: #1e293b; }
.app-head-status { font-size: 11px; color: #22c55e; display: flex; align-items: center; gap: 4px; }
.app-head-status i { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; display: inline-block; }
.app-head-more { font-size: 18px; color: #94a3b8; }

.app-msgs { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.bubble { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 12.5px; line-height: 1.45; }
.bubble-in { align-self: flex-start; background: #fff; color: #334155; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.bubble-out { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.bubble-img { display: block; margin-top: 6px; width: 140px; height: 84px; border-radius: 8px; background: linear-gradient(135deg, #c7d2fe, #e9d5ff); }

.app-input { display: flex; align-items: center; gap: 8px; padding: 10px 12px 16px; background: #fff; border-top: 1px solid #eef0f6; }
.app-input-box { flex: 1; background: #f1f4f9; border-radius: 999px; padding: 8px 14px; font-size: 12px; color: #94a3b8; }
.app-input-send { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; }

/* ============ 功能特色 ============ */
.features { background: var(--bg); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; transition: transform .2s ease, box-shadow .2s ease;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.feature-icon { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.ic-blue   { background: #eef2ff; color: #6366f1; }
.ic-purple { background: #f3e8ff; color: #9333ea; }
.ic-green  { background: #ecfdf5; color: #16a34a; }
.ic-orange { background: #fff7ed; color: #ea580c; }
.ic-cyan   { background: #ecfeff; color: #0891b2; }
.ic-rose   { background: #fff1f2; color: #e11d48; }
.feature-card h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 14.5px; }

/* ============ 产品展示 ============ */
.showcase { background: #fff; }
.showcase-row { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.showcase-text h3 { font-size: 26px; font-weight: 800; margin-bottom: 12px; }
.showcase-text p { color: var(--muted); font-size: 16px; }
.showcase-list { list-style: none; margin-top: 20px; }
.showcase-list li { padding: 10px 0; color: var(--ink-soft); font-weight: 500; display: flex; align-items: center; gap: 10px; }
.showcase-list li::before { content: "✓"; color: #fff; background: var(--grad); width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }

.showcase-visual { display: flex; justify-content: center; }
.mini-phone { width: 300px; background: #fff; border: 1px solid var(--line); border-radius: 28px; padding: 18px; box-shadow: var(--shadow-md); }
.mini-list { display: flex; flex-direction: column; }
.mini-item { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 12px; }
.mini-item.active { background: #eef2ff; }
.mini-avatar { width: 42px; height: 42px; border-radius: 12px; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.a1 { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.a2 { background: linear-gradient(135deg,#f59e0b,#f97316); }
.a3 { background: linear-gradient(135deg,#10b981,#06b6d4); }
.a4 { background: linear-gradient(135deg,#ec4899,#a855f7); }
.mini-body { flex: 1; min-width: 0; }
.mini-top { display: flex; justify-content: space-between; align-items: center; }
.mini-top b { font-size: 14px; color: #1e293b; }
.mini-top span { font-size: 11px; color: #94a3b8; }
.mini-preview { font-size: 12px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.mini-badge { background: #ef4444; color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 5px; font-weight: 600; }
.mini-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }

/* ============ 下载 ============ */
.download { background: var(--bg); }
.platform-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.platform-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px;
  text-align: center; position: relative; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.platform-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.platform-card.recommended { border-color: var(--primary); box-shadow: 0 24px 48px -24px rgba(99,102,241,.5); }
.platform-head { display: flex; justify-content: center; align-items: center; position: relative; margin-bottom: 18px; }
.platform-icon { width: 64px; height: 64px; border-radius: 18px; background: #eef2ff; color: var(--primary); display: flex; align-items: center; justify-content: center; }
.platform-recommend {
  position: absolute; top: -34px; right: -6px; background: var(--grad); color: #fff;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.platform-card h3 { font-size: 21px; font-weight: 800; }
.platform-desc { color: var(--muted); font-size: 14px; margin: 10px 0 6px; min-height: 44px; }
.platform-meta { font-size: 12px; color: #94a3b8; margin-bottom: 20px; }
.btn-download {
  width: 100%; padding: 14px; background: var(--ink); color: #fff; border-radius: 12px; font-size: 15px; font-weight: 600;
}
.btn-download:hover { background: var(--primary); transform: translateY(-2px); }
.platform-size { font-size: 12px; color: #cbd5e1; margin-top: 10px; }

.download-tip {
  max-width: 640px; margin: 32px auto 0; background: #eef2ff; border: 1px solid #c7d2fe;
  border-radius: 14px; padding: 16px 20px; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: #3730a3;
}

/* ============ FAQ ============ */
.faq { background: #fff; }
.faq-list { max-width: 720px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 20px 0; font-size: 16px; font-weight: 600; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq-arrow { color: var(--primary); font-size: 20px; transition: transform .2s ease; }
.faq-item.open .faq-arrow { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a p { padding-bottom: 20px; color: var(--muted); font-size: 15px; }

/* ============ 页脚 ============ */
.footer { background: #0b1020; color: #fff; padding: 60px 24px 0; }
.footer-inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 32px; }
.footer .brand-name { color: #fff; }
.footer-desc { color: #94a3b8; font-size: 14px; margin-top: 12px; max-width: 280px; }
.footer-links { display: flex; gap: 28px; align-items: flex-start; }
.footer-links a { color: #94a3b8; font-size: 14px; transition: color .2s; }
.footer-links a:hover { color: #fff; }
.footer-bottom { text-align: center; color: #64748b; font-size: 13px; padding: 28px 0; border-top: 1px solid rgba(255,255,255,.08); margin-top: 48px; }

/* ============ 响应式 ============ */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-sub, .hero-meta { margin-left: auto; margin-right: auto; }
  .hero-meta { justify-content: center; }
  .hero-actions { justify-content: center; }
  .hero-phone { margin-top: 20px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .showcase-row { grid-template-columns: 1fr; text-align: center; }
  .showcase-list { display: inline-block; text-align: left; }
  .platform-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
}

@media (max-width: 640px) {
  .nav-links {
    position: fixed; top: 68px; left: 0; right: 0; background: #fff; flex-direction: column;
    padding: 16px 24px; gap: 0; box-shadow: var(--shadow-md); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { color: var(--ink-soft) !important; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-toggle { display: block; }
  /* 手机端隐藏头部「立即下载」按钮：多语言下文案较长（如「今すぐダウンロード」），会撑破固定头部宽度 */
  .nav-actions .btn-primary { display: none; }
  .section { padding: 64px 20px; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero { padding: 120px 20px 72px; }
  .hero-meta { gap: 24px; }
}

/* ============ 语言切换器 ============ */
.lang-switch { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22); color: #fff; border-radius: 999px;
  padding: 7px 12px; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.lang-btn:hover { background: rgba(255,255,255,.18); }
.lang-caret { transition: transform .2s; }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; background: #fff; border-radius: 12px;
  box-shadow: var(--shadow-md); padding: 6px; min-width: 150px; list-style: none; z-index: 200;
}
.lang-menu button {
  display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--ink-soft); transition: .15s;
}
.lang-menu button:hover { background: #eef2ff; color: var(--primary); }
.lang-menu button.active { background: #eef2ff; color: var(--primary); font-weight: 600; }

/* 滚动后（白底）语言按钮适配 */
.nav.scrolled .lang-btn { color: var(--ink); border-color: var(--line); background: #fff; }

@media (max-width: 640px) {
  .lang-btn { padding: 7px 10px; }
  .lang-btn .lang-caret { display: none; }
  .lang-menu { right: 0; }
}
