/* ═══════════════════════════════════════════════════════════
   Astrion 官网主页 — 深空主题
   原则：无 glow、无圆角套娃、无大面积纯黑、克制用色
   ═══════════════════════════════════════════════════════════ */

:root {
  /* 深空底色：带蓝意的暗色，不用纯黑 */
  --bg-0: #0c1120;            /* 页面最深底 */
  --bg-1: #111830;            /* 天顶微亮 */
  --bg-panel: #151c31;        /* 实体面板（不透明） */
  --text-1: #eef1f8;
  --text-2: #a7b0c4;
  --text-3: #6b7488;
  --line: rgba(168, 180, 210, 0.14);
  --line-strong: rgba(168, 180, 210, 0.24);
  /* 唯一强调色：星空冰蓝，克制使用（eyebrow/hover/active 态） */
  --accent: #a9c2f0;
  --accent-strong: #c1d4f6;
  --accent-ink: #0c1120;
  /* CTA 用星白实底 */
  --cta: #eef1f8;
  --cta-hover: #dde3f0;
  /* 迷你示意用的状态色（低饱和） */
  --ok: #7ba889;
  --del: #b0766a;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Noto Sans SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas,
    "Liberation Mono", monospace;

  --page-max: 1120px;
  --topbar-h: 60px;
}

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

html {
  scroll-behavior: smooth;
  /* 橡皮筋过度滚动时露出的底色：与页面渐变同源，杜绝露白 */
  background: linear-gradient(180deg, #111830 0%, #0c1120 34rem, #0c1120 100%);
  background-color: #0c1120;
}

body {
  font-family: var(--font-sans);
  color: var(--text-1);
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 34rem, var(--bg-0) 100%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(169, 194, 240, 0.3); }

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

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.1em 0.42em;
  background: rgba(168, 180, 210, 0.12);
  border-radius: 5px;
}

/* ───────── 星空画布：fixed 全页背景，内容浮在上 ───────── */

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.topbar, main, .footer { position: relative; z-index: 1; }

/* ───────── 通用 ───────── */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-head {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 32px;
}

.section-title {
  margin-top: 14px;
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.section-sub {
  margin-top: 12px;
  max-width: 560px;
  color: var(--text-2);
  font-size: 15px;
}

/* ───────── 按钮：固定高度，状态切换不改尺寸 ───────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 550;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  white-space: nowrap;
}

.btn-sm { height: 36px; padding: 0 16px; font-size: 13.5px; }

.btn-primary { background: var(--cta); color: var(--accent-ink); }
.btn-primary:hover { background: var(--cta-hover); }

.btn-ghost { border-color: var(--line-strong); color: var(--text-1); }
.btn-ghost:hover { border-color: var(--text-2); background: rgba(168, 180, 210, 0.06); }

/* ───────── 顶栏 ───────── */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 50;
  /* 初始透明（浮在 hero 上），滚动后实底 */
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.topbar.scrolled {
  background: var(--bg-0);
  border-bottom-color: var(--line);
}

.topbar-inner {
  max-width: var(--page-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { width: 26px; height: 26px; color: var(--text-1); display: inline-flex; }
.brand-logo .astrion-avatar { width: 100%; height: 100%; }
.brand-logo-sm { width: 20px; height: 20px; }
.brand-name { font-size: 16px; font-weight: 620; letter-spacing: 0.01em; }

.topnav { display: flex; align-items: center; gap: 26px; }

.topnav-link {
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.15s ease;
}
.topnav-link:hover { color: var(--text-1); }

/* ───────── 总览 ───────── */

.hero {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 96px) 32px 110px;
}

.hero-title-row { margin-top: 22px; }

.hero-title {
  font-size: clamp(72px, 12.5vw, 156px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  background: linear-gradient(160deg, #f4f6fc 30%, #b9c3da 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 六边形眼睛跟随标题字号：
   盒高 1.025em → 六边形实高 ≈0.71em（= 大写字高），
   vertical-align 补偿 viewBox 底部余白，与标题 baseline 对齐 */
.hero-mascot {
  display: inline-block;
  width: 1.025em;
  height: 1.025em;
  margin-left: 0.16em;
  vertical-align: -0.157em;
  color: #eef1f8;
}
.hero-mascot .astrion-avatar { width: 100%; height: 100%; }

.hero-sub {
  margin-top: 28px;
  max-width: 520px;
  font-size: 17px;
  color: var(--text-2);
}

.hero-actions { margin-top: 34px; display: flex; gap: 14px; }

/* git clone 单行代码块（hero 区，查看文档按钮上方）：整块可点复制，右侧复制/对勾图标切换。
   实体面板底（--bg-panel 不透明），无光晕；code 必须清掉全局行内代码样式（背景/padding/圆角），
   否则外框里又套一层底色块（圆角套娃，实测实踩）。 */
.hero-clone {
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 14px;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.hero-clone:hover { border-color: var(--text-2); }
.hero-clone code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-1);
  white-space: nowrap;
  background: none;
  padding: 0;
  border-radius: 0;
}
.hero-clone-icon {
  display: inline-flex;
  position: relative;
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--text-3);
  transition: color 0.15s ease;
}
/* 复制/对勾叠放同一位移，用 opacity 交叉淡入淡出（原 display 瞬切已废弃） */
.hero-clone-icon svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.18s ease;
}
.hero-clone:hover .hero-clone-icon { color: var(--text-2); }
.hero-clone .icon-check, .contact-copy .icon-check { opacity: 0; }
.hero-clone.copied .icon-copy, .contact-copy.copied .icon-copy { opacity: 0; }
.hero-clone.copied .icon-check, .contact-copy.copied .icon-check { opacity: 1; }
.hero-clone.copied .hero-clone-icon { color: var(--accent); }
/* 命令与复制图标之间的竖分隔线（contact-mailbox 同款，两处共用） */
.hero-clone-sep, .contact-mail-sep {
  width: 1px;
  height: 20px;
  align-self: center;
  background: var(--line);
  flex: none;
}

.hero-platforms {
  margin-top: 44px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-3);
}

.platform em { font-style: normal; color: var(--text-3); opacity: 0.75; }
.platform-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); opacity: 0.5; }

/* ───────── 演示区 ───────── */

.demo { padding: 60px 0 40px; scroll-margin-top: 40px; }

.demo-frame-wrap {
  max-width: calc(var(--page-max) + 2px);
  margin: 34px auto 0;
  padding: 0 32px;
}

.demo-frame {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-panel);
}

.demo-frame iframe {
  display: block;
  border: 0;
  width: 1400px;   /* 逻辑尺寸：永不触发窄屏断点 */
  height: 860px;
  transform-origin: top left;
  /* 子文档整页切换（新建对话进 /new）时浏览器会把 iframe 区域画成不透明白（与子文档 CSS 无关），
     唯一可靠对策是导航期间隐藏 iframe 露出 demo-frame 深色底：初始隐藏，子文档主题真正落地
     （data-theme 出现）且首帧绘制后 postMessage 加 .demo-frame-ready 瞬时显示（demo.html / site.js）。
     不做 opacity 过渡：ready 时机已保证显示即深色内容帧，渐变只会把异常帧「有动画地」播出来。 */
  background: #1a1a1a;
  opacity: 0;
}
.demo-frame iframe.demo-frame-ready {
  opacity: 1;
}

.demo-note {
  max-width: var(--page-max);
  margin: 14px auto 0;
  padding: 0 32px;
  font-size: 13px;
  color: var(--text-3);
}

/* ───────── 特色功能 ───────── */

.features { padding: 110px 0 30px; scroll-margin-top: 20px; }

.feature-list {
  max-width: var(--page-max);
  margin: 26px auto 0;
  padding: 0 32px;
}

.feature-row {
  display: block;
  padding: 54px 0;
  border-top: 1px solid var(--line);
}
.feature-row:last-child { border-bottom: 1px solid var(--line); }

/* 带动画的行：左文右动画。动画列给足 540（03/04 舞台逻辑宽）→ 舞台 curScale=1 不缩放，
   三个动画的智能体渲染尺寸一致 */
.feature-row--anim {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 540px);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.feature-anim {
  position: relative;
  height: 388px;
}
/* 动画内部元素样式在 anim-embed.css（与 anim-demo 共用类名， token 取自主题） */

.feature-index {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-3);
  letter-spacing: 0.14em;
}

.feature-title {
  margin-top: 10px;
  font-size: clamp(21px, 2.6vw, 27px);
  font-weight: 640;
  letter-spacing: -0.01em;
}

.feature-desc {
  margin-top: 12px;
  max-width: 560px;
  font-size: 15px;
  color: var(--text-2);
}

/* —— 迷你 UI 示意：纯 CSS，无装饰性元素 —— */

.feature-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

/* 01 三档分段控件 */
.mini-modeswitch {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  overflow: hidden;
  background: var(--bg-panel);
}
.mini-mode {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  font-size: 14px;
  color: var(--text-2);
  border-left: 1px solid var(--line);
}
.mini-mode:first-child { border-left: 0; }
.mini-mode.is-active { background: rgba(169, 194, 240, 0.13); color: var(--accent-strong); }

/* 02 权限开关组 */
.mini-perms {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--bg-panel);
  padding: 6px 0;
  min-width: 260px;
}
.mini-perm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 16px;
}
.mini-perm + .mini-perm { border-top: 1px solid var(--line); }
.mini-perm-label { font-size: 14px; color: var(--text-1); }
.mini-switch {
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: rgba(168, 180, 210, 0.22);
  position: relative;
  transition: background-color 0.16s ease;
}
.mini-switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-1);
  transition: transform 0.16s ease;
}
.mini-switch.is-on { background: var(--accent); }
.mini-switch.is-on::after { transform: translateX(14px); background: #0c1120; }

/* 03 diff 片段 */
.mini-diff {
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--bg-panel);
  font-family: var(--font-mono);
  font-size: 12.5px;
  min-width: 300px;
  overflow: hidden;
}
.mini-diff-file {
  padding: 9px 14px;
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
}
.mini-diff-line { padding: 5px 14px; white-space: nowrap; }
.mini-diff-line.is-add { color: var(--ok); background: rgba(123, 168, 137, 0.08); }
.mini-diff-line.is-del { color: var(--del); background: rgba(176, 118, 106, 0.07); }
.mini-diff-stat {
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
}

/* 04 检查点时间线 */
.mini-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--bg-panel);
  padding: 8px 0;
  min-width: 260px;
}
.mini-tl-node {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 16px;
  position: relative;
}
.mini-tl-node + .mini-tl-node::before {
  content: "";
  position: absolute;
  left: 21px;
  top: -6px;
  width: 1px;
  height: 12px;
  background: var(--line-strong);
}
.mini-tl-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid var(--text-3);
  flex: none;
}
.mini-tl-node.is-current .mini-tl-dot { border-color: var(--accent); background: var(--accent); }
.mini-tl-label { font-size: 14px; color: var(--text-1); }
.mini-tl-node.is-current .mini-tl-label { color: var(--accent-strong); }

/* ───────── FAQ ───────── */

.faq { padding: 110px 0 60px; scroll-margin-top: 20px; }

.faq-list {
  max-width: 760px;
  margin: 30px auto 0;
  padding: 0 32px;
}

.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 62px;
  padding: 12px 2px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 550;
  list-style: none;
  transition: color 0.15s ease;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q:hover { color: var(--accent-strong); }

.faq-icon {
  flex: none;
  width: 14px; height: 14px;
  position: relative;
}
.faq-icon::before, .faq-icon::after {
  content: "";
  position: absolute;
  background: var(--text-2);
  transition: transform 0.2s ease;
}
.faq-icon::before { left: 0; top: 6px; width: 14px; height: 1.5px; }
.faq-icon::after { left: 6.25px; top: 0; width: 1.5px; height: 14px; }
/* 收起动画期间 open 仍在（内容要可见才能播高度动画），用 .closing 让图标在点击瞬间即变回 + */
.faq-item[open]:not(.closing) .faq-icon::after { transform: scaleY(0); }

.faq-a {
  overflow: hidden;
  /* JS 做高度动画；无 JS 时 details 原生展开也完整可读 */
}
.faq-a p {
  padding: 2px 2px 22px;
  max-width: 640px;
  color: var(--text-2);
  font-size: 15px;
}

/* ───────── 联系我 ─────────
   单外框双分区：左侧邮箱（mailto 直跳写信）+ 竖分隔线 + 右侧复制图标按钮
   （复用 hero-clone 的图标切换类名结构）。实体面板底、无光晕。 */

.contact { padding: 50px 0 40px; scroll-margin-top: 20px; }

.contact-sub {
  margin-top: 14px;
  font-size: 15px;
  color: var(--text-2);
}

.contact-row {
  max-width: var(--page-max);
  margin: 26px auto 0;
  padding: 0 32px;
  display: flex;
}

.contact-mailbox {
  display: inline-flex;
  align-items: stretch;
  height: 46px;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  transition: border-color 0.15s ease;
}
.contact-mailbox:hover { border-color: var(--text-2); }

.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  text-decoration: none;
}
.contact-mail svg { width: 16px; height: 16px; color: var(--text-3); flex: none; transition: color 0.15s ease; }
.contact-mail:hover svg { color: var(--text-2); }
.contact-mail-addr {
  font-family: var(--font-mono);
  font-size: 14.5px;
  color: var(--text-1);
}

.contact-copy {
  width: 46px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  cursor: pointer;
}
.contact-copy:hover .hero-clone-icon { color: var(--text-2); }
.contact-copy.copied .hero-clone-icon { color: var(--accent); }

/* ───────── 底栏 ───────── */

.footer {
  border-top: 1px solid var(--line);
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 26px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 580;
  color: var(--text-2);
}

.footer-links { display: flex; gap: 24px; align-items: center; }
.footer-links a { font-size: 13.5px; color: var(--text-3); transition: color 0.15s ease; }
.footer-links a:hover { color: var(--text-1); }
/* 语言切换：视觉与 footer 链接一致（button 元素去默认样式） */
.lang-toggle {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-3);
  transition: color 0.15s ease;
}
.lang-toggle:hover { color: var(--text-1); }

/* ───────── 响应式 ───────── */

@media (max-width: 860px) {
  .feature-row--anim { grid-template-columns: minmax(0, 1fr); }
  .feature-anim { height: 340px; }
  .topnav-link { display: none; }
  .hero { padding-top: calc(var(--topbar-h) + 64px); padding-bottom: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .topbar, .faq-q { transition: none; }
}
