/* ==========================================================================
   base.css — 设计变量 / 重置 / 排版基调
   设计语言：纸卡摊在桌面上 —— 白纸、深褐描边、贴纸拼贴、超粗中文
   ========================================================================== */

:root {
  /* 桌面与纸张 */
  --bg: #f1ebdd;
  --bg-warm: #f7f2e6;
  --paper: #ffffff;

  /* 文字 */
  --ink: #3a3430;
  --ink-2: #4a4440;
  --muted: #8d847a;
  --muted-2: #a99f94;

  /* 线条与阴影：卡片描边是这个设计的骨架，不能太浅 */
  --rule: #6e6661;
  --line: #e0d8c9;
  --line-2: #cfc4b2;
  --shadow-sm: 0 2px 5px rgba(84, 66, 48, 0.06);
  --shadow-md: 0 22px 44px -26px rgba(74, 56, 38, 0.42), 0 3px 8px rgba(74, 56, 38, 0.06);
  --shadow-lg: 0 44px 78px -34px rgba(74, 56, 38, 0.5), 0 8px 18px rgba(74, 56, 38, 0.08);

  /* 点缀色（同时用作卡片底部色带） */
  --mint: #cfe6d8;
  --green: #6f9f86;
  --green-deep: #4e7d67;
  --yellow: #f7dd9b;
  --pink: #f3bcc4;
  --lilac: #cdc6ea;
  --sky: #bcdcee;
  --apricot: #f6cfa8;

  /* 形状 */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-paper: 14px;

  /* 字体：全部系统字体，不依赖任何 CDN（国内直连也秒开） */
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui,
    -apple-system, "Segoe UI", sans-serif;
  --font-hand: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: var(--font-sans);
  --font-en: "Segoe UI", ui-rounded, system-ui, sans-serif;

  /* 动效 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
  background-color: var(--bg);
  /* 真实纸面照片打底 + 几处柔光，保证卡片压得住 */
  background-image:
    radial-gradient(1100px 640px at 16% -12%, rgba(255, 253, 246, 0.68) 0%, rgba(255, 253, 246, 0) 62%),
    radial-gradient(880px 520px at 88% 2%, rgba(253, 245, 228, 0.55) 0%, rgba(253, 245, 228, 0) 58%),
    radial-gradient(1000px 700px at 50% 118%, rgba(214, 209, 192, 0.75) 0%, rgba(214, 209, 192, 0) 66%),
    url("../assets/bg-paper.jpg");
  background-size: auto, auto, auto, cover;
  background-position: center, center, center, center;
  background-repeat: no-repeat;
  background-attachment: fixed, fixed, fixed, fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 首页锁住整页滚动，只让卡片墙横向滚 */
body.is-home {
  height: 100%;
  overflow: hidden;
}

/* 纸面颗粒：极淡的斜向细纹，避免大面积纯色发死 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(120, 100, 78, 0.028) 0px,
    rgba(120, 100, 78, 0.028) 1px,
    transparent 1px,
    transparent 4px
  );
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 6px;
}

/* 滚动条：细，融进纸面 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d8cdba;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #c4b6a0;
  background-clip: padding-box;
}

/* ---------- 通用排版工具类 ---------- */

/* 中文大字：系统字体 + 轻微描边加粗，得到接近 Black 字重的厚重感 */
.hand {
  font-family: var(--font-hand);
  font-weight: 900;
  letter-spacing: 0.02em;
  -webkit-text-stroke: 0.4px currentColor;
  paint-order: stroke fill;
}

.en {
  font-family: var(--font-en);
  letter-spacing: 0.14em;
  text-transform: lowercase;
}

.muted {
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@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;
  }
}
