/* ==========================================================================
   鸣雀 LARKMUSE · 基础层 base.css
   reset / 纸面 / 排版 / 栅格 / 布局原子
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-soft);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 560px at 8% -6%, rgba(217, 164, 65, 0.11), transparent 68%),
    radial-gradient(900px 520px at 96% 2%, rgba(200, 85, 61, 0.05), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.05'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

body.is-locked {
  overflow: hidden;
}

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

img {
  height: auto;
}

svg {
  flex-shrink: 0;
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

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

table {
  border-collapse: collapse;
  width: 100%;
}

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

/* ---------- 排版 ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-title);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
}
h2 {
  font-size: var(--fs-h2);
}
h3 {
  font-size: var(--fs-h3);
}
h4 {
  font-size: var(--fs-h4);
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: 500;
  color: var(--ink);
}

em {
  font-style: normal;
}

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

::selection {
  background: var(--gold-soft);
  color: var(--ink);
}

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

/* 拉丁展示体 */
.latin {
  font-family: var(--font-latin);
  letter-spacing: 0.01em;
}

.serif {
  font-family: var(--font-serif);
}

.kai {
  font-family: var(--font-kai);
}

/* ---------- 无障碍 ---------- */
.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;
}

/* ---------- 布局原子 ---------- */
.shell {
  width: min(100%, calc(var(--shell) + var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(3rem, 5vw, 4.5rem);
}

.section--paper-deep {
  background-color: var(--paper-deep);
  background-image:
    radial-gradient(900px 420px at 80% 0%, rgba(217, 164, 65, 0.12), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.05'/%3E%3C/svg%3E");
}

.section--ink {
  background-color: var(--ink-block);
  color: var(--on-dark);
  color-scheme: dark;
  background-image:
    radial-gradient(760px 420px at 88% -10%, rgba(217, 164, 65, 0.18), transparent 68%),
    radial-gradient(620px 380px at 4% 110%, rgba(200, 85, 61, 0.14), transparent 70%);
}

.section--ink h2,
.section--ink h3,
.section--ink h4 {
  color: var(--on-dark);
}

.section--ink p {
  color: var(--on-dark-muted);
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, 2.2vw, 2rem);
  row-gap: var(--sp-8);
}

.span-3 {
  grid-column: span 3;
}
.span-4 {
  grid-column: span 4;
}
.span-5 {
  grid-column: span 5;
}
.span-6 {
  grid-column: span 6;
}
.span-7 {
  grid-column: span 7;
}
.span-8 {
  grid-column: span 8;
}
.span-9 {
  grid-column: span 9;
}
.span-12 {
  grid-column: span 12;
}

.start-6 {
  grid-column-start: 6;
}
.start-7 {
  grid-column-start: 7;
}
.start-8 {
  grid-column-start: 8;
}

.stack {
  display: flex;
  flex-direction: column;
}

.stack--2 {
  gap: var(--sp-2);
}
.stack--3 {
  gap: var(--sp-3);
}
.stack--4 {
  gap: var(--sp-4);
}
.stack--6 {
  gap: var(--sp-6);
}
.stack--8 {
  gap: var(--sp-8);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

/* 章节眉标 */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-muted);
}

.eyebrow__no {
  font-family: var(--font-latin);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--gold-deep);
}

.eyebrow__line {
  width: 2.25rem;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.section--ink .eyebrow {
  color: var(--on-dark-muted);
}
.section--ink .eyebrow__no {
  color: var(--on-dark-gold);
}

/* 引导段落 */
.lede {
  max-width: 56ch;
  font-size: var(--fs-lede);
  line-height: 1.9;
  color: var(--ink-muted);
  font-weight: 300;
}

.section--ink .lede {
  color: var(--on-dark-muted);
}

/* 细金线 */
.rule {
  width: 100%;
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, var(--line-gold), var(--line-soft) 55%, transparent);
}

.rule--center {
  background: linear-gradient(90deg, transparent, var(--line-gold), transparent);
}

.hairline {
  height: 1px;
  border: 0;
  background: var(--line);
}

/* 竖排中文点缀 */
.vlabel {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-serif);
  font-size: var(--fs-xs);
  letter-spacing: 0.34em;
  color: var(--ink-muted);
  line-height: 1;
}

/* 数字/等宽标签 */
.num {
  font-family: var(--font-latin);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0.02em;
}

/* ---------- 动效基元 ---------- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes line-in {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes seal-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.03);
  }
}

.js.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}

.js.reveal-ready .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* 首屏入场 stagger（仅 CSS，无需 JS） */
.enter {
  animation: fade-up 0.9s var(--ease) both;
  animation-delay: var(--enter-delay, 0s);
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .js.reveal-ready .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 响应式栅格回退 ---------- */
@media (max-width: 1024px) {
  .span-3,
  .span-4,
  .span-5 {
    grid-column: span 6;
  }
  .span-7,
  .span-8,
  .span-9 {
    grid-column: span 12;
  }
  .start-6,
  .start-7,
  .start-8 {
    grid-column-start: auto;
  }
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    row-gap: var(--sp-6);
  }
  .span-3,
  .span-4,
  .span-5,
  .span-6 {
    grid-column: span 6;
  }
}
