/* ============================================================================
   基础层：重置 + 舞台（两页横向叠放，纵向平移切换）
   ========================================================================= */

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cover-bg-0);
  overflow: hidden; /* 页面本体永不滚动，滚动只发生在右栏内部 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

ul, ol {
  list-style: none;
}

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

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

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

/* ---------- 舞台与页面 ---------- */

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}

.page {
  position: absolute;
  inset: 0;
  transition:
    transform var(--dur-page) var(--ease-io),
    opacity 560ms var(--ease-out);
  will-change: transform;
}

.page--cover {
  z-index: 2;
  transform: translateY(0);
}

.page--detail {
  z-index: 1;
  transform: translateY(100%);
}

.stage[data-page="detail"] .page--cover {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.stage[data-page="detail"] .page--detail {
  transform: translateY(0);
}

/* ---------- 通用滚动条 ---------- */

.scroll-y {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(12, 20, 36, 0.18) transparent;
}

.scroll-y::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

.scroll-y::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-y::-webkit-scrollbar-thumb {
  background: rgba(12, 20, 36, 0.16);
  border-radius: var(--r-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}

.scroll-y::-webkit-scrollbar-thumb:hover {
  background: rgba(12, 20, 36, 0.3);
  background-clip: content-box;
}

/* ---------- 工具类 ---------- */

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