/* ==========================================================================
   万象城指南 · 共享样式表 /assets/site.css
   结构：令牌 → 基础 → 页头 → 按钮 → 页脚 → 页面基础件 → 动效与可访问性
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --ink: #0E1B2C;
  --ink-deep: #0A1421;
  --ink-card: #1C2E45;
  --gold: #C9A24B;
  --gold-soft: #E8CE93;
  --paper: #F5F1E8;
  --jade: #4E8C7A;
  --dusk: #C4633C;
  --line: #D8D3C7;
  --muted: #6B7686;
  --surface: #FBF8F1;
  --line-dark: rgba(216, 211, 199, 0.22);
  --paper-72: rgba(245, 241, 232, 0.72);
  --paper-55: rgba(245, 241, 232, 0.55);
  --frame: 1200px;
  --gap: 24px;
  --font-sans: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 2. 基础重置与中文排版 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video, picture { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
code { font-family: var(--font-mono); font-size: 0.94em; }

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
}
h1 {
  font-size: clamp(40px, 6vw, 88px);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.12;
}
h2 { font-size: 28px; }
h3 { font-size: 18px; letter-spacing: 0.03em; }

.mono {
  font-family: var(--font-mono);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 12px;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.site-header :focus-visible,
.site-footer :focus-visible { outline-color: var(--gold-soft); }

/* ---------- 3. 跳转链接 ---------- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 120;
  display: inline-block;
  padding: 10px 20px;
  background: var(--gold);
  color: var(--ink-deep);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  transition: top 0.18s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- 4. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid rgba(201, 162, 75, 0.24);
  box-shadow: 0 1px 0 rgba(10, 20, 33, 0.55);
}

.command-bar {
  background: var(--ink-deep);
  border-bottom: 1px solid var(--line-dark);
}
.command-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  max-width: var(--frame);
  margin-inline: auto;
  padding: 6px clamp(16px, 4vw, 40px);
  font-size: 13px;
  line-height: 1.5;
  color: var(--paper-55);
}
.command-bar__tag {
  letter-spacing: 0.18em;
  color: var(--gold-soft);
}
.command-bar__rule {
  flex: 0 0 1px;
  width: 1px;
  height: 12px;
  background: rgba(216, 211, 199, 0.32);
}
.command-bar__version {
  margin-left: auto;
  display: flex;
  align-items: center;
}
.command-bar__lang {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--paper-55);
  white-space: nowrap;
}
.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 10px;
  border: 1px solid rgba(201, 162, 75, 0.45);
  color: var(--paper-72);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.version-badge:hover {
  border-color: var(--gold-soft);
  color: var(--paper);
}
.version-badge__dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  background: var(--gold);
  transform: rotate(45deg);
}
.version-badge .mono {
  font-size: 12px;
  color: var(--gold-soft);
}

.header-frame {
  max-width: var(--frame);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding-block: 12px;
}

.brand {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
}
.brand__mark {
  position: relative;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(201, 162, 75, 0.7);
  background: linear-gradient(135deg, transparent 0 46%, var(--gold) 46% 54%, transparent 54% 100%);
}
.brand__mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(232, 206, 147, 0.35);
}
.brand__text { min-width: 0; }
.brand__name {
  display: block;
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.1em;
  line-height: 1.25;
}
.brand__tagline {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--paper-55);
}

.nav-toggle {
  order: 2;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(201, 162, 75, 0.45);
  color: var(--gold-soft);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.nav-toggle:hover { border-color: var(--gold-soft); color: var(--paper); }
.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 9px;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1px;
  background: currentColor;
  transition: top 0.2s var(--ease), transform 0.2s var(--ease);
}
.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars::after { top: 8px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 4px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 4px; transform: rotate(-45deg); }
.nav-toggle__label { font-size: 13px; letter-spacing: 0.1em; }

.site-nav {
  order: 3;
  flex: 1 0 100%;
  display: none;
  padding-top: 6px;
  border-top: 1px solid rgba(216, 211, 199, 0.16);
}
.site-nav[data-open="true"] { display: block; }
.site-nav__list {
  display: flex;
  flex-direction: column;
  counter-reset: nav-index;
}
.site-nav__item {
  position: relative;
  counter-increment: nav-index;
}
.site-nav__link {
  position: relative;
  display: block;
  padding: 12px 4px 12px 34px;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--paper-72);
  border-bottom: 1px solid rgba(216, 211, 199, 0.1);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.site-nav__link::before {
  content: counter(nav-index, decimal-leading-zero);
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(232, 206, 147, 0.55);
}
.site-nav__link:hover {
  color: var(--paper);
  background: rgba(28, 46, 69, 0.6);
}
.site-nav__link[aria-current="page"] { color: var(--gold-soft); }
.site-nav__link[aria-current="page"]::before { color: var(--gold); }

.header-actions {
  order: 4;
  flex: 1 0 100%;
  display: none;
  gap: 10px;
}
.site-nav[data-open="true"] ~ .header-actions { display: flex; }
.header-actions .btn { flex: 1 1 0; }

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(216, 211, 199, 0.12);
  pointer-events: none;
}
.scroll-progress__bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-soft) 100%);
  transition: width 0.12s linear;
}

/* ---------- 5. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-align: center;
  border: 1px solid transparent;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease), box-shadow 0.2s var(--ease),
              transform 0.2s var(--ease);
}
.btn--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink-deep);
  box-shadow: 0 8px 20px -14px rgba(201, 162, 75, 0.9);
}
.btn--gold:hover {
  background: var(--gold-soft);
  border-color: var(--gold-soft);
  box-shadow: 0 12px 26px -14px rgba(201, 162, 75, 0.85);
}
.btn--gold:active { transform: translateY(1px); }
.btn--ghost {
  background: transparent;
  border-color: rgba(201, 162, 75, 0.5);
  color: var(--paper);
}
.btn--ghost:hover {
  border-color: var(--gold-soft);
  color: var(--gold-soft);
  background: rgba(28, 46, 69, 0.55);
}
.section--paper .btn--ghost,
.section--paper .btn--ghost:hover {
  color: var(--ink);
  border-color: var(--line);
  background: transparent;
}
.section--paper .btn--ghost:hover {
  border-color: var(--gold);
  color: var(--ink);
}

/* ---------- 6. 页脚 ---------- */
.site-footer {
  position: relative;
  background: var(--ink-deep);
  color: var(--paper);
  border-top: 1px solid rgba(201, 162, 75, 0.3);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(90deg, rgba(216, 211, 199, 0.35) 0 1px, transparent 1px 26px);
  opacity: 0.45;
  pointer-events: none;
}
.footer-frame {
  max-width: var(--frame);
  margin-inline: auto;
  padding: clamp(44px, 6vw, 76px) clamp(16px, 4vw, 40px) clamp(28px, 4vw, 40px);
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 5vw, 56px);
}
.footer-brand { max-width: 36ch; }
.brand--footer {
  margin-bottom: 14px;
  color: var(--paper);
}
.footer-brand__note {
  font-size: 14px;
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: var(--paper-55);
}
.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 20px;
}
.footer-col__title {
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(216, 211, 199, 0.2);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--gold-soft);
}
.footer-col__list { display: grid; gap: 2px; }
.footer-link {
  position: relative;
  display: block;
  padding: 7px 0 7px 14px;
  font-size: 14px;
  letter-spacing: 0.03em;
  color: var(--paper-72);
  transition: color 0.2s var(--ease);
}
.footer-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 0;
  background: var(--gold);
  transform: translateY(-50%);
  transition: height 0.2s var(--ease);
}
.footer-link:hover,
.footer-link:focus-visible { color: var(--paper); }
.footer-link:hover::before,
.footer-link:focus-visible::before { height: 16px; }
.footer-link .mono {
  font-size: 12px;
  color: rgba(245, 241, 232, 0.4);
}
.footer-meta {
  display: grid;
  gap: 6px 32px;
  margin-top: clamp(32px, 5vw, 48px);
  padding-top: 20px;
  border-top: 1px solid rgba(216, 211, 199, 0.2);
  font-size: 13px;
  line-height: 1.7;
  color: var(--paper-55);
}
.footer-meta__version {
  color: var(--gold-soft);
  letter-spacing: 0.08em;
}
.footer-meta__legal,
.footer-meta__contact,
.footer-meta__address { letter-spacing: 0.02em; }
.footer-meta .mono { color: rgba(245, 241, 232, 0.75); }

/* ---------- 7. 页面基础件（供页面专属 CSS 组合） ---------- */
.container {
  width: 100%;
  max-width: var(--frame);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}
.container--narrow { max-width: 860px; }

.section { padding-block: clamp(48px, 7.5vw, 96px); }
.section--paper { background: var(--paper); color: var(--ink); }
.section--dark { background: var(--ink); color: var(--paper); }
.section--band { background: var(--ink-card); color: var(--paper); }
.section--dark .eyebrow,
.section--band .eyebrow { color: var(--gold-soft); }

.breadcrumb {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.breadcrumb__item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.breadcrumb__sep {
  font-family: var(--font-mono);
  color: var(--line);
}
.breadcrumb__link:hover { color: var(--ink); }
.section--dark .breadcrumb,
.section--band .breadcrumb { color: var(--paper-55); }
.section--dark .breadcrumb__link:hover,
.section--band .breadcrumb__link:hover { color: var(--paper); }

.prose { max-width: 38em; }
.prose > * + * { margin-top: 1.1em; }
.prose p {
  font-size: 16px;
  line-height: 1.78;
  letter-spacing: 0.01em;
}
.prose ul,
.prose ol { padding-left: 1.2em; list-style: disc; }
.prose li + li { margin-top: 0.5em; }
.section--dark .prose,
.section--band .prose { color: var(--paper-72); }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}
.grid--split-reverse { grid-template-columns: 1fr; }

.card {
  position: relative;
  padding: clamp(18px, 3vw, 28px);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.card--link:hover,
.card--link:focus-within {
  border-color: var(--gold);
  box-shadow: 0 12px 30px -20px rgba(14, 27, 44, 0.55);
}
.card__index {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.card__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.card__body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
}
.card__meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.section--dark .card,
.section--band .card {
  background: var(--ink-card);
  border-color: var(--line-dark);
  color: var(--paper);
}
.section--dark .card__index,
.section--band .card__index { color: var(--gold-soft); }
.section--dark .card__body,
.section--band .card__body { color: var(--paper-72); }
.section--dark .card__meta,
.section--band .card__meta {
  border-top-color: var(--line-dark);
  color: var(--paper-55);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.tag--gold { border-color: var(--gold); color: #8A6C26; }
.tag--jade { border-color: var(--jade); color: var(--jade); }
.tag--dusk { border-color: var(--dusk); color: var(--dusk); }
.section--dark .tag,
.section--band .tag { border-color: var(--line-dark); color: var(--paper-72); }
.section--dark .tag--gold,
.section--band .tag--gold { border-color: var(--gold); color: var(--gold-soft); }
.section--dark .tag--jade,
.section--band .tag--jade { border-color: rgba(78, 140, 122, 0.7); color: #8FC0B0; }
.section--dark .tag--dusk,
.section--band .tag--dusk { border-color: rgba(196, 99, 60, 0.7); color: #E09270; }

.media {
  position: relative;
  margin: 0;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  background: linear-gradient(155deg, var(--ink-card) 0%, var(--ink-deep) 62%, #0c1a2b 100%);
}
.media--wide { aspect-ratio: 21 / 9; }
.media--tall { aspect-ratio: 3 / 4; }
.media > img,
.media > picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media__inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: rgba(245, 241, 232, 0.42);
}
.media::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(232, 206, 147, 0.18);
  pointer-events: none;
}
.media__caption {
  display: block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.section--dark .media,
.section--band .media { border-color: var(--line-dark); }
.section--dark .media__caption,
.section--band .media__caption { color: var(--paper-55); }

.divider {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--line);
}
.section--dark .divider,
.section--band .divider { background: var(--line-dark); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
  font-size: 14px;
  letter-spacing: 0.04em;
  transition: gap 0.2s var(--ease), color 0.2s var(--ease);
}
.link-arrow::after { content: "→"; }
.link-arrow:hover { gap: 14px; color: var(--gold); }

/* ---------- 8. 入场显现协议 ---------- */
[data-reveal] { opacity: 1; }
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 9. 断点：平板 ---------- */
@media (min-width: 700px) {
  .grid--2,
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
}

/* ---------- 10. 断点：桌面 ---------- */
@media (min-width: 900px) {
  .masthead {
    flex-wrap: nowrap;
    gap: 20px;
    padding-block: 14px;
  }
  .brand { order: 1; flex: 0 1 auto; }
  .nav-toggle { display: none; }
  .site-nav {
    order: 2;
    flex: 1 1 auto;
    display: block;
    margin-left: auto;
    padding-top: 0;
    border-top: 0;
  }
  .site-nav__list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0;
  }
  .site-nav__link {
    padding: 10px 14px 10px 32px;
    border-bottom: 0;
    border-left: 1px solid rgba(216, 211, 199, 0.14);
  }
  .site-nav__item:first-child .site-nav__link { border-left: 0; }
  .site-nav__link::before { left: 14px; }
  .site-nav__link[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--gold);
  }
  .header-actions {
    order: 3;
    flex: 0 0 auto;
    display: flex;
    margin-left: 8px;
  }
  .header-actions .btn { flex: 0 0 auto; }
  .footer-top { grid-template-columns: 1.05fr 2fr; align-items: start; }
  .footer-meta { grid-template-columns: 1fr 1fr; }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--split { grid-template-columns: 5fr 3fr; align-items: start; }
  .grid--split-reverse { grid-template-columns: 3fr 5fr; align-items: start; }
}

/* ---------- 11. 小屏细节 ---------- */
@media (max-width: 479px) {
  .brand__tagline { display: none; }
  .command-bar__rule { display: none; }
  .header-actions { flex-wrap: wrap; }
  .header-actions .btn { flex: 1 1 100%; }
}

/* ---------- 12. 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
