/* =========================================================
   自由国度 · 基础层
   色板取自世界本身：松林的黑绿、晨光的麦金、草坡的苔绿、
   岩层的赤陶，以及公告纸的米白。
   ========================================================= */

:root {
  --ink: #0a100d;
  --ink-2: #101a15;
  --ink-3: #16241c;
  --paper: #ece4d2;
  --paper-2: #ded3bb;
  --text: #ebe4d3;
  --text-dim: #a9ad99;
  --gold: #d8a35a;
  --gold-deep: #a97434;
  --moss: #7d9a58;
  --ember: #c2592f;
  --line: rgba(235, 228, 211, 0.16);
  --line-strong: rgba(235, 228, 211, 0.34);
  --line-dark: rgba(10, 16, 13, 0.16);

  --font-display: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --header-h: 66px;
  --gutter: clamp(18px, 4.2vw, 64px);
  --max: 1220px;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: block; }

/* 纸面噪点：整站铺一层，压低“屏幕感” */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}

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

/* 锚点跳转后标题不被固定顶栏压住 */
section[id],
div[id],
main [id] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/* ---------- 顶栏 ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--moss), var(--gold));
  z-index: 9999;
  pointer-events: none;
}

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9990;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 var(--gutter);
  background: rgba(10, 16, 13, 0.9);
  border-bottom: 1px solid var(--line);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), height 0.4s var(--ease);
}

.site-header.is-solid {
  background: var(--ink);
  border-bottom-color: var(--line-strong);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}

.brand .mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  clip-path: circle(47%);
  object-fit: cover;
  flex: 0 0 auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text strong {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.12em;
}
.brand-text em {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.2vw, 30px);
  margin-left: auto;
}

.nav-link {
  position: relative;
  font-size: 14px;
  color: rgba(235, 228, 211, 0.72);
  padding: 6px 0;
  transition: color 0.28s var(--ease);
  white-space: nowrap;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--text); }
.nav-link.is-active::after { transform: scaleX(1); }

.header-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.addr-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text);
  transition: border-color 0.28s var(--ease), background 0.28s var(--ease), color 0.28s var(--ease);
}
.addr-pill .dot {
  width: 6px; height: 6px;
  background: var(--moss);
  box-shadow: 0 0 0 3px rgba(125, 154, 88, 0.18);
  flex: 0 0 auto;
}
.addr-pill:hover { border-color: var(--gold); background: rgba(216, 163, 90, 0.08); }
.addr-pill.is-copied { border-color: var(--moss); color: var(--moss); }

@media (max-width: 720px) {
  :root { --header-h: 58px; }
  .header-side { display: none; }
  .brand-text em { display: none; }
  .nav { gap: 13px; }
  .nav-link { font-size: 13px; }
}

@media (max-width: 380px) {
  .brand-text strong { font-size: 16px; letter-spacing: 0.06em; }
  .nav { gap: 10px; }
  .nav-link { font-size: 12.5px; }
}

/* ---------- 通用版式 ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  position: relative;
  padding: clamp(64px, 9vw, 132px) 0;
}

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

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  margin-bottom: 22px;
}
.kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.section--paper .kicker { color: rgba(10, 16, 13, 0.6); }

.title-xl {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30px, 4.6vw, 56px);
  line-height: 1.18;
  letter-spacing: 0.01em;
  margin: 0;
  text-wrap: balance;
}

.lede {
  color: var(--text-dim);
  font-size: clamp(14px, 1.5vw, 17px);
  line-height: 1.9;
  max-width: 34em;
  margin: 18px 0 0;
}
.section--paper .lede { color: rgba(10, 16, 13, 0.66); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 24px;
  font-size: 14px;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--gold);
  color: var(--ink);
}
.btn--primary:hover { background: #e6b26b; }

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); background: rgba(216, 163, 90, 0.06); }

.section--paper .btn--ghost { border-color: rgba(10, 16, 13, 0.3); color: var(--ink); }
.section--paper .btn--ghost:hover { border-color: var(--ink); background: rgba(10, 16, 13, 0.06); }
.section--paper .btn--primary { background: var(--ink); color: var(--paper); }
.section--paper .btn--primary:hover { background: #182a21; }

/* ---------- 滚动显现（进出视野均可回滚） ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.75s var(--ease),
    transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

.reveal--fade {
  transform: none;
  opacity: 0;
}

.reveal--left {
  transform: translateX(-30px);
}

.reveal--scale {
  transform: scale(0.94);
  transform-origin: 50% 100%;
}

/* 麦金细线：随显现展开，滚回时收回 */
.rule {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease);
  transition-delay: var(--d, 0s);
}
.rule.is-in { transform: scaleX(1); }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--ink-2);
  padding: clamp(40px, 6vw, 72px) 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
}
@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.footer-brand .mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  clip-path: circle(47%);
  object-fit: cover;
  flex: 0 0 auto;
}
.footer-brand h3 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.1em;
  margin: 0 0 6px;
}
.footer-brand p {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  max-width: 24em;
  line-height: 1.7;
}

.footer-col h4 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  font-size: 14px;
  color: rgba(235, 228, 211, 0.82);
  transition: color 0.25s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer-col a:hover { color: var(--gold); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  align-items: center;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: rgba(169, 173, 153, 0.8);
}
.footer-bottom code {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--text-dim);
}

/* ---------- 提示浮层 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 18px);
  z-index: 9995;
  padding: 12px 20px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 无障碍 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .rule {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .reveal { opacity: 1; transform: none; }
  .rule { transform: scaleX(1); }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
