/* x.ai/grok 风格设计 token — 跟随系统亮/暗，无手动切换按钮 */
:root {
  /* 默认暗色（无 prefers-color-scheme 时的回退） */
  color-scheme: dark;
  --bg: #0a0a0a;
  --card: #1a1a1a;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.15);
  --fg: #ffffff;
  --fg-muted: rgba(255, 255, 255, 0.5);
  --fg-dim: rgba(255, 255, 255, 0.45);
  --fg-faint: rgba(255, 255, 255, 0.3);
  --header-bg: rgba(10, 10, 10, 0.85);
  --drawer-bg: #0c0c0c;
  --drawer-backdrop: rgba(0, 0, 0, 0.55);
  --modal-backdrop: rgba(0, 0, 0, 0.65);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-hover-soft: rgba(255, 255, 255, 0.04);
  --surface-soft: rgba(255, 255, 255, 0.03);
  --surface-elevated: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(0, 0, 0, 0.35);
  --input-focus-border: rgba(255, 255, 255, 0.35);
  --btn-primary-bg: #ffffff;
  --btn-primary-fg: #0a0a0a;
  --btn-primary-hover: rgba(255, 255, 255, 0.9);
  --btn-secondary-fg: #ffffff;
  --lang-indicator-bg: #ffffff;
  --lang-indicator-fg: #0a0a0a;
  --icon-muted: #666666;
  --icon-soft: #555555;
  --danger: #f08080;
  --section-line: hsl(221 12% 14%);
  --demo-bubble-bg: rgba(255, 255, 255, 0.04);
  --demo-fg: rgba(255, 255, 255, 0.85);
  --demo-fg-soft: rgba(255, 255, 255, 0.7);
  --demo-fg-muted: rgba(255, 255, 255, 0.55);
  --demo-fg-dim: rgba(255, 255, 255, 0.45);
  --demo-fg-faint: rgba(255, 255, 255, 0.4);
  --demo-dot: rgba(255, 255, 255, 0.45);
  --radius-card: 16px;
  --radius-pill: 9999px;
  --header-h: 4rem;
  --font: Inter, "SF Pro Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* 系统亮色模式 */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #ffffff;
    --card: #f4f4f5;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.14);
    --fg: #0a0a0a;
    --fg-muted: rgba(10, 10, 10, 0.55);
    --fg-dim: rgba(10, 10, 10, 0.5);
    --fg-faint: rgba(10, 10, 10, 0.38);
    --header-bg: rgba(255, 255, 255, 0.88);
    --drawer-bg: #fafafa;
    --drawer-backdrop: rgba(0, 0, 0, 0.35);
    --modal-backdrop: rgba(0, 0, 0, 0.4);
    --surface-hover: rgba(0, 0, 0, 0.05);
    --surface-hover-soft: rgba(0, 0, 0, 0.035);
    --surface-soft: rgba(0, 0, 0, 0.03);
    --surface-elevated: rgba(0, 0, 0, 0.07);
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-focus-border: rgba(0, 0, 0, 0.35);
    --btn-primary-bg: #0a0a0a;
    --btn-primary-fg: #ffffff;
    --btn-primary-hover: #222222;
    --btn-secondary-fg: #0a0a0a;
    --lang-indicator-bg: #0a0a0a;
    --lang-indicator-fg: #ffffff;
    --icon-muted: #737373;
    --icon-soft: #8a8a8a;
    --danger: #d14343;
    --section-line: rgba(0, 0, 0, 0.08);
    --demo-bubble-bg: rgba(0, 0, 0, 0.04);
    --demo-fg: rgba(10, 10, 10, 0.9);
    --demo-fg-soft: rgba(10, 10, 10, 0.7);
    --demo-fg-muted: rgba(10, 10, 10, 0.55);
    --demo-fg-dim: rgba(10, 10, 10, 0.48);
    --demo-fg-faint: rgba(10, 10, 10, 0.4);
    --demo-dot: rgba(10, 10, 10, 0.4);
  }
}

/* 系统暗色模式（显式覆盖，与默认一致） */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; border: 0; background: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

.container {
  width: 100%;
  margin-inline: auto;
  padding-inline: 16px;
}
@media (min-width: 1024px) {
  .container { padding-inline: 24px; }
}
@media (min-width: 1280px) {
  .container { max-width: 80rem; }
}

/* Header — 桌面完整；手机对齐 x.ai：Logo + 主 CTA + 菜单 */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}
.site-header .inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  height: 100%;
}
.logo {
  position: relative;
  z-index: 2;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

/* Features / Highlights / Buy：桌面初始居中，滚动后贴 GrokAI 右侧 */
.nav-links {
  display: none;
  align-items: center;
  gap: 0.25rem;
}
@media (min-width: 900px) {
  .nav-links {
    display: flex;
    position: absolute;
    top: 50%;
    left: 0;
    z-index: 1;
    transform: translate3d(var(--nav-x, 0px), -50%, 0);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
  }
  .site-header.no-nav-transition .nav-links {
    transition: none;
  }
}
.nav-links a {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color 0.15s var(--ease);
}
.nav-links a:hover { color: var(--fg); }

/* 右侧 Sign in / 语言 / Get Super：固定右对齐，不随滚动移动 */
.header-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}
.user-chip {
  font-size: 13px;
  color: var(--fg-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 语言切换：EN / CN — 固定尺寸 + 滑动指示器（避免周围文案变宽时被顶开） */
.lang-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: 88px;
  height: 36px;
  padding: 3px;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 0 1px var(--border-strong);
  overflow: hidden;
}
.lang-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  height: 100%;
  width: 100%;
}
.lang-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--lang-indicator-bg);
  z-index: 0;
  pointer-events: none;
  /* 柔和缓动 + GPU 合成，避免生硬跳变 */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate3d(0, 0, 0);
  will-change: transform;
}
.lang-indicator.cn {
  transform: translate3d(100%, 0, 0);
}
.lang-toggle button {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  white-space: nowrap;
  line-height: 1;
}
.lang-toggle button.active {
  color: var(--lang-indicator-fg);
}
.lang-toggle button:not(.active):hover {
  color: var(--fg);
}

/* 顶栏可变文案按钮预留宽度，切换语言时不把 lang-toggle 挤偏 */
.header-actions #btn-auth {
  min-width: 5.5rem;
  flex-shrink: 0;
}
.header-actions .header-cta {
  min-width: 6.75rem;
  flex-shrink: 0;
}

/* 桌面专属 / 手机菜单按钮 */
.desktop-only { display: none !important; }
@media (min-width: 900px) {
  .desktop-only { display: inline-flex !important; }
  .desktop-only.user-chip:not(.hidden) { display: inline-block !important; }
  .desktop-only.lang-toggle { display: inline-flex !important; }
  .menu-btn { display: none !important; }
}
.menu-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  color: var(--fg);
}
.menu-btn:hover { background: var(--surface-hover); }
.menu-btn-bar {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
}
body.drawer-open { overflow: hidden; }

/* 侧滑抽屉 */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--drawer-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  width: min(100%, 320px);
  height: 100%;
  background: var(--drawer-bg);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.25s var(--ease);
  display: flex;
  flex-direction: column;
  padding: 0 0 env(safe-area-inset-bottom);
}
.mobile-drawer.open {
  transform: translateX(0);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.drawer-close {
  width: 40px;
  height: 40px;
  font-size: 24px;
  line-height: 1;
  color: var(--fg-muted);
  border-radius: 10px;
}
.drawer-close:hover { color: var(--fg); background: var(--surface-hover); }
.drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 12px;
  gap: 2px;
  flex: 1;
  overflow: auto;
}
.drawer-nav a {
  display: block;
  padding: 14px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-muted);
  border-radius: 10px;
}
.drawer-nav a:hover { color: var(--fg); background: var(--surface-hover-soft); }
.drawer-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.drawer-lang { align-self: flex-start; }
.drawer-footer .user-chip {
  max-width: 100%;
  font-size: 12px;
}

/* 验证码行 */
.code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.code-row input {
  flex: 1;
  min-width: 0;
}
.code-row .btn-send-code {
  flex-shrink: 0;
  height: 44px;
  padding: 0 14px;
  white-space: nowrap;
}
.code-row .btn-send-code:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
  white-space: nowrap;
}
.btn-sm { height: 36px; padding: 8px 16px; }
.btn-md { height: 44px; padding: 12px 20px; }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); }
.btn-primary:hover { background: var(--btn-primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: transparent;
  color: var(--btn-secondary-fg);
  box-shadow: 0 0 0 1px var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-hover); }
.btn-block { width: 100%; }

/* Hero — 手机 H1 ~36px（对齐 x.ai mobile） */
.hero {
  padding: calc(var(--header-h) + 3.5rem) 0 3rem;
  text-align: center;
}
@media (min-width: 640px) {
  .hero { padding: calc(var(--header-h) + 5.5rem) 0 4.5rem; }
}
.hero-inner { max-width: 48rem; margin-inline: auto; }
.badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 12px;
  color: var(--fg-faint);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.badge .sep { opacity: 0.5; }
.icon-circle {
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.hero h1 {
  font-size: clamp(2.25rem, 6.5vw, 3.75rem); /* 36px → 60px */
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-top: 1rem;
}
.hero .sub {
  margin: 1.25rem auto 0;
  max-width: 36rem;
  font-size: 16px;
  line-height: 1.625;
  color: var(--fg-muted);
  padding-inline: 4px;
}
@media (min-width: 640px) {
  .hero .sub { font-size: 18px; margin-top: 1.5rem; }
}
.cta-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-inline: 8px;
}
.cta-row .btn { width: 100%; }
@media (min-width: 480px) {
  .cta-row {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding-inline: 0;
  }
  .cta-row .btn { width: auto; }
}

/* Sections — 手机 py-16，桌面 py-24 */
.section {
  border-top: 1px solid var(--section-line);
  padding: 4rem 0;
}
@media (min-width: 640px) {
  .section { padding: 6rem 0; }
}
.section-head { margin-bottom: 2rem; max-width: 36rem; }
@media (min-width: 640px) {
  .section-head { margin-bottom: 2.5rem; }
}
.section-head.center {
  text-align: center;
  margin-inline: auto;
  max-width: 42rem;
}
.section-head h2 {
  font-size: clamp(1.875rem, 4vw, 2.25rem); /* ~30px mobile */
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.section-head p {
  margin-top: 0.75rem;
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.625;
}
@media (min-width: 640px) {
  .section-head p { font-size: 16px; }
}

/* Feature + demo — 对齐 x.ai：左 4 段随页滚动，右 sticky 对话框钉在视口 */
.feature-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .feature-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 4rem;
    /* 必须 stretch：右列与左列同高，sticky 才能在整段 4×50vh 内吸住 */
    align-items: stretch;
  }
}
.feature-panels {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.feature-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (min-width: 1024px) {
  .feature-panel {
    /* 每段占半屏，四段 ≈ 2 屏滚动，期间右侧 demo 固定 */
    min-height: 50vh;
  }
}
.feature-panel-inner {
  padding: 2.5rem 0;
  transition: opacity 0.5s ease;
  opacity: 1;
}
@media (min-width: 1024px) {
  .feature-panel-inner {
    padding: 3rem 0;
    opacity: 0.2;
  }
  .feature-panel-inner.is-active {
    opacity: 1;
  }
}
.feature-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.feature-title h3 {
  font-size: clamp(1.5rem, 3vw, 1.875rem); /* 24px → 30px */
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.feature-desc {
  margin-top: 1rem;
  font-size: 16px;
  line-height: 1.625;
  color: var(--fg-muted);
  max-width: 32rem;
}
.feature-list {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.625;
  color: var(--fg-dim);
}
.feature-list svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--icon-muted);
}
/* 右侧演示列：桌面与左列同高 + sticky；手机跟在文案后 */
.feature-demo-col {
  width: 100%;
  min-width: 0;
}
@media (min-width: 1024px) {
  .feature-demo-col {
    /* 与左列 stretch 同高，作为 sticky 的 containing block */
    height: 100%;
    position: relative;
  }
}
.feature-demo-sticky {
  width: 100%;
}
@media (min-width: 1024px) {
  .feature-demo-sticky {
    position: sticky;
    /* 对齐 x.ai：top ≈ 50vh - 演示卡半高(220) */
    top: calc(50vh - 220px);
    /* 防止在个别浏览器被压扁 */
    align-self: flex-start;
  }
}
/* ---------- 动态聊天演示（对齐 x.ai grok-browser-theme）---------- */
.demo-card.grok-demo {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  height: 360px; /* 手机对齐 x.ai */
  min-height: 320px;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 1024px) {
  .demo-card.grok-demo {
    height: 440px;
    min-height: 360px;
  }
}
.demo-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  /* 上下渐隐遮罩，贴近原站 mask-image */
  mask-image: linear-gradient(to bottom, transparent, #000 24px, #000 calc(100% - 12px), transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 24px, #000 calc(100% - 12px), transparent);
}
.demo-messages {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 16px 12px;
  overflow: hidden;
}
.demo-user {
  align-self: flex-end;
  max-width: 80%;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--demo-bubble-bg);
  font-size: 14px;
  line-height: 1.55;
  color: var(--demo-fg);
}
.demo-thinking {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--demo-fg-soft);
}
.demo-thinking-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.demo-avatars {
  display: flex;
  align-items: center;
}
.demo-avatars span {
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  margin-left: -6px;
  box-shadow: 0 0 0 2px var(--card);
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.demo-avatars span:first-child { margin-left: 0; }
.demo-avatars span.show {
  opacity: 1;
  transform: scale(1);
}
.demo-avatars span:nth-child(1) {
  background: radial-gradient(circle at 30% 30%, #f472b6 0%, #a855f7 100%);
}
.demo-avatars span:nth-child(2) {
  background: radial-gradient(circle at 30% 30%, #60a5fa 0%, #22d3ee 100%);
}
.demo-avatars span:nth-child(3) {
  background: radial-gradient(circle at 30% 30%, #34d399 0%, #10b981 100%);
}
.demo-avatars span:nth-child(4) {
  background: radial-gradient(circle at 30% 30%, #facc15 0%, #f97316 100%);
}
.demo-thinking-meta { color: var(--demo-fg-muted); font-size: 12px; }
.demo-thinking-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--demo-fg-dim);
  padding-left: 2px;
}
.demo-thinking-line i {
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background: var(--demo-dot);
  margin-top: 7px;
  flex-shrink: 0;
}
.demo-answer-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--demo-fg);
  margin-top: 4px;
}
.demo-answer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.demo-answer-list li {
  position: relative;
  padding-left: 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--demo-fg-soft);
}
.demo-answer-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background: var(--demo-dot);
}
.demo-answer-list li strong {
  font-weight: 500;
  color: var(--demo-fg);
  margin-right: 4px;
}

/* 入场动画 */
.demo-anim {
  opacity: 0;
  filter: blur(3px);
  transform: translateY(16px);
  transition:
    opacity 0.45s var(--ease),
    transform 0.45s var(--ease),
    filter 0.45s var(--ease);
}
.demo-anim.in {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}
.demo-user.demo-anim {
  transform: translateY(20px) scale(0.96);
}
.demo-user.demo-anim.in {
  transform: translateY(0) scale(1);
}

/* 底部输入条 */
.demo-composer {
  margin: 0 14px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  flex-shrink: 0;
}
.demo-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--demo-fg-muted);
  flex-shrink: 0;
}
.demo-composer-input {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  font-size: 13px;
  line-height: 20px;
  color: var(--demo-fg-faint);
  overflow: hidden;
  white-space: nowrap;
}
.demo-placeholder {
  overflow: hidden;
  text-overflow: ellipsis;
}
.demo-placeholder.typing {
  color: var(--demo-fg);
}
.demo-caret {
  width: 2px;
  height: 14px;
  margin-left: 1px;
  background: var(--demo-fg-muted);
  flex-shrink: 0;
  transform: translateY(-1px);
  animation: demo-blink 1s steps(1) infinite;
}
.demo-caret.hide { opacity: 0; animation: none; }
@keyframes demo-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.demo-mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 12px;
  color: var(--demo-fg-soft);
  flex-shrink: 0;
}
.demo-send-btn {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-elevated);
  color: var(--demo-fg-soft);
  flex-shrink: 0;
  opacity: 0.35;
  transition: opacity 0.2s var(--ease), background-color 0.2s var(--ease);
}
.demo-send-btn.active {
  opacity: 1;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
}

@media (prefers-reduced-motion: reduce) {
  .demo-anim,
  .demo-avatars span,
  .demo-send-btn {
    transition: none !important;
  }
  .demo-caret { animation: none; opacity: 1; }
}

/* Cap grid */
.cap-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .cap-grid { grid-template-columns: 1fr 1fr; gap: 2.25rem 3rem; }
}
@media (min-width: 1024px) {
  .cap-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.cap-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.cap-item svg { flex-shrink: 0; margin-top: 2px; color: var(--icon-soft); }
.cap-item strong {
  display: block;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}
.cap-item span {
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-dim);
}

/* 购买区：1个月 | 2个月 并排；仅 1 张时居中 */
.pricing-wrap {
  display: grid;
  gap: 1.25rem;
  max-width: 28rem;
  margin-inline: auto;
  width: 100%;
  grid-template-columns: 1fr;
  justify-items: stretch;
}
@media (min-width: 720px) {
  .pricing-wrap {
    max-width: 44rem;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
  }
  /* 只有一张卡：单列 + 限宽 + 居中（:has 兜底 + JS class） */
  .pricing-wrap:has(.product-card:only-child),
  .pricing-wrap.is-single {
    grid-template-columns: minmax(0, 28rem);
    justify-content: center;
    max-width: 44rem;
  }
}
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .product-card { padding: 2rem; }
}
.product-card .tag {
  display: inline-flex;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-faint);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
}
.product-card h3 {
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.product-card .subtitle {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.5;
}
.price-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}
.price-row .currency {
  font-size: 18px;
  color: var(--fg-muted);
}
.price-row .amount {
  font-size: clamp(2rem, 8vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}
.price-row .unit {
  font-size: 14px;
  color: var(--fg-faint);
}
.product-features {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.product-features li {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.5;
}
.product-features svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--icon-muted);
}
.stock-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 12px;
  color: var(--fg-faint);
  text-align: center;
}
.stock-hint .stock-sep {
  opacity: 0.5;
}
.buy-note {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 13px;
  color: var(--fg-faint);
  max-width: 28rem;
  margin-inline: auto;
  line-height: 1.6;
}

/* 我的订单 */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 36rem;
  margin-inline: auto;
}
.order-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.order-card .meta {
  font-size: 12px;
  color: var(--fg-faint);
}
.order-card .name {
  font-size: 15px;
  font-weight: 500;
}
.order-card .code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14px;
  color: var(--demo-fg);
  word-break: break-all;
  background: var(--demo-bubble-bg);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 0.25rem;
}
.empty-hint {
  text-align: center;
  color: var(--fg-muted);
  font-size: 14px;
  padding: 2rem 0;
}

/* Footer — 手机 2 列（对齐 x.ai） */
.site-footer {
  border-top: 1px solid var(--section-line);
  padding: 2.5rem 0 2rem;
}
@media (min-width: 640px) {
  .site-footer { padding: 3rem 0 2rem; }
}
.footer-grid {
  display: grid;
  gap: 1.75rem 2rem;
  grid-template-columns: 1fr 1fr;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
}
.footer-grid h4 {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 0.75rem;
}
.footer-grid a, .footer-grid span {
  display: block;
  font-size: 13px;
  color: var(--fg-muted);
  padding: 0.25rem 0;
}
.footer-grid a:hover { color: var(--fg); }
.footer-bottom {
  margin-top: 2.5rem;
  font-size: 12px;
  color: var(--fg-faint);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s var(--ease);
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  width: 100%;
  max-width: 400px;
  max-height: min(90vh, 640px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
}
@media (min-width: 480px) {
  .modal { padding: 1.75rem; }
}
@media (max-width: 479px) {
  .code-row {
    flex-wrap: wrap;
  }
  .code-row .btn-send-code {
    flex: 1 1 100%;
  }
}

/* 安全区 + 超小屏顶栏 CTA 略收紧 */
@media (max-width: 380px) {
  .header-cta {
    padding-left: 12px;
    padding-right: 12px;
    font-size: 13px;
  }
  .site-header .inner { gap: 0.4rem; }
}
.modal h3 {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.modal .hint {
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 1.25rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0.9rem;
}
.field label {
  font-size: 13px;
  color: var(--fg-dim);
}
.field input {
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s var(--ease);
}
.field input:focus {
  border-color: var(--input-focus-border);
}
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.modal-switch {
  text-align: center;
  font-size: 13px;
  color: var(--fg-muted);
  margin-top: 0.75rem;
}
.modal-switch button {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.form-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 1.25em;
  margin-bottom: 0.5rem;
}

/* 扫码支付弹窗 */
.pay-modal { text-align: center; }
.pay-amount {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 1rem;
}
.pay-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 0 auto 1rem;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  width: fit-content;
  box-shadow: 0 0 0 1px var(--border);
}
.pay-qr-wrap img {
  display: block;
  width: 220px;
  height: 220px;
}
.pay-status {
  font-size: 14px;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
  min-height: 1.4em;
}
.pay-status.is-success { color: #16a34a; }
.pay-open-link { margin-bottom: 0.5rem; }
.pay-open-link[hidden] { display: none !important; }

/* 账户 / 管理后台 */
.account-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.account-email {
  font-size: 13px;
  color: var(--fg-muted);
}
.admin-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.admin-tab {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  box-shadow: 0 0 0 1px var(--border-strong);
  background: transparent;
}
.admin-tab.is-active {
  color: var(--btn-primary-fg);
  background: var(--btn-primary-bg);
  box-shadow: none;
}
.admin-stats {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
}
.admin-stats b { color: var(--fg); font-weight: 500; }
.admin-note {
  text-align: center;
  font-size: 12px;
  color: var(--fg-faint);
  max-width: 36rem;
  margin: 0 auto 1.25rem;
  line-height: 1.5;
}
.admin-settings-form {
  max-width: 32rem;
  margin: 0 auto;
  text-align: left;
}
.admin-settings-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--fg);
  font: inherit;
  resize: vertical;
}
.admin-settings-form select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--fg);
  font: inherit;
}
.field-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--fg);
  cursor: pointer;
}
.order-card .admin-sync {
  margin-top: 0.5rem;
  align-self: flex-start;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 13px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  max-width: 90vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.hidden { display: none !important; }

/* 语言切换：内容两段式过渡（离场 → 换文 → 入场）
   注意：默认不要写 transform，否则会破坏内部 position:sticky（能力区右栏） */
.content-wrap,
.site-footer {
  transition:
    opacity 0.42s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 1;
}

/* 离场：略上收 + 淡出，短促干净 */
.content-wrap.lang-leaving,
.site-footer.lang-leaving {
  opacity: 0;
  transform: translate3d(0, -8px, 0);
  transition-duration: 0.2s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.8, 0.4);
  pointer-events: none;
}

/* 入场预备：无动画瞬移到下方起点；去掉本 class 即自动淡入回默认态 */
.content-wrap.lang-enter-prep,
.site-footer.lang-enter-prep {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition: none !important;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .content-wrap,
  .site-footer,
  .content-wrap.lang-leaving,
  .site-footer.lang-leaving,
  .content-wrap.lang-enter-prep,
  .site-footer.lang-enter-prep {
    transition: opacity 0.12s linear !important;
    transform: none !important;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Hero 加载入场 - fade in + slide up */
.hero-fade-in {
  opacity: 0;
  transform: translateY(28px);
  animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-fade-in-delay-1 { animation-delay: 0.15s; }
.hero-fade-in-delay-2 { animation-delay: 0.4s; }
.hero-fade-in-delay-3 { animation-delay: 0.65s; }
.hero-fade-in-delay-4 { animation-delay: 0.9s; }
.hero-fade-in-delay-5 { animation-delay: 1.15s; }

/* 滚动触发展示 - reveal */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger 延迟用于列表/网格子元素 */
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.4s; }
.reveal-delay-6 { transition-delay: 0.48s; }
.reveal-delay-7 { transition-delay: 0.56s; }
.reveal-delay-8 { transition-delay: 0.64s; }

@media (prefers-reduced-motion: reduce) {
  .hero-fade-in,
  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
}
