/* =========================================================
   PG游艺 · 共享样式表 /assets/site.css
   档案馆 + 制图桌：细线、网格、等宽编号、矿物色
   ========================================================= */

:root {
  --ink: #1F332B;
  --ink-soft: #355247;
  --moss: #6F8A77;
  --stone: #D9D3C7;
  --paper: #EFEAE1;
  --sheet: #FCFBF7;
  --char: #2B2B28;
  --amber: #C88A2E;
  --amber-deep: #8A5A1B;
  --clay: #A8644A;
  --line: #B9B1A4;
  --line-soft: rgba(185, 177, 164, 0.42);
  --line-hair: rgba(185, 177, 164, 0.28);
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.75) inset, 0 12px 32px -24px rgba(31, 51, 43, 0.6);
  --shadow-2: 0 22px 48px -34px rgba(31, 51, 43, 0.7);
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-pill: 999px;
  --font-serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-sans: "Inter", "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --wrap: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body,
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul, ol { padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(185, 177, 164, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(185, 177, 164, 0.13) 1px, transparent 1px);
  background-size: 88px 88px;
  background-position: -1px -1px;
  color: var(--char);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--ink-soft); text-decoration: none; }
a:hover { color: var(--amber-deep); }

button { font: inherit; color: inherit; }

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--amber-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: rgba(200, 138, 46, 0.28); color: var(--ink); }

/* ---------- 中文排版 ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.15; }
h2 { font-size: clamp(1.55rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); line-height: 1.35; }
h4 { font-size: 1.05rem; }

p { text-wrap: pretty; }

.mono,
.eyebrow,
.display-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--moss);
}

.display-num {
  font-size: clamp(2.4rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--clay);
}

.lead {
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 42ch;
}

.prose { max-width: 40em; }
.prose p + p { margin-top: 1em; }
.prose h3 { margin-top: 1.8em; margin-bottom: 0.5em; }

/* ---------- 容器与栅格 ---------- */
.wrap {
  width: min(var(--wrap), calc(100% - 2.5rem));
  margin-inline: auto;
}

.wrap-narrow {
  width: min(760px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.section { padding: clamp(2.6rem, 6vw, 5rem) 0; }

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

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: clamp(1.2rem, 3vw, 2.2rem);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: clamp(1rem, 2.4vw, 1.8rem);
}

.stack > * + * { margin-top: 1rem; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 16.5rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

/* ---------- 面包屑 ---------- */
.crumbs {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--moss);
  padding: 1.1rem 0 0;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 0.45rem;
  color: var(--line);
}

.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--amber-deep); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--sheet);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn:hover { background: var(--stone); color: var(--ink); }

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.btn-primary:hover { background: var(--ink-soft); border-color: var(--ink-soft); color: var(--paper); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn-ghost:hover { background: var(--sheet); border-color: var(--moss); color: var(--ink); }

/* ---------- 标签 / 状态 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--sheet);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  line-height: 1.5;
}

.tag--amber {
  color: var(--amber-deep);
  border-color: rgba(200, 138, 46, 0.5);
  background: rgba(200, 138, 46, 0.09);
}

.tag--clay {
  color: var(--clay);
  border-color: rgba(168, 100, 74, 0.45);
  background: rgba(168, 100, 74, 0.08);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(200, 138, 46, 0.18);
  flex: none;
}

/* ---------- 面板 ---------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--sheet);
  box-shadow: var(--shadow-1);
  padding: clamp(1rem, 2.4vw, 1.45rem);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--moss);
}

/* ---------- 索引侧栏 ---------- */
.rail {
  position: sticky;
  top: 6.5rem;
  align-self: start;
}

.rail-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 0.75rem;
}

.rail-list {
  list-style: none;
  border-top: 1px solid var(--line-soft);
}

.rail-link {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.6rem 0.3rem 0.6rem 0.1rem;
  border-bottom: 1px solid var(--line-hair);
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.5;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.rail-link::before {
  content: "";
  width: 6px;
  height: 1px;
  background: var(--line);
  flex: none;
  transform: translateY(-0.25em);
  transition: width 0.2s var(--ease), background 0.2s var(--ease);
}

.rail-link:hover { color: var(--ink); background: rgba(217, 211, 199, 0.35); }

.rail-link.is-active,
.rail-link[aria-current="true"] {
  color: var(--ink);
  font-weight: 600;
}

.rail-link.is-active::before,
.rail-link[aria-current="true"]::before {
  width: 16px;
  background: var(--amber);
}

/* ---------- 表格 ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
}

.data-table caption {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--moss);
  padding-bottom: 0.6rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--line-hair);
  vertical-align: top;
}

.data-table thead th {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  background: rgba(217, 211, 199, 0.3);
}

.data-table tbody tr:nth-child(even) { background: rgba(217, 211, 199, 0.18); }

/* ---------- 图像容器 ---------- */
.figure-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background-color: var(--sheet);
  background-image:
    linear-gradient(rgba(185, 177, 164, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(185, 177, 164, 0.3) 1px, transparent 1px);
  background-size: 34px 34px;
}

.figure-frame--wide { aspect-ratio: 16 / 9; }

.figure-frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure-caption {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--moss);
}

/* ---------- 进入淡入 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* =========================================================
   头部
   ========================================================= */
.skip-link {
  position: fixed;
  top: -6rem;
  left: 0.9rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  transition: top 0.2s var(--ease);
}

.skip-link:focus { top: 0.9rem; color: var(--paper); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: linear-gradient(180deg, var(--paper) 0%, rgba(239, 234, 225, 0.94) 62%, rgba(239, 234, 225, 0) 100%);
}

.read-progress {
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: rgba(185, 177, 164, 0.3);
  pointer-events: none;
}

.read-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--moss) 0%, var(--amber) 100%);
  transition: transform 0.12s linear;
}

.header-wrap {
  padding-top: 0.85rem;
  padding-bottom: 0.7rem;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.42rem 0.55rem 0.42rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(252, 251, 247, 0.9);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.brand:hover { color: var(--ink); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: var(--radius-s);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  color: var(--moss);
  line-height: 1.3;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--sheet);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.nav-toggle:hover { border-color: var(--moss); }

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 16px;
  height: 12px;
}

.nav-toggle-bars i {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--ink);
  transition: transform 0.22s var(--ease);
}

.site-header[data-open] .nav-toggle-bars i:first-child { transform: translateY(2.75px) rotate(45deg); }
.site-header[data-open] .nav-toggle-bars i:last-child { transform: translateY(-2.75px) rotate(-45deg); }

.nav-panel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  list-style: none;
}

.nav-link {
  display: block;
  padding: 0.45rem 0.68rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.4;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.nav-link:hover {
  background: rgba(217, 211, 199, 0.6);
  color: var(--ink);
}

.nav-link[aria-current="page"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  box-shadow: inset 0 -2px 0 rgba(200, 138, 46, 0.85);
}

.nav-link[aria-current="page"]:hover {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
  color: var(--paper);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.35rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.07em;
  line-height: 1.3;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.nav-cta::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.nav-cta:hover { background: var(--ink); color: var(--paper); }

/* =========================================================
   页脚
   ========================================================= */
.site-footer {
  margin-top: clamp(3rem, 7vw, 6rem);
  background: var(--ink);
  background-image:
    linear-gradient(rgba(239, 234, 225, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239, 234, 225, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  color: rgba(239, 234, 225, 0.76);
  border-top: 3px solid var(--amber);
}

.footer-inner {
  padding: clamp(2.2rem, 5vw, 3.4rem) 0 1.6rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.35fr;
  gap: clamp(1.5rem, 3.5vw, 3rem);
  padding-bottom: clamp(1.6rem, 4vw, 2.4rem);
  border-bottom: 1px solid rgba(239, 234, 225, 0.16);
}

.footer-brand { min-width: 0; }

.footer-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(239, 234, 225, 0.35);
  border-radius: var(--radius-s);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.footer-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--paper);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.footer-note {
  font-size: 14px;
  line-height: 1.75;
  color: rgba(239, 234, 225, 0.66);
  max-width: 32ch;
}

.footer-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.85rem;
}

.footer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-link {
  display: inline-block;
  color: rgba(239, 234, 225, 0.74);
  font-size: 14.5px;
  line-height: 1.6;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.footer-link:hover {
  color: var(--paper);
  border-bottom-color: var(--amber);
}

.footer-contact-list {
  display: grid;
  gap: 0.55rem;
}

.footer-contact-list dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: rgba(239, 234, 225, 0.5);
}

.footer-contact-list dd { margin: 0; }

.footer-value {
  font-size: 14px;
  line-height: 1.65;
  color: rgba(239, 234, 225, 0.82);
  word-break: break-word;
}

.footer-baseline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1.35rem;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: rgba(239, 234, 225, 0.55);
}

.footer-copy { margin: 0; }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  list-style: none;
}

.footer-legal .footer-link {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: rgba(239, 234, 225, 0.6);
}

.footer-legal .footer-link:hover { color: var(--paper); }

.footer-icp { margin: 0; }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1080px) {
  .nav-link { padding: 0.45rem 0.55rem; font-size: 14px; }
  .nav-cta { padding: 0.45rem 0.75rem; font-size: 11.5px; }
  .brand-sub { display: none; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1.2fr; }
  .footer-contact { grid-column: 1 / -1; }
  .footer-contact-list { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .rail { position: static; top: auto; }
  .rail-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0 1rem; }

  .nav-shell {
    flex-wrap: wrap;
    border-radius: 22px;
    padding: 0.5rem 0.6rem;
  }

  .nav-toggle { display: inline-flex; }

  .nav-panel {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    margin-top: 0.55rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--line-soft);
  }

  .site-header[data-open] .nav-panel {
    display: flex;
    animation: navDrop 0.22s var(--ease) both;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
  }

  .nav-link {
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-s);
    font-size: 16px;
    white-space: normal;
  }

  .nav-link[aria-current="page"] { box-shadow: inset 3px 0 0 rgba(200, 138, 46, 0.9); }

  .nav-cta {
    justify-content: center;
    margin: 0.4rem 0 0.2rem;
    padding: 0.7rem 0.9rem;
    font-size: 12.5px;
  }
}

@keyframes navDrop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .wrap { width: calc(100% - 1.6rem); }
  .brand-name { font-size: 15.5px; }
  .brand-mark { width: 30px; height: 30px; font-size: 11px; }
  .header-wrap { padding-top: 0.6rem; padding-bottom: 0.5rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-baseline { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .data-table { font-size: 14px; }
  .data-table th, .data-table td { padding: 0.55rem 0.45rem; }
}

@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;
  }
  .reveal { opacity: 1; transform: none; }
  .read-progress-bar { transition: none; }
}
