/* ============================================================
   base.css — 重置 / 排版 / 焦点 / 动效降级 / 容器与节奏
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

/* 锚点跳转（#appoint 等）时给吸顶页头留出空间，避免标题被盖住 */
[id] { scroll-margin-top: calc(var(--infobar-h) + 28px); }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--f-body);
  font-size: var(--fs-body);
  line-height: 1.78;          /* 中文正文行高 ≥1.7 */
  letter-spacing: .012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) ease-out;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: .006em;
  text-wrap: balance;
}

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.25em; }
li { margin-bottom: var(--sp-2); }
li:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--c-ink); }
em { font-style: normal; color: var(--c-accent); }

hr {
  border: 0;
  border-top: 1px solid var(--c-line);
  margin: var(--sp-7) 0;
}

::selection { background: var(--c-accent-lt); color: var(--c-accent-dp); }

/* ---- 可见焦点：2px 描边 + 2px 偏移 ---- */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* ---- 跳转链接（键盘用户） ---- */
/* 注意：选择器写成 a.skip-link，是为了压过后面 .atmos > * { position: relative }。
   两者特异性相同（.atmos > * 里的 * 不计分），写在后面的会赢，
   跳转链接一旦变成 relative 就会在页头上面撑出一行高度。 */
a.skip-link {
  position: fixed;
  display: block;
  left: var(--sp-4);
  top: -80px;
  z-index: 100;
  background: var(--c-ink);
  color: var(--c-bg);
  padding: 10px 18px;
  border-radius: var(--r-xs);
  font-size: var(--fs-sm);
  transition: top var(--dur-fast) var(--ease-out);
}
a.skip-link:focus { top: var(--sp-4); }

/* ---- 容器 ---- */
.wrap {
  width: 100%;
  max-width: var(--w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: var(--w-narrow); }

/* ---- 区块节奏 ---- */
.section { padding-block: clamp(56px, 8vw, 104px); position: relative; }
.section--tight { padding-block: clamp(40px, 5vw, 64px); }
.section--deep { background: var(--c-bg-deep); }
.section--jade { background: var(--c-jade); color: #F2EFE8; }
.section--ink  { background: var(--c-ink); color: #F2EFE8; }

.section--jade h2, .section--ink h2,
.section--jade h3, .section--ink h3 { color: #FFFDF9; }
.section--jade p, .section--ink p { color: rgba(242, 239, 232, .82); }

/* ---- 氛围层：颗粒 + 极淡径向光 ---- */
.atmos::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(48rem 32rem at 88% -6%, rgba(164, 78, 59, .07), transparent 62%),
    radial-gradient(42rem 30rem at 2% 8%, rgba(43, 71, 65, .06), transparent 58%);
}
.atmos::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .042;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.atmos > * { position: relative; z-index: 2; }

/* ---- 入场与滚动揭示：只动 opacity / transform ---- */
/* 渐进增强：只有 JS 可用时才隐藏元素等待入场。
   这样即使脚本失败、被广告拦截器屏蔽或爬虫不执行 JS，
   内容依然默认可见，不会出现"整页空白"。 */
.js .rv {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}
.js .rv.in { opacity: 1; transform: none; }

/* 首屏编排：3 组错峰 90ms */
.js .stack > .rv:nth-child(1) { transition-delay: 0ms; }
.js .stack > .rv:nth-child(2) { transition-delay: 90ms; }
.js .stack > .rv:nth-child(3) { transition-delay: 180ms; }
.js .stack > .rv:nth-child(4) { transition-delay: 270ms; }
.js .stack > .rv:nth-child(5) { transition-delay: 360ms; }

/* ---- 降级：尊重系统偏好 ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---- 打印 ---- */
@media print {
  .site-head, .float-widget, .mnav, .cta-band, .foot { display: none !important; }
  body { background: #fff; color: #000; }
}
