/* =========================================================
   /assets/site.css — 共享外壳与基础组件
   ========================================================= */

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

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

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

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

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

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

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

input, textarea, select { font: inherit; }

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

/* ---------- 2. Tokens ---------- */
:root {
  /* 夜色色谱 */
  --ink: #0A0F2C;
  --panel: #121A45;
  --line: #26306B;
  --gold: #E8C56A;
  --coral: #F0724E;
  --mist: #A78BDA;
  --ivory: #F5F1E6;
  --star: #9AA3C9;
  --black: #14162B;
  --mint: #6FE3C4;

  /* 字体 */
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;

  /* 度量 */
  --rail-w: 236px;
  --gutter: clamp(20px, 4vw, 56px);
  --maxw: 1240px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 420ms;
}

/* ---------- 3. 基底与中文排版 ---------- */
body {
  min-height: 100vh;
  background-color: var(--ink);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at 84% -12%, rgba(167, 139, 218, 0.22), transparent 62%),
    radial-gradient(760px 520px at 6% 106%, rgba(232, 197, 106, 0.11), transparent 66%),
    radial-gradient(520px 420px at 46% 42%, rgba(38, 48, 107, 0.55), transparent 70%),
    var(--ink);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.01em;
}

p { max-width: 40em; }

::selection {
  background: var(--gold);
  color: var(--black);
}

/* ---------- 4. 焦点与可访问性 ---------- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: fixed;
  top: -72px;
  left: 12px;
  z-index: 300;
  padding: 11px 20px;
  background: var(--gold);
  color: var(--black);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  border-radius: 0;
  transition: top 0.24s var(--ease);
}

.skip-link:focus {
  top: 12px;
  outline: 2px solid var(--ivory);
  outline-offset: 2px;
}

/* ---------- 5. 头部外壳 ---------- */
.site-header { display: contents; }

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

/* --- 5.1 桌面侧边轨道 --- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 80;
  display: none;
  width: var(--rail-w);
  flex-direction: column;
  padding: 26px 22px 22px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rail__brand {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.rail__mark {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: 0.42em;
  color: var(--ivory);
  transition: color 0.24s var(--ease);
}

.rail__brand:hover .rail__mark { color: var(--gold); }

.rail__tagline {
  writing-mode: vertical-rl;
  font-family: var(--font-body);
  font-size: 10.5px;
  line-height: 1.1;
  letter-spacing: 0.34em;
  color: var(--star);
}

.rail__nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 24px;
}

.rail__link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 11px;
  padding: 10px 0 10px 15px;
  color: var(--star);
  transition: color 0.2s var(--ease), padding-left 0.2s var(--ease);
}

.rail__link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 0;
  background: var(--gold);
  transform: translateY(-50%);
  transition: height 0.3s var(--ease);
}

.rail__link:hover {
  color: var(--ivory);
  padding-left: 19px;
}

.rail__link:hover::before { height: 14px; }

.rail__link[aria-current="page"] {
  color: var(--ivory);
  padding-left: 19px;
}

.rail__link[aria-current="page"]::before { height: 22px; }

.rail__index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--mist);
  transition: color 0.2s var(--ease);
}

.rail__link[aria-current="page"] .rail__index { color: var(--gold); }

.rail__label {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
}

.rail__util {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.rail__util-note {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--star);
  text-transform: uppercase;
}

.rail__util-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  background: var(--coral);
  color: #1A0C07;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  border: 1px solid var(--coral);
  border-radius: 0;
  transition: background 0.22s var(--ease), color 0.22s var(--ease), border-color 0.22s var(--ease);
}

.rail__util-link::after {
  content: "→";
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: 0.75;
}

.rail__util-link:hover { background: #F78E6F; border-color: #F78E6F; }

.rail__util-link--ghost {
  background: transparent;
  color: var(--gold);
  border-color: var(--line);
}

.rail__util-link--ghost:hover {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}

/* --- 5.2 移动顶栏 --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px var(--gutter);
  background: rgba(10, 15, 44, 0.94);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.topbar__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: 0.14em;
  color: var(--ivory);
}

.topbar__brand:hover { color: var(--gold); }

.topbar__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  color: var(--ivory);
  border-radius: 0;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.topbar__toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.topbar__toggle-bars {
  position: relative;
  display: block;
  width: 16px;
  height: 1px;
  background: currentColor;
}

.topbar__toggle-bars::before,
.topbar__toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1px;
  background: currentColor;
}

.topbar__toggle-bars::before { top: -5px; }
.topbar__toggle-bars::after { top: 5px; }

.topbar__toggle-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

/* --- 5.3 移动抽屉 --- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  padding: 18px var(--gutter) 32px;
  background: var(--ink);
  background-image:
    radial-gradient(620px 420px at 88% -8%, rgba(167, 139, 218, 0.24), transparent 64%),
    radial-gradient(520px 380px at 4% 104%, rgba(232, 197, 106, 0.1), transparent 66%);
  color: var(--ivory);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s linear 0.3s;
}

.drawer[data-open] {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s linear 0s;
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.drawer__title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.26em;
  color: var(--gold);
  text-transform: uppercase;
  max-width: none;
}

.drawer__close {
  padding: 8px 15px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ivory);
  border-radius: 0;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.drawer__close:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.drawer__nav {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

.drawer__link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 15px 2px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: clamp(21px, 5.4vw, 28px);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ivory);
  transition: color 0.2s var(--ease), padding-left 0.2s var(--ease);
}

.drawer__link:hover,
.drawer__link[aria-current="page"] {
  color: var(--gold);
  padding-left: 8px;
}

.drawer__index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--mist);
}

.drawer__label { line-height: 1.2; }

.drawer__foot {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: auto;
  padding-top: 30px;
}

.drawer__util {
  display: grid;
  gap: 10px;
}

.drawer__util-link {
  display: block;
  padding: 13px;
  text-align: center;
  background: var(--coral);
  border: 1px solid var(--coral);
  color: #1A0C07;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.13em;
  border-radius: 0;
}

.drawer__util-link--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--gold);
}

.drawer__note {
  font-size: 12px;
  color: var(--star);
  word-break: break-word;
  max-width: none;
}

@media (min-width: 1024px) {
  .rail { display: flex; }
  .topbar { display: none; }
  .drawer { display: none; }
}

/* ---------- 6. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(64px, 9vw, 132px);
  padding: clamp(40px, 6vw, 76px) var(--gutter) 30px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  color: var(--star);
  font-size: 13px;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  width: 72px;
  height: 2px;
  background: var(--gold);
}

.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 0.75fr));
  gap: clamp(26px, 4vw, 56px);
  max-width: var(--maxw);
  margin: 0 auto;
}

.footer__brand {
  display: inline-block;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gold);
  font-family: var(--font-display);
  font-size: clamp(21px, 2.4vw, 27px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ivory);
}

.footer__brand:hover { color: var(--gold); }

.footer__intro {
  margin-top: 16px;
  max-width: 34em;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--star);
}

.footer__note {
  margin-top: 12px;
  max-width: 34em;
  font-size: 12px;
  line-height: 1.8;
  color: var(--star);
  opacity: 0.82;
}

.footer__col { min-width: 0; }

.footer__heading {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
}

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

.footer__link {
  display: inline-block;
  font-size: 13px;
  color: var(--star);
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.footer__link:hover {
  color: var(--ivory);
  border-bottom-color: var(--gold);
}

.footer__contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px 32px;
  max-width: var(--maxw);
  margin: clamp(32px, 5vw, 56px) auto 0;
  padding-top: clamp(20px, 3vw, 28px);
  border-top: 1px solid var(--line);
}

.footer__contact-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.footer__contact-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
}

.footer__contact-value {
  font-size: 13px;
  color: var(--ivory);
  word-break: break-word;
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: var(--maxw);
  margin: clamp(22px, 4vw, 34px) auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--star);
}

.footer__copy,
.footer__icp { max-width: none; }

@media (max-width: 900px) {
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__brand-col { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .footer__grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .footer__legal { flex-direction: column; align-items: flex-start; }
}

/* ---------- 7. 内容容器与网格 ---------- */
.shell {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.shell--narrow { max-width: 820px; }

.grid {
  display: grid;
  gap: clamp(20px, 3vw, 40px);
}

.grid--7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.grid--8-4 { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }

@media (max-width: 900px) {
  .grid--7-5,
  .grid--8-4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 8. 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.22s var(--ease), color 0.22s var(--ease),
              border-color 0.22s var(--ease), transform 0.22s var(--ease);
}

.btn:hover { transform: translateY(-1px); }

.btn--gold {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
}

.btn--gold:hover { background: #F3D68C; border-color: #F3D68C; }

.btn--coral {
  background: var(--coral);
  color: #1A0C07;
  border-color: var(--coral);
}

.btn--coral:hover { background: #F78E6F; border-color: #F78E6F; }

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

.btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn--sm {
  padding: 9px 16px;
  font-size: 12px;
  letter-spacing: 0.12em;
}

/* ---------- 9. 面包屑 ---------- */
.breadcrumb {
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--star);
}

.breadcrumb__item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  color: var(--line);
}

.breadcrumb__link {
  color: var(--star);
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.breadcrumb__link:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.breadcrumb__current { color: var(--ivory); }

/* ---------- 10. 长文阅读区 ---------- */
.prose {
  background: var(--ivory);
  color: var(--black);
  padding: clamp(24px, 5vw, 64px);
  border-radius: 0;
}

.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-display);
  color: var(--black);
  line-height: 1.32;
}

.prose h2 {
  margin-top: 1.9em;
  font-size: clamp(23px, 3vw, 33px);
  font-weight: 700;
}

.prose h3 {
  margin-top: 1.6em;
  font-size: clamp(18px, 2vw, 23px);
}

.prose p {
  margin-top: 1em;
  max-width: 38em;
  line-height: 1.9;
}

.prose a {
  color: #8A5A12;
  border-bottom: 1px solid currentColor;
}

.prose a:hover { color: var(--coral); }

.prose ul,
.prose ol { margin-top: 1em; }

.prose li {
  position: relative;
  margin-top: 0.55em;
  padding-left: 20px;
  max-width: 38em;
}

.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.92em;
  width: 9px;
  height: 1px;
  background: var(--coral);
}

.prose strong { font-weight: 700; }

/* ---------- 11. 基础组件 ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: clamp(18px, 3vw, 32px);
}

.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(--gold);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--gold);
}

.rule {
  height: 1px;
  margin-block: clamp(30px, 5vw, 60px);
  border: 0;
  background: var(--line);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.6;
  color: var(--star);
}

.tag--gold { color: var(--gold); border-color: rgba(232, 197, 106, 0.45); }
.tag--coral { color: var(--coral); border-color: rgba(240, 114, 78, 0.45); }
.tag--mist { color: var(--mist); border-color: rgba(167, 139, 218, 0.45); }
.tag--mint { color: var(--mint); border-color: rgba(111, 227, 196, 0.45); }

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px rgba(111, 227, 196, 0.85);
}

/* ---------- 12. 图片容器 ---------- */
.media {
  position: relative;
  margin: 0;
  border-radius: 0;
}

.media__frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(152deg, #121A45 0%, #1D2559 52%, #2C1F52 78%, #3A2456 100%);
  border: 1px solid var(--line);
  border-radius: 0;
}

.media__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(320px 220px at 78% 12%, rgba(167, 139, 218, 0.35), transparent 70%),
    radial-gradient(260px 180px at 14% 92%, rgba(232, 197, 106, 0.18), transparent 72%);
}

.media__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media__caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.06em;
  color: var(--star);
  max-width: none;
}

.media--wide .media__frame { aspect-ratio: 21 / 9; }
.media--portrait .media__frame { aspect-ratio: 4 / 5; }
.media--square .media__frame { aspect-ratio: 1 / 1; }

/* ---------- 13. 滚动显现与进度 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  will-change: opacity, transform;
}

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

.scroll-progress {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 150;
  width: 2px;
  height: 100vh;
  background: linear-gradient(180deg, var(--gold) 0%, var(--coral) 58%, var(--mist) 100%);
  transform: scaleY(0);
  transform-origin: top center;
  pointer-events: none;
}

/* ---------- 14. 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    transform: none;
  }

  .btn:hover,
  .rail__link:hover,
  .drawer__link:hover {
    transform: none;
  }
}

/* ---------- 15. 断点微调 ---------- */
@media (max-width: 1023px) {
  .rail { display: none; }
  .topbar { display: flex; }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .footer__contact { grid-template-columns: minmax(0, 1fr); }
  .prose { padding: 22px 18px; }
  .scroll-progress { width: 2px; }
}
