/* ============================================================
   B.AI实验室 下载站样式
   设计基调：深色中性底 + 金色品牌强调 + 毛玻璃 + 紧凑信息密度
   间距体系：4 / 8 / 12 / 16 / 24 / 32 / 48 / 56 / 64
   ============================================================ */
:root {
  color-scheme: dark;
  --page: #131415;
  --surface: rgba(29, 32, 33, 0.66);
  --surface-solid: #1d2021;
  --surface-soft: #232627;
  --line: #323434;
  --line-strong: #3e4141;
  --text: #eeeef0;
  --muted: #a8aaaa;
  /* 浅灰小字提亮到 4.5:1 以上，满足 WCAG AA 对小号文字的对比度要求 */
  --faint: #8d9090;
  --gold: #d7b15e;
  --gold-strong: #efcf82;
  --gold-ink: #24201a;
  --green: #5fca93;
  --max: 1160px;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--page);
  /* 字体栈前置 system-ui：Win11 走 Segoe UI Variable，数字与英文更精致 */
  font-family: system-ui, "Segoe UI Variable Display", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* 装饰性负偏移（角线/阴影）不允许引发横向滚动；clip 不创建滚动容器，不影响 sticky */
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }

/* 页面氛围层：左上金色微光 + 右下冷灰微光 + 细噪点，营造纵深而非纯平底色 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(560px 420px at 14% -6%, rgba(215, 177, 94, 0.07), transparent 70%),
    radial-gradient(720px 520px at 96% 30%, rgba(120, 138, 155, 0.05), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.028'/%3E%3C/svg%3E");
}

/* ---------- 顶栏：悬浮毛玻璃卡片 ---------- */
.site-header {
  /* 高透明底 + 强模糊：滚动内容从栏后穿过时呈现悬浮玻璃感 */
  position: sticky;
  top: 10px;
  z-index: 10;
  width: min(calc(100% - 48px), var(--max));
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 12px auto 0;
  padding: 0 20px;
  border: 1px solid rgba(62, 65, 65, 0.85);
  border-radius: 12px;
  background: rgba(19, 20, 21, 0.42);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 700;
}
.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--gold-strong), var(--gold));
  box-shadow: 0 0 10px rgba(215, 177, 94, 0.5);
}
.site-header nav { display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: 14px; }
.site-header nav a:hover, .text-link:hover, .site-footer a:hover { color: var(--gold-strong); }
.nav-version {
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--gold-strong);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

main { width: min(calc(100% - 48px), var(--max)); margin: 0 auto; }

/* ---------- 首屏 ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(440px, 1.06fr);
  gap: clamp(32px, 5.5vw, 84px);
  align-items: center;
  padding: 52px 0 56px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--gold-strong);
  font-size: 12px;
  font-weight: 700;
  /* 英文大写小标签：字距略拉开展示精致感 */
  letter-spacing: 0.08em;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(95, 202, 147, 0.55);
}
h1, h2 { margin: 0; line-height: 1.12; }
h1 { font-size: clamp(40px, 4.6vw, 58px); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 27px; font-weight: 700; letter-spacing: -0.005em; }
.hero-summary { max-width: 470px; margin: 18px 0 30px; color: var(--muted); font-size: 19px; }

/* 下载区：平台芯片行 + 次级链接两行结构，版本与体积信息由下方元信息行承担 */
.download-line { display: flex; flex-direction: column; align-items: flex-start; gap: 13px; }
/* width:100% 撑满父级（父级为 column flex + flex-start，不撑满则子项均分不到全宽） */
.platform-row { width: 100%; display: flex; align-items: stretch; gap: 14px; flex-wrap: wrap; }

/* 平台芯片基础样式（先声明，金色激活态在后覆盖）；
   flex:1 三等分拉伸填满整行，与下方元信息行同宽对齐 */
.platform-chip {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(35, 38, 39, 0.42);
  font-size: 14px;
  font-weight: 600;
}
.platform-chip svg { flex: none; opacity: 0.9; }
.platform-chip.is-disabled {
  color: var(--faint);
  border-color: var(--line);
  background: rgba(29, 32, 33, 0.32);
  opacity: 0.62;
  cursor: not-allowed;
  user-select: none;
}

/* Windows 芯片 = 可用平台：金色实心高亮（声明在 platform-chip 之后以覆盖灰色基础样式） */
.download-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 244, 214, 0.28);
  border-radius: 10px;
  color: var(--gold-ink);
  background: linear-gradient(180deg, #e6c37b 0%, #d2ab55 100%);
  box-shadow: 0 10px 26px rgba(215, 177, 94, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.download-button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(215, 177, 94, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.download-button:active { transform: translateY(0); }
.download-button[aria-disabled="true"] { pointer-events: none; filter: saturate(0.5) brightness(0.85); }
.text-link { color: var(--muted); font-size: 14px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* 版本元信息：四列紧凑排布，等宽数字避免跳版 */
.release-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 34px 0 0;
}
.release-meta div { min-width: 0; border-left: 2px solid var(--line-strong); padding-left: 12px; }
.release-meta dt { color: var(--faint); font-size: 12px; }
.release-meta dd { margin: 2px 0 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.install-hint { margin: 22px 0 0; max-width: 520px; padding: 0; list-style: none; color: var(--faint); font-size: 13px; line-height: 1.65; display: grid; gap: 5px; }
.install-hint li { position: relative; padding-left: 16px; }
.install-hint li::before { content: ""; position: absolute; top: 0.62em; left: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }

/* 产品截图：金色光晕托底 + 角线 + 偏移阴影，深色界面不再沉入背景 */
.product-image { position: relative; margin: 0; }
.product-image::before {
  content: "";
  position: absolute;
  top: -18px;
  right: -18px;
  width: 42%;
  height: 40%;
  border-top: 1px solid rgba(215, 177, 94, 0.62);
  border-right: 1px solid rgba(215, 177, 94, 0.62);
  pointer-events: none;
}
.product-image::after {
  content: "";
  position: absolute;
  inset: -8% -6%;
  background: radial-gradient(closest-side, rgba(215, 177, 94, 0.10), transparent 72%);
  pointer-events: none;
}
.product-image img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  /* height:auto 覆盖 img 标签 height 属性的呈现提示，否则图片会被拉成 573x1517 的竖条 */
  height: auto;
  aspect-ratio: 2560 / 1517; /* 与 width/height 属性双保险，加载前即占位，消除布局跳动 */
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #0c0d0e;
  box-shadow: 18px 20px 0 rgba(18, 20, 20, 0.85);
}
/* ---------- 内容分区：左标题右内容的编辑式两栏 ---------- */
.content-section {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  gap: 48px;
  padding: 56px 0;
  border-top: 1px solid var(--line);
}
.section-heading .eyebrow { margin-bottom: 10px; }
.release-notes { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.release-notes li { position: relative; padding-left: 18px; color: var(--muted); font-size: 15px; }
.release-notes li::before {
  content: "";
  position: absolute;
  top: 0.66em;
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--gold);
}

/* 校验码区：完整哈希 + 一键复制 + certutil 用法提示 */
.checksum { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.checksum-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.checksum-label { color: var(--faint); }
.checksum code {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 12.5px;
}
.copy-button {
  min-height: 30px;
  padding: 3px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.copy-button:hover { color: var(--gold-strong); border-color: rgba(215, 177, 94, 0.55); }
.copy-button[data-state="done"] { color: var(--green); border-color: rgba(95, 202, 147, 0.55); }
.hash-hint { margin: 10px 0 0; color: var(--faint); font-size: 12.5px; }
.hash-hint code { color: var(--muted); font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; }

/* 更新历史：完整日志行 + 默认高度折叠 + 展开/收起 */
.history-body { position: relative; display: flex; flex-direction: column; }
.history-list { display: grid; margin: 0; padding: 0 6px; list-style: none; }
.history-list li { padding: 13px 10px; border-radius: 8px; transition: background 0.15s ease; }
.history-list li:hover { background: rgba(35, 38, 39, 0.6); }
.history-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.history-version {
  padding: 1px 9px;
  border: 1px solid rgba(215, 177, 94, 0.4);
  border-radius: 999px;
  color: var(--gold-strong);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.history-date { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.history-notes { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.history-notes li { position: relative; padding: 0 0 0 14px; border-radius: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.history-notes li:hover { background: none; }
.history-notes li::before { content: "·"; position: absolute; left: 2px; color: var(--faint); }

/* 折叠态：限制高度 + 底部渐隐遮罩提示还有更多内容 */
.history-list.is-collapsed { max-height: 280px; overflow: hidden; }
.history-body.is-collapsed::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 52px;
  height: 72px;
  background: linear-gradient(180deg, rgba(19, 20, 21, 0), var(--page) 88%);
  pointer-events: none;
}
/* 展开状态下列表很长，按钮吸在视口底部随滚动可见，任意位置可随时收起 */
.history-toggle {
  position: sticky;
  bottom: 16px;
  z-index: 2;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  min-height: 32px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  /* 悬浮时内容从按钮后滚过，需要半透明实底保持可读 */
  background: rgba(29, 32, 33, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.history-toggle:hover { color: var(--gold-strong); border-color: rgba(215, 177, 94, 0.55); }
.history-toggle.is-open svg { transform: rotate(180deg); }
.history-toggle svg { transition: transform 0.2s ease; }

.site-footer {
  width: min(calc(100% - 48px), var(--max));
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto;
  padding: 26px 0 30px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}

/* ---------- 焦点可见性：金色描边替代浏览器默认白圈 ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid rgba(215, 177, 94, 0.75);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 入场动效：首屏元素轻量淡入上移（一次性） ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise-in 0.5s cubic-bezier(0.22, 0.8, 0.36, 1) both; }
  .hero-copy > *:nth-child(2) { animation-delay: 0.06s; }
  .hero-copy > *:nth-child(3) { animation-delay: 0.12s; }
  .hero-copy > *:nth-child(4) { animation-delay: 0.18s; }
  .hero-copy > *:nth-child(5) { animation-delay: 0.24s; }
  .hero-copy > *:nth-child(6) { animation-delay: 0.30s; }
  .product-image { animation: rise-in 0.6s 0.15s cubic-bezier(0.22, 0.8, 0.36, 1) both; }
  @keyframes rise-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 56px 0 52px; }
  .product-image { max-width: 660px; }
  /* 窄屏收紧装饰角线的负偏移，避免顶出视口造成横向滚动 */
  .product-image::before { top: -10px; right: -8px; }
  .content-section { grid-template-columns: 1fr; gap: 22px; padding: 46px 0; }
  .release-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .history-date { display: none; }
}
@media (max-width: 600px) {
  .site-header, main, .site-footer { width: min(calc(100% - 32px), var(--max)); }
  .site-header { padding: 0 14px; }
  /* 锚点导航在一屏多的页面里价值有限，窄屏隐藏以免顶栏溢出 */
  .site-header nav { display: none; }
  /* 窄屏芯片回到内容自适应宽度，避免三等分挤压文字 */
  .platform-chip { flex: 0 0 auto; }
  h1 { font-size: 38px; }
  .hero-summary { font-size: 16.5px; }
  .release-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-image::after { inset: -4% -3%; }
  .product-image img { box-shadow: 10px 12px 0 rgba(18, 20, 20, 0.85); }
  .checksum-row { grid-template-columns: auto minmax(0, 1fr); }
  .copy-button { grid-column: 2; justify-self: start; }
}
