/* 问径 · 基础样式：纸、墨、朱砂。 */
:root {
  --paper: #f5f0e6;
  --paper-2: #ece5d6;
  --card: #fbf8f2;
  --ink: #1e1c19;
  --ink-2: #57524a;
  --ink-3: #8c857a;
  --rule: #d8cfbe;
  --contour: #b9ab92;
  --accent: #b5341f;
  --accent-ink: #f6f1e7;
  --accent-soft: rgba(181, 52, 31, 0.1);
  --teal: #2f5f5a;
  --warn-bg: #f4e3cf;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: "SF Mono", "Menlo", "Consolas", "Roboto Mono", monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161512;
    --paper-2: #1e1c18;
    --card: #1c1a17;
    --ink: #ece6da;
    --ink-2: #b3ab9d;
    --ink-3: #7d766b;
    --rule: #3a362f;
    --contour: #3b372f;
    --accent: #e0654b;
    --accent-ink: #1a1512;
    --accent-soft: rgba(224, 101, 75, 0.14);
    --teal: #7fb3aa;
    --warn-bg: #3a2a1f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #161512; --paper-2: #1e1c18; --card: #1c1a17; --ink: #ece6da; --ink-2: #b3ab9d;
  --ink-3: #7d766b; --rule: #3a362f; --contour: #3b372f; --accent: #e0654b; --accent-ink: #1a1512;
  --accent-soft: rgba(224, 101, 75, 0.14); --teal: #7fb3aa; --warn-bg: #3a2a1f; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.3; margin: 0; letter-spacing: 0.02em; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* 背景等高线：像地形图，也像电子密度图 */
.contour {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none;
  color: var(--contour);
}
.contour path { fill: none; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.contour .drift { animation: drift 90s linear infinite; transform-origin: center; transform-box: fill-box; }
.contour .drift.rev { animation-direction: reverse; animation-duration: 120s; }
@keyframes drift { to { transform: rotate(360deg); } }

/* 页眉页脚 */
.masthead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(16px, 5vw, 48px);
  max-width: 1080px; width: 100%; margin: 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-name { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: 0.3em; }
.masthead-meta { font-size: 13px; color: var(--ink-3); }
.colophon {
  margin-top: auto; padding: 32px 16px 28px; text-align: center;
  font-size: 12px; color: var(--ink-3); letter-spacing: 0.04em;
}
.noscript { text-align: center; padding: 40px 16px; }

/* 印章 */
.seal {
  display: inline-grid; place-items: center;
  width: 64px; height: 64px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--serif); font-weight: 700; font-size: 34px; line-height: 1;
  border-radius: 6px;
  box-shadow: inset 0 0 0 3px var(--accent), inset 0 0 0 5px var(--accent-ink);
  transform: rotate(-4deg);
  user-select: none;
}
.seal-sm { width: 32px; height: 32px; font-size: 17px; border-radius: 4px;
  box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 3px var(--accent-ink); }
.seal-lg { width: 96px; height: 96px; font-size: 22px; line-height: 1.25; padding: 10px; text-align: center; }

/* 视图容器与过渡 */
.view {
  width: 100%; max-width: 760px; margin: 0 auto;
  padding: clamp(16px, 4vw, 40px) 16px 40px;
  outline: none;
}
.view.wide { max-width: 1000px; }
.enter { animation: enter 0.5s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* 通用组件 */
.eyebrow { font-size: 13px; letter-spacing: 0.2em; color: var(--accent); font-weight: 600; }
.lede { font-size: 17px; color: var(--ink-2); }
.muted { color: var(--ink-3); font-size: 14px; }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 28px;
  border: 1px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-size: 16px; font-weight: 600; letter-spacing: 0.08em;
  cursor: pointer; text-decoration: none;
  transition: transform 0.2s var(--ease), background 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-1px); background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.link { background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--ink-2);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--rule); }
.link:hover { color: var(--accent); text-decoration-color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: clamp(20px, 4vw, 32px); }
.notice { background: var(--warn-bg); border-left: 3px solid var(--accent); border-radius: 6px; padding: 14px 18px; font-size: 15px; }
.error { color: var(--accent); font-size: 14px; min-height: 1.75em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
