/* ============================================================
   麒麟娱乐 · 中文站  /assets/site.css
   共享外壳：重置 / 变量 / 中文排版 / 轨道头部 / 页脚 / 基础组件
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: #7A5E2E #0B0D10;
  scrollbar-width: thin;
}

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

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

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

button, input, select, textarea { font: inherit; color: inherit; }

a { color: inherit; }

/* ---------- 设计变量 ---------- */
:root {
  --ink: #0B0D10;
  --panel: #14181E;
  --gold: #D6A84B;
  --gold-light: #F0D28A;
  --crimson: #C8452F;
  --mist: #8FA3A6;
  --fog: #C9D4D2;
  --ivory: #F4EFE6;
  --slate: #2A3438;
  --bronze: #7A5E2E;

  --rule: rgba(214, 168, 75, 0.22);
  --rule-soft: rgba(143, 163, 166, 0.18);
  --rule-deep: rgba(143, 163, 166, 0.10);

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

  --rail-w: 252px;
  --shell-max: 1180px;
  --gutter: clamp(18px, 4vw, 56px);
  --radius-l: 22px;
  --radius-m: 14px;
  --radius-s: 8px;
  --focus-ring: 2px solid var(--gold-light);
}

/* ---------- 基础 ---------- */
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ivory);
  background-color: var(--ink);
  background-image:
    radial-gradient(1100px 680px at 92% -10%, rgba(122, 94, 46, 0.22), transparent 62%),
    radial-gradient(900px 620px at 2% 108%, rgba(42, 52, 56, 0.62), transparent 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.nav-open { overflow: hidden; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.01em;
  color: var(--ivory);
}

h1 { font-size: clamp(34px, 5.6vw, 74px); }
h2 { font-size: clamp(26px, 3.6vw, 46px); }
h3 { font-size: clamp(20px, 2.4vw, 28px); }
h4 { font-size: clamp(17px, 1.8vw, 21px); }

p { line-height: 1.78; }

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

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 工具 ---------- */
.u-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  font-feature-settings: "tnum" 1;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, var(--rule), var(--rule-deep) 60%, transparent);
}

.annotation {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  color: var(--mist);
  text-transform: uppercase;
}

.annotation--vertical {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.34em;
  font-size: 12px;
  color: var(--mist);
  padding-block: 4px;
}

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 600;
  padding: 11px 20px;
  border-radius: var(--radius-s);
  background: var(--gold);
  color: #0B0D10;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 0.22s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--ivory);
  outline-offset: 2px;
}

/* ============================================================
   轨道头部
   ============================================================ */
.orbit-header {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-w);
  z-index: 220;
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 3vh, 38px);
  padding: clamp(22px, 3.2vh, 42px) 20px clamp(20px, 3vh, 32px) 26px;
  overflow-y: auto;
  background: linear-gradient(180deg, #151A21 0%, #10141A 46%, #0B0D10 100%);
  border-right: 1px solid var(--rule);
}

.orbit-header::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 100%;
  background: repeating-linear-gradient(180deg, var(--gold) 0 10px, transparent 10px 28px);
  opacity: 0.26;
  pointer-events: none;
}

/* 品牌 */
.orbit-brand { flex: 0 0 auto; }

.orbit-brand__link {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: inherit;
}

.orbit-brand__mark {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}

.orbit-brand__mark::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid var(--gold);
  border-radius: 50% 6px 50% 6px;
  transform: rotate(45deg);
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
}

.orbit-brand__mark::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--crimson);
  box-shadow: 0 0 0 3px rgba(200, 69, 47, 0.18);
}

.orbit-brand__link:hover .orbit-brand__mark::before {
  transform: rotate(135deg);
  border-color: var(--gold-light);
}

.orbit-brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.orbit-brand__name {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--ivory);
  line-height: 1.3;
}

.orbit-brand__desc {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--mist);
  white-space: nowrap;
}

/* 移动端抽屉按钮（桌面隐藏） */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 15px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ivory);
  cursor: pointer;
  transition: border-color 0.22s ease, color 0.22s ease, background-color 0.22s ease;
}

.nav-toggle:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  background: rgba(214, 168, 75, 0.07);
}

.nav-toggle__bars {
  display: inline-grid;
  gap: 4px;
  width: 16px;
}

.nav-toggle__bars span {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.nav-toggle__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
}

.orbit-header[data-open] .nav-toggle__bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.orbit-header[data-open] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.orbit-header[data-open] .nav-toggle__bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* 主导航 */
.orbit-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1 1 auto;
  min-height: 0;
}

.orbit-nav__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.orbit-nav__link {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 12px;
  border-radius: var(--radius-s);
  text-decoration: none;
  color: var(--fog);
  font-size: 15px;
  letter-spacing: 0.06em;
  line-height: 1.45;
  transition: color 0.22s ease, background-color 0.22s ease;
}

.orbit-nav__link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 0;
  background: var(--gold);
  transform: translateY(-50%);
  transition: height 0.26s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.26s ease;
}

.orbit-nav__no {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--bronze);
  transition: color 0.22s ease;
}

.orbit-nav__label { min-width: 0; }

.orbit-nav__link:hover {
  color: var(--ivory);
  background: rgba(214, 168, 75, 0.07);
}

.orbit-nav__link:hover .orbit-nav__no { color: var(--gold); }
.orbit-nav__link:hover::before { height: 16px; }

.orbit-nav__link[aria-current="page"] {
  color: var(--ivory);
  background: rgba(214, 168, 75, 0.11);
}

.orbit-nav__link[aria-current="page"]::before {
  height: 22px;
  background: var(--crimson);
}

.orbit-nav__link[aria-current="page"] .orbit-nav__no { color: var(--gold-light); }

.orbit-nav__meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--rule-soft);
}

.orbit-nav__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--mist);
}

.orbit-nav__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--crimson);
  box-shadow: 0 0 0 3px rgba(200, 69, 47, 0.16);
  animation: orbit-pulse 2.8s ease-in-out infinite;
}

@keyframes orbit-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(200, 69, 47, 0.16); }
  50% { box-shadow: 0 0 0 5px rgba(200, 69, 47, 0.06); }
}

.orbit-nav__version {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--gold);
}

/* ============================================================
   内容容器与基础组件
   ============================================================ */
.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.section { padding-block: clamp(28px, 5vw, 58px); }

.section + .section { border-top: 1px solid var(--rule-soft); }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: clamp(18px, 3vw, 34px);
}

.section__title { font-size: clamp(22px, 3vw, 36px); }

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

.prose {
  max-width: 36em;
  color: var(--fog);
}

.prose p + p { margin-top: 1em; }

/* 面包屑 */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(18px, 3vw, 32px);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--mist);
}

.crumbs a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.crumbs a:hover {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}

.crumbs__sep { color: var(--bronze); }

.crumbs [aria-current="page"] { color: var(--fog); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, color 0.24s ease, background-color 0.24s ease;
}

.btn--primary {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 52%, #B98C33 100%);
  color: #0B0D10;
  font-weight: 700;
  box-shadow: 0 12px 26px -16px rgba(214, 168, 75, 0.9);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px -16px rgba(214, 168, 75, 0.95);
}

.btn--ghost {
  border-color: var(--rule);
  background: rgba(20, 24, 30, 0.55);
  color: var(--fog);
}

.btn--ghost:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  color: var(--gold-light);
}

.btn--sm { padding: 9px 18px; font-size: 13.5px; }

/* 档案卡片 */
.panel {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-l);
  background: linear-gradient(158deg, rgba(20, 24, 30, 0.96) 0%, rgba(11, 13, 16, 0.97) 100%);
}

.panel--gold { border-color: rgba(214, 168, 75, 0.36); }

.panel__no {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.lift {
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.28s ease, box-shadow 0.28s ease;
}

.lift:hover {
  transform: translateY(-3px);
  border-color: rgba(214, 168, 75, 0.48);
  box-shadow: 0 20px 38px -28px rgba(0, 0, 0, 0.95);
}

/* 网格 */
.grid {
  display: grid;
  gap: clamp(14px, 2.2vw, 24px);
}

.grid--2 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); }

/* 图片容器（页面阶段放占位内容） */
.frame-media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-l);
  background:
    radial-gradient(120% 120% at 18% 8%, #1C222B 0%, #0B0D10 72%);
}

.frame-media img,
.frame-media svg,
.frame-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame-media--wide { aspect-ratio: 21 / 9; }
.frame-media--tall { aspect-ratio: 3 / 4; }
.frame-media--square { aspect-ratio: 1 / 1; }

.frame-media::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(214, 168, 75, 0.2);
  border-radius: calc(var(--radius-l) - 8px);
  pointer-events: none;
}

.frame-media__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 34px 18px 15px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--fog);
  background: linear-gradient(180deg, transparent, rgba(11, 13, 16, 0.88));
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--mist);
}

.tag--gold { border-color: rgba(214, 168, 75, 0.5); color: var(--gold-light); }
.tag--crimson { border-color: transparent; background: var(--crimson); color: var(--ivory); }

/* 阅读进度尺（由 site.js 注入） */
.scroll-meter {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 500;
  pointer-events: none;
  background: rgba(20, 24, 30, 0.6);
}

.scroll-meter__bar {
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--bronze), var(--gold) 58%, var(--gold-light));
}

/* ============================================================
   页脚
   ============================================================ */
.archive-footer {
  position: relative;
  margin-top: clamp(48px, 8vw, 96px);
  padding: clamp(32px, 5vw, 64px) 0 clamp(22px, 3vw, 34px);
  border-top: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(20, 24, 30, 0) 0%, #12161C 32%, #0B0D10 100%);
}

.archive-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 14px, transparent 14px 36px);
  opacity: 0.24;
}

.archive-footer__inner {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 44px);
}

.archive-footer__brand { min-width: 0; }

.archive-footer__line {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--ivory);
}

.archive-footer__mark {
  display: inline-block;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-right: 11px;
  background: var(--gold);
  border-radius: 50% 2px 50% 2px;
  transform: rotate(45deg);
}

.archive-footer__statement {
  margin-top: 12px;
  max-width: 30em;
  font-size: 15px;
  line-height: 1.8;
  color: var(--mist);
}

.archive-footer__heading {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold);
}

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

.archive-footer__link {
  display: inline-block;
  font-size: 15px;
  text-decoration: none;
  color: var(--fog);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

.archive-footer__contact-line {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--fog);
  word-break: break-all;
}

.archive-footer__contact-note {
  margin-top: 10px;
  max-width: 26em;
  font-size: 13px;
  line-height: 1.7;
  color: var(--mist);
}

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 9px 17px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: border-color 0.22s ease, color 0.22s ease, background-color 0.22s ease;
}

.to-top:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  background: rgba(214, 168, 75, 0.07);
}

.archive-footer__meta {
  margin-top: clamp(26px, 4vw, 46px);
  padding-top: 16px;
  border-top: 1px solid var(--rule-deep);
}

.archive-footer__meta-inner {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--mist);
}

.archive-footer__meta-item--ver { color: var(--gold); }

/* ============================================================
   断点
   ============================================================ */
@media (min-width: 1024px) {
  body { padding-left: var(--rail-w); }
}

@media (min-width: 768px) {
  .archive-footer__inner {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
  .archive-footer__brand { grid-column: 1 / -1; }
}

@media (min-width: 1100px) {
  .archive-footer__inner {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.75fr) minmax(0, 1fr);
    align-items: start;
  }
  .archive-footer__brand { grid-column: auto; }
}

@media (max-width: 1023px) {
  .orbit-header {
    position: sticky;
    top: 0;
    inset: auto;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px var(--gutter);
    overflow: visible;
    background: rgba(11, 13, 16, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    z-index: 230;
  }

  .orbit-header::after { content: none; }

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

  .orbit-brand__mark { width: 28px; height: 28px; }
  .orbit-brand__name { font-size: 16px; letter-spacing: 0.12em; }
  .orbit-brand__desc { font-size: 9.5px; letter-spacing: 0.1em; }

  .orbit-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: auto;
    width: min(320px, 86vw);
    flex: none;
    padding: 26px 20px 30px;
    overflow-y: auto;
    background: linear-gradient(180deg, #151A21 0%, #0B0D10 100%);
    border-right: 1px solid var(--rule);
    transform: translateX(-102%);
    transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.34s ease;
    box-shadow: 0 0 0 100vmax rgba(8, 9, 11, 0);
    z-index: 320;
  }

  .orbit-header[data-open] .orbit-nav {
    transform: translateX(0);
    box-shadow: 0 0 0 100vmax rgba(8, 9, 11, 0.78);
  }

  .orbit-nav__link { font-size: 15.5px; padding-block: 11px; }
}

@media (max-width: 560px) {
  .orbit-brand__desc { display: none; }
  .archive-footer__meta-inner { font-size: 11px; }
  .btn { width: 100%; }
}

/* ============================================================
   可访问性
   ============================================================ */
@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;
    scroll-behavior: auto !important;
  }

  .lift:hover,
  .btn--primary:hover,
  .btn--ghost:hover { transform: none; }

  .orbit-brand__link:hover .orbit-brand__mark::before { transform: rotate(45deg); }
}
