/* ==========================================================================
   九娱乐会馆 · /assets/site.css
   共享外壳：侧轨导航 / 页脚 / 通用组件 / 响应式 / 无障碍
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

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

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

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

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

button {
  background: none;
  border: 0;
  padding: 0;
}

/* ---------- 2. 变量 ---------- */
:root {
  --ink-900: #0A0B0D;
  --ink-800: #12141A;
  --ink-700: #1B1E25;
  --cream-100: #F3EADC;
  --cream-300: #DCCFB8;
  --text-100: #EDE7DD;
  --cinnabar-600: #C43A2B;
  --cinnabar-400: #E0604B;
  --gold-500: #C9A227;
  --gold-300: #E5C878;
  --mist-500: #8C9AA3;
  --mist-300: #B7C3CA;
  --mist-700: #4A565E;

  --line: rgba(220, 207, 184, .14);
  --line-strong: rgba(220, 207, 184, .28);
  --line-gold: rgba(201, 162, 39, .38);

  --rail-w: 88px;
  --rail-w-open: 240px;
  --bar-h: 56px;

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

  --ease: cubic-bezier(.22, .61, .36, 1);
  --cut: 18px;
}

/* ---------- 3. 基础中文排版 ---------- */
body {
  background-color: var(--ink-900);
  background-image:
    radial-gradient(1200px 600px at 82% -10%, rgba(201, 162, 39, .05), transparent 70%),
    radial-gradient(900px 520px at 4% 110%, rgba(196, 58, 43, .05), transparent 72%);
  background-repeat: no-repeat;
  color: var(--text-100);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.65rem, 3.2vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); letter-spacing: 0; }

h4 {
  font-family: var(--font-mono);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-300);
  line-height: 1.6;
}

p { margin: 0; }

a {
  color: var(--gold-300);
  text-decoration: none;
  transition: color .2s var(--ease);
}

a:hover { color: var(--cinnabar-400); }

::selection {
  background: var(--cinnabar-600);
  color: var(--cream-100);
}

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

/* ---------- 4. 工具类 ---------- */
.sr-only {
  position: absolute;
  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;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 400;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--ink-900);
  background: var(--gold-300);
  border: 1px solid var(--gold-500);
  transform: translateY(-160%);
  transition: transform .24s var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--ink-900);
}

.container {
  width: min(100% - 48px, 1180px);
  margin-inline: auto;
}

.prose {
  max-width: 68ch;
  font-size: 17px;
  line-height: 1.9;
}

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mist-500);
}

/* ---------- 5. 滚动进度 ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 300;
  pointer-events: none;
  background: linear-gradient(90deg, var(--cinnabar-600), var(--gold-500));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .08s linear;
}

/* ---------- 6. 页头 · 侧轨 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: var(--rail-w);
  background: var(--ink-800);
  border-right: 1px solid var(--line);
  transition: width .36s var(--ease);
}

.rail-mini {
  display: none;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--cream-100);
}

/* 切换按钮 */
.rail-toggle {
  position: fixed;
  top: 18px;
  left: 22px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  background: var(--ink-800);
  color: var(--gold-300);
  cursor: pointer;
  transition: border-color .22s var(--ease), background-color .22s var(--ease);
}

.rail-toggle:hover {
  border-color: var(--gold-500);
  background: rgba(201, 162, 39, .10);
}

.rail-toggle__bars {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 18px;
  height: 12px;
}

.rail-toggle__bars i {
  display: block;
  height: 1.5px;
  width: 100%;
  background: currentColor;
  transition: transform .3s var(--ease), width .3s var(--ease);
}

html[data-nav-open="true"] .rail-toggle__bars i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
html[data-nav-open="true"] .rail-toggle__bars i:nth-child(2) { width: 0; }
html[data-nav-open="true"] .rail-toggle__bars i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* 轨道 */
.rail {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 78px 0 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.rail::-webkit-scrollbar { width: 4px; }
.rail::-webkit-scrollbar-thumb { background: var(--line-strong); }

.rail__head {
  padding: 0 26px 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.rail__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.rail__seal {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
  color: var(--ink-900);
  background: var(--gold-500);
  border: 1px solid var(--gold-300);
  transform: rotate(-3deg);
  transition: background-color .22s var(--ease), transform .3s var(--ease);
}

.rail__brand:hover .rail__seal {
  background: var(--cinnabar-400);
  transform: rotate(0deg);
}

.rail__brandtext {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width .34s var(--ease), opacity .28s var(--ease);
}

html[data-nav-open="true"] .rail__brandtext {
  max-width: 160px;
  opacity: 1;
}

.rail__name {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--cream-100);
  white-space: nowrap;
}

.rail__tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.6;
  letter-spacing: .04em;
  color: var(--mist-500);
}

.rail__status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--mist-300);
}

.rail__statustext {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: max-width .34s var(--ease), opacity .28s var(--ease);
}

html[data-nav-open="true"] .rail__statustext {
  max-width: 150px;
  opacity: 1;
}

.status-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cinnabar-400);
  box-shadow: 0 0 0 3px rgba(196, 58, 43, .16);
}

.rail__label {
  padding: 0 26px;
  margin: 16px 0 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--mist-500);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .22s var(--ease);
}

html:not([data-nav-open="true"]) .rail__label {
  opacity: 0;
  height: 1px;
  margin: 12px 26px;
  padding: 0;
  background: var(--line);
}

.rail__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail__list--pin {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.rail__link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding: 0 26px;
  color: var(--mist-300);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
}

.rail__link:hover,
.rail__link:focus-visible {
  color: var(--gold-300);
  background: rgba(201, 162, 39, .07);
}

.rail__link[aria-current="page"] {
  color: var(--cream-100);
  border-left-color: var(--cinnabar-600);
  background: linear-gradient(90deg, rgba(196, 58, 43, .18), rgba(196, 58, 43, 0) 72%);
}

.rail__num {
  flex: 0 0 auto;
  min-width: 18px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--gold-500);
  transition: color .2s var(--ease);
}

.rail__link[aria-current="page"] .rail__num { color: var(--cinnabar-400); }

.rail__text {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  font-size: 14px;
  letter-spacing: .04em;
  transition: max-width .34s var(--ease), opacity .26s var(--ease);
}

html[data-nav-open="true"] .rail__text {
  max-width: 152px;
  opacity: 1;
}

.rail__link--pin .rail__num { color: var(--mist-500); }
.rail__link--pin:hover .rail__num { color: var(--gold-300); }

.rail__foot {
  margin-top: auto;
  padding: 18px 22px 0;
  border-top: 1px solid var(--line);
}

html:not([data-nav-open="true"]) .rail__foot { display: none; }

/* 遮罩 */
.rail-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: none;
  padding: 0;
  border: 0;
  background: rgba(4, 5, 7, .74);
  cursor: pointer;
}

/* ---------- 7. 复制按钮 ---------- */
.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .03em;
  color: var(--mist-300);
  background: transparent;
  border: 1px solid var(--line);
  padding: 5px 8px;
  cursor: pointer;
  text-align: left;
  word-break: break-all;
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}

.copy-chip:hover,
.copy-chip:focus-visible {
  color: var(--gold-300);
  border-color: var(--gold-500);
  background: rgba(201, 162, 39, .08);
}

.copy-chip[data-copied="true"] {
  color: var(--gold-300);
  border-color: var(--gold-300);
}

.copy-chip__hint {
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--gold-500);
  opacity: .8;
}

.copy-chip[data-copied="true"] .copy-chip__hint { color: var(--gold-300); opacity: 1; }

/* ---------- 8. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: 120px;
  background: var(--ink-800);
  border-top: 1px solid var(--line-strong);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: min(280px, 46%);
  height: 1px;
  background: linear-gradient(90deg, var(--cinnabar-600), rgba(196, 58, 43, 0));
}

.site-footer::after {
  content: "九";
  position: absolute;
  right: 18px;
  bottom: 74px;
  font-family: var(--font-display);
  font-size: 240px;
  font-weight: 900;
  line-height: .75;
  color: rgba(201, 162, 39, .045);
  pointer-events: none;
  user-select: none;
}

.footer__inner {
  position: relative;
  z-index: 1;
  max-width: 1228px;
  margin-inline: auto;
  padding: 72px 24px 36px;
}

.footer__masthead {
  max-width: 56ch;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 44px;
}

.footer__brand {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 900;
  letter-spacing: .08em;
  color: var(--cream-100);
  text-decoration: none;
}

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

.footer__tag {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--gold-500);
}

.footer__closing {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.9;
  color: var(--mist-300);
}

.footer__nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px 28px;
}

.footer__coltitle {
  margin: 0 0 16px;
  padding-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold-500);
  border-bottom: 1px solid var(--line);
}

.footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__link {
  font-size: 14px;
  line-height: 1.7;
  color: var(--mist-300);
  text-decoration: none;
  transition: color .2s var(--ease);
}

.footer__link:hover,
.footer__link:focus-visible { color: var(--gold-300); }

.footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 52px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--mist-500);
}

.footer__bar > p { margin: 0; }

.footer__bar .footer__link {
  font-size: 12px;
  color: var(--mist-500);
}

.footer__bar .footer__link:hover { color: var(--gold-300); }

.footer__legal { color: var(--gold-500); }

.footer__sep { color: var(--mist-700); }

.footer__bar .copy-chip {
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  color: var(--mist-500);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.footer__bar .copy-chip:hover,
.footer__bar .copy-chip:focus-visible {
  color: var(--gold-300);
  background: none;
}

/* ---------- 9. 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  padding: .8em 1.55em;
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.4;
  color: var(--gold-300);
  background: transparent;
  border: 1px solid var(--gold-300);
  cursor: pointer;
  text-decoration: none;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  transition: background-color .24s var(--ease), color .24s var(--ease), border-color .24s var(--ease);
}

.btn:hover,
.btn:focus-visible {
  background: var(--gold-300);
  color: var(--ink-900);
}

.btn--primary {
  background: var(--cinnabar-600);
  border-color: var(--cinnabar-600);
  color: var(--cream-100);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--cinnabar-400);
  border-color: var(--cinnabar-400);
  color: var(--ink-900);
}

.btn--ghost {
  color: var(--text-100);
  border-color: var(--line-strong);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  background: rgba(201, 162, 39, .1);
  border-color: var(--gold-500);
  color: var(--gold-300);
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--mist-500);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5em;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: .5em;
  color: var(--mist-700);
}

.breadcrumb a {
  color: var(--mist-300);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--gold-300); }

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

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

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.panel {
  position: relative;
  padding: 34px;
  background: var(--ink-700);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

.card {
  position: relative;
  padding: 26px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--cut));
  transition: transform .32s var(--ease), border-color .32s var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(229, 200, 120, 0), var(--gold-300), rgba(229, 200, 120, 0));
  opacity: 0;
  transition: opacity .34s var(--ease);
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.card:hover::before { opacity: 1; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  line-height: 1.6;
  color: var(--gold-300);
  background: rgba(201, 162, 39, .08);
  border: 1px solid var(--line-gold);
}

.tag--red {
  color: var(--cinnabar-400);
  background: rgba(196, 58, 43, .1);
  border-color: rgba(196, 58, 43, .45);
}

.tag--mist {
  color: var(--mist-300);
  background: transparent;
  border-color: var(--line-strong);
}

.img-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--ink-800);
  border: 1px solid var(--line);
}

.img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.85) contrast(1.06) brightness(.9);
  transition: transform .5s var(--ease);
}

.img-frame:hover img { transform: scale(1.03); }

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

/* ---------- 10. 响应式 ---------- */
@media (min-width: 1024px) {
  body {
    padding-left: var(--rail-w);
    transition: padding-left .36s var(--ease);
  }

  html[data-nav-open="true"] body { padding-left: var(--rail-w-open); }
  html[data-nav-open="true"] .site-header { width: var(--rail-w-open); }

  .scroll-progress { left: var(--rail-w); }
}

@media (max-width: 1023px) {
  body { padding-top: var(--bar-h); }

  html[data-nav-open="true"] { overflow: hidden; }

  .site-header {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    height: var(--bar-h);
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 0 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
    background: #0A0B0D;
    transition: none;
  }

  .rail-mini { display: block; }

  .rail-toggle {
    position: fixed;
    top: 8px;
    left: 10px;
    width: 40px;
    height: 40px;
    z-index: 90;
  }

  html[data-nav-open="true"] .rail-mini { opacity: 0; pointer-events: none; }

  .rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 2;
    width: min(324px, 86vw);
    padding: 68px 0 28px;
    background: var(--ink-800);
    border-right: 1px solid var(--line-strong);
    transform: translateX(-102%);
    transition: transform .34s var(--ease);
  }

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

  .rail__label { opacity: 1; }
  .rail__name, .rail__tag, .rail__statustext, .rail__text { opacity: 1; max-width: none; }
  .rail__brandtext { opacity: 1; max-width: none; }
  .rail__foot { display: block; }

  html[data-nav-open="true"] .rail-scrim { display: block; }

  .scroll-progress { left: 0; top: var(--bar-h); }
}

@media (max-width: 900px) {
  .footer__nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  body { font-size: 16px; }

  .container { width: min(100% - 32px, 1180px); }

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

  .panel { padding: 24px; }
  .card { padding: 20px; }

  .footer__inner { padding: 52px 20px 28px; }
  .footer__masthead { margin-bottom: 32px; padding-bottom: 28px; }
  .site-footer { margin-top: 72px; }
  .site-footer::after { font-size: 160px; bottom: 56px; opacity: .6; }
  .footer__bar { gap: 8px 14px; font-size: 11.5px; }
}

@media (max-width: 520px) {
  .footer__nav { grid-template-columns: 1fr; gap: 28px; }
  .footer__sep { display: none; }
}

/* ---------- 11. 减少动效 ---------- */
@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;
  }

  .card:hover { transform: none; }
  .img-frame:hover img { transform: none; }
}
