/* ==========================================================================
   易丰娱乐会馆 · 共享样式 /assets/site.css
   侧轨导览 + 通栏正文；粗野主义工具感 × 克制东方会馆气质
   ========================================================================== */

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

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

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 { max-width: 100%; }

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

a { color: var(--electric); text-underline-offset: 3px; }

[hidden] { display: none !important; }

/* ---------- 2. 变量 ---------- */
:root {
  --paper: #F5F7F4;
  --mist: #E3ECE9;
  --line: #C6D8D3;
  --ink: #0D3835;
  --sand: #E8DAC0;
  --gold: #C79A4B;
  --electric: #17706B;
  --cinnabar: #C0432C;
  --mute: #5E6E68;
  --carbon: #0B1512;

  --rail-w: 200px;
  --head-h: 62px;

  --font-head: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "PingFang SC", serif;
  --font-mono: "JetBrains Mono", "Sarasa Mono SC", "SFMono-Regular", Consolas, monospace;

  --shadow-hard: 6px 6px 0 var(--ink);
  --shadow-soft: 4px 4px 0 var(--ink);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- 3. 中文排版基线 ---------- */
body {
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, rgba(198, 216, 211, 0.28) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(198, 216, 211, 0.18) 0 1px, transparent 1px 26px);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.85;
  padding-top: var(--head-h);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--ink);
}

h1 { font-weight: 900; font-size: clamp(2.6rem, 6vw, 4.4rem); }
h2 { font-weight: 900; font-size: 2rem; }
h3 { font-weight: 700; font-size: 1.25rem; }

p { font-size: 1.0625rem; line-height: 1.85; }

#main-content { scroll-margin-top: calc(var(--head-h) + 12px); }

/* ---------- 4. 焦点可见 ---------- */
:focus-visible {
  outline: 3px solid var(--cinnabar);
  outline-offset: 2px;
}

/* ---------- 5. 跳转链接 ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  display: inline-block;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--carbon);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  border: 2px solid var(--carbon);
}

.skip-link:focus {
  left: 10px;
  top: 10px;
}

/* ---------- 6. 阅读进度条 ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
  z-index: 190;
  pointer-events: none;
}

.progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  transition: width 0.08s linear;
}

/* ---------- 7. 页头 · 品牌轨道 ---------- */
.site-head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 180;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: #EAF2EF;
  border-bottom: 2px solid var(--carbon);
}

.head-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  min-height: var(--head-h);
}

.head-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #F5F7F4;
  text-decoration: none;
}

.head-brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  background: var(--gold);
  color: var(--carbon);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.125rem;
  border: 2px solid var(--carbon);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}

.head-brand__name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* 移动端栏目开关 */
.nav-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 11px;
  background: transparent;
  color: #EAF2EF;
  border: 2px solid rgba(234, 242, 239, 0.5);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.nav-toggle:hover {
  border-color: var(--gold);
  color: var(--sand);
}

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: transform 0.18s var(--ease);
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: transform 0.18s var(--ease);
}

.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }

.site-head[data-open] .nav-toggle__bars { background: transparent; }
.site-head[data-open] .nav-toggle__bars::before { transform: translateY(5px) rotate(45deg); }
.site-head[data-open] .nav-toggle__bars::after { transform: translateY(-5px) rotate(-45deg); }

/* 轨道导航（移动端默认收起） */
.rail {
  display: none;
  padding: 6px 12px 16px;
  border-top: 2px solid rgba(234, 242, 239, 0.2);
  max-height: calc(100vh - var(--head-h));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.site-head[data-open] .rail { display: block; }

.rail__list {
  display: grid;
  gap: 3px;
}

.rail__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #D3E3DE;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease);
}

.rail__link:hover {
  background: rgba(234, 242, 239, 0.09);
  color: #FFFFFF;
}

.rail__link[aria-current="page"] {
  background: var(--gold);
  color: var(--carbon);
  border-left-color: var(--carbon);
}

.rail__idx {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  opacity: 0.62;
}

.rail__link[aria-current="page"] .rail__idx { opacity: 0.85; }

.rail__label { flex: 1 1 auto; }

/* 轨道底部常驻区 */
.rail__foot {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(234, 242, 239, 0.18);
}

.rail__version {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: var(--sand);
  text-decoration: none;
  border: 2px solid var(--gold);
  background: rgba(199, 154, 75, 0.1);
}

.rail__version:hover {
  background: var(--gold);
  color: var(--carbon);
}

.rail__save {
  display: block;
  width: 100%;
  padding: 7px 10px;
  background: var(--mist);
  color: var(--carbon);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-align: center;
  border: 2px solid var(--carbon);
  box-shadow: 3px 3px 0 var(--gold);
  cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.rail__save:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--gold);
}

.rail__hint {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.6;
  color: #A8BFB9;
  padding: 6px 8px;
  background: rgba(234, 242, 239, 0.07);
  border-left: 2px solid var(--gold);
}

.rail__link--quiet {
  font-size: 0.8125rem;
  font-weight: 400;
  color: #9FB8B2;
}

/* ---------- 8. 页脚 ---------- */
.site-foot {
  margin-top: 72px;
  padding-top: 54px;
  background: var(--carbon);
  color: #CBD9D5;
  border-top: 2px solid var(--ink);
}

.foot-inner {
  width: min(100% - 36px, 1180px);
  margin-inline: auto;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-bottom: 8px;
}

.foot-col { min-width: 0; }

.foot-brand {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.375rem;
  line-height: 1.3;
  color: #F5F7F4;
  letter-spacing: 0.01em;
}

.foot-line {
  margin-top: 8px;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #9FB4AF;
}

.region-tag {
  display: inline-block;
  margin-top: 14px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  color: var(--sand);
  border: 2px solid var(--gold);
}

.foot-title {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
}

.foot-list {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.foot-list a {
  display: inline-block;
  color: #CBD9D5;
  font-size: 0.9375rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.foot-list a:hover {
  color: #FFFFFF;
  border-bottom-color: var(--gold);
}

.foot-copy {
  display: inline-block;
  padding: 2px 0;
  color: #CBD9D5;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px dashed rgba(203, 217, 213, 0.4);
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

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

.foot-copy.is-copied {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.foot-note {
  margin-top: 12px;
  font-size: 0.8125rem;
  line-height: 1.75;
  color: #8AA09B;
}

.foot-legal {
  margin-top: 44px;
  padding: 16px 0 22px;
  border-top: 1px solid rgba(203, 217, 213, 0.16);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.8;
  color: #8FA5A0;
}

/* ---------- 9. 通用布局与工具 ---------- */
.wrap {
  width: min(100% - 36px, 1180px);
  margin-inline: auto;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}

.lede {
  font-size: 1.125rem;
  line-height: 1.95;
  color: var(--mute);
  max-width: 62ch;
}

.rule {
  height: 2px;
  border: 0;
  background: var(--ink);
}

.mark {
  background: var(--sand);
  padding: 0 0.28em;
  color: var(--ink);
}

/* ---------- 10. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--electric);
  color: #FFFFFF;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn--ghost {
  background: var(--paper);
  color: var(--ink);
}

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

/* ---------- 11. 面包屑 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 16px 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--mute);
}

.crumbs a {
  color: var(--mute);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

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

.crumbs span[aria-hidden="true"] { color: var(--line); }

/* ---------- 12. 索引条 ---------- */
.index-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.chip {
  display: inline-block;
  padding: 4px 10px;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 2px solid var(--ink);
  transition: background-color 0.16s var(--ease);
}

.chip:hover { background: var(--sand); }

.chip[aria-current="page"] {
  background: var(--gold);
  color: var(--carbon);
}

/* ---------- 13. 卡片 ---------- */
.card {
  padding: 20px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard);
}

.card--sand { background: var(--sand); }
.card--mist { background: var(--mist); }

/* ---------- 14. 数据方格矩阵 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2px;
  background: var(--ink);
  border: 2px solid var(--ink);
}

.stat {
  padding: 15px 16px;
  background: var(--paper);
}

.stat__key {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: var(--mute);
}

.stat__val {
  display: block;
  margin-top: 6px;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.375rem;
  line-height: 1.3;
  color: var(--ink);
}

/* ---------- 15. 折叠面板 ---------- */
.panel {
  background: var(--paper);
  border: 2px solid var(--ink);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.0625rem;
  text-align: left;
  cursor: pointer;
  border-bottom: 2px solid var(--ink);
  transition: background-color 0.16s var(--ease);
}

.panel__head:hover { background: var(--sand); }

.panel__head::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--cinnabar);
}

.panel__head[aria-expanded="true"]::after { content: "–"; }

.panel__body {
  padding: 16px;
  border-top: 2px solid var(--ink);
}

.panel[data-open] .panel__body { display: block; }

/* ---------- 16. 图片容器 ---------- */
.media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--mist);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-hard);
}

.media > img,
.media > svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

/* ---------- 17. 滚动显现 ---------- */
.reveal-init {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

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

/* ---------- 18. 桌面端：轨道竖立 + 正文右移 ---------- */
@media (min-width: 901px) {
  body {
    padding-top: 0;
    padding-left: var(--rail-w);
  }

  #main-content { scroll-margin-top: 16px; }

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

  .site-head {
    right: auto;
    bottom: 0;
    width: var(--rail-w);
    border-bottom: 0;
    border-right: 2px solid var(--carbon);
  }

  .head-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 22px 18px 18px;
    min-height: 0;
    border-bottom: 2px solid rgba(234, 242, 239, 0.2);
  }

  .head-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
  }

  .head-brand__name { white-space: normal; }

  .nav-toggle { display: none; }

  .rail {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px 14px 16px;
    border-top: 0;
    max-height: none;
    overflow-y: auto;
  }

  .rail__list { gap: 2px; }

  .rail__link {
    padding: 9px 10px;
    font-size: 0.9375rem;
  }

  .rail__foot { margin-top: auto; }

  .foot-grid {
    grid-template-columns: 1.15fr 0.9fr 1.45fr 1fr;
    gap: 34px;
  }
}

/* ---------- 19. 平板微调 ---------- */
@media (min-width: 601px) and (max-width: 900px) {
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 20. 降低动效 ---------- */
@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;
  }

  .reveal-init {
    opacity: 1;
    transform: none;
  }

  .btn:hover,
  .rail__save:hover {
    transform: none;
    box-shadow: var(--shadow-soft);
  }
}
