/* ==========================================================================
   星澜 AI 官网 · 基础层（base.css）
   reset / 排版 / 容器 / 页面背景 / 可访问性基础
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  /* 揭示动效使用左右位移，避免在窄屏产生横向滚动条 */
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--text-1);
  background-color: var(--bg-1);
  /* 深空底色 + 两团品牌光晕，fixed 避免长页面重绘 */
  background-image:
    radial-gradient(1100px 720px at 12% -8%, rgba(108, 92, 231, 0.2), transparent 62%),
    radial-gradient(940px 640px at 92% 2%, rgba(34, 211, 238, 0.13), transparent 60%),
    radial-gradient(900px 900px at 50% 118%, rgba(79, 124, 255, 0.1), transparent 62%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body.is-locked {
  overflow: hidden;
  touch-action: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
  margin: 0;
}

ul[class],
ol[class] {
  padding: 0;
  list-style: none;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

img {
  height: auto;
  border: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

strong,
b {
  font-weight: 650;
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--sp-8) 0;
}

::selection {
  background: rgba(108, 92, 231, 0.42);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--c-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 自定义滚动条（桌面） */
@media (pointer: fine) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: var(--bg-0);
  }
  ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(108, 92, 231, 0.55), rgba(34, 211, 238, 0.4));
    border-radius: 999px;
    border: 2px solid var(--bg-0);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(108, 92, 231, 0.8), rgba(34, 211, 238, 0.62));
  }
}

/* ---------- 容器 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* ---------- 区块 ---------- */
.section {
  position: relative;
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: var(--section-y-sm);
}

.section--bordered {
  border-top: 1px solid var(--line-soft);
}

/* ---------- 排版 ---------- */
.display {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 760;
}

.h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 740;
}

.h2 {
  font-size: var(--fs-h2);
  line-height: 1.16;
  letter-spacing: var(--tracking-snug);
  font-weight: 700;
}

.h3 {
  font-size: var(--fs-h3);
  line-height: 1.28;
  letter-spacing: -0.008em;
  font-weight: 650;
}

.h4 {
  font-size: var(--fs-h4);
  line-height: 1.36;
  font-weight: 620;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.72;
  color: var(--text-2);
  max-width: 62ch;
}

.text-2 {
  color: var(--text-2);
}

.text-3 {
  color: var(--text-3);
}

.text-sm {
  font-size: var(--fs-sm);
}

.text-xs {
  font-size: var(--fs-xs);
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0;
}

.grad-text {
  background: var(--grad-text);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: var(--fs-xs);
  font-weight: 620;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-3);
}

.eyebrow::before {
  content: "";
  width: 1.6em;
  height: 1px;
  background: var(--grad-brand);
  opacity: 0.9;
}

.eyebrow--plain::before {
  display: none;
}

/* 段落之间的常规节奏 */
.prose p + p {
  margin-top: var(--sp-4);
}

.prose h3 {
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}

.prose ul {
  margin: var(--sp-4) 0 0;
  padding-left: 1.15em;
  list-style: disc;
  color: var(--text-2);
}

.prose li + li {
  margin-top: var(--sp-2);
}

.prose li::marker {
  color: var(--c-cyan);
}

/* ---------- 可访问性 ---------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: calc(var(--z-cursor) + 10);
  translate: -50% -160%;
  padding: 0.7em 1.4em;
  border-radius: var(--r-pill);
  background: var(--grad-brand);
  color: #fff;
  font-weight: 620;
  box-shadow: var(--shadow-md);
  transition: translate var(--dur-2) var(--ease-out);
}

.skip-link:focus-visible {
  translate: -50% 0;
  outline-offset: 2px;
}

/* ---------- 背景装饰 ---------- */
.bg-grid {
  position: absolute;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 72% 60% at 50% 32%, #000 12%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 72% 60% at 50% 32%, #000 12%, transparent 76%);
}

.bg-glow {
  position: absolute;
  z-index: var(--z-bg);
  pointer-events: none;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
}

/* 站点主区域（供固定头部留白） */
.page-main {
  position: relative;
  z-index: var(--z-base);
}

/* 页面顶部渐变细线（品牌感） */
.page-line {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: var(--grad-line);
  z-index: var(--z-raised);
  pointer-events: none;
}

/* 图标基础尺寸（inline sprite <use>） */
.ico {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico--fill {
  fill: currentColor;
  stroke: none;
}

/* 通用工具 */
.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.gap-2 {
  gap: var(--sp-2);
}

.gap-3 {
  gap: var(--sp-3);
}

.gap-4 {
  gap: var(--sp-4);
}

.mt-4 {
  margin-top: var(--sp-4);
}

.mt-6 {
  margin-top: var(--sp-6);
}

.mt-8 {
  margin-top: var(--sp-8);
}

.hidden {
  display: none !important;
}

@media (max-width: 560px) {
  .hide-mobile {
    display: none !important;
  }
}

/* 超大屏：容器适当加宽，避免 1440+ 两侧发空 */
@media (min-width: 1600px) {
  :root {
    --container: 1320px;
    --container-wide: 1440px;
    --gutter: 2.75rem;
    --section-y: clamp(5rem, 6.2vw, 8.5rem);
  }
}
