/* ============================================================
   新元素软件官网 · styles.css
   结构：1 设计令牌 → 2 基础 → 3 按钮 → 4 导航 → 5 首屏与光斑
        → 6 区块通用 → 7 关于我们 → 8 卡片网格 → 9 联系与页脚
        → 10 产品详情页 → 11 动效 → 12 响应式 → 13 减弱动效
   ============================================================ */

/* ---------- 1 设计令牌 ---------- */
:root {
  --bg: #f7f9ff;
  --bg-alt: #eef3ff;
  --bg-card: #ffffff;
  --brand: #2f4bff;
  --brand-2: #7b5cff;
  --accent: #00c8dc;
  --text-heading: #1a2440;
  --text-body: #4a5578;
  --text-muted: #6b7a99;
  --gradient: linear-gradient(90deg, var(--brand), var(--brand-2));
  --radius: 14px;
  --shadow-sm: 0 4px 16px rgba(30, 48, 102, .08);
  --shadow-md: 0 10px 30px rgba(30, 48, 102, .12);
  --shadow-lg: 0 18px 44px rgba(47, 75, 255, .18);
  --container: 1200px;
  --section-gap: 104px;
  --nav-h: 72px;
}

/* ---------- 2 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
section { padding: var(--section-gap) 0; }
section[id] { scroll-margin-top: 80px; }
.grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 3 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 34px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s, background .25s;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 10px 26px rgba(47, 75, 255, .35);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(47, 75, 255, .45); }
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; left: -70%;
  width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
}
.btn-primary:hover::after { left: 130%; }
.btn-ghost {
  border: 2px solid rgba(47, 75, 255, .35);
  color: var(--brand);
  background: rgba(255, 255, 255, .6);
}
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--brand); background: #fff; }

/* ---------- 4 导航 ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  transition: background .3s, box-shadow .3s;
}
.nav--scrolled {
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 24px rgba(30, 48, 102, .08);
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--text-heading); letter-spacing: 1px; }
.brand img { width: 35px; height: auto; flex: none; }
.nav-links { display: flex; gap: 36px; }
.nav-links a {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-body);
  position: relative;
  padding: 6px 0;
  transition: color .25s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  border-radius: 2px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--brand); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-toggle { display: none; }

/* ---------- 5 首屏与流动光斑 ---------- */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + 96px) 0 120px;
  overflow: hidden;
  background: linear-gradient(165deg, #f7f9ff 0%, #eef3ff 55%, #f2ecff 100%);
}
.hero-inner { position: relative; text-align: center; max-width: 880px; }
.hero-kicker {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(47, 75, 255, .08);
  color: var(--brand);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 2px;
}
.hero h1 {
  margin-top: 26px;
  font-size: 58px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: 2px;
}
.hero-sub { margin-top: 22px; font-size: 18px; color: var(--text-muted); }
.hero-cta { margin-top: 40px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.orbs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
  pointer-events: none;
}
.orb-1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(47, 75, 255, .45), transparent 65%);
  top: -120px; left: -80px;
  animation: drift-a 22s ease-in-out infinite alternate;
}
.orb-2 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(123, 92, 255, .4), transparent 65%);
  top: 18%; right: -100px;
  animation: drift-b 26s ease-in-out infinite alternate;
}
.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(0, 200, 220, .35), transparent 65%);
  bottom: -120px; left: 30%;
  animation: drift-a 30s ease-in-out infinite alternate-reverse;
}
@keyframes drift-a {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(60px, 40px) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate(0, 0) scale(1.08); }
  to { transform: translate(-70px, 30px) scale(.94); }
}

/* ---------- 6 区块通用 ---------- */
.section-head { text-align: center; max-width: 760px; margin: 0 auto 56px; }
.section-head .kicker {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--brand);
  margin-bottom: 12px;
}
.section-head h2 { font-size: 38px; font-weight: 800; color: var(--text-heading); letter-spacing: 1px; line-height: 1.3; }
.section-head p { margin-top: 14px; color: var(--text-muted); }
.alt-bg { background: var(--bg-alt); }

/* 实力数字 */
.stats {
  background: var(--bg-card);
  padding: 56px 0;
  border-top: 1px solid rgba(47, 75, 255, .06);
  border-bottom: 1px solid rgba(47, 75, 255, .06);
}
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat-num {
  font-size: 44px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat-num .count { font-style: normal; }
.stat-label { display: block; margin-top: 6px; color: var(--text-muted); font-size: 15px; }

/* ---------- 7 关于我们 ---------- */
.about-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; }
.about-text h2 { font-size: 34px; font-weight: 800; color: var(--text-heading); margin-bottom: 20px; line-height: 1.3; }
.about-text p { text-indent: 2em; }
.about-text p + p { margin-top: 14px; }
.culture { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.culture-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .3s, box-shadow .3s;
}
.culture-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.culture-item h3 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.culture-item p { font-size: 13.5px; color: var(--text-muted); }

/* ---------- 8 卡片网格 ---------- */
.grid { display: grid; gap: 24px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .3s, box-shadow .3s;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity .3s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card:hover::before { opacity: 1; }
.card .icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(47, 75, 255, .12), rgba(123, 92, 255, .12));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--brand);
}
.card .icon svg { width: 26px; height: 26px; }
.card h3 { font-size: 19px; font-weight: 700; color: var(--text-heading); margin-bottom: 10px; }
.card p { font-size: 14.5px; }
.card ul { margin-top: 14px; display: grid; gap: 8px; }
.card ul li { font-size: 14px; color: var(--text-muted); padding-left: 18px; position: relative; }
.card ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gradient);
}
.badge-core {
  position: absolute;
  top: 16px; right: 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}
.product-card { display: block; }
.product-card .more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  color: var(--brand);
  font-weight: 700;
  font-size: 14px;
  transition: gap .25s;
}
.product-card:hover .more { gap: 10px; }

/* ---------- 9 联系与页脚 ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 1080px; margin: 0 auto; }
.contact-item { text-align: center; }
.contact-item .icon { margin: 0 auto 20px; }
.contact-item h3 { margin-bottom: 6px; }
.contact-item a:hover { color: var(--brand); }
.footer { background: #10162e; color: #93a0c4; padding: 34px 0; font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.footer a { transition: color .25s; }
.footer a:hover { color: #fff; }

/* ---------- 10 产品详情页 ---------- */
.page-hero {
  position: relative;
  padding: calc(var(--nav-h) + 72px) 0 80px;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(165deg, #f7f9ff 0%, #eef3ff 55%, #f2ecff 100%);
}
.page-hero .container { position: relative; max-width: 880px; }
.crumb { font-size: 14px; color: var(--text-muted); margin-bottom: 18px; }
.crumb a { transition: color .25s; }
.crumb a:hover { color: var(--brand); }
.page-hero h1 { font-size: 44px; font-weight: 800; color: var(--text-heading); letter-spacing: 2px; line-height: 1.3; }
.page-hero .lead { margin-top: 18px; font-size: 17px; color: var(--text-muted); }
.page-hero .hero-cta { margin-top: 32px; }
.page-cta { text-align: center; }
.related { margin-top: 36px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.related a {
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid rgba(47, 75, 255, .25);
  color: var(--text-body);
  font-size: 14px;
  font-weight: 600;
  transition: color .25s, border-color .25s, background-color .25s;
}
.related a:hover { border-color: var(--brand); color: var(--brand); background: rgba(47, 75, 255, .05); }

/* ---------- 11 滚动显现动效 ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s cubic-bezier(.22, .61, .36, 1), transform .7s cubic-bezier(.22, .61, .36, 1);
  animation: reveal-fallback .7s cubic-bezier(.22, .61, .36, 1) 2.5s forwards;
}
html.js .reveal.visible { opacity: 1; transform: none; animation: none; }
.visible { opacity: 1; transform: none; }
@keyframes reveal-fallback { to { opacity: 1; transform: none; } }

/* ---------- 12 响应式 ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { font-size: 46px; }
  .page-hero h1 { font-size: 36px; }
  .section-head h2 { font-size: 32px; }
}
@media (max-width: 768px) {
  :root { --section-gap: 72px; --nav-h: 64px; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 16px;
    box-shadow: 0 20px 30px rgba(30, 48, 102, .12);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  html.js .nav-links { display: none; }
  html.js .nav-links.open { display: flex; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid rgba(47, 75, 255, .08); }
  .nav-links a::after { display: none; }
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    padding: 12px;
    cursor: pointer;
  }
  .nav-toggle span {
    width: 22px; height: 2px;
    background: var(--text-heading);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
  }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .hero { padding: calc(var(--nav-h) + 64px) 0 88px; }
  .hero h1 { font-size: 34px; }
  .hero h1 .grad { display: block; width: fit-content; margin: 0 auto; }
  .hero-sub { font-size: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
  .stat-num { font-size: 36px; }
  .contact-grid { grid-template-columns: 1fr; }
  .culture { grid-template-columns: 1fr; }
  .footer-inner { justify-content: center; text-align: center; }
  .footer-company, .footer-record { display: block; }
  .footer-sep { display: none; }
  .page-hero h1 { font-size: 30px; }
}
@media (max-width: 480px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .section-head h2 { font-size: 26px; }
  .btn { padding: 12px 26px; font-size: 15px; }
}

/* ---------- 13 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
