/* =============================================================
   云枢科技 · 设计系统基础层
   base.css —— 变量 / 重置 / 排版 / 按钮 / 导航 / 页脚 / 通用组件
   修改品牌色只需改 :root 里的 --brand 系列变量
   ============================================================= */

/* ---------- 1. 设计令牌 ---------- */
:root {
  /* 色彩 */
  --bg: #07080c;
  --bg-soft: #0a0c12;
  --bg-elev: #0e111a;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);

  --text: #eef1f8;
  --text-2: #a8b1c5;
  --text-3: #7a869e;

  /* 品牌色（换品牌只需改这三行 + --grad） */
  --brand: #4f7bff;
  --brand-2: #22d3ee;
  --brand-3: #8b5cf6;
  --grad: linear-gradient(135deg, #4f7bff 0%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(79, 123, 255, 0.16), rgba(34, 211, 238, 0.08));

  /* 形状与阴影 */
  --radius: 18px;
  --radius-lg: 24px;
  --radius-sm: 11px;
  --shadow-sm: 0 8px 24px -12px rgba(0, 0, 0, 0.7);
  --shadow: 0 28px 70px -30px rgba(0, 0, 0, 0.9);
  --glow: 0 0 0 1px rgba(79, 123, 255, 0.35), 0 18px 50px -18px rgba(79, 123, 255, 0.55);

  /* 布局 */
  --container: 1180px;
  --header-h: 72px;
  --gutter: clamp(20px, 4vw, 40px);

  /* 动效 */
  --ease: cubic-bezier(0.22, 0.68, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* 字体（全部系统字体，不依赖外部 CDN，国内访问更快） */
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

/* ---------- 2. 重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: rgba(79, 123, 255, 0.35);
  color: #fff;
}

/* 键盘焦点可见性（无障碍硬性要求，勿删） */
:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-soft);
}
::-webkit-scrollbar-thumb {
  background: #23293a;
  border-radius: 99px;
  border: 2px solid var(--bg-soft);
}
::-webkit-scrollbar-thumb:hover {
  background: #313951;
}

/* ---------- 3. 布局工具 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: clamp(64px, 8.5vw, 116px);
}

.section--tight {
  padding-block: clamp(48px, 6vw, 80px);
}

.section--soft {
  background: linear-gradient(180deg, transparent, var(--bg-soft) 18%, var(--bg-soft) 82%, transparent);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 999;
  padding: 12px 20px;
  background: var(--brand);
  color: #fff;
  border-radius: 0 0 10px 10px;
  font-size: 0.9rem;
  transition: top 0.25s var(--ease);
}
.skip-link:focus {
  top: 0;
  color: #fff;
}

/* ---------- 4. 文字组件 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.79rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.14);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(36px, 5vw, 58px);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head h2 {
  margin-top: 20px;
  font-size: clamp(1.75rem, 3.6vw, 2.7rem);
}

.section-head p {
  margin-top: 16px;
  color: var(--text-2);
  font-size: clamp(0.98rem, 1.4vw, 1.08rem);
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted {
  color: var(--text-2);
}

.mono {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

/* ---------- 5. 按钮 ---------- */
.btn {
  --btn-pad-y: 13px;
  --btn-pad-x: 26px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: 99px;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease),
    background-color 0.28s var(--ease), border-color 0.28s var(--ease), color 0.28s var(--ease);
}

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.28s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 14px 34px -14px rgba(79, 123, 255, 0.85);
}

.btn-primary:hover {
  box-shadow: 0 20px 46px -14px rgba(79, 123, 255, 0.95);
  color: #fff;
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: var(--surface-hover);
  color: #fff;
}

.btn-lg {
  --btn-pad-y: 16px;
  --btn-pad-x: 32px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand-2);
  font-size: 0.93rem;
  font-weight: 600;
}

.btn-link svg {
  width: 15px;
  height: 15px;
  transition: transform 0.28s var(--ease);
}

.btn-link:hover {
  color: #7de9f9;
}

.btn-link:hover svg {
  transform: translateX(4px);
}

/* ---------- 6. 卡片 ---------- */
.card {
  position: relative;
  padding: clamp(24px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  transition: border-color 0.35s var(--ease), background-color 0.35s var(--ease),
    transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.card:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.card--lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

/* 图标徽章 */
.icon-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  border: 1px solid rgba(79, 123, 255, 0.28);
  background: var(--grad-soft);
  color: var(--brand-2);
}

.icon-badge svg {
  width: 22px;
  height: 22px;
}

/* 卡片内数字角标 */
.card-index {
  font-family: var(--font-num);
  font-size: 0.78rem;
  color: var(--text-3);
  letter-spacing: 0.1em;
}

/* ---------- 7. 站点导航 ---------- */
/* 顶栏默认就有半透明背景：即使 JS 失效，滚动时内容也不会穿透标题栏 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  background: rgba(7, 8, 12, 0.65);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(7, 8, 12, 0.85);
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--grad);
  box-shadow: 0 8px 20px -8px rgba(79, 123, 255, 0.9);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-text small {
  font-size: 0.6rem;
  color: var(--text-3);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav > a {
  position: relative;
  padding: 9px 15px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 0.93rem;
  font-weight: 500;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.nav > a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav > a.is-active {
  color: var(--text);
}

.nav > a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  transform: translateX(-50%);
}

.nav .nav-cta {
  margin-left: 12px;
  padding: 11px 22px;
  color: #fff;
}

.nav .nav-cta::after {
  display: none;
}

.nav .nav-cta:hover {
  color: #fff;
}

/* 汉堡按钮（移动端） */
.nav-toggle {
  display: none;
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.nav-toggle span {
  position: absolute;
  left: 50%;
  width: 17px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--text);
  transform: translateX(-50%);
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease), top 0.3s var(--ease);
}

.nav-toggle span:nth-child(1) {
  top: 15px;
}
.nav-toggle span:nth-child(2) {
  top: 20px;
}
.nav-toggle span:nth-child(3) {
  top: 25px;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  top: 20px;
  transform: translateX(-50%) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  top: 20px;
  transform: translateX(-50%) rotate(-45deg);
}

/* ---------- 8. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: 40px;
  padding-top: clamp(56px, 7vw, 84px);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-soft), #05060a);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 52px;
}

.footer-brand p {
  margin-top: 18px;
  max-width: 320px;
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.85;
}

.footer-brand .footer-social {
  margin-top: 22px;
}

.footer-col h4 {
  margin-bottom: 16px;
  color: var(--text);
  font-size: 0.89rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.footer-col li + li {
  margin-top: 11px;
}

.footer-col a,
.footer-col span {
  color: var(--text-2);
  font-size: 0.89rem;
}

.footer-col a:hover {
  color: var(--brand-2);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-block: 24px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 0.83rem;
}

.footer-bottom a {
  color: var(--text-3);
}

.footer-bottom a:hover {
  color: var(--text-2);
}

.footer-social {
  display: flex;
  gap: 10px;
}

.footer-social a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text-2);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease),
    background-color 0.25s var(--ease);
}

.footer-social a:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.footer-social svg {
  width: 15px;
  height: 15px;
}

/* ---------- 9. 滚动进场动画 ----------
   渐进增强：只有 JS 成功运行（<html> 带 .js 类）时才隐藏待入场元素，
   否则内容直接可见，绝不因脚本故障而白屏。 */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
  will-change: opacity, transform;
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* 尊重系统"减弱动态效果"设置 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 10. 背景光晕装饰 ---------- */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

.glow-orb--brand {
  background: radial-gradient(circle, rgba(79, 123, 255, 0.32), transparent 70%);
}

.glow-orb--cyan {
  background: radial-gradient(circle, rgba(34, 211, 238, 0.22), transparent 70%);
}

.grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, #000 30%, transparent 100%);
}

/* ---------- 11. 响应式 ---------- */
@media (max-width: 980px) {
  /* 汉堡按钮只在 JS 可用时显示，否则点击没有响应反而误导 */
  .js .nav-toggle {
    display: block;
  }

  /* 无 JS 时：导航按普通流式排列，保证仍可点击 */
  .nav {
    flex-wrap: wrap;
    gap: 2px 4px;
  }

  /* 有 JS 时：导航变成抽屉 */
  .js .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    padding: 16px var(--gutter) 28px;
    background: rgba(8, 10, 15, 0.97);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }

  .js .nav.is-open {
    opacity: 1;
    transform: none;
    visibility: visible;
  }

  .nav > a {
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: 11px;
  }

  .nav > a.is-active::after {
    display: none;
  }

  .nav > a.is-active {
    background: var(--surface);
    color: var(--brand-2);
  }

  .nav .nav-cta {
    margin: 12px 0 0;
    justify-content: center;
    padding: 14px 22px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 34px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  :root {
    --header-h: 64px;
  }

  .brand-text small {
    display: none;
  }

  .btn {
    font-size: 0.9rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 打印样式 */
@media print {
  .site-header,
  .site-footer,
  .btn,
  .nav-toggle {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
}

/* =============================================================
   12. 视觉增强层（2026-10 升级）
   ============================================================= */

/* ---- 主按钮：hover 扫光 ---- */
.btn-primary {
  overflow: hidden;
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 55%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transform: skewX(-22deg);
  transition: left 0.65s var(--ease);
  pointer-events: none;
}

.btn-primary:hover::after {
  left: 135%;
}

/* 导航预约按钮 hover 加深光晕 */
.nav .nav-cta:hover {
  box-shadow: 0 16px 42px -12px rgba(79, 123, 255, 1);
}

/* ---- 卡片：hover 顶部渐变高光线 ---- */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(79, 123, 255, 0.85), rgba(34, 211, 238, 0.85), transparent);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

/* ---- eyebrow 呼吸圆点 ---- */
.eyebrow::before {
  animation: dotPulse 2.8s ease-in-out infinite;
}

@keyframes dotPulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.05);
  }
}

/* ---- 页脚顶部发光带 ---- */
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: min(780px, 82%);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 123, 255, 0.7), rgba(34, 211, 238, 0.7), transparent);
  pointer-events: none;
}

/* ---- 滚动条更贴合品牌 ---- */
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #2b3752, #1d2434);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #3d4f78, #2b3752);
}
