/* ============================================================
   汇芯智算官网 — Apple/Synopsys 式明亮科技感
   纯净白底分区 + 活力蓝渐变 + 大字号标题 + 胶囊按钮
   无装饰图标, 无纹理噪点, 内容即设计
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;          /* Apple 灰分区 */
  --panel: #ffffff;
  --line: #e8e8ed;
  --ink: #1d1d1f;             /* Apple 近黑 */
  --ink-dim: #6e6e73;         /* Apple 灰 */
  --ink-faint: #86868b;
  --blue: #0071e3;            /* Apple 蓝 */
  --blue-deep: #0058a3;
  --blue-soft: rgba(0, 113, 227, 0.08);
  --grad: linear-gradient(92deg, #0071e3 0%, #00a3e0 55%, #00c7be 100%);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.04);
  --shadow-lift: 0 4px 16px rgba(0, 0, 0, 0.06), 0 16px 44px rgba(0, 0, 0, 0.07);
  --radius: 18px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --maxw: 1280px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--blue); color: #fff; }

/* height:auto 必不可少: 否则 HTML height 属性作为表现性提示钉死高度,
   宽度被 max-width 压缩时图片会被纵向拉伸失真 */
img { max-width: 100%; height: auto; display: block; }

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

/* ---------- 通用布局 ---------- */

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

section { padding: 96px 0; position: relative; }

/* 灰白分区交替(Apple 风格): 自动给偶数序 section 上灰底, hero/cta 保持自定义背景 */
section.alt,
main > section:nth-of-type(even):not(.hero):not(.cta-band):not(.page-hero) { background: var(--bg-alt); }

h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin-bottom: 18px;
  color: var(--ink);
}

.section-lead { color: var(--ink-dim); max-width: 660px; font-size: 17.5px; }

/* 渐变强调词 */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- 顶部导航 ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; color: var(--ink); }
.brand img { height: 32px; width: auto; }
.brand .x { color: var(--blue); font-family: var(--mono); margin: 0 1px; }

.nav-links { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.nav-links a {
  font-size: 14.5px;
  color: var(--ink-dim);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--ink); }

.nav-links .lang {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--blue);
  border: 1px solid rgba(0, 113, 227, 0.3);
  border-radius: 980px;
  padding: 3px 12px;
  background: none;
  cursor: pointer;
}
.nav-links .lang:hover { background: var(--blue-soft); }

/* .nav-links .btn-login 提高优先级, 压过 .nav-links a 的通用链接色 */
.nav-links .btn-login {
  font-size: 14.5px;
  color: #fff;
  background: var(--blue);
  border-radius: 980px;
  padding: 8px 20px;
  font-weight: 500;
  transition: background 0.2s, transform 0.15s;
}
.nav-links .btn-login:hover { background: var(--blue-deep); transform: translateY(-1px); }

.nav-toggle { display: none; }

/* ---------- Hero(首页/平台页) ---------- */

.hero {
  padding: 176px 0 88px;
  background:
    radial-gradient(900px 420px at 82% -6%, rgba(0, 113, 227, 0.10), transparent 65%),
    radial-gradient(600px 320px at 8% 12%, rgba(0, 199, 190, 0.07), transparent 60%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.68fr) minmax(0, 1.32fr);
  gap: 44px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(36px, 5.2vw, 60px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.02em;
  margin: 18px 0 24px;
}

.hero h1 .accent {
  position: relative;
  white-space: nowrap;
}

.hero p.lead { color: var(--ink-dim); font-size: 18px; max-width: 520px; }

.hero-cta { display: flex; align-items: center; gap: 16px; margin-top: 36px; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 500;
  font-size: 16px;
  border-radius: 980px;
  padding: 13px 28px;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: var(--blue-deep); transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  border: 1px solid rgba(0, 113, 227, 0.35);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 980px;
  padding: 12px 24px;
  font-size: 15.5px;
  transition: background 0.2s;
}
.btn-ghost:hover { background: var(--blue-soft); }

.hero-stats { display: flex; gap: 44px; margin-top: 52px; }

/* hero 统计数字用纯色蓝, 降低与渐变标题/按钮同屏的渐变密度 */
.stat .num {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--blue);
  line-height: 1.15;
}
.stat .lbl { font-size: 13.5px; color: var(--ink-dim); margin-top: 4px; }

/* hero 右侧产品窗口 */
.hero-shot {
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-lift);
  transform: perspective(1600px) rotateY(-4deg) rotateX(1deg);
  overflow: hidden;
}

.hero-shot .chrome {
  display: flex;
  gap: 6px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}
.hero-shot .chrome i {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #d6d6dc;
}
.hero-shot .chrome i:nth-child(1) { background: #f0b3ad; }
.hero-shot .chrome i:nth-child(2) { background: #f3d8a4; }
.hero-shot .chrome i:nth-child(3) { background: #b4e0cd; }
.hero-shot img { width: 100%; }

/* ---------- 子页头 ---------- */

.page-hero {
  padding: 168px 0 72px;
  background:
    radial-gradient(900px 420px at 82% -6%, rgba(0, 113, 227, 0.10), transparent 65%),
    radial-gradient(600px 320px at 8% 16%, rgba(0, 199, 190, 0.07), transparent 60%);
}

.page-hero h1 {
  font-size: clamp(32px, 4.6vw, 52px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.page-hero .lead { color: var(--ink-dim); font-size: 18px; max-width: 740px; }

/* ---------- 方法论/特性三卡 ---------- */

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.method-card {
  border-radius: var(--radius);
  background: var(--panel);
  padding: 30px 28px;
  box-shadow: var(--shadow);
  transition: transform 0.22s, box-shadow 0.22s;
}
section.alt .method-card { background: var(--bg); box-shadow: none; border: 1px solid var(--line); }
.method-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }

.method-card h3 { font-size: 19px; margin-bottom: 10px; letter-spacing: -0.01em; }
.method-card p { color: var(--ink-dim); font-size: 14.5px; }

/* 方法论引用: 与标题统一左对齐; 不限宽, 保证换行后第二句一行放下 */
.method-quote {
  margin-top: 48px;
  font-size: 17.5px;
  color: var(--ink-dim);
  max-width: none;
  line-height: 1.75;
}
.method-quote strong { font-weight: 600; color: var(--ink); }

.arch-figure {
  margin-top: 56px;
  border-radius: var(--radius);
  background: var(--panel);
  padding: 28px;
  box-shadow: var(--shadow);
}
section.alt .arch-figure { background: var(--bg); box-shadow: none; border: 1px solid var(--line); }
.arch-figure figcaption {
  font-size: 13.5px;
  color: var(--ink-dim);
  margin-top: 16px;
  text-align: center;
}

/* ---------- 九大设计域 ---------- */

.domains-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 48px;
}

.domain {
  border-radius: var(--radius);
  background: var(--panel);
  padding: 26px 26px 22px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
section.alt .domain { background: var(--bg); box-shadow: none; border: 1px solid var(--line); }
.domain:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.domain h3 { font-size: 17.5px; margin: 8px 0 6px; letter-spacing: -0.01em; }
.domain p { color: var(--ink-dim); font-size: 14px; line-height: 1.65; }

/* ---------- 核心能力 ---------- */

.caps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.cap {
  border-radius: var(--radius);
  padding: 30px 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  position: relative;
}
section.alt .cap { background: var(--bg); box-shadow: none; border: 1px solid var(--line); }
.cap h3 { font-size: 18.5px; margin-bottom: 10px; letter-spacing: -0.01em; }
.cap p { color: var(--ink-dim); font-size: 14.5px; }

/* 13 步流水线横带 */
.pipeline {
  margin-top: 56px;
  border-radius: var(--radius);
  background: var(--panel);
  padding: 34px 30px 30px;
  overflow-x: auto;
  box-shadow: var(--shadow);
}
section.alt .pipeline { background: var(--bg); box-shadow: none; border: 1px solid var(--line); }
.pipeline-flow { display: flex; align-items: center; gap: 0; min-width: 900px; }
.pipeline-flow .step {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 980px;
  padding: 7px 14px;
  white-space: nowrap;
  background: var(--bg-alt);
}
.pipeline-flow .step.hot { color: var(--blue); border-color: rgba(0, 113, 227, 0.4); background: var(--blue-soft); font-weight: 600; }
.pipeline-flow .wire {
  flex: 0 0 22px;
  height: 1.5px;
  background: var(--line);
}

/* ---------- 业务范围卡片(首页): 4 列图形化简卡 ---------- */

.biz-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 48px;
}

.biz-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0 0 26px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.22s, box-shadow 0.22s;
}
section.alt .biz-card { background: var(--bg); box-shadow: none; border: 1px solid var(--line); }
section.alt .biz-card::after { content: none; }
.biz-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }

/* 顶部渐变色条: 每张卡不同的活力渐变, 图形化区分板块 */
.biz-card::before {
  content: "";
  display: block;
  height: 5px;
  width: 100%;
  background: var(--grad);
  opacity: 0.85;
}
.biz-card[data-d="1"]::before { background: linear-gradient(92deg, #00a3e0, #6a8dff); }
.biz-card[data-d="2"]::before { background: linear-gradient(92deg, #00c7be, #35d0a0); }
.biz-card[data-d="3"]::before { background: linear-gradient(92deg, #8a6bff, #c86bff); }

.biz-card h3 {
  font-size: 19px;
  letter-spacing: -0.01em;
  padding: 26px 26px 0;
  line-height: 1.35;
}
.biz-card .more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 18px 26px 0;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--blue);
}

/* ---------- 特性双列列表(服务子页) ---------- */

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 20px;
  margin-top: 48px;
}

.feature {
  border-radius: var(--radius);
  background: var(--panel);
  padding: 26px 28px;
  box-shadow: var(--shadow);
}
section.alt .feature { background: var(--bg); box-shadow: none; border: 1px solid var(--line); }
.feature h3 { font-size: 16.5px; margin-bottom: 8px; letter-spacing: -0.01em; }
.feature p { color: var(--ink-dim); font-size: 14px; }

/* 指标带 */
.metric-band {
  margin-top: 52px;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}
section.alt .metric-band { background: var(--bg); box-shadow: none; border: 1px solid var(--line); }
.metric .num {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.metric .lbl { font-size: 13.5px; color: var(--ink-dim); margin-top: 4px; }

/* ---------- 客户价值 ---------- */

.values-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 48px;
}

.value {
  border-radius: var(--radius);
  padding: 28px 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
section.alt .value { background: var(--bg); box-shadow: none; border: 1px solid var(--line); }
.value h3 { font-size: 16.5px; margin-bottom: 8px; letter-spacing: -0.01em; }
.value p { color: var(--ink-dim); font-size: 14px; }

/* ---------- CTA ---------- */

.cta-band {
  text-align: center;
  padding: 110px 32px;
  background:
    radial-gradient(760px 320px at 50% 116%, rgba(0, 113, 227, 0.13), transparent 68%),
    var(--bg-alt);
}
.cta-band h2 { font-size: clamp(26px, 3.6vw, 40px); }
.cta-band p { color: var(--ink-dim); margin: 14px 0 36px; font-size: 17px; }

/* ---------- 页脚 ---------- */

footer { padding: 56px 0 40px; border-top: 1px solid var(--line); background: var(--bg); }
.foot-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  flex-wrap: wrap;
}
.foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.foot-brand img { height: 28px; }
.foot-meta { font-size: 13.5px; color: var(--ink-dim); text-align: right; }
.foot-meta a:hover { color: var(--ink); }
.foot-meta .mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--ink-faint); }

/* ---------- 滚动浮现 (仅 JS 可用时启用, 见 main.js) ---------- */

.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.65s ease, transform 0.65s ease; }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal[data-d="1"] { transition-delay: 0.08s; }
.js .reveal[data-d="2"] { transition-delay: 0.16s; }
.js .reveal[data-d="3"] { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 响应式 ---------- */

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-shot { transform: none; }
  .method-grid, .domains-grid, .caps-grid { grid-template-columns: 1fr 1fr; }
  .values-grid { grid-template-columns: 1fr 1fr; }
  .biz-grid { grid-template-columns: 1fr 1fr; }
  .feature-list { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  section { padding: 68px 0; }
  .wrap { padding: 0 20px; }
  .nav-inner { padding: 12px 20px; gap: 18px; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    padding: 18px 24px 24px;
    gap: 16px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle {
    display: block;
    margin-left: auto;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-family: var(--mono);
    padding: 6px 12px;
    cursor: pointer;
  }
  .brand { margin-right: auto; }
  .btn-login { text-align: center; }
  .method-grid, .domains-grid, .caps-grid, .values-grid { grid-template-columns: 1fr; }
  .hero { padding: 132px 0 60px; }
  .page-hero { padding: 132px 0 52px; }
  /* 13 步流水线在手机上改为换行布局, 免去卡内横向拖动 */
  .pipeline { overflow-x: visible; }
  .pipeline-flow { min-width: 0; flex-wrap: wrap; gap: 8px; }
  .pipeline-flow .wire { display: none; }
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; }
}
