@charset "UTF-8";
/* ==========================================================================
   base.css · reset + 排版 + 移动端安全区 + 无障碍
   --------------------------------------------------------------------------
   只做「全局地基」：不定义任何组件外观（组件在 glass.css / sections.css）。
   令牌一律引用 tokens.css，不在此重定义。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 现代 reset
   -------------------------------------------------------------------------- */

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

html,
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd,
ul,
ol,
fieldset,
legend,
pre,
hr {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

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

img,
video {
  height: auto;
  border-style: none;
  background-color: var(--c-rose-50);
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  background: none;
  border: 0;
  margin: 0;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/*
   触控热区兜底（验收硬指标 1：点击目标 ≥ 44px）。
   base.css 在 tokens.css 之后、glass.css / sections.css 之前加载，
   因此这里给所有 <button> 的 44px 底线会被后续具名组件的显式 min-height 覆盖，
   既保证「忘了写热区的按钮」不会低于无障碍标准，也不干扰已设计好的组件。
   （实测：修复前 .tag__btn 仅 44×14、.theme-toggle 仅 12×2，均无法正常点按。）
*/
button {
  min-height: var(--tap-min);
  min-width: var(--tap-min);
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--glass-border);
}

a {
  color: var(--c-accent-text);
  text-decoration: none;
  text-underline-offset: 0.22em;
  transition: color var(--dur-fast) var(--ease-out-soft);
}

a:hover {
  color: var(--c-ink-900);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

/*
   按钮式链接（带类名的，如「查看全部」「写给我们的话」）必须具备 44px 点击热区。
   正文段落内的裸行内链接按 WCAG 2.5.8 的 "inline" 例外豁免 —— 强行撑到 44px
   会破坏中文行文节奏与行距，反而降低可读性。
*/
a[class] {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
}

[hidden] {
  display: none !important;
}

/* 移动端安全区变量注入：把浏览器安全区内边距带进令牌，供全站复用 */
@supports (padding: env(safe-area-inset-bottom)) {
  :root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
  }
}

/* --------------------------------------------------------------------------
   2. 页面底色与文字
   -------------------------------------------------------------------------- */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--bg-app-solid);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--sp-6) + var(--safe-top));
  /* 抑制横向滚动：必须用 overflow-x: clip，不能用 hidden。
     hidden 会让 html/body 成为 position: sticky 的滚动容器，
     导致 .tl-group 分组标题无法吸顶（sticky 完全失效）。
     clip 同样裁剪溢出，但不创建滚动容器，sticky 正常工作。 */
  overflow-x: clip;
}

body {
  min-height: 100%;
  /* 同上：clip 而非 hidden，保住 sticky 吸顶 */
  overflow-x: clip;
  color: var(--c-ink-900);
  font-family: var(--ff-body);
  font-size: var(--fs-md);
  font-weight: 400;
  line-height: var(--lh-normal);
  background-color: var(--bg-app-solid);
  /* 页面渐变底色【不在 body 上铺】——由 .backdrop（position: fixed; inset: 0）统一铺。
     实测证据（用洋红/亮绿对照实验）：把 .backdrop 底色调成洋红、body 调成亮绿后，
     屏幕上洋红占 16.3%、亮绿占 0.0% —— 说明 body 的渐变被 .backdrop 100% 遮挡，
     属于【无效绘制】；而且 body 的 background-size:100% 100% 会把它拉伸到
     整篇文档（实测 7813px ≈ 视口的 9.6 倍），白画一张超长渐变。
     另外实测：保留「视口尺度」的 .backdrop 渐变，每屏可分辨明度层次 14 档；
     若改成在 body 上拉伸，层次掉到 11 档（渐变被摊平），反而不利。
     此处保留 background-color 作为兜底纯色，避免极端情况下露白。 */
  background-image: none;
  background-repeat: no-repeat;
  background-attachment: scroll;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
  word-break: break-word;
  transition: background-color var(--dur-base) var(--ease-out-soft),
    color var(--dur-base) var(--ease-out-soft);
}

/* 桌面端：左右留出安全区，避免刘海屏横屏时内容贴边 */
body {
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

::selection {
  background-color: var(--c-rose-200);
  color: var(--c-ink-900);
}

/* --------------------------------------------------------------------------
   3. 标题层级与通用排版
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--ff-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--c-ink-900);
  letter-spacing: 0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(var(--fs-2xl), 8.4vw, var(--fs-3xl));
  letter-spacing: 0.02em;
}

h2 {
  font-size: clamp(var(--fs-xl), 5.6vw, var(--fs-2xl));
}

h3 {
  font-size: clamp(var(--fs-lg), 4.4vw, var(--fs-xl));
}

h4 {
  font-size: var(--fs-lg);
}

h5 {
  font-size: var(--fs-md);
}

h6 {
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-ink-500);
}

p {
  font-size: var(--fs-md);
  line-height: var(--lh-loose);
  color: var(--c-ink-700);
  text-wrap: pretty;
}

p + p {
  margin-top: var(--sp-3);
}

small {
  font-size: var(--fs-xs);
  color: var(--c-ink-500);
}

strong,
b {
  font-weight: 600;
  color: var(--c-ink-900);
}

em,
i {
  font-style: italic;
}

code,
kbd,
samp,
pre {
  font-family: var(--ff-num);
  font-size: 0.94em;
}

time,
.timer__num,
[data-count],
[data-duration],
.stats__value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.text-grad {
  background-image: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* --------------------------------------------------------------------------
   4. 焦点态（统一双环，全站不得裸 outline: none）
   -------------------------------------------------------------------------- */

/*
   焦点环用 --c-focus-ring（浅色为 --c-accent-strong #831a40）而非 rose-400：
   rose-400(#ff8bb8) 在粉底上对比度仅 2.06:1，远低于 WCAG 非文字组件 3:1 要求；
   原 #d9447e 在加深后的粉底上也只有 2.44:1，同样不达标。
   #831a40 实测 on 背景深端 4.90:1、on 玻璃卡 4.32:1，稳定达标，
   且依旧是玫瑰色系（深玫瑰），不破坏整体调性。
*/
:root {
  --c-focus-ring: var(--c-accent-strong);
}

html[data-theme="dark"] {
  /* 深色底上 rose-500 已达 8.52:1，用更亮的粉更醒目 */
  --c-focus-ring: var(--c-rose-500);
}

:focus-visible {
  outline: 2px solid var(--c-focus-ring);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* 双环：内圈隔离带 + 外圈粉色描边，在玻璃背景上依然清晰 */
.btn:focus-visible,
.chip:focus-visible,
.tag:focus-visible,
.music-fab:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--c-focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9),
    0 0 0 6px var(--glass-inner-glow);
}

/* 深色下把隔离环换成墨色，避免白圈过曝 */
html[data-theme="dark"] :focus-visible {
  outline-color: var(--c-focus-ring);
}

html[data-theme="dark"] .btn:focus-visible,
html[data-theme="dark"] .chip:focus-visible,
html[data-theme="dark"] .tag:focus-visible,
html[data-theme="dark"] .music-fab:focus-visible,
html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] [tabindex]:focus-visible {
  box-shadow: 0 0 0 1px rgba(28, 20, 32, 0.92), 0 0 0 6px rgba(var(--glow-rgb), 0.24);
}

/* 鼠标点击不显示焦点环，键盘导航才显示 */
:focus:not(:focus-visible) {
  outline: none;
}

/* --------------------------------------------------------------------------
   5. 无障碍工具类
   -------------------------------------------------------------------------- */

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sr-only--focusable:focus-visible,
.sr-only--focusable:active {
  position: fixed;
  top: calc(var(--sp-3) + var(--safe-top));
  left: calc(var(--sp-3) + var(--safe-left));
  z-index: var(--z-music);
  width: auto;
  height: auto;
  padding: var(--sp-2) var(--sp-4);
  margin: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  border-radius: var(--r-full);
  color: var(--c-ink-900);
  font-size: var(--fs-sm);
  background-color: var(--glass-bg-strong);
  box-shadow: var(--glass-shadow);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus-visible {
  left: calc(var(--sp-3) + var(--safe-left));
  top: calc(var(--sp-3) + var(--safe-top));
  z-index: var(--z-music);
}

/* 长文本省略工具 */
.clamp-1,
.clamp-2,
.clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-1 {
  -webkit-line-clamp: 1;
  line-clamp: 1;
}

.clamp-2 {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.clamp-3 {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* --------------------------------------------------------------------------
   6. 入场动画基类 .reveal
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition-property: opacity, transform;
  transition-duration: var(--dur-slow);
  transition-timing-function: var(--ease-out-soft);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* 由 JS 注入的阶梯延迟（--reveal-delay 可用内联样式覆盖） */
.reveal[data-reveal-index="1"] { --reveal-delay: 60ms; }
.reveal[data-reveal-index="2"] { --reveal-delay: 120ms; }
.reveal[data-reveal-index="3"] { --reveal-delay: 180ms; }
.reveal[data-reveal-index="4"] { --reveal-delay: 240ms; }
.reveal[data-reveal-index="5"] { --reveal-delay: 300ms; }
.reveal[data-reveal-index="6"] { --reveal-delay: 360ms; }
.reveal[data-reveal-index="7"] { --reveal-delay: 420ms; }
.reveal[data-reveal-index="8"] { --reveal-delay: 480ms; }
.reveal[data-reveal-index="9"] { --reveal-delay: 540ms; }
.reveal[data-reveal-index="10"] { --reveal-delay: 600ms; }

/* 容器内自动阶梯：时间轴卡片依次浮现（避免逐条 inline style） */
.timeline > .reveal:nth-child(1) { --reveal-delay: 0ms; }
.timeline > .reveal:nth-child(2) { --reveal-delay: 70ms; }
.timeline > .reveal:nth-child(3) { --reveal-delay: 140ms; }
.timeline > .reveal:nth-child(4) { --reveal-delay: 210ms; }
.timeline > .reveal:nth-child(5) { --reveal-delay: 280ms; }
.timeline > .reveal:nth-child(6) { --reveal-delay: 350ms; }
.timeline > .reveal:nth-child(7) { --reveal-delay: 420ms; }
.timeline > .reveal:nth-child(8) { --reveal-delay: 490ms; }

.reveal--fade {
  transform: none;
}

.reveal--left {
  transform: translate3d(-22px, 0, 0);
}

.reveal--right {
  transform: translate3d(22px, 0, 0);
}

.reveal--scale {
  transform: translate3d(0, 12px, 0) scale(0.975);
}

.reveal--up {
  transform: translate3d(0, 26px, 0);
}

/* --------------------------------------------------------------------------
   7. 动效偏好与打印
   -------------------------------------------------------------------------- */

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .backdrop,
  .music-fab {
    display: none !important;
  }

  /* 打印不强制纯黑，保留玫瑰灰黑文字，纸质上依然沉稳 */
  body {
    background-color: transparent;
    background-image: none;
  }

  .glass {
    background-color: transparent;
    background-image: none;
    box-shadow: none;
    border-color: rgba(74, 44, 58, 0.2);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
