/* ============================================================
   金数通官网设计 Token v3 (2026-09-12)
   基准: Linear / Vercel Geist / Stripe 质感 — 纯净锌灰基底、克制光效、
   展示字体大标题、1px 高光描边、expo-out 动效
   原则: 中性灰阶基底 + 唯一品牌渐变强调 (白名单: logo/标题强调词/主CTA/关键数字/hover描边)
   v3 全部类名与变量向后兼容 v2.2.1, 值级升级
   ============================================================ */
@import url('https://fonts.loli.net/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* 基底 (zinc-950 系, 更冷更净) */
  --bg-base:        #09090B;
  --bg-card:        #101014;
  --bg-elevated:    #16171C;
  --border:         rgba(255, 255, 255, .08);
  --border-strong:  rgba(255, 255, 255, .16);

  /* 文字三级 */
  --text-primary:   #F4F5F8;
  --text-secondary: #9BA1AE;
  --text-muted:     #5D6470;

  /* 品牌渐变 (VI 新版: 唯一彩色强调来源) */
  --brand-cyan:     #0AFFFF;
  --brand-magenta:  #D000E2;
  --brand-blue:     #0874B5;
  --brand-gradient: linear-gradient(90deg, #0AFFFF 0%, #D000E2 100%);
  --brand-glow:     0 0 28px rgba(10, 255, 255, .14);

  /* 功能色 (仅状态/反馈) */
  --ok:   #34D399;
  --warn: #F5B84C;
  --err:  #F87171;

  /* 字体 */
  --font-sans:    "Inter", "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Space Grotesk", "Inter", "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", ui-monospace, Consolas, "Courier New", monospace;

  /* 布局 */
  --radius-card: 16px;
  --content-max: 1200px;
  --section-gap: 104px;

  /* 动效曲线 (expo-out, Linear 质感) */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 全局基线 ---------- */
body {
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* 兜底背景: 原来是靠各页内联 body 背景, 漏设的页在深色站里会闪白 */
  background-color: var(--bg-base);
  color: var(--text-primary);
}

::selection {
  background: rgba(10, 255, 255, .85);
  color: #09090B;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .14) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .14);
  border-radius: 9999px;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .22); }

:focus-visible {
  outline: 2px solid rgba(10, 255, 255, .6);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 排版 ---------- */
h1, h2, h3, .jst-display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
h1 { letter-spacing: -0.035em; line-height: 1.08; }
h2 { line-height: 1.15; }

.jst-num, .font-mono, code, pre {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- 区块 ---------- */
.jst-section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: calc(var(--section-gap) / 2) 24px;
}

/* 顶部光晕 (aurora): 主视觉区块的质感底 — 挂在 body 或 section 上 */
.jst-aurora {
  position: relative;
}
.jst-aurora::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(720px 340px at 50% 0%, rgba(10, 255, 255, .07), transparent 62%),
    radial-gradient(900px 420px at 82% 12%, rgba(208, 0, 226, .05), transparent 60%);
}

/* ---------- 卡片: 顶部内高光 + 渐变更亮 + 克制浮起 ---------- */
.jst-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .028), rgba(255, 255, 255, 0) 42%),
    var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), 0 1px 2px rgba(0, 0, 0, .3);
  transition: border-color .3s var(--ease-out), transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.jst-card:hover {
  border-color: transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 42%) padding-box,
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    var(--brand-gradient) border-box;
  border: 1px solid transparent;
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 44px -18px rgba(0, 0, 0, .65), var(--brand-glow);
}

/* ---------- 主按钮: 渐变实底 + 内高光 ---------- */
.jst-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .72rem 1.7rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .01em;
  color: #09090B;
  background: var(--brand-gradient);
  border: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 1px 2px rgba(0, 0, 0, .4);
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow .25s var(--ease-out), transform .25s var(--ease-out), filter .25s var(--ease-out);
}
.jst-btn-primary:hover {
  filter: saturate(1.15) brightness(1.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), 0 6px 28px -6px rgba(10, 255, 255, .35), 0 6px 28px -8px rgba(208, 0, 226, .3);
  transform: translateY(-1px);
  color: #09090B;
}

/* ---------- 次按钮: 中性描边, hover 渐现品牌描边 (Linear 式克制) ---------- */
.jst-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .72rem 1.7rem;
  border-radius: 9999px;
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .01em;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, .02);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .25s var(--ease-out), background .25s var(--ease-out), transform .25s var(--ease-out);
}
.jst-btn-ghost:hover {
  border-color: transparent;
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    var(--brand-gradient) border-box;
  transform: translateY(-1px);
  color: #fff;
}

/* ---------- 渐变文字 (标题强调词) ---------- */
.jst-grad-text {
  background-image: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 终端风标签 (mono 小字标注) ---------- */
.jst-tag {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ---------- 滚动叙事 (ui-spec §5-1): 配合 IntersectionObserver ---------- */
.jst-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .55s var(--ease-out), transform .55s var(--ease-out);
}
.jst-reveal.jst-revealed {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .jst-reveal { transition: none; opacity: 1; transform: none; }
  /* 全局兜底: 尊重系统「减弱动态效果」设置, 收敛所有过渡/动画/平滑滚动。
     原先只覆盖 .jst-reveal, 轮播/呼吸灯/粒子/卡片 hover 仍在动。 */
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto !important; }
}

/* ---------- 空态卡 (看板暂无数据等) ---------- */
.jst-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .375rem;
}
.jst-empty-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .6rem;
  border-radius: 9999px;
  font-size: .72rem;
  font-weight: 500;
  color: var(--warn);
  border: 1px solid rgba(245, 184, 76, .35);
  background: rgba(245, 184, 76, .08);
}

/* ---------- 导航悬停下拉 (数字员工自导航) ---------- */
.jst-dd { position: relative; }
.jst-dd > a { display: inline-flex; align-items: center; gap: .3rem; }
.jst-dd > a::after {
  content: '';
  width: 5px; height: 5px;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: .6;
  transition: transform .2s var(--ease-out);
}
.jst-dd:hover > a::after { transform: rotate(45deg) translateY(0); }
.jst-dd-menu {
  position: absolute;
  top: 100%; left: 50%;
  transform: translate(-50%, 10px);
  opacity: 0; visibility: hidden;
  transition: opacity .22s var(--ease-out), transform .22s var(--ease-out), visibility .22s;
  background: rgba(22, 23, 28, .92);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .45rem;
  min-width: 190px;
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255,255,255,.05);
  z-index: 60;
}
.jst-dd.open .jst-dd-menu {
  opacity: 1; visibility: visible;
  transform: translate(-50%, 2px);
}
.jst-dd-menu a {
  display: block;
  padding: .5rem .9rem;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: .875rem;
  white-space: nowrap;
  text-decoration: none;
}
.jst-dd-menu a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.jst-dd-menu a.jst-dd-active { color: var(--brand-cyan); }

/* ---------- 页面 hero 视觉标识（区分度） ---------- */
.hv { position: absolute; right: 1rem; bottom: .5rem; width: 300px; opacity: .9; pointer-events: none; }
@media (max-width: 1279px) { .hv { width: 240px; opacity: .65; } }
@media (max-width: 767px) { .hv { display: none; } }

/* ---------- 全站导航三栏栅格：菜单组恒定居中 ----------
   原先 nav 用 flex + justify-between，中间菜单组的水平位置由左右两组宽度决定：
   任何页面在右侧多放一个元素（如 AI 子页的登录态 #authNavSlot），菜单组就被挤偏
   （实测偏 151px；即使塞进右侧组内也仍偏 31px）。
   改成 1fr auto 1fr 栅格后，中间组永远居中，左右两侧内容再宽也不影响——
   这是「全站导航位置一致」的结构性保证，各页无需改动。 */
nav.flex.items-center.justify-between {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
nav.flex.items-center.justify-between > *:first-child { justify-self: start; }
nav.flex.items-center.justify-between > *:last-child { justify-self: end; }

/* ---------- 导航当前页高亮 + 「来时的路」胶囊按钮 ----------
   补全：8 个页面（digital-employees / pipeline / addons / raisingShrimp /
   workshop-*）只引用了类名却没有定义，导致当前页无高亮、按钮退化成裸链接。 */
.nav-link-active { color: #fff !important; font-weight: 500; position: relative; }
.nav-link-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 2px;
  background: var(--brand-gradient);
  border-radius: 1px;
}
/* 全站统一：所有选中态导航项（含下拉入口）下划线一律用品牌彩色渐变，
   !important 压掉各页 <style> 里的本地蓝色定义 */
nav .nav-link-active::after { background: var(--brand-gradient) !important; }
/* 下拉入口 ::after 被箭头占用：选中态隐藏箭头，用背景图补同款渐变下划线 */
.jst-dd > a.nav-link-active { padding-bottom: .3rem !important; }
.jst-dd > a.nav-link-active::after { display: none; }
.jst-dd > a.nav-link-active {
  background-image: var(--brand-gradient) !important;
  background-size: 70% 2px;
  background-position: center bottom;
  background-repeat: no-repeat;
}
.origin-ghost-btn {
  padding: .5rem 1.25rem;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  color: #F2F4F8;
  white-space: nowrap;
  border: 1px solid transparent;
  background: linear-gradient(var(--bg-elevated), var(--bg-elevated)) padding-box, var(--brand-gradient) border-box;
  transition: box-shadow .2s ease, transform .2s ease, color .2s ease;
  cursor: pointer;
  text-decoration: none;
}
.origin-ghost-btn:hover { box-shadow: 0 0 24px rgba(10, 255, 255, .25); color: #fff; transform: translateY(-1px); }

/* ---------- 移动端菜单（全站约定：固定定位默认隐藏） ---------- */
.mobile-menu { position: fixed; inset: 0; background: rgba(10,10,11,.96); backdrop-filter: blur(12px); z-index: 100; display: none; flex-direction: column; padding: 1.5rem; }
.mobile-menu.active { display: flex; }
.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.mobile-menu-title { font-size: 1.2rem; font-weight: 600; color: #F0F0F5; }
.mobile-menu-close { background: none; border: none; color: #9CA3AF; font-size: 2.5rem; line-height: 1; cursor: pointer; }
.mobile-nav-links { display: flex; flex-direction: column; gap: 1.25rem; }
.mobile-nav-links a { color: #D1D5DB; text-decoration: none; font-size: 1.05rem; padding: .5rem 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.mobile-nav-links a.active { color: #fff; font-weight: 600; }

/* ---------- 输入控件聚焦可见性 ----------
   hermes_agent / openclaw_agent 的输入框与按钮内联写了 outline:none,
   键盘用户完全看不到焦点位置。用 :focus-visible 补回描边（鼠标点击不触发）。 */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand-cyan);
  outline-offset: 2px;
  border-radius: 4px;
}
