/* ==========================================================================
   合乐娱乐会馆 · /assets/site.css
   共享外壳：页头（索引灯箱）/ 页脚（档案落款）/ 通用组件
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

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

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

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

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

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

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

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

/* ---------- 2. Tokens ---------- */
:root {
  --ink-900: #05131F;
  --ink-800: #081E2E;
  --ink-700: #0E2C40;
  --ink-600: #16394F;
  --gold-500: #D9A94E;
  --gold-200: #F2D79B;
  --cinnabar-500: #C8402F;
  --cinnabar-300: #E8776A;
  --jade-400: #4FB39C;
  --paper-100: #F5F0E6;
  --paper-300: #DFD6C6;
  --text-dark-1: #EAF0F4;
  --text-dark-2: #9FB2C0;
  --text-light-1: #16222B;
  --text-light-2: #4A5A66;

  --rail-w: 0px;
  --shell-max: 1200px;
  --gutter: clamp(1.15rem, 4.5vw, 3rem);

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

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: 320ms;
  --hairline: 1px solid var(--ink-600);
}

/* ---------- 3. Base typography ---------- */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-left: var(--rail-w);
  background: var(--ink-900);
  color: var(--text-dark-1);
  font-family: var(--font-body);
  font-size: clamp(16px, 0.35vw + 15.2px, 17.5px);
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.01em;
}

#main-content { flex: 1 0 auto; }

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

/* ---------- 4. Skip link ---------- */
.skip-link {
  position: fixed;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 300;
  padding: 0.6rem 1rem;
  background: var(--gold-500);
  color: var(--ink-900);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 2px;
  transform: translateY(-180%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 5. Header : 索引灯箱 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ink-900);
  border-bottom: var(--hairline);
  color: var(--text-dark-1);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-500), rgba(217, 169, 78, 0) 55%);
  pointer-events: none;
}

/* 阅读进度 */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 150;
  pointer-events: none;
}
.read-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-500), var(--cinnabar-500));
}

/* 品牌区 */
.masthead-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
  padding: 0.7rem var(--gutter);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.brand-seal {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  background: var(--cinnabar-500);
  color: var(--paper-100);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(245, 240, 230, 0.42);
  transform: rotate(-2deg);
}

.brand-text { display: block; min-width: 0; }

.brand-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.05em;
  color: var(--text-dark-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  line-height: 1.5;
  letter-spacing: 0.07em;
  color: var(--text-dark-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 移动端索引开关 */
.nav-toggle {
  position: relative;
  z-index: 2;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  background: var(--ink-800);
  border: 1px solid var(--ink-600);
  border-radius: 2px;
  color: var(--gold-200);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  transition: border-color 0.22s var(--ease), color 0.22s var(--ease);
}
.nav-toggle:hover { border-color: var(--gold-500); }

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 1rem;
  height: 2px;
  background: var(--gold-500);
  transition: background-color 0.22s var(--ease);
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 1rem;
  height: 2px;
  background: var(--gold-500);
  transition: transform 0.22s var(--ease), top 0.22s var(--ease);
}
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }

.site-header[data-open] .nav-toggle-bars { background: transparent; }
.site-header[data-open] .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.site-header[data-open] .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

/* 移动端索引面板 */
.site-nav {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--ink-800);
  border-bottom: var(--hairline);
  box-shadow: 0 28px 56px rgba(3, 10, 17, 0.6);
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  transition: max-height 0.3s var(--ease), visibility 0.3s;
}

.site-header[data-open] .site-nav {
  max-height: calc(100vh - 3.9rem);
  max-height: calc(100dvh - 3.9rem);
  overflow-y: auto;
  visibility: visible;
}

.nav-inner { padding: 1rem var(--gutter) 1.6rem; }

.nav-eyebrow {
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--gold-500);
}

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

.nav-item { position: relative; }

.nav-link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.62rem 0.2rem 0.62rem 0.9rem;
  border-left: 2px solid transparent;
  color: var(--text-dark-2);
  font-size: 1rem;
  transition: color 0.22s var(--ease), border-color 0.22s var(--ease), background-color 0.22s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  bottom: 0.32rem;
  width: 0;
  height: 1px;
  background: var(--gold-500);
  transition: width 0.24s var(--ease);
}

.nav-link:hover { color: var(--gold-200); }
.nav-link:hover::after,
.nav-link:focus-visible::after { width: calc(100% - 1.1rem); }

.nav-link[aria-current="page"] {
  color: var(--gold-200);
  border-left-color: var(--gold-500);
  background: linear-gradient(90deg, rgba(217, 169, 78, 0.14), rgba(217, 169, 78, 0) 85%);
}

.nav-num {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--gold-500);
}
.nav-link[aria-current="page"] .nav-num { color: var(--gold-200); }
.nav-label { letter-spacing: 0.02em; }

.nav-foot {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: var(--hairline);
}

.nav-service {
  margin-bottom: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-dark-2);
}

.nav-cta { width: 100%; }

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.35rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-align: center;
  transition: background-color 0.22s var(--ease), color 0.22s var(--ease), border-color 0.22s var(--ease);
}

.btn-gold {
  color: var(--gold-200);
  border-color: var(--gold-500);
  background: rgba(217, 169, 78, 0.07);
}
.btn-gold:hover,
.btn-gold:focus-visible {
  background: var(--gold-500);
  color: var(--ink-900);
  border-color: var(--gold-500);
}

.btn-cinnabar {
  color: var(--paper-100);
  border-color: var(--cinnabar-500);
  background: var(--cinnabar-500);
}
.btn-cinnabar:hover,
.btn-cinnabar:focus-visible {
  background: var(--cinnabar-300);
  border-color: var(--cinnabar-300);
  color: var(--text-light-1);
}

.btn-ghost {
  color: var(--text-dark-2);
  border-color: var(--ink-600);
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
  color: var(--gold-200);
  border-color: var(--gold-500);
}

/* ---------- 7. Layout helpers ---------- */
.shell {
  width: min(100% - (var(--gutter) * 2), var(--shell-max));
  margin-inline: auto;
}

.grid-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}
@media (min-width: 900px) {
  .grid-split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
  .grid-split--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

/* ---------- 8. Breadcrumbs ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-dark-2);
}
.crumbs a { transition: color 0.2s var(--ease); }
.crumbs a:hover { color: var(--gold-200); }
.crumbs [aria-current="page"] { color: var(--gold-500); }
.crumbs-sep { opacity: 0.55; }

/* ---------- 9. Prose ---------- */
.prose {
  max-width: 68ch;
  font-size: 1.0625rem;
  line-height: 1.9;
}
.prose > * + * { margin-top: 1.2em; }
.prose h2 { margin-top: 2.2em; font-size: clamp(1.3rem, 2.4vw, 1.72rem); }
.prose h3 { margin-top: 1.8em; font-size: 1.15rem; }
.prose ul,
.prose ol { padding-left: 1.25em; list-style: revert; }
.prose a {
  color: var(--gold-200);
  border-bottom: 1px solid var(--gold-500);
}

.surface-paper {
  background: var(--paper-100);
  color: var(--text-light-1);
}
.surface-paper .prose a {
  color: var(--cinnabar-500);
  border-bottom-color: var(--cinnabar-300);
}
.surface-paper .prose h2,
.surface-paper .prose h3 { color: var(--text-light-1); }

/* ---------- 10. Panels (<details>) ---------- */
.panel {
  background: var(--ink-700);
  border: 1px solid var(--ink-600);
  border-radius: 3px;
  transition: border-color 0.22s var(--ease);
}
.panel + .panel { margin-top: 0.6rem; }
.panel:hover { border-color: rgba(217, 169, 78, 0.45); }

.panel > summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  list-style: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-dark-1);
  transition: color 0.2s var(--ease);
}
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::after {
  content: "+";
  margin-left: auto;
  flex: none;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--gold-500);
  transition: transform 0.22s var(--ease), color 0.2s var(--ease);
}
.panel[open] > summary { color: var(--gold-200); }
.panel[open] > summary::after { content: "\2013"; transform: rotate(180deg); }

.panel-body {
  padding: 0 1.15rem 1.15rem;
  color: var(--text-dark-2);
  font-size: 0.95rem;
  line-height: 1.85;
}
.panel-body > * + * { margin-top: 0.9em; }

/* ---------- 11. Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.16rem 0.55rem;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  background: rgba(217, 169, 78, 0.12);
  color: var(--gold-200);
}
.tag--cinnabar {
  background: var(--cinnabar-500);
  color: var(--paper-100);
}
.tag--jade {
  background: rgba(79, 179, 156, 0.16);
  color: var(--jade-400);
}

/* ---------- 12. Media frames ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--ink-600);
  border-radius: 3px;
  background:
    radial-gradient(120% 90% at 15% 10%, rgba(217, 169, 78, 0.18), transparent 60%),
    linear-gradient(150deg, var(--ink-700), var(--ink-900) 72%);
}
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 2.6rem;
  height: 2.6rem;
  background: linear-gradient(135deg, transparent 50%, rgba(217, 169, 78, 0.55) 50%);
  pointer-events: none;
}
.media-frame--tall { aspect-ratio: 4 / 5; }
.media-frame--wide { aspect-ratio: 21 / 9; }

.media-caption {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-dark-2);
}

/* ---------- 13. Footer : 档案落款 ---------- */
.site-footer {
  position: relative;
  margin-top: auto;
  padding-left: 0;
  background: var(--ink-900);
  border-top: var(--hairline);
  color: var(--text-dark-2);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-500), var(--cinnabar-500) 44%, rgba(200, 64, 47, 0) 90%);
}

.footer-inner {
  width: min(100% - (var(--gutter) * 2), var(--shell-max));
  margin-inline: auto;
  padding: clamp(2.4rem, 5vw, 3.6rem) 0 clamp(1.6rem, 3vw, 2.4rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.8rem, 4vw, 2.8rem);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.95rem;
}

.footer-brand-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.06em;
  color: var(--text-dark-1);
}

.footer-tagline {
  max-width: 26ch;
  font-size: 0.82rem;
  line-height: 1.85;
  color: var(--text-dark-2);
  padding-left: 0.7rem;
  border-left: 2px solid var(--gold-500);
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem 1.2rem;
}

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

.footer-col-title,
.footer-contact-title {
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--ink-600);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--gold-500);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link {
  position: relative;
  display: inline-block;
  font-size: 0.9rem;
  color: var(--text-dark-2);
  transition: color 0.2s var(--ease);
}
.footer-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 1px;
  background: var(--gold-500);
  transition: width 0.24s var(--ease);
}
.footer-link:hover,
.footer-link:focus-visible { color: var(--gold-200); }
.footer-link:hover::after,
.footer-link:focus-visible::after { width: 100%; }

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

.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.9rem;
}

.footer-contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.footer-contact-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--jade-400);
}

.footer-contact-value {
  color: var(--text-dark-1);
  overflow-wrap: anywhere;
}

.footer-note {
  margin-top: 0.85rem;
  padding-left: 0.7rem;
  border-left: 2px solid var(--cinnabar-500);
  font-size: 0.76rem;
  line-height: 1.8;
  color: var(--text-dark-2);
}

.footer-legal { border-top: 1px solid var(--ink-600); }

.footer-legal-inner {
  width: min(100% - (var(--gutter) * 2), var(--shell-max));
  margin-inline: auto;
  padding: 1rem 0 1.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--text-dark-2);
}

.footer-copyright { margin-right: auto; }
.footer-icp { color: var(--text-dark-2); }

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.8rem;
  border: 1px solid var(--ink-600);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-dark-2);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.to-top:hover,
.to-top:focus-visible {
  color: var(--gold-200);
  border-color: var(--gold-500);
}

/* ---------- 14. Reveal ---------- */
html.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
html.reveal-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 15. Responsive : tablet ---------- */
@media (max-width: 400px) {
  .masthead-bar .brand-tag { display: none; }
}

@media (min-width: 560px) {
  .footer-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .footer-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .footer-contact { grid-column: 1 / -1; }
}

@media (min-width: 1100px) {
  .footer-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1.05fr);
    align-items: start;
  }
  .footer-contact { grid-column: auto; }
}

/* ---------- 16. Responsive : desktop rail ---------- */
@media (min-width: 1024px) {
  :root { --rail-w: 250px; }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-w);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    border-bottom: 0;
    border-right: var(--hairline);
    background: linear-gradient(180deg, var(--ink-900) 0%, var(--ink-800) 100%);
  }

  .site-header::after {
    top: 0;
    bottom: 0;
    left: auto;
    right: -1px;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, var(--gold-500), rgba(217, 169, 78, 0) 46%);
  }

  .read-progress { position: absolute; }

  .masthead-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    min-height: 0;
    padding: 2rem 1.35rem 1.4rem;
  }

  .brand { width: 100%; gap: 0.75rem; }
  .brand-name { font-size: 1.06rem; }
  .brand-tag { white-space: normal; overflow: visible; }

  .nav-toggle { display: none; }

  .site-nav {
    position: static;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    max-height: none;
    overflow: visible;
    visibility: visible;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .nav-inner {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 0.4rem 1.35rem 1.6rem;
  }

  .nav-eyebrow { margin-bottom: 0.9rem; }

  .nav-link {
    font-size: 0.94rem;
    padding: 0.52rem 0.15rem 0.52rem 0.85rem;
  }

  .nav-foot { margin-top: auto; }
  .nav-cta { width: auto; }
}

/* ---------- 17. Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html.reveal-ready [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
