/* =========================================================
   AiTerm 下载页 · 纯净高端浅色系
   设计原则：白净底、留白大气、indigo 强调、超精细阴影、微交互质感
   ========================================================= */

:root {
  /* ---- 基底：纯净白，非冷灰 ---- */
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --bg-subtle: #f5f5f7;
  --bg-sunken: #f0f0f3;

  /* ---- 文字：深炭灰，非纯黑 ---- */
  --text: #1d1d1f;
  --text-secondary: #424245;
  --muted: #6e6e73;
  --muted-light: #86868b;

  /* ---- 线条：极淡 ---- */
  --line: rgba(0, 0, 0, 0.06);
  --line-strong: rgba(0, 0, 0, 0.10);
  --line-focus: rgba(79, 70, 229, 0.30);

  /* ---- 强调：高端 indigo ---- */
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-light: #818cf8;
  --accent-soft: rgba(79, 70, 229, 0.06);
  --accent-soft-hover: rgba(79, 70, 229, 0.10);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);

  /* ---- 语义色 ---- */
  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.08);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.08);

  /* ---- 阴影：超精细分层 ---- */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 24px 56px rgba(0, 0, 0, 0.10), 0 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-accent: 0 4px 14px rgba(79, 70, 229, 0.25);
  --shadow-accent-lg: 0 8px 28px rgba(79, 70, 229, 0.30);

  /* ---- 圆角 ---- */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-pill: 999px;

  /* ---- 过渡 ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-normal: 280ms var(--ease-out);
  --transition-slow: 500ms var(--ease-out);

  /* ---- 布局 ---- */
  --page-width: 1200px;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Cascadia Code", "Menlo", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
  /* 极淡的纵向渐变 + 微妙的 radial 质感 */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(99, 102, 241, 0.06), transparent),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 30%, var(--bg) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(79, 70, 229, 0.12);
  color: var(--accent-hover);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.20);
}

.site-shell {
  position: relative;
  width: min(calc(100% - 48px), var(--page-width));
  margin: 0 auto;
  padding: 20px 0 64px;
}

/* ==================== 顶栏：毛玻璃 ==================== */

.topbar {
  position: sticky;
  top: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.60);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}

/* 滚动时顶栏增强 */
.site-shell.scrolled .topbar {
  border-color: var(--line);
  box-shadow: var(--shadow-md);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  transition: transform var(--transition-normal);
}

.brand:hover .brand-logo {
  transform: scale(1.05) rotate(-2deg);
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.topnav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.topnav a {
  position: relative;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--text);
  background: var(--bg-subtle);
}

/* ==================== Hero ==================== */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 40px;
  align-items: center;
  padding: 64px 0 56px;
}

.hero-copy {
  padding: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2.4s var(--ease-out) infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text);
}

/* 渐变文字高亮 */
.hero h1 .highlight {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text {
  max-width: 52ch;
  margin: 20px 0 0;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-actions,
.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

/* ---- 按钮 ---- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 26px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all var(--transition-normal);
  user-select: none;
}

.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.button-primary {
  color: #ffffff;
  background: var(--accent);
  box-shadow: var(--shadow-accent);
}

.button-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent-lg);
}

.button-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-accent);
}

.button-secondary {
  color: var(--text);
  background: var(--bg-elevated);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}

.button-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--line-focus);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.button-secondary:active {
  transform: translateY(0);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
  transition: gap var(--transition-fast), color var(--transition-fast);
}

.text-link::after {
  content: "\2192";
  font-size: 1.1em;
  transition: transform var(--transition-fast);
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--accent-hover);
  gap: 6px;
}

.text-link:hover::after {
  transform: translateX(3px);
}

/* 禁用态 */
a.is-disabled,
.download-card.is-unavailable .button,
.download-card.is-unavailable .text-link {
  pointer-events: none;
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---- Hero 要点列表 ---- */

.hero-points {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.hero-points li {
  position: relative;
  padding-left: 28px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.hero-points li::after {
  content: "";
  position: absolute;
  left: 5px;
  top: calc(0.45em + 5px);
  width: 8px;
  height: 4px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* ---- Hero 视觉区 ---- */

.hero-visual {
  position: relative;
  padding: 16px;
  border-radius: var(--radius-2xl);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.hero-visual:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* 装饰性光晕 */
.hero-visual::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -30%;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.10), transparent 70%);
  pointer-events: none;
}

.hero-visual img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
  position: relative;
  z-index: 1;
}

/* ==================== 通用 Section ==================== */

.section {
  padding: 96px 0 0;
}

.section-heading {
  max-width: 760px;
}

.section-heading .eyebrow {
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

.section-text {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

/* ---- 网格布局 ---- */

.feature-grid,
.download-grid,
.steps-grid,
.faq-list {
  display: grid;
  gap: 20px;
  margin-top: 40px;
}

.feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ---- 特性卡片 ---- */

.feature-card {
  position: relative;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

/* 顶部渐变线，hover 时显现 */
.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-focus);
}

.feature-card:hover::before {
  opacity: 1;
}

/* 卡片图标 */
.feature-card .feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.4rem;
}

.feature-card h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.feature-card p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--muted);
}

/* ==================== 下载区 ==================== */

.section-download {
  position: relative;
}

.download-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.download-card {
  position: relative;
  padding: 32px;
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.download-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
}

/* 高亮卡片：平台匹配 */
.download-card.highlight {
  border-color: var(--accent);
  box-shadow: var(--shadow-accent), var(--shadow-sm);
}

.download-card.highlight::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.download-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.platform-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.download-card h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ---- Chip 标签 ---- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-light);
}

.chip-accent {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(79, 70, 229, 0.20);
}

.chip-accent::before {
  background: var(--accent);
}

.chip-success {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(5, 150, 105, 0.20);
}

.chip-success::before {
  background: var(--success);
}

/* ---- Meta 列表 ---- */

.meta-list {
  display: grid;
  gap: 0;
  margin: 24px 0 0;
  padding: 0;
}

.meta-list > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.meta-list > div:last-child {
  border-bottom: none;
}

.meta-list dt {
  color: var(--muted-light);
  font-weight: 500;
  font-size: 0.85rem;
}

.meta-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.5;
  word-break: break-word;
}

/* SHA256 等宽弱化 */
.meta-list dd[data-field$="-sha"] {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--muted);
  font-size: 0.85rem;
}

.download-desc {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.download-tip {
  margin: 20px 0 0;
  font-size: 0.88rem;
  color: var(--muted-light);
}

/* ==================== 步骤 ==================== */

.steps-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.step-card {
  position: relative;
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* 步骤连接线 */
.step-card:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 52px;
  right: -20px;
  width: 20px;
  height: 1px;
  background: var(--line-strong);
  z-index: 1;
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: var(--shadow-accent);
}

.step-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.step-card p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--muted);
}

/* ==================== FAQ ==================== */

.faq-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.faq-item {
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.faq-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.faq-item h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.faq-item p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--muted);
}

/* ==================== 页脚 ==================== */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 96px;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.footer strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.footer span {
  font-size: 0.88rem;
  color: var(--muted);
}

.footer a {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer a:hover {
  color: var(--accent-hover);
}

/* ==================== 滚动渐入动画 ==================== */

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 逐项延迟 */
.fade-in:nth-child(1) { transition-delay: 0ms; }
.fade-in:nth-child(2) { transition-delay: 80ms; }
.fade-in:nth-child(3) { transition-delay: 160ms; }
.fade-in:nth-child(4) { transition-delay: 240ms; }

/* ==================== 响应式 ==================== */

@media (max-width: 1080px) {
  .feature-grid,
  .faq-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 48px;
  }

  .hero-visual {
    max-width: 560px;
  }
}

@media (max-width: 820px) {
  .site-shell {
    width: min(calc(100% - 32px), var(--page-width));
    padding-top: 12px;
  }

  .download-grid,
  .steps-grid {
    grid-template-columns: 1fr;
  }

  .download-card-head,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .topnav {
    gap: 2px;
  }

  .topnav a {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .download-card,
  .step-card,
  .faq-item {
    padding: 24px 20px;
  }

  .section {
    padding-top: 64px;
  }

  .step-card:not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 520px) {
  .hero h1 {
    font-size: 1.6rem;
  }

  .button {
    width: 100%;
  }

  .meta-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .footer {
    padding: 20px;
  }
}
