/* 全站设计变量与基础排版。业务页面和公共组件只引用这里的主题。 */
:root {
  --paper: #f7f3ea;
  --paper-deep: #efe9dc;
  --paper-warm: #f2ecdf;
  --white: #fffdf7;
  --ink: #14110d;
  --ink-soft: #3a342b;
  --muted: #7a7367;
  --gold: #b8913f;
  --gold-light: #d8b26a;
  --gold-ink: #8a6a2f;
  --gold-wash: #b8913f14;
  --gold-soft: #f5edd8;
  --line: #14110d29;
  --line-soft: #14110d17;
  --line-warm: #e8deca;
  --navy: var(--ink);
  --navy-deep: #0a0906;
  --font-display: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-num: ui-monospace, "SF Mono", Menlo, monospace;
  --serif: var(--font-display);
  --sans: var(--font-sans);
  --gutter: clamp(20px, 4vw, 40px);
  --header-h: 78px;
  --radius: 4px;
  --radius-lg: 8px;
  --card-padding: 24px;
  --shadow-sm: 0 4px 20px #14110d08;
  --shadow-md: 0 12px 32px #14110d0d;
  --shadow-lg: 0 24px 60px #14110d14;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out-expo: var(--ease);
  --ease-out-quart: var(--ease);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--paper);
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

body.menu-open,
body.modal-open {
  overflow: hidden;
}

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

h1,
h2,
h3,
h4 {
  margin: 0 0 16px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.4;
  text-wrap: balance;
}

h1 {
  font-size: clamp(30px, 4vw, 48px);
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
}

h3 {
  font-size: 20px;
}

p,
figure,
blockquote {
  margin: 0 0 16px;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

button,
summary {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

:focus-visible {
  outline: 2px solid var(--gold-ink);
  outline-offset: 3px;
}

section[id] {
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.container {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: 900px;
}

.section {
  position: relative;
  padding-block: clamp(48px, 7vw, 88px);
}

.section + .section {
  border-top: 1px solid var(--line-soft);
}

.section--tight {
  padding-block: clamp(36px, 5vw, 64px);
}

.section--soft {
  background: var(--paper-warm);
}

.section--navy {
  background: var(--navy);
  color: var(--paper);
}

.section--navy :is(h2, h3, p) {
  color: inherit;
}

.eyebrow,
.kicker {
  color: var(--gold-ink);
  font-size: 11px;
  letter-spacing: .1em;
}

.section-head {
  max-width: 760px;
  margin-bottom: 32px;
}

.section-sub {
  color: var(--muted);
  font-size: 14px;
}

.reveal {
  opacity: 1;
  transform: none;
}

@media (max-width: 900px) {
  :root {
    --header-h: 68px;
  }
}

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

@media (max-width: 540px) {
  :root {
    --card-padding: 20px;
  }
}

/* 名词注释 */
.term {
  position: relative;
  border-bottom: 1px dotted currentColor;
  cursor: help;
}

.term::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 80;
  width: max-content;
  max-width: min(320px, calc(100vw - 40px));
  padding: 10px 12px;
  border: 1px solid #d8b26a66;
  border-radius: 3px;
  background: #201b14;
  color: #f3ead6;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0;
  white-space: normal;
  text-align: left;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.term:hover::after,
.term:focus::after,
.term.is-open::after {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 700px) {
  .term::after {
    left: var(--tip-left, 0);
    transform: none;
  }
}
