/* ============================================================
   base.css — 重置、配色 tokens、字体、基础元素
   禅意宁静主题
   ============================================================ */

:root {
  /* 背景 / 表面 */
  --bg: #f5f1e8;            /* 宣纸米白 */
  --bg-soft: #efe9da;       /* 略深米 */
  --surface: #fbf8f0;       /* 卡片底 */
  --surface-2: #f2ecdb;     /* 次级表面 */
  --ink: #2b2b2b;           /* 主文字 */
  --ink-2: #5a5751;         /* 次文字 */
  --ink-3: #8a8579;         /* 弱文字 */
  --line: #ddd5c2;          /* 分隔线 */
  --line-soft: #e7e0cd;

  /* 点缀色 */
  --gold: #a8821f;          /* 赭石金 */
  --bamboo: #7d9b76;        /* 竹青 */
  --vermilion: #8a4b3a;     /* 朱赭 */
  --dark-panel: #3a3f3b;    /* 青灰面板 */

  /* 七组配色 */
  --g1: #b8862b;  /* 皮肤附属 — 赭金 */
  --g2: #9c5240;  /* 肌肉结缔 — 朱赭 */
  --g3: #7a3b3b;  /* 内脏 — 暗红 */
  --g4: #8a6d3b;  /* 消化排泄 — 土褐 */
  --g5: #4a7a86;  /* 体液一 — 青蓝 */
  --g6: #6b8e6b;  /* 体液二 — 竹青 */
  --g7: #7d7d6e;  /* 关节排泄 — 石灰 */

  /* 字体 */
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC",
    "SimSun", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;

  /* 形状 */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: none;
  --shadow: 0 2px 10px rgba(80, 65, 30, 0.06);
  --shadow-lg: 0 6px 24px rgba(60, 50, 25, 0.10);

  --maxw: 1180px;
  --header-h: 64px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--bg);
  /* 微妙的宣纸纹理：极淡的双层径向渐变 */
  background-image:
    radial-gradient(circle at 18% 12%, rgba(168, 130, 31, 0.05), transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(125, 155, 118, 0.05), transparent 45%);
  background-attachment: fixed;
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin: 0 0 0.5em;
}

h1 { font-size: 1.9rem; letter-spacing: 0.04em; }
h2 { font-size: 1.4rem; letter-spacing: 0.03em; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 1em; }

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--vermilion); }

ul, ol { margin: 0 0 1em; padding-left: 1.4em; }

strong { color: var(--ink); font-weight: 600; }

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  background: var(--surface-2);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

button {
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

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

/* 通用工具 */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.loading { color: var(--ink-3); text-align: center; padding: 3rem 0; }

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

.pali {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-2);
  font-weight: 400;
}

.muted { color: var(--ink-3); }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  letter-spacing: 0.04em;
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.92rem;
  transition: all 0.18s;
}
.btn:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-1px); }
.btn-primary {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.btn-primary:hover { background: #8f6d18; color: #fff; border-color: #8f6d18; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
