/* =========================================================
   莫垚 · 重置与排版
   ========================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 620px at 12% -8%, #FDF7EF 0%, rgba(253, 247, 239, 0) 62%),
    radial-gradient(900px 520px at 92% 4%, #F8EFE3 0%, rgba(248, 239, 227, 0) 58%),
    linear-gradient(180deg, #FBF5EC 0%, #FAF3E9 46%, #F8F0E4 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.72;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

body.is-locked-scroll { overflow: hidden; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.35;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(26px, 3.2vw, 40px); }
h2 { font-size: clamp(21px, 2.2vw, 28px); }
h3 { font-size: clamp(17px, 1.5vw, 20px); }

p {
  margin: 0;
  max-width: var(--measure);
}

a {
  color: var(--rose-deep);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

a:hover { color: var(--ink); }

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

img { height: auto; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input, textarea {
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: var(--sp-6) 0;
}

::selection {
  background: var(--blush);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.u-measure { max-width: var(--measure); }

.empty-line {
  margin: var(--sp-6) auto;
  color: var(--ink-3);
  font-size: 14px;
  text-align: center;
  max-width: 42ch;
}

.link-btn {
  display: inline-block;
  color: var(--ink-2);
  font-size: 13px;
  padding: 6px 2px;
  min-height: 32px;
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.link-btn:hover {
  color: var(--rose-deep);
  border-bottom-color: rgba(185, 107, 98, .4);
}

/* 滚动条：细一点，不抢戏 */
@supports (scrollbar-width: thin) {
  html { scrollbar-width: thin; scrollbar-color: rgba(59, 50, 44, .18) transparent; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(59, 50, 44, .16);
  border-radius: var(--r-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
