/* 行之 Marketing Site — Shared Base Styles
   设计语言：Corporate Navy —— 深海军蓝 + 中性灰，克制、商务、无装饰光效。
   规则：不使用霓虹光晕 / 玻璃拟态 / 渐变文字 / 星空动画，仅用实色 + 清晰边框 + 轻阴影。 */

/* ─── Dark Theme (default) — "Corporate Navy" ─── */
:root,
[data-theme="dark"] {
  /* 基础层 */
  --bg: #0b1220;
  --bg-elev: #111a2b;
  --surface: #111a2b;
  --card: #141d30;
  --card-solid: #141d30;

  /* 描边 */
  --border: rgba(148, 163, 184, 0.16);
  --border-light: rgba(148, 163, 184, 0.10);
  --border-strong: rgba(148, 163, 184, 0.30);
  --border-glow: rgba(59, 130, 246, 0.35);

  /* 文字 */
  --text: #e7ecf5;
  --text2: #94a3b8;
  /* 修正：原 #64748b 在 --card 上仅 3.54:1（小字不达 AA），
     提亮到 #7c8aa0 → card 4.81 / bg 5.35 / 面板 4.97，全部 ≥ 4.5:1。 */
  --text3: #7c8aa0;

  /* 主色（深海军蓝体系） */
  --primary: #7aa7f0;
  --primary-h: #a3c1f7;
  --primary-solid: #2563eb;
  --primary-solid-h: #1d4ed8;
  --on-primary: #ffffff;
  --accent: rgba(37, 99, 235, 0.18);
  --accent2: rgba(37, 99, 235, 0.10);

  /* 语义色 */
  --success: #34d399;
  --warn: #eab308;
  --error: #f87171;
  --info: #60a5fa;
  --purple: #a78bfa;
  --gold: #d9a441;
  --gold-h: #e8b95c;

  /* 形状与投影 */
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.40);
  --shadow-md: 0 4px 12px rgba(2, 6, 23, 0.45);
  --shadow-deep: 0 12px 32px rgba(2, 6, 23, 0.55);
  --shadow-card: 0 1px 2px rgba(2, 6, 23, 0.40);
  --glass-blur: none;
  --glass-blur-sm: none;
  --glow-top: none;
  --glow-gold: none;

  /* RGB 通道（供 rgba() 组合） */
  --primary-rgb: 122, 167, 240;
  --accent-rgb: 96, 165, 250;
  --gold-rgb: 217, 164, 65;
  --success-rgb: 52, 211, 153;
  --error-rgb: 248, 113, 113;
  --text-rgb: 231, 236, 245;

  --font: "Inter", "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --section-spacing: 88px;
}

/* ─── Light Theme — "Corporate Navy (Light)" ─── */
[data-theme="light"] {
  --bg: #f6f8fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --card: #ffffff;
  --card-solid: #ffffff;

  --border: #e3e8ef;
  --border-light: #eef1f6;
  --border-strong: #cbd5e1;
  --border-glow: rgba(30, 64, 175, 0.30);

  --text: #0f172a;
  --text2: #5b6779;
  /* 修正：原 #8794a7 在 --bg 上仅 2.89:1（低于 AA），
     加深到 #667080 → bg 4.71 / card 5.01 / 表头底 4.57，全部 ≥ 4.5:1。 */
  --text3: #667080;

  --primary: #1e40af;
  --primary-h: #1d4ed8;
  --primary-solid: #1e40af;
  --primary-solid-h: #1a3699;
  --on-primary: #ffffff;
  --accent: rgba(30, 64, 175, 0.07);
  --accent2: rgba(30, 64, 175, 0.05);

  --success: #15803d;
  --warn: #b45309;
  --error: #b91c1c;
  --info: #1d4ed8;
  --purple: #6d28d9;
  --gold: #a16207;
  --gold-h: #b45309;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-deep: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06);

  --primary-rgb: 30, 64, 175;
  --accent-rgb: 37, 99, 235;
  --gold-rgb: 161, 98, 7;
  --success-rgb: 21, 128, 61;
  --error-rgb: 185, 28, 28;
  --text-rgb: 15, 23, 42;
}

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}
/* 深色：极浅的纵向渐变，仅用于避免大面积纯色死板，不含任何光晕 */
[data-theme="dark"] body {
  background: linear-gradient(180deg, #0c1424 0%, #0b1220 55%, #0a101c 100%);
  background-attachment: fixed;
}
[data-theme="light"] body {
  background: var(--bg);
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary-h); }

img { max-width: 100%; height: auto; }

/* ─── Typography ─── */
h1, h2, h3, h4, h5, h6 { line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }

/* 商务风：不用渐变文字，改为实色主色 */
.text-gradient { color: var(--text); }
.text-gradient-gold { color: var(--gold); }
.text-center { text-align: center; }
.text-muted { color: var(--text2); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius); border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  font-family: var(--font); position: relative; line-height: 1.2;
}
.btn-primary {
  background: var(--primary-solid); color: var(--on-primary);
  border-color: var(--primary-solid); box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--primary-solid-h); border-color: var(--primary-solid-h);
  color: var(--on-primary); box-shadow: var(--shadow-md);
}
.btn-outline {
  background: transparent; border-color: var(--border-strong); color: var(--text);
}
.btn-outline:hover {
  border-color: var(--primary); color: var(--primary);
  background: var(--accent);
}
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ─── Theme Toggle Button ─── */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: transparent; color: var(--text2); cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.theme-toggle:hover {
  border-color: var(--primary); color: var(--primary); background: var(--accent);
}
.theme-toggle svg { width: 16px; height: 16px; display: block; }
.theme-toggle .sun-icon { display: block; }
.theme-toggle .moon-icon { display: none; }
[data-theme="light"] .theme-toggle .sun-icon { display: none; }
[data-theme="light"] .theme-toggle .moon-icon { display: block; }

/* ─── Cards ─── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-card);
  position: relative; overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.card-icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  background: var(--accent); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.card-icon svg { width: 22px; height: 22px; stroke: var(--primary); stroke-width: 1.8; fill: none; }
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--text2); }

/* ─── Grid ─── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ─── Section ─── */
.section { padding: var(--section-spacing) 24px; position: relative; z-index: 1; }
.section-title { font-size: 30px; margin-bottom: 12px; }
.section-subtitle { font-size: 16px; color: var(--text2); max-width: 620px; margin: 0 auto 48px; }
.container { max-width: 1200px; margin: 0 auto; }

/* Section divider */
.section-divider {
  height: 1px; max-width: 1200px; margin: 0 auto;
  background: var(--border); position: relative; z-index: 1;
}

/* ─── 装饰元素：商务风下全部禁用 ─── */
.orb,
.hero-glow,
.hero-glow.g1,
.hero-glow.g2,
.cursor-glow,
.hero-canvas { display: none !important; }

.gradient-border { position: relative; }
.gradient-border::before { display: none !important; }

/* ─── Scroll Reveal ─── */
.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.reveal.revealed { opacity: 1; transform: translateY(0); }
.reveal:nth-child(2) { transition-delay: 0.06s; }
.reveal:nth-child(3) { transition-delay: 0.12s; }
.reveal:nth-child(4) { transition-delay: 0.18s; }
.reveal:nth-child(5) { transition-delay: 0.24s; }
.reveal:nth-child(6) { transition-delay: 0.30s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none !important; transform: none !important; opacity: 1 !important; }
  .card, .btn { transition: none !important; transform: none !important; }
}

/* ─── Badges ─── */
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 6px; font-size: 12px; font-weight: 600;
  letter-spacing: 0.01em;
}
.badge-primary { background: var(--accent); color: var(--primary); border: 1px solid var(--border); }
.badge-success { background: rgba(var(--success-rgb), 0.12); color: var(--success); }
.badge-gold { background: rgba(var(--gold-rgb), 0.12); color: var(--gold); }

/* ─── Stats ─── */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center;
}
.stat-value {
  font-size: 34px; font-weight: 700; color: var(--text); margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.stat-label { font-size: 14px; color: var(--text2); }
@media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* ─── Terminal / Code Demo ─── */
.terminal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; max-width: 720px; margin: 0 auto;
}
.terminal-header {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  background: var(--bg-elev); border-bottom: 1px solid var(--border);
}
[data-theme="light"] .terminal-header { background: #f8fafc; }
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.red { background: #d4656b; }
.terminal-dot.yellow { background: #d1a03c; }
.terminal-dot.green { background: #5a9e6f; }
.terminal-title { font-size: 12px; color: var(--text2); margin-left: 8px; font-family: var(--font-mono); }
.terminal-body { padding: 20px; font-family: var(--font-mono); font-size: 13px; line-height: 1.8; }
.terminal-body .comment { color: var(--text3); }
.terminal-body .key { color: var(--info); }
.terminal-body .string { color: var(--success); }
.terminal-body .prompt { color: var(--primary); }
.terminal-body .cursor-blink { display: inline-block; width: 8px; height: 16px; background: var(--primary); animation: blink 1s step-end infinite; vertical-align: text-bottom; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ─── Testimonials ─── */
.testimonials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.testimonial-card { padding: 24px; }
.testimonial-card blockquote { font-size: 14px; color: var(--text2); line-height: 1.7; margin-bottom: 16px; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: var(--text2); flex-shrink: 0;
  background: var(--bg-elev); border: 1px solid var(--border);
}
[data-theme="light"] .testimonial-avatar { background: #f1f5f9; border-color: var(--border); }
.testimonial-name { font-size: 14px; font-weight: 600; }
.testimonial-role { font-size: 12px; color: var(--text2); }
@media (max-width: 768px) { .testimonials-grid { grid-template-columns: 1fr; } }

/* ─── Changelog ─── */
.changelog-list { max-width: 640px; margin: 0 auto; text-align: left; }
.changelog-item { display: flex; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.changelog-date { font-size: 13px; color: var(--text2); white-space: nowrap; min-width: 90px; font-family: var(--font-mono); }
.changelog-content h4 { font-size: 15px; margin-bottom: 4px; }
.changelog-content p { font-size: 13px; color: var(--text2); }

/* ─── Features CTA Link ─── */
.features-cta-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--primary); font-weight: 600; font-size: 14px;
  text-decoration: none; padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.features-cta-link:hover {
  background: var(--accent);
  border-color: var(--primary);
  color: var(--primary-h);
}
.features-cta-link svg {
  width: 18px; height: 18px; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.25s ease;
}
.features-cta-link:hover svg { transform: translateX(4px); }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 64px 16px; }
  .section-title { font-size: 24px; }
}
@media (max-width: 480px) {
  .btn-lg { padding: 12px 20px; font-size: 14px; }
  .stat-value { font-size: 26px; }
}

/* ─── Accessibility: skip-link ───
   焦点环（:focus-visible）统一由共享层 theme.css §5.1 提供，
   此处不再重复声明 —— 原实现在焦点态强加 border-radius:4px，
   会给圆角按钮/卡片叠上错误圆角，造成聚焦时形状跳变。 */
.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 1000;
  padding: 10px 18px;
  background: var(--primary-solid);
  color: var(--on-primary);
  font-size: 13px;
  font-weight: 600;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
  color: var(--on-primary);
}
