/* ==========================================================================
   base.css — 复位、页面外壳、容器与滚动进场
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg-page);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .3s var(--ease-std), color .3s var(--ease-std);
}

h1, h2, h3, h4, h5, h6, p { margin: 0; }
h1, h2, h3, h4, h5, h6 { font-weight: inherit; }
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--color-text-strong); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--color-chip); color: var(--color-text-strong); }

:lang(zh), .page { font-family: var(--font-main); }

/* ---- 容器：max 1260，两侧至少 60 ---- */
.wrap {
  width: calc(100% - (var(--gutter) * 2));
  max-width: var(--container);
  margin-inline: auto;
}

/* ---- 分区 ---- */
.sec {
  width: calc(100% - (var(--gutter) * 2));
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--sec-pad) 0;
  position: relative;
}
.sec-head {
  height: 58px;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
  font-family: var(--font-main);
}
.sec-body-gap { margin-top: 48px; }
.sec-title {
  font-size: 40px;
  font-weight: 400;
  line-height: normal;
  color: var(--color-text-strong);
  width: 100%;
  font-family: var(--font-main);
}
.sec-sub {
  margin-top: 12px;
  text-align: center;
  font-size: 16px;
  line-height: 24px;
  color: var(--color-text-secondary);
  font-family: var(--font-main);
}
.sec-head--stacked { height: auto; display: block; }

/* ---- 滚动进场：opacity + translateY(60) / .8s expo ---- */
.reveal {
  opacity: 0;
  transform: translateY(var(--reveal-y));
  transition:
    opacity var(--reveal-dur) var(--ease-out-expo),
    transform var(--reveal-dur) var(--ease-out-expo);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---- 胶囊按钮：180x44 · r999 · pad 5/16 · 14/22 · gap 8 ---- */
.pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  min-width: 180px;
  padding: 5px 16px;
  border-radius: var(--r-999);
  border: 1px solid var(--color-primary);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 22px;
  transition: transform .2s var(--ease-std), box-shadow .2s var(--ease-std),
              background-color .2s var(--ease-std), color .2s var(--ease-std),
              border-color .2s var(--ease-std);
}
.pill--solid { background: var(--color-invert); color: var(--color-on-invert); border-color: var(--color-invert); }
.pill--line  { background: transparent; color: var(--color-text-strong); }
.pill--line:hover  { background: var(--color-hover); }
.pill--solid:hover { transform: translateY(-1px); box-shadow: 0 6px 18px var(--color-shadow); }
.pill--soft {
  height: 40px; min-width: 120px; border-color: transparent;
  background: var(--color-bg-section);
  font-size: 14px; line-height: 22px;
}
.pill--soft:hover { background: var(--color-surface-hover); }
.pill svg { width: 12px; height: 12px; }

/* ---- 图片位：未加载时是占底圆角块（mimo .u-img 实测） ---- */
.u-img { background: var(--color-card-img); border-radius: var(--r-24); overflow: hidden; }
.u-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---- 等宽徽章文字（原 20px 小方块样式随生态格移除，.mono 现为纯等宽） ---- */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.m-txt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------------- 应用外壳（mimo base.css:117-147 原样） ----------------
   线上站并非 document 滚动：notice(40) 固定在壳顶部，
   真正滚动的是 <main class="scroller">，页脚也在它内部。
   这里 1:1 复刻，sticky/滚动定位的参照系才和原站一致。            */
html, body { height: 100%; }
body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.scroller {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--color-scrollbar) transparent;
}
.scroller::-webkit-scrollbar { width: 8px; }
.scroller::-webkit-scrollbar-thumb { background: var(--color-scrollbar); border-radius: 8px; }
.scroller::-webkit-scrollbar-track { background: transparent; }
.page { width: 100%; flex: none; }   /* flex:none 必需：否则列向 flex 会把它 shrink 成一屏高，
                                        sticky 包含块随之只剩一屏 → 导航滚过首屏就脱开 */
.hero-portal { min-height: calc(100dvh - var(--banner-h) - var(--nav-h)); }   /* 首屏 = 公告条 + 导航 + 一屏 */
body.notice-off .hero-portal { min-height: calc(100dvh - var(--nav-h)); }

@media (max-width: 919px) {
  .hero-portal { min-height: 0; }
  :root { --gutter: 20px; }
  .sec-title { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .scroller { scroll-behavior: auto; }
}

/* ---- 键盘可达性：Tab 焦点描边（仅键盘触发，鼠标点击不出现） ---- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection { background: var(--accent-mid); }

/* ---- hidden 属性必须真正隐藏：作者样式里的 display:flex/grid 会覆盖 UA 的 [hidden]{display:none} ---- */
[hidden] { display: none !important; }
