/* ==========================================================================
   base.css — 设计变量 / 重置 / 排版基调
   配色取自 llx.life 的实际色板：暖白纸底 + 褐灰文字 + 薄荷绿点缀
   ========================================================================== */

:root {
  /* 底色与纸张 */
  --bg: #f7f4ef;
  --bg-deep: #efeae2;
  --paper: #fffdf8;
  --paper-2: #fdf8ee;

  /* 文字 */
  --ink: #2f2b29;
  --ink-2: #4a4440;
  --muted: #9a908a;
  --muted-2: #b8aea6;

  /* 线条与阴影 */
  --line: #e7dfd5;
  --line-2: #d7cdc2;
  --shadow-sm: 0 2px 6px rgba(90, 70, 50, 0.05);
  --shadow-md: 0 14px 32px -18px rgba(90, 70, 50, 0.3), 0 2px 6px rgba(90, 70, 50, 0.04);
  --shadow-lg: 0 40px 80px -40px rgba(90, 70, 50, 0.45), 0 8px 20px -10px rgba(90, 70, 50, 0.15);

  /* 点缀色 */
  --mint: #cfe6d8;
  --green: #6f9f86;
  --green-deep: #4e7d67;
  --yellow: #f7dd9b;
  --pink: #f3bcc4;
  --lilac: #cdc6ea;
  --sky: #bcdcee;

  /* 形状 */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 34px;

  /* 字体 */
  --font-hand: "ZCOOL KuaiLe", "LXGW WenKai", "STKaiti", cursive;
  --font-body: "Quicksand", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-en: "Quicksand", 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(1200px 620px at 12% -8%, #fffdf9 0%, rgba(255, 253, 249, 0) 62%),
    radial-gradient(900px 520px at 92% 4%, #fdf4e6 0%, rgba(253, 244, 230, 0) 60%),
    radial-gradient(900px 700px at 50% 108%, #eef4ee 0%, rgba(238, 244, 238, 0) 58%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 首页是横向卡片墙，锁住整页滚动；子页正常滚动 */
body.is-home {
  height: 100%;
  overflow: hidden;
}

/* 细微纸纹：用 repeating-linear 造极淡的横向纹理 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(160, 140, 120, 0.022) 0px,
    rgba(160, 140, 120, 0.022) 1px,
    transparent 1px,
    transparent 3px
  );
}

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(--mint);
  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: #ddd3c8;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #c9bdb0;
  background-clip: padding-box;
}

/* ---------- 通用排版工具类 ---------- */

.hand {
  font-family: var(--font-hand);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.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;
  }
}
