/* ============================================================
   九娱乐会馆 · shared site kit
   夜幕蓝图：深墨底 + 鎏金细线 + 等宽索引
   ============================================================ */

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

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

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

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

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

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

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

button { background: none; border: 0; cursor: pointer; }

::selection { background: rgba(200, 163, 90, .3); color: var(--paper); }

/* ---------- tokens ---------- */
:root {
  --ink-900: #07090C;
  --ink-800: #0D1117;
  --ink-700: #121820;
  --line: #2A3540;
  --line-soft: rgba(42, 53, 64, .62);
  --gold: #C8A35A;
  --gold-deep: #A5813C;
  --gold-hi: #E8D7A6;
  --terracotta: #C65F45;
  --steppe: #2E7F78;
  --cyber: #3BA99C;
  --paper: #F2EBDD;
  --mist: #9BA7AD;
  --signal: #7B5EA7;

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

  --rail-w: 17.25rem;
  --header-h: 4.25rem;
  --page-max: 78rem;
  --gap: clamp(1rem, 2.4vw, 2rem);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- base typography ---------- */
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  padding-left: 0;
  background-color: var(--ink-900);
  background-image:
    linear-gradient(to right, rgba(42, 53, 64, .30) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(42, 53, 64, .30) 1px, transparent 1px);
  background-size: 96px 96px;
  background-attachment: fixed;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .02em;
  color: var(--paper);
}

p { color: inherit; }

strong { color: var(--gold-hi); font-weight: 700; }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyber);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------- skip link ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: .75rem;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  padding: .7rem 1.1rem;
  background: var(--gold);
  color: #07090C;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .14em;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: .75rem; }

/* ============================================================
   HEADER · 侧边轨道 / 移动顶栏
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--ink-800);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 28px -24px #000;
}

.header-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  min-height: var(--header-h);
  padding: .55rem clamp(1rem, 3vw, 1.5rem);
}

/* brand */
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 0;
  padding-right: .25rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.3rem;
  height: 2.3rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--gold-hi);
  border: 1px solid var(--gold);
  background:
    linear-gradient(150deg, rgba(200, 163, 90, .24), rgba(7, 9, 12, .55));
  box-shadow:
    inset 0 0 0 1px rgba(7, 9, 12, .85),
    0 0 0 1px rgba(200, 163, 90, .14);
  transition: box-shadow .3s var(--ease), color .3s var(--ease);
}
.brand:hover .brand-mark { color: #fff; box-shadow: inset 0 0 0 1px rgba(7, 9, 12, .85), 0 0 14px -2px rgba(200, 163, 90, .55); }

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

.brand-name {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.25;
  color: var(--paper);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .1em;
  line-height: 1.5;
  color: var(--mist);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* toggle */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-left: auto;
  padding: .55rem .8rem;
  border: 1px solid var(--line);
  background: var(--ink-900);
  color: var(--gold-hi);
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .18em;
  transition: border-color .25s var(--ease), color .25s var(--ease);
}
.nav-toggle:hover { border-color: var(--gold); }

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 1rem;
}
.nav-toggle-bars span {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform .28s var(--ease), opacity .2s var(--ease);
}
.site-header[data-open] .nav-toggle-bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.site-header[data-open] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.site-header[data-open] .nav-toggle-bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* nav (mobile drawer base) */
.site-nav {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--header-h);
  bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 1.25rem clamp(1rem, 4vw, 1.75rem) 2.5rem;
  background:
    linear-gradient(180deg, #0B0F14 0%, var(--ink-800) 55%, #080B0F 100%);
  border-top: 1px solid var(--line);
  overflow-y: auto;
  transform: translateX(-101%);
  visibility: hidden;
  transition: transform .32s var(--ease), visibility .32s var(--ease);
}
.site-header[data-open] .site-nav { transform: none; visibility: visible; }

body.nav-open { overflow: hidden; }

.nav-title {
  margin-bottom: .85rem;
  font-family: var(--font-mono);
  font-size: .64rem;
  font-weight: 400;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--steppe);
}

.nav-list { display: flex; flex-direction: column; gap: .1rem; }

.nav-item { display: block; }

.nav-link {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding: .55rem .25rem .55rem .9rem;
  border-left: 1px solid transparent;
  color: var(--mist);
  transition: color .22s var(--ease), border-color .22s var(--ease), background .22s var(--ease);
}
.nav-link:hover,
.nav-link:focus-visible {
  color: var(--gold-hi);
  border-left-color: var(--steppe);
  background: linear-gradient(90deg, rgba(46, 127, 120, .14), transparent 72%);
}
.nav-link[aria-current="page"] {
  color: var(--gold-hi);
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(200, 163, 90, .16), transparent 72%);
}

.nav-index {
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .12em;
  color: rgba(200, 163, 90, .58);
  transition: color .22s var(--ease);
}
.nav-link[aria-current="page"] .nav-index { color: var(--cyber); }

.nav-label {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: .08em;
}

/* utility */
.nav-utility {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.utility-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  background: var(--ink-900);
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .1em;
  transition: color .22s var(--ease), border-color .22s var(--ease), background .22s var(--ease);
}
.utility-link:hover,
.utility-link:focus-visible {
  color: var(--gold-hi);
  border-color: rgba(200, 163, 90, .6);
  background: rgba(200, 163, 90, .08);
}

.utility-dot {
  width: 4px;
  height: 4px;
  background: var(--cyber);
  box-shadow: 0 0 6px rgba(59, 169, 156, .8);
}

.nav-meta {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-top: auto;
  padding-top: 1.1rem;
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .14em;
  color: rgba(155, 167, 173, .7);
}

/* progress */
.rail-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(42, 53, 64, .55);
}
.rail-progress-bar {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--steppe), var(--gold));
  transition: width .12s linear;
}

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

  .site-header {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail-w);
    display: flex;
    flex-direction: column;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, #0B0F14 0%, var(--ink-800) 42%, #080B0F 100%);
    box-shadow: none;
  }

  .header-rail {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-height: 0;
    padding: 1.75rem 1.4rem 1.1rem;
    overflow-y: auto;
  }

  .brand {
    flex-direction: row;
    align-items: center;
    padding-bottom: 1.4rem;
    border-bottom: 1px solid var(--line);
  }

  .nav-toggle { display: none; }

  .site-nav {
    position: static;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0 0;
    background: none;
    border-top: 0;
    overflow: visible;
    transform: none;
    visibility: visible;
  }

  .nav-title { margin-bottom: 1rem; }

  .nav-link { padding-left: 1rem; }

  .nav-utility { margin-top: 1.75rem; }

  .nav-meta { padding-top: 1.25rem; }

  .rail-progress {
    left: auto;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    height: auto;
  }
  .rail-progress-bar {
    width: 100%;
    height: var(--progress, 0%);
    background: linear-gradient(180deg, var(--steppe), var(--gold));
    transition: height .12s linear;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative;
  margin-top: clamp(3rem, 8vw, 6rem);
  background: var(--ink-800);
  border-top: 1px solid var(--line);
  color: var(--mist);
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .55;
}

.footer-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 3rem) 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.75rem, 4vw, 3rem);
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 1.6fr .75fr .75fr 1.2fr; }
}

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

.footer-mark {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 1.75rem);
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--gold-hi);
  line-height: 1.2;
}

.footer-summary {
  max-width: 34ch;
  font-size: .9rem;
  line-height: 1.8;
  color: var(--mist);
}

.footer-stamp {
  align-self: flex-start;
  margin-top: .35rem;
  padding: .3rem .6rem;
  border: 1px dashed rgba(200, 163, 90, .4);
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .2em;
  color: rgba(200, 163, 90, .78);
}

.footer-col { display: flex; flex-direction: column; gap: .85rem; min-width: 0; }

.footer-title {
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: .64rem;
  font-weight: 400;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
}

.footer-list { display: flex; flex-direction: column; gap: .5rem; font-size: .88rem; }

.footer-list a {
  display: inline-block;
  color: var(--mist);
  border-bottom: 1px solid transparent;
  transition: color .22s var(--ease), border-color .22s var(--ease);
}
.footer-list a:hover,
.footer-list a:focus-visible {
  color: var(--gold-hi);
  border-bottom-color: rgba(200, 163, 90, .6);
}

.footer-contact-list { gap: .65rem; }

.footer-contact-list li { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }

.footer-key {
  flex: none;
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .18em;
  color: var(--steppe);
}

.footer-val {
  font-size: .85rem;
  line-height: 1.65;
  color: var(--paper);
  word-break: break-word;
}

.footer-note {
  max-width: 32ch;
  padding-left: .75rem;
  border-left: 1px solid rgba(198, 95, 69, .55);
  font-size: .78rem;
  line-height: 1.7;
  color: rgba(155, 167, 173, .85);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.5rem;
  margin-top: clamp(1.75rem, 4vw, 3rem);
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .12em;
  color: rgba(155, 167, 173, .8);
}
.footer-copy { color: var(--mist); }
.footer-icp { color: var(--mist); }
.footer-coord { margin-left: auto; color: rgba(200, 163, 90, .7); }

/* ============================================================
   SHARED COMPONENTS
   ============================================================ */
.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.section { padding-block: clamp(2.5rem, 6vw, 5rem); }

.section-head {
  display: grid;
  gap: .7rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.section-index {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .22em;
  color: var(--steppe);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1.2;
}

.section-lede,
.lede {
  max-width: 44ch;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.8;
  color: var(--mist);
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 10vw, 7rem);
  line-height: .95;
  letter-spacing: .02em;
  color: var(--paper);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}

.grid { display: grid; grid-template-columns: 1fr; gap: var(--gap); }

.grid--split { grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .grid--split {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, .9fr);
    align-items: start;
  }
}

.rule {
  height: 1px;
  margin-block: clamp(1.5rem, 4vw, 3rem);
  border: 0;
  background: linear-gradient(90deg, var(--line), rgba(200, 163, 90, .55), var(--line));
}

.note {
  padding: .9rem 0 .9rem 1rem;
  border-left: 2px solid var(--terracotta);
  background: linear-gradient(90deg, rgba(198, 95, 69, .1), transparent 72%);
  font-size: .92rem;
  line-height: 1.75;
  color: var(--mist);
}

/* panel */
.panel {
  position: relative;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: linear-gradient(180deg, rgba(18, 24, 32, .96), rgba(10, 14, 19, .96));
  border: 1px solid var(--line);
  box-shadow: 0 24px 48px -36px #000;
}
.panel::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(200, 163, 90, .14);
  pointer-events: none;
}

/* media */
.media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 100% at 15% 0%, rgba(200, 163, 90, .16), transparent 58%),
    linear-gradient(160deg, #101822 0%, #0A0E13 62%, #131A22 100%);
  box-shadow: 0 22px 44px -32px #000;
}
.media::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 1;
  border: 1px solid rgba(200, 163, 90, .18);
  pointer-events: none;
}
.media > img,
.media > picture > img,
.media > video {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--wide { aspect-ratio: 16 / 9; }
.media--tall { aspect-ratio: 3 / 4; }
.media--square { aspect-ratio: 1 / 1; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .78rem 1.35rem;
  border: 1px solid var(--line);
  background: var(--ink-800);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: .76rem;
  letter-spacing: .14em;
  line-height: 1.2;
  transition: color .24s var(--ease), border-color .24s var(--ease), background .24s var(--ease), transform .24s var(--ease);
}
.btn:hover,
.btn:focus-visible {
  color: var(--gold-hi);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.btn--gold {
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold) 45%, var(--gold-deep));
  color: #07090C;
  font-weight: 700;
}
.btn--gold:hover,
.btn--gold:focus-visible {
  color: #05070A;
  border-color: transparent;
  filter: brightness(1.08);
}

.btn--line {
  background: transparent;
  border-color: rgba(200, 163, 90, .5);
  color: var(--gold-hi);
}
.btn--line:hover,
.btn--line:focus-visible {
  background: rgba(200, 163, 90, .1);
  border-color: var(--gold);
}

/* tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .22rem .6rem;
  border: 1px solid var(--line);
  background: rgba(13, 17, 23, .82);
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .12em;
  line-height: 1.6;
}
.tag--gold { color: var(--gold-hi); border-color: rgba(200, 163, 90, .48); background: rgba(200, 163, 90, .1); }
.tag--red { color: #E79A83; border-color: rgba(198, 95, 69, .55); background: rgba(198, 95, 69, .12); }
.tag--teal { color: #7FD3C8; border-color: rgba(46, 127, 120, .55); background: rgba(46, 127, 120, .14); }

/* breadcrumb */
.crumb {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .12em;
  color: var(--mist);
}
.crumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.crumb li { display: flex; align-items: center; gap: .5rem; }
.crumb li + li::before { content: "/"; color: rgba(200, 163, 90, .5); }
.crumb a { transition: color .22s var(--ease); }
.crumb a:hover,
.crumb a:focus-visible { color: var(--gold-hi); }
.crumb [aria-current="page"] { color: var(--paper); }

/* ---------- reveal motion ---------- */
[data-reveal] { --reveal-delay: 0ms; }

html.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
html.reveal-ready [data-reveal].is-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* ---------- responsive guards ---------- */
@media (max-width: 480px) {
  .brand-sub { max-width: 12rem; }
  .footer-coord { margin-left: 0; }
}

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