/* ===== 1. Reset ===== */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: #f7f2e8;
  background-image:
    radial-gradient(circle at 10% -4%, rgba(200, 164, 74, 0.12), transparent 44%),
    radial-gradient(circle at 92% 4%, rgba(164, 64, 47, 0.07), transparent 40%);
  background-repeat: no-repeat;
  color: #1a2431;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, dt, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0.05em;
  color: #0f1f33;
}

::selection { background: rgba(200, 164, 74, 0.34); color: #0b1626; }

:focus-visible {
  outline: 2px solid #c8a44a;
  outline-offset: 3px;
}

#main-content:focus { outline: none; }
#main-content:focus-visible { outline: 2px solid #c8a44a; outline-offset: -4px; }

/* ===== 2. Tokens ===== */
:root {
  --ink-900: #0b1626;
  --ink-800: #0f1f33;
  --ink-700: #16293f;
  --ink-600: #1f3550;
  --gold-600: #a8842a;
  --gold-500: #c8a44a;
  --gold-400: #dfc176;
  --paper-50: #f7f2e8;
  --paper-100: #f1e9da;
  --paper-200: #e6dac6;
  --line: #ded2bd;
  --line-strong: #c6b699;
  --cinnabar: #a4402f;
  --muted: #6f6a5e;
  --shell-w: 1180px;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ===== 3. Layout primitives ===== */
.shell {
  width: min(var(--shell-w), 100% - clamp(24px, 6vw, 80px));
  margin-inline: auto;
}

.section { padding-block: clamp(36px, 6vw, 80px); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 32px;
  margin-bottom: clamp(20px, 3vw, 36px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 { font-size: clamp(22px, 3.2vw, 32px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-600);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--gold-500);
  flex: 0 0 auto;
}

.grid {
  display: grid;
  gap: clamp(16px, 2.4vw, 32px);
}
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.rule {
  height: 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: linear-gradient(90deg, var(--line-strong), transparent);
  margin: clamp(24px, 4vw, 48px) 0;
}

/* ===== 4. Skip link ===== */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  transform: translateY(-180%);
  padding: 10px 18px;
  background: var(--gold-500);
  color: var(--ink-900);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-decoration: none;
  transition: transform 0.22s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ===== 5. Header: command bar ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: linear-gradient(180deg, #0d1b2d 0%, #0b1626 100%);
  color: var(--paper-100);
  border-bottom: 1px solid var(--gold-600);
}

.header-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 28px);
  min-height: 78px;
  padding-block: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  text-decoration: none;
  color: inherit;
}

.brand-seal {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--gold-500);
  color: var(--gold-400);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  background: radial-gradient(circle at 30% 24%, rgba(200, 164, 74, 0.24), transparent 72%);
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.brand:hover .brand-seal,
.brand:focus-visible .brand-seal {
  border-color: var(--gold-400);
  color: #f6ecd6;
  background: radial-gradient(circle at 30% 24%, rgba(223, 193, 118, 0.4), transparent 76%);
}

.brand-text { display: block; }

.brand-name {
  display: block;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.25;
  color: #f6f0e2;
}
.brand-sub {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(223, 193, 118, 0.64);
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(223, 193, 118, 0.82);
  white-space: nowrap;
}
.status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--gold-400);
  box-shadow: 0 0 0 3px rgba(200, 164, 74, 0.18);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  background: transparent;
  border: 1px solid rgba(200, 164, 74, 0.55);
  color: var(--paper-100);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.nav-toggle:hover { border-color: var(--gold-400); background: rgba(200, 164, 74, 0.12); }
.nav-toggle.is-active { border-color: var(--gold-400); background: rgba(200, 164, 74, 0.18); }

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 16px;
}
.nav-toggle-bars span {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform 0.25s ease;
}
.nav-toggle.is-active .nav-toggle-bars span:first-child { transform: translateY(2.5px) rotate(45deg); }
.nav-toggle.is-active .nav-toggle-bars span:last-child { transform: translateY(-2.5px) rotate(-45deg); }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.4vw, 20px);
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: stretch;
  gap: clamp(2px, 0.7vw, 8px);
}

.nav-link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
  border: 1px solid transparent;
  color: rgba(241, 233, 218, 0.78);
  text-decoration: none;
  transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}
.nav-link:hover {
  color: #ffffff;
  border-color: rgba(200, 164, 74, 0.45);
  background: rgba(200, 164, 74, 0.09);
}
.nav-index {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(200, 164, 74, 0.7);
  transition: color 0.25s ease;
}
.nav-label {
  font-size: 13.5px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.nav-link[aria-current="page"],
.nav-link[aria-current="page"]:hover {
  color: #ffffff;
  background: rgba(200, 164, 74, 0.16);
  border-color: rgba(223, 193, 118, 0.85);
}
.nav-link[aria-current="page"] .nav-index { color: var(--gold-400); }
.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  background: var(--gold-400);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--gold-500);
  background: linear-gradient(180deg, rgba(200, 164, 74, 0.14), rgba(200, 164, 74, 0.02));
  color: var(--gold-400);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.nav-cta:hover {
  background: var(--gold-500);
  border-color: var(--gold-400);
  color: var(--ink-900);
}

.header-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(200, 164, 74, 0.14);
  overflow: hidden;
  pointer-events: none;
}
.meter-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-400));
}

/* ===== 6. Footer ===== */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 8vw, 96px);
  background: var(--ink-900);
  color: rgba(241, 233, 218, 0.74);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cinnabar) 0 72px, var(--gold-600) 72px 248px, rgba(200, 164, 74, 0.16) 248px 100%);
}

.footer-top { padding-top: 3px; }

.footer-shell {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr 1.3fr;
  gap: clamp(24px, 4vw, 64px);
  padding-block: clamp(40px, 6vw, 72px) clamp(32px, 5vw, 56px);
  align-items: start;
}

.footer-seal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(200, 164, 74, 0.55);
  color: var(--gold-400);
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
  background: radial-gradient(circle at 30% 24%, rgba(200, 164, 74, 0.2), transparent 72%);
}
.footer-name {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #f6f0e2;
}
.footer-motto {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: rgba(241, 233, 218, 0.6);
}
.footer-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(200, 164, 74, 0.2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  line-height: 1.9;
  color: rgba(200, 164, 74, 0.62);
}

.footer-heading {
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-400);
}

.footer-list { display: grid; gap: 9px; }

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(241, 233, 218, 0.76);
  font-size: 13.5px;
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: color 0.22s ease;
}
.footer-link::before {
  content: "";
  width: 10px;
  height: 1px;
  flex: 0 0 auto;
  background: rgba(200, 164, 74, 0.5);
  transition: width 0.22s ease, background-color 0.22s ease;
}
.footer-link:hover { color: var(--gold-400); }
.footer-link:hover::before { width: 18px; background: var(--gold-400); }

.footer-dl { display: grid; gap: 12px; font-size: 13.5px; }
.footer-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}
.footer-row dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: rgba(200, 164, 74, 0.7);
}
.footer-row dd {
  margin: 0;
  color: rgba(241, 233, 218, 0.86);
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}
.footer-hint {
  margin-top: 18px;
  padding-left: 12px;
  border-left: 2px solid rgba(200, 164, 74, 0.35);
  font-size: 12px;
  line-height: 1.9;
  color: rgba(241, 233, 218, 0.52);
}

.footer-bottom {
  border-top: 1px solid rgba(200, 164, 74, 0.2);
  background: rgba(0, 0, 0, 0.22);
}
.footer-bottom-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding-block: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(241, 233, 218, 0.55);
}
.footer-legal { margin: 0; }

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
}
.footer-legal-links a {
  color: rgba(241, 233, 218, 0.68);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.22s ease, border-color 0.22s ease;
}
.footer-legal-links a:hover {
  color: var(--gold-400);
  border-bottom-color: var(--gold-400);
}

.to-top {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(200, 164, 74, 0.42);
  background: transparent;
  color: rgba(223, 193, 118, 0.92);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }
.to-top:hover {
  background: var(--gold-500);
  border-color: var(--gold-400);
  color: var(--ink-900);
}

/* ===== 7. Shared components ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border: 1px solid var(--gold-600);
  background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
  color: var(--ink-900);
  font-size: 14px;
  letter-spacing: 0.16em;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.25s ease, background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn:hover { filter: brightness(1.07); }

.btn--ghost {
  background: transparent;
  color: var(--ink-800);
  border-color: var(--line-strong);
}
.btn--ghost:hover {
  border-color: var(--gold-600);
  color: var(--gold-600);
  filter: none;
}

.btn--ink {
  background: var(--ink-800);
  border-color: var(--ink-800);
  color: var(--paper-100);
}
.btn--ink:hover {
  background: var(--ink-600);
  border-color: var(--gold-600);
  color: #ffffff;
  filter: none;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(18px, 3vw, 32px);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.crumbs li { display: inline-flex; align-items: center; gap: 8px; }
.crumbs li + li::before { content: "/"; color: var(--line-strong); }
.crumbs a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.crumbs a:hover { color: var(--gold-600); border-bottom-color: var(--gold-500); }

.prose {
  max-width: 68ch;
  font-size: 15.5px;
  line-height: 1.95;
  color: #2c333d;
}
.prose p + p { margin-top: 1em; }
.prose h2 {
  margin: 2em 0 0.7em;
  font-size: clamp(20px, 2.4vw, 26px);
}
.prose h3 {
  margin: 1.8em 0 0.6em;
  font-size: 17px;
  letter-spacing: 0.06em;
}
.prose ul { padding-left: 0; }
.prose li {
  position: relative;
  margin-top: 0.55em;
  padding-left: 20px;
}
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.8em;
  width: 8px;
  height: 1px;
  background: var(--gold-600);
}
.prose a {
  color: var(--cinnabar);
  text-decoration: none;
  border-bottom: 1px solid rgba(164, 64, 47, 0.4);
}
.prose a:hover { border-bottom-color: var(--cinnabar); }

.card {
  position: relative;
  padding: clamp(18px, 2.6vw, 30px);
  border: 1px solid var(--line);
  background: var(--paper-100);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 12px 26px -24px rgba(11, 22, 38, 0.6);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  border-color: var(--gold-500);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 20px 36px -28px rgba(11, 22, 38, 0.75);
}
.card h3 {
  font-size: 19px;
  letter-spacing: 0.06em;
}
.card p {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink-600);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
}
.tag--gold {
  border-color: rgba(200, 164, 74, 0.6);
  background: rgba(200, 164, 74, 0.1);
  color: var(--gold-600);
}
.tag--red {
  border-color: rgba(164, 64, 47, 0.42);
  background: rgba(164, 64, 47, 0.07);
  color: var(--cinnabar);
}

/* 图片容器基础规则：页面阶段放入 img 即可 */
.media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--paper-200), #cfc2a8);
}
.media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.72) contrast(1.03) brightness(1.02);
}
.media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 22, 38, 0) 55%, rgba(11, 22, 38, 0.26));
  pointer-events: none;
}
.media--wide { aspect-ratio: 16 / 9; }
.media--tall { aspect-ratio: 3 / 4; }
.media--square { aspect-ratio: 1 / 1; }
.media--band { aspect-ratio: 21 / 9; }

/* ===== 8. Reveal protocol ===== */
html.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s cubic-bezier(0.2, 0.7, 0.3, 1), transform 0.65s cubic-bezier(0.2, 0.7, 0.3, 1);
}
html.js-ready [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ===== 9. Responsive ===== */
@media (max-width: 980px) {
  .header-status { display: none; }
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: 10px clamp(20px, 6vw, 40px) 24px;
    background: linear-gradient(180deg, #0b1626 0%, #101f33 100%);
    border-bottom: 1px solid rgba(200, 164, 74, 0.42);
    box-shadow: 0 30px 46px -28px rgba(0, 0, 0, 0.85);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
  .site-nav[data-open="true"] { display: flex; }

  .nav-list { flex-direction: column; gap: 0; width: 100%; }
  .nav-item { border-bottom: 1px solid rgba(200, 164, 74, 0.15); }
  .nav-item:last-child { border-bottom: 0; }

  .nav-link {
    flex-direction: row;
    align-items: baseline;
    gap: 14px;
    padding: 14px 6px;
    border: 1px solid transparent;
  }
  .nav-link .nav-index { font-size: 10px; }
  .nav-link .nav-label { font-size: 15px; letter-spacing: 0.16em; }
  .nav-link[aria-current="page"],
  .nav-link[aria-current="page"]:hover {
    background: rgba(200, 164, 74, 0.1);
    border-color: transparent;
    border-left: 2px solid var(--gold-400);
    padding-left: 12px;
  }
  .nav-link[aria-current="page"]::after { display: none; }

  .nav-cta { margin-top: 18px; padding: 13px 20px; }

  .footer-shell { grid-template-columns: 1fr 1fr; }
  .footer-contact { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .grid--3,
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: minmax(0, 1fr); }

  .footer-shell { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .footer-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .footer-row dt { letter-spacing: 0.2em; }

  .footer-bottom-shell { flex-direction: column; align-items: flex-start; }
  .to-top { margin-left: 0; }
}

@media (max-width: 520px) {
  .brand-seal { width: 38px; height: 38px; font-size: 19px; }
  .brand-name { font-size: 16px; letter-spacing: 0.12em; }
  .brand-sub { font-size: 9px; letter-spacing: 0.16em; }
  .header-shell { min-height: 68px; }
}

/* ===== 10. Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html.js-ready [data-reveal] { opacity: 1; transform: none; }
}
