/* ============================================================
   Reseek 官网 · 基础样式与视觉母题工具类
   ============================================================ */

/* —— Reset —— */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-wrap: break-word;
  position: relative;
}

img { max-width: 100%; height: auto; display: block; }

/* —— 全局坐标网格背景（精密图纸母题） —— */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 120% 100% at 50% 0%, #000 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 120% 100% at 50% 0%, #000 30%, transparent 90%);
}

/* —— 颗粒噪点层（质感） —— */
.grain {
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main { position: relative; z-index: 1; }

/* —— 通用容器 —— */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

section {
  position: relative;
  padding-block: var(--sp-section);
  scroll-margin-top: 88px; /* 锚点跳转时避开固定导航遮挡 */
}

/* —— 排版基础（中文不用负字距） —— */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.18; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
strong, b { font-weight: 600; color: var(--text); }
::selection { background: var(--cyan); color: var(--void); }

/* —— 键盘可达性 —— */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: calc(var(--z-nav) + 10);
  padding: 0.7em 1.1em;
  background: var(--cyan);
  color: var(--void);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  border-radius: var(--radius);
  transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 1rem; }

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

/* ============================================================
   视觉母题工具类（全站复用）
   ============================================================ */

/* —— 刻度标注 tick：[ 01 / PAIN POINTS ] —— */
.tick {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.tick::before {
  content: "";
  flex: none;
  width: 28px;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}
.tick .idx { color: var(--cyan); }

/* —— 切角面板（仪表面板质感） —— */
.clip-corner {
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}

/* —— 辉光边框 —— */
.glow-border {
  box-shadow: 0 0 0 1px var(--line), 0 0 40px -12px var(--cyan-glow);
}

/* —— section 标题装饰：等宽小标 + 大标题 —— */
.section-head { margin-bottom: clamp(2rem, 4.5vw, 3.5rem); }
.section-head h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  margin-top: 1.1rem;
  max-width: 24em;
  line-height: 1.25;
  text-wrap: balance;
}

/* —— 滚动渐入：只在 JS 可用时隐藏，禁用 JS 时内容默认可见 —— */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.js [data-reveal-delay="1"] { transition-delay: 0.07s; }
.js [data-reveal-delay="2"] { transition-delay: 0.14s; }
.js [data-reveal-delay="3"] { transition-delay: 0.21s; }
.js [data-reveal-delay="4"] { transition-delay: 0.28s; }
.js [data-reveal-delay="5"] { transition-delay: 0.35s; }

/* —— 通用按钮（CTA） —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  padding: 0.75em 1.5em;
  border: 1px solid var(--line-bright);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius);
  transition: border-color 0.35s var(--ease), color 0.35s var(--ease),
              background-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.btn:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-primary {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan-soft), 0 0 30px -10px var(--cyan-glow);
}
.btn-primary:hover {
  background: var(--cyan);
  color: var(--void);
  box-shadow: 0 0 40px -8px var(--cyan-glow);
}

/* —— 大号描边装饰数字 —— */
.ghost-num {
  font-family: var(--font-display);
  font-size: var(--fs-num);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-bright);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

/* —— 证据四级标签 —— */
.grade {
  display: inline-block;
  margin-inline: 0.25em;
  padding: 0.05em 0.5em;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.72em;
  font-style: normal;
  letter-spacing: 0.04em;
  line-height: 1.6;
  vertical-align: 0.05em;
  white-space: nowrap;
}
.grade--disc  { color: var(--grade-disc); }
.grade--third { color: var(--grade-third); }
.grade--est   { color: var(--grade-est); }
.grade--todo  { color: var(--grade-todo); }

/* —— 动效偏好 —— */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
