/* ============================================
   基础样式 — 重置 / 排版 / 纹理背景
   一会去哪儿 · Base
   ============================================ */

/* ── 现代重置 ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── 纸张噪点纹理 ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.36 0 0 0 0 0.31 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── 暖色光晕装饰 ── */
body::after {
  content: '';
  position: fixed;
  top: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle, var(--weather-tint-soft) 0%, transparent 60%);
  opacity: 0.7;
  transition: background var(--duration-slow) var(--ease-smooth);
}

/* ── 排版基线 ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

p {
  line-height: var(--leading-relaxed);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-deep);
}

strong, b {
  font-weight: var(--weight-bold);
}

/* ── 数字字体 ── */
.numeric {
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

/* ── 列表 ── */
ul, ol {
  list-style: none;
}

/* ── 图片 ── */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── 按钮 ── */
button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

/* ── 输入 ── */
input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ── 焦点可见 ── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ── 选区 ── */
::selection {
  background: var(--color-primary-tint);
  color: var(--color-primary-deep);
}

/* ── 滚动条 ── */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-warm);
}

::-webkit-scrollbar-thumb {
  background: var(--color-primary-soft);
  border-radius: var(--radius-pill);
  border: 2px solid var(--color-bg-warm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ── 通用工具类 ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
  position: relative;
  z-index: var(--z-base);
}

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

/* ── 视图容器 ── */
.view {
  display: none;
  position: relative;
  z-index: var(--z-base);
}

.view.is-active {
  display: block;
}

/* ── 视图切换动画 ── */
.view.is-active {
  animation: viewFadeIn var(--duration-slow) var(--ease-out) both;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .view.is-active {
    animation: none;
  }
}
