/* ============================================================
   Base · 重置 / 排版 / 安全区 / 布局骨架
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;                 /* 禁止无意义横向滚动 */
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

/* 主屏 Web App 独立窗口下，顶部由我们自己的导航栏负责，避免内容钻进状态栏 */
#app {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: calc(var(--safe-top) + var(--topbar-h) + 8px);
  padding-bottom: calc(var(--safe-bottom) + var(--tabbar-h) + var(--tabbar-gap) + 28px);
  padding-left: calc(var(--page-x) + var(--safe-left));
  padding-right: calc(var(--page-x) + var(--safe-right));
}

.view {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  min-height: 40vh;
}

/* 页面进入 / 退出过渡 */
.view--enter { animation: viewIn var(--dur-slow) var(--ease) both; }
.view--leave { animation: viewOut var(--dur-fast) var(--ease) both; }
@keyframes viewIn  { from { opacity: 0; transform: translateY(10px) scale(0.995); } to { opacity: 1; transform: none; } }
@keyframes viewOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-6px); } }

/* ---------- 排版 ---------- */
.large-title {
  margin: 2px 0 4px;
  font-size: clamp(28px, 8.2vw, 34px);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.15;
}
.eyebrow {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
}
.section-title { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -0.015em; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 26px 2px 12px;
}
.section-head--tight { margin-top: 18px; }
.muted { color: var(--text-secondary); }
.muted-2 { color: var(--text-tertiary); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.body-2 { font-size: 15px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; letter-spacing: -0.01em; }
.strong { font-weight: 650; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1 1 auto; }

/* ---------- 控件基线 ---------- */
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-appearance: none; appearance: none; border: 0; background: none; }
a { color: var(--accent); text-decoration: none; }
img { display: block; max-width: 100%; }
svg { display: block; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

/* 键盘弹出时，输入框滚动到可见区域由浏览器处理；此处仅避免整体被压缩 */
body.keyboard-open .tabbar { opacity: 0; pointer-events: none; }

/* ---------- 无障碍：减弱动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
