/* =========================================================
   九洲平台 · 共享样式表  /assets/site.css
   夜航灯塔色系：靛蓝夜底 + 暖琥珀强调 + 旧纸黄纸页
   ========================================================= */

:root {
  --indigo-night: #131E36;
  --indigo-deep: #1B2C4B;
  --indigo-mid: #2A4166;

  --amber: #D99836;
  --amber-bright: #F0BC6A;

  --paper-yellow: #EFE2C6;
  --paper-white: #FBF6EC;

  --signal-orange: #F2632E;
  --rock-gray: #5B6577;
  --ink: #0C1420;

  --rail-width: 236px;
  --rail-mobile-width: 292px;
  --shell-max: 1180px;

  --line-warm: rgba(217, 152, 54, 0.28);
  --line-warm-soft: rgba(217, 152, 54, 0.14);
  --line-cool: rgba(42, 65, 102, 0.85);

  --text-on-dark: rgba(239, 226, 198, 0.88);
  --text-on-dark-dim: rgba(239, 226, 198, 0.58);

  --font-title: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
  --font-body: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease-page: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow-paper: 0 18px 36px -24px rgba(12, 20, 32, 0.85);
}

/* ---------------- Reset ---------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background-color: var(--indigo-night);
  background-image:
    linear-gradient(to right, rgba(217, 152, 54, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(217, 152, 54, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-nav-locked { overflow: hidden; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--paper-yellow);
  text-wrap: balance;
}

p, figure, blockquote, dl, dd { margin: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

hr { border: 0; }

::selection {
  background: var(--amber);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--amber-bright);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------------- 骨架 ---------------- */

.site-header {
  position: relative;
  z-index: 50;
}

#main-content {
  display: block;
}

@media (min-width: 1024px) {
  body { padding-left: var(--rail-width); }
}

/* ---------------- 跳过链接 ---------------- */

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 90;
  padding: 11px 18px;
  background: var(--amber-bright);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  border: 1px solid var(--ink);
  transform: translateY(-180%);
  transition: transform 0.2s var(--ease-page);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------------- 阅读进度条 ---------------- */

.progress-rail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  background: rgba(42, 65, 102, 0.6);
  pointer-events: none;
}

.progress-rail__bar {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--amber) 0%, var(--amber-bright) 55%, var(--signal-orange) 100%);
}

@media (min-width: 1024px) {
  .progress-rail { left: var(--rail-width); }
}

/* ---------------- 移动端抽屉按钮 ---------------- */

.nav-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  background: var(--indigo-deep);
  border: 1px solid rgba(217, 152, 54, 0.55);
  border-radius: 2px;
  color: var(--paper-yellow);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  box-shadow: 0 10px 24px -14px rgba(12, 20, 32, 0.9);
  transition: border-color 0.18s var(--ease-page), background-color 0.18s var(--ease-page);
}

.nav-toggle:hover {
  border-color: var(--amber-bright);
  background: var(--indigo-mid);
}

.nav-toggle__bars {
  display: block;
  width: 18px;
}

.nav-toggle__bars i {
  display: block;
  height: 2px;
  background: var(--amber);
  border-radius: 1px;
}

.nav-toggle__bars i + i { margin-top: 4px; }

.nav-toggle__bars i:nth-child(2) { width: 70%; }

.nav-toggle__label { display: inline; }

.nav-toggle__label[data-label-close] { display: none; }

.nav-toggle[aria-expanded="true"] .nav-toggle__label[data-label-open] { display: none; }

.nav-toggle[aria-expanded="true"] .nav-toggle__label[data-label-close] { display: inline; }

.nav-toggle[aria-expanded="true"] {
  border-color: var(--amber-bright);
  background: var(--indigo-mid);
}

/* ---------------- 遮罩 ---------------- */

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 62;
  background: rgba(12, 20, 32, 0.74);
  opacity: 1;
}

.nav-scrim[hidden] { display: none; }

/* ---------------- 侧边轨道导航 ---------------- */

.side-rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--rail-mobile-width);
  max-width: 86vw;
  z-index: 65;
  display: flex;
  flex-direction: column;
  padding: 64px 0 0;
  background-color: var(--indigo-deep);
  border-right: 1px solid var(--indigo-mid);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(-102%);
  transition: transform 0.28s var(--ease-page);
  box-shadow: 18px 0 40px -30px rgba(0, 0, 0, 0.9);
}

.side-rail[data-open] {
  transform: translateX(0);
}

.side-rail::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(217, 152, 54, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(217, 152, 54, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}

.rail-head,
.rail-groups,
.rail-foot {
  position: relative;
  z-index: 1;
}

.rail-head {
  padding: 0 20px 18px;
  border-bottom: 1px solid var(--line-warm-soft);
}

.rail-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.rail-brand__mark {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: rgba(217, 152, 54, 0.1);
  border: 1px solid var(--amber);
  color: var(--amber-bright);
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 20px;
  line-height: 1;
}

.rail-brand__text {
  display: block;
  min-width: 0;
}

.rail-brand__name {
  display: block;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--paper-yellow);
}

.rail-brand__tag {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  color: var(--text-on-dark-dim);
}

.rail-groups {
  flex: 1 1 auto;
  padding: 18px 0 10px;
}

.rail-group + .rail-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-cool);
}

.rail-group__label {
  padding: 0 20px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(239, 226, 198, 0.42);
}

.rail-group--index {
  padding-top: 16px;
  padding-bottom: 16px;
  background: linear-gradient(180deg, rgba(42, 65, 102, 0.62) 0%, rgba(42, 65, 102, 0.16) 100%);
  border-top: 1px solid rgba(217, 152, 54, 0.4);
  border-bottom: 1px solid var(--line-warm-soft);
}

.rail-group--index .rail-group__label {
  color: var(--amber);
}

.rail-list {
  display: flex;
  flex-direction: column;
}

.rail-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 20px;
  border-left: 2px solid transparent;
  color: rgba(239, 226, 198, 0.78);
  font-size: 15px;
  line-height: 1.5;
  transition: color 0.16s var(--ease-page),
              background-color 0.16s var(--ease-page),
              border-color 0.16s var(--ease-page);
}

.rail-link:hover {
  color: var(--paper-yellow);
  background: rgba(42, 65, 102, 0.62);
  border-left-color: var(--amber);
}

.rail-link[aria-current="page"] {
  color: var(--amber-bright);
  background: rgba(217, 152, 54, 0.13);
  border-left-color: var(--amber-bright);
}

.rail-link--major {
  align-items: center;
  padding: 13px 20px;
}

.rail-link__num {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--amber);
}

.rail-link__text {
  display: inline-block;
}

.rail-link--major[aria-current="page"] .rail-link__num {
  color: var(--signal-orange);
}

.rail-foot {
  margin-top: auto;
  padding: 16px 20px 22px;
  border-top: 1px solid var(--line-warm-soft);
  background: rgba(19, 30, 54, 0.72);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.06em;
  color: var(--text-on-dark-dim);
}

.rail-foot__pos {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.rail-foot__num {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--signal-orange);
}

.rail-foot__label {
  letter-spacing: 0.1em;
  color: rgba(239, 226, 198, 0.82);
}

.rail-foot__line {
  display: block;
  word-break: break-all;
}

/* ---------------- 桌面端：轨道常驻 ---------------- */

@media (min-width: 1024px) {
  .nav-toggle { display: none; }

  .nav-scrim { display: none !important; }

  .side-rail {
    width: var(--rail-width);
    max-width: none;
    padding-top: 24px;
    padding-bottom: 0;
    transform: none;
    transition: none;
    box-shadow: none;
  }

  .side-rail[data-open] { transform: none; }

  .side-rail::after {
    content: "";
    position: absolute;
    top: 0;
    right: -1px;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, var(--amber) 0%, rgba(217, 152, 54, 0.08) 42%, transparent 100%);
    opacity: 0.55;
    pointer-events: none;
  }
}

/* ---------------- 页脚 ---------------- */

.site-footer {
  position: relative;
  margin-top: 72px;
  padding: 48px 24px 26px;
  background-color: var(--indigo-deep);
  border-top: 1px solid var(--indigo-mid);
  color: var(--text-on-dark);
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(217, 152, 54, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(217, 152, 54, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
}

.site-footer > * {
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  gap: 34px;
  max-width: var(--shell-max);
  margin: 0 auto;
}

.footer-brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  background: rgba(217, 152, 54, 0.1);
  border: 1px solid var(--amber);
  color: var(--amber-bright);
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 19px;
  line-height: 1;
}

.footer-brand__name {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--paper-yellow);
}

.footer-brand__tag {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-on-dark-dim);
}

.footer-brand .btn {
  margin-top: 18px;
}

.footer-brand__meta {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(239, 226, 198, 0.42);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 20px;
}

.footer-col__title {
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line-warm);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-links a {
  display: inline-block;
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  font-size: 14px;
  color: rgba(239, 226, 198, 0.72);
  transition: color 0.16s var(--ease-page), border-color 0.16s var(--ease-page);
}

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

.footer-links a[aria-current="page"] {
  color: var(--amber-bright);
  border-bottom-color: var(--amber-bright);
}

.footer-contact__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.footer-contact__list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
  line-height: 1.6;
}

.footer-contact__key {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid rgba(217, 152, 54, 0.42);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.footer-contact__val {
  color: var(--text-on-dark);
  word-break: break-word;
}

.footer-contact__note {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-on-dark-dim);
  border-left: 2px solid var(--line-warm);
  padding-left: 10px;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 26px;
  max-width: var(--shell-max);
  margin: 36px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line-cool);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(239, 226, 198, 0.45);
}

.footer-record {
  display: inline-flex;
  align-items: center;
  color: rgba(239, 226, 198, 0.7);
}

.footer-record::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 9px;
  background: var(--signal-orange);
}

.footer-update { letter-spacing: 0.06em; }

.footer-copy { letter-spacing: 0.08em; }

@media (min-width: 640px) {
  .footer-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .site-footer { padding: 56px 40px 28px; }

  .footer-grid {
    grid-template-columns: 220px minmax(0, 1fr) 268px;
    gap: 40px;
    align-items: start;
  }
}

/* ---------------- 通用容器与网格 ---------------- */

.wrap {
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .wrap { padding: 0 40px; }
}

.measure {
  max-width: 68ch;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid--2,
.grid--3 {
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 860px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------------- 夜面卡片 / 纸页 ---------------- */

.plate {
  position: relative;
  padding: 24px;
  background-color: var(--indigo-mid);
  border: 1px solid var(--line-warm);
  color: var(--text-on-dark);
}

.plate::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(251, 246, 236, 0.05);
  pointer-events: none;
}

.paper {
  position: relative;
  padding: 28px;
  background: var(--paper-white);
  color: var(--ink);
  border: 1px solid rgba(12, 20, 32, 0.18);
  box-shadow: var(--shadow-paper);
}

.paper h2,
.paper h3,
.paper h4 {
  color: var(--ink);
}

.paper p {
  color: #22303F;
}

.paper--yellow {
  background: var(--paper-yellow);
}

/* ---------------- 标题与分隔 ---------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
}

.eyebrow::before {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: var(--amber);
}

.section-num {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--signal-orange);
}

.rule {
  display: block;
  height: 1px;
  margin: 32px 0;
  border: 0;
  background: linear-gradient(90deg, var(--amber) 0 48px, var(--line-cool) 48px 100%);
}

/* ---------------- 标签牌 ---------------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(217, 152, 54, 0.5);
  background: rgba(217, 152, 54, 0.1);
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  border-radius: 1px;
}

.tag--orange {
  border-color: rgba(242, 99, 46, 0.6);
  background: rgba(242, 99, 46, 0.12);
  color: var(--signal-orange);
}

.tag--paper {
  border-color: rgba(12, 20, 32, 0.24);
  background: rgba(12, 20, 32, 0.05);
  color: var(--rock-gray);
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--amber);
  border-radius: 2px;
  background: transparent;
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-align: center;
  transition: background-color 0.18s var(--ease-page),
              color 0.18s var(--ease-page),
              border-color 0.18s var(--ease-page);
}

.btn:hover {
  background: rgba(217, 152, 54, 0.14);
  border-color: var(--amber-bright);
  color: var(--paper-yellow);
}

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

.btn--amber:hover {
  background: var(--amber-bright);
  border-color: var(--amber-bright);
  color: var(--ink);
}

.btn--ghost {
  border-color: rgba(239, 226, 198, 0.36);
  color: rgba(239, 226, 198, 0.86);
}

.btn--ghost:hover {
  border-color: var(--amber);
  background: rgba(217, 152, 54, 0.1);
  color: var(--amber-bright);
}

/* ---------------- 面包屑 ---------------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(239, 226, 198, 0.48);
}

.crumbs a {
  color: rgba(239, 226, 198, 0.72);
  border-bottom: 1px solid transparent;
  transition: color 0.16s var(--ease-page), border-color 0.16s var(--ease-page);
}

.crumbs a:hover {
  color: var(--amber-bright);
  border-bottom-color: var(--amber);
}

.crumbs__sep {
  color: var(--amber);
  opacity: 0.6;
}

/* ---------------- 图片容器（页面阶段放置图片） ---------------- */

.media {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-warm);
  background-color: var(--indigo-deep);
  background-image:
    linear-gradient(to right, rgba(217, 152, 54, 0.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(217, 152, 54, 0.09) 1px, transparent 1px);
  background-size: 22px 22px;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--wide { aspect-ratio: 21 / 9; }

.media--square { aspect-ratio: 1 / 1; }

.media--tall { aspect-ratio: 3 / 4; }

.media__caption {
  margin-top: 10px;
  padding-left: 10px;
  border-left: 2px solid var(--amber);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.08em;
  color: var(--rock-gray);
}

.media__caption--light {
  color: var(--text-on-dark-dim);
}

/* ---------------- 统计数字 ---------------- */

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat__num {
  font-family: var(--font-mono);
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--amber-bright);
}

.stat__label {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-on-dark-dim);
}

/* ---------------- 动效克制 & 无障碍 ---------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .skip-link { transition: none; }
}
