/* ============================================================
   万物皆可爬 · 基础样式（reset / 排版 / 布局骨架）
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.68;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--t-med) ease, color var(--t-med) ease;
}

/* 等高线纹理背景 —— 路书地形图气质 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-radial-gradient(circle at 88% -12%, transparent 0 88px, var(--bg-contour) 88px 89px),
    repeating-radial-gradient(circle at -8% 108%, transparent 0 120px, var(--bg-contour) 120px 121px);
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font-family: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

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

/* —— 排版 —— */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

/* 路书编号式小标签（mono kicker） */
.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }

/* —— 应用骨架 —— */
.app-shell { position: relative; z-index: 1; min-height: 100vh; }

.app-main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.view {
  flex: 1;
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-4) calc(var(--nav-h) + var(--sp-8));
}

/* 移动端底部留出标签栏高度；桌面端由侧栏占位 */
@media (min-width: 900px) {
  .app-main { margin-left: var(--sidebar-w); }
  .view { padding: var(--sp-10) var(--sp-8) var(--sp-16); }
}

/* —— 页面级切换动画 —— */
.view-enter .page {
  animation: pageIn var(--t-slow) var(--ease-out) both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* —— 滚动条 —— */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
