/* ==========================================================================
   万博娱乐 · 中文站 — 共享外壳样式 /assets/site.css
   深墨蓝控制台 + 鎏金索引 + 矿物色缓冲；纵向叙事长卷骨架
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: #0B1B2B;
}

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

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

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

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

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

h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }

main { display: block; }

/* ---------- tokens ---------- */
:root {
  --ink: #0B1B2B;
  --ink-deep: #08131F;
  --ink-2: #102A43;
  --gold: #C8A24A;
  --gold-bright: #E6C77E;
  --cinnabar: #C2452D;
  --paper: #F3EBDD;
  --warm: #D8D2C4;
  --rock: #59606A;
  --moss: #5E7563;
  --clay: #A9684B;

  --glass: rgba(255, 255, 255, .055);
  --glass-strong: rgba(255, 255, 255, .10);
  --line: rgba(200, 162, 74, .20);
  --line-soft: rgba(243, 235, 221, .12);

  --text: #E9E2D4;
  --text-soft: rgba(233, 226, 212, .72);
  --text-dim: rgba(233, 226, 212, .48);
  --text-faint: rgba(233, 226, 212, .30);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --wrap: 1280px;
  --gutter: clamp(16px, 4vw, 28px);
  --gap: clamp(16px, 2.2vw, 30px);
  --section-y: clamp(48px, 7vw, 96px);

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

  --ease: 200ms cubic-bezier(.4, 0, .2, 1);
}

/* ---------- base typography ---------- */
body {
  min-height: 100vh;
  background-color: var(--ink);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1 { font-size: clamp(2.25rem, 5vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.5rem); letter-spacing: .03em; }
h4 { font-size: 1.05rem; letter-spacing: .03em; }

p { max-width: 68ch; }

strong, b { font-weight: 700; color: var(--paper); }

::selection { background: rgba(200, 162, 74, .38); color: #fff; }

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

/* ---------- layout primitives ---------- */
.wrap {
  width: min(var(--wrap), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.section { padding-block: var(--section-y); }

.rule {
  height: 1px;
  border: 0;
  background: var(--line-soft);
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
  transition: color var(--ease);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--gold);
  opacity: .65;
}

.chapter-index {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  color: var(--gold);
  transition: color var(--ease);
}

[data-chapter].is-active .eyebrow,
[data-chapter].is-active .chapter-index {
  color: var(--gold-bright);
}

.lede {
  font-size: clamp(16px, 1.35vw, 18px);
  line-height: 1.8;
  color: var(--text-soft);
  max-width: 62ch;
}

.grid {
  display: grid;
  gap: var(--gap);
}

.col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-12 {
  grid-column: 1 / -1;
  min-width: 0;
}

@media (min-width: 900px) {
  .grid-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .col-3 { grid-column: span 3; }
  .col-4 { grid-column: span 4; }
  .col-5 { grid-column: span 5; }
  .col-6 { grid-column: span 6; }
  .col-7 { grid-column: span 7; }
  .col-8 { grid-column: span 8; }
  .col-12 { grid-column: span 12; }
}

/* ---------- breadcrumb ---------- */
.breadcrumb {
  padding-top: 18px;
  font-size: 12.5px;
  letter-spacing: .04em;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  color: rgba(200, 162, 74, .5);
}

.breadcrumb a {
  color: var(--text-soft);
  transition: color var(--ease);
}

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

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

/* ---------- buttons ---------- */
.btn {
  --btn-h: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--btn-h);
  padding: 0 20px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .05em;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.btn-sm { --btn-h: 34px; padding: 0 14px; font-size: 13px; letter-spacing: .04em; }
.btn-lg { --btn-h: 50px; padding: 0 26px; font-size: 15px; }

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #0B1B2B;
}

.btn-gold:hover,
.btn-gold:focus-visible {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  color: var(--ink-deep);
}

.btn-outline {
  background: transparent;
  border-color: rgba(200, 162, 74, .45);
  color: var(--gold-bright);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--gold-bright);
  background: rgba(200, 162, 74, .12);
}

.btn-ghost {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(243, 235, 221, .16);
  color: var(--paper);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  color: var(--gold-bright);
  border-color: rgba(200, 162, 74, .5);
  background: rgba(200, 162, 74, .10);
}

.btn-cinnabar {
  background: var(--cinnabar);
  border-color: var(--cinnabar);
  color: #FFF6F2;
}

.btn-cinnabar:hover,
.btn-cinnabar:focus-visible {
  background: #D4553C;
  border-color: #D4553C;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--gold-bright);
}

.link-arrow::after {
  content: "\2192";
  transition: transform var(--ease);
}

.link-arrow:hover::after,
.link-arrow:focus-visible::after { transform: translateX(4px); }

/* ---------- cards & tags ---------- */
.card {
  position: relative;
  min-width: 0;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--glass);
  transition: transform var(--ease), border-color var(--ease), background var(--ease);
}

.card--hover:hover,
.card--hover:focus-within {
  transform: translateY(-2px);
  border-color: rgba(200, 162, 74, .45);
  background: var(--glass-strong);
}

.card--paper {
  background: var(--paper);
  border-color: transparent;
  color: var(--ink);
}

.card--paper h2,
.card--paper h3,
.card--paper h4 { color: var(--ink); }

.card--paper p { color: #33404E; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(200, 162, 74, .08);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--gold-bright);
  white-space: nowrap;
}

.tag--moss {
  color: #A7C2AE;
  border-color: rgba(94, 117, 99, .55);
  background: rgba(94, 117, 99, .18);
}

.tag--clay {
  color: #DCA68C;
  border-color: rgba(169, 104, 75, .55);
  background: rgba(169, 104, 75, .18);
}

.tag--cinnabar {
  color: #F0A392;
  border-color: rgba(194, 69, 45, .55);
  background: rgba(194, 69, 45, .18);
}

/* ---------- media containers（页面阶段放入图片占位） ---------- */
.media {
  position: relative;
  display: block;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: linear-gradient(155deg, #12314F 0%, #0B1B2B 55%, #08131F 100%);
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(200, 162, 74, .18), transparent 58%),
    linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .07) 50%, transparent 62%);
  mix-blend-mode: screen;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3  { aspect-ratio: 4 / 3; }
.media--3x2  { aspect-ratio: 3 / 2; }
.media--1x1  { aspect-ratio: 1 / 1; }
.media--21x9 { aspect-ratio: 21 / 9; }

.media-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--text-dim);
}

@media (max-width: 640px) {
  .media--21x9 { aspect-ratio: 16 / 9; }
  .media--4x3  { aspect-ratio: 3 / 2; }
}

/* ---------- skip link ---------- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 120;
  padding: 10px 20px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: var(--gold);
  color: #0B1B2B;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  transition: top var(--ease);
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(11, 27, 43, .94);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
  transition: background var(--ease), box-shadow var(--ease);
}

.site-header.is-stuck {
  background: rgba(9, 22, 36, .97);
  box-shadow: 0 18px 34px -26px rgba(0, 0, 0, .95);
}

.header-inner {
  width: min(var(--wrap), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
}

/* brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(150deg, rgba(200, 162, 74, .24), rgba(200, 162, 74, .04));
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--gold-bright);
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}

.brand:hover .brand-mark,
.brand:focus-visible .brand-mark {
  border-color: var(--gold-bright);
  background: linear-gradient(150deg, rgba(200, 162, 74, .38), rgba(200, 162, 74, .10));
  color: #FFF8E6;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-name {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--paper);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  color: rgba(233, 226, 212, .52);
}

/* nav */
.primary-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  transition: color var(--ease), background var(--ease);
}

.nav-label { white-space: nowrap; }

.nav-index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: rgba(200, 162, 74, .55);
  transition: color var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  background: var(--gold-bright);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--ease);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--paper);
  background: rgba(255, 255, 255, .05);
}

.nav-link:hover .nav-index,
.nav-link:focus-visible .nav-index { color: var(--gold-bright); }

.nav-link[aria-current="page"] {
  color: var(--gold-bright);
  background: rgba(200, 162, 74, .10);
}

.nav-link[aria-current="page"] .nav-index { color: var(--gold-bright); }

.nav-link[aria-current="page"]::after { transform: scaleX(1); }

/* header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.header-cta { letter-spacing: .04em; }

/* toggle */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .05);
  color: var(--paper);
  font-size: 13px;
  letter-spacing: .08em;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  color: var(--gold-bright);
  border-color: rgba(200, 162, 74, .55);
}

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 16px;
  height: 10px;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--ease), top var(--ease);
}

.nav-toggle-bars::before { top: 0; }
.nav-toggle-bars::after { top: 8px; }

.site-header[data-open] .nav-toggle {
  color: var(--gold-bright);
  border-color: rgba(200, 162, 74, .55);
  background: rgba(200, 162, 74, .12);
}

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

/* progress rail */
.header-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(200, 162, 74, .12);
  overflow: hidden;
}

.header-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright) 100%);
}

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #0A1929 0%, #08131F 100%);
  color: var(--text);
}

.footer-band {
  height: 3px;
  background: linear-gradient(90deg,
    var(--gold) 0%,
    rgba(200, 162, 74, .55) 26%,
    rgba(194, 69, 45, .85) 55%,
    rgba(94, 117, 99, .85) 82%,
    rgba(169, 104, 75, .8) 100%);
  opacity: .85;
}

.footer-inner {
  width: min(var(--wrap), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  padding-block: clamp(40px, 6vw, 74px) 0;
  display: grid;
  gap: clamp(28px, 4vw, 48px);
  grid-template-columns: minmax(0, 1fr);
}

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

.brand--footer { margin-bottom: 18px; }

.footer-summary {
  max-width: 32ch;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-soft);
}

.footer-motto {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: rgba(200, 162, 74, .65);
}

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

.footer-title {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .24em;
  color: var(--gold);
  text-transform: uppercase;
}

.footer-links li + li { margin-top: 10px; }

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--text-soft);
  transition: color var(--ease);
}

.footer-links a::before {
  content: "";
  width: 12px;
  height: 1px;
  background: var(--gold);
  opacity: .45;
  transition: width var(--ease), opacity var(--ease);
}

.footer-links a:hover,
.footer-links a:focus-visible { color: var(--gold-bright); }

.footer-links a:hover::before,
.footer-links a:focus-visible::before { width: 20px; opacity: 1; }

.footer-links a[aria-current="page"] { color: var(--gold-bright); }

.contact-list {
  display: grid;
  gap: 12px;
}

.contact-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.contact-key {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  color: rgba(233, 226, 212, .42);
  white-space: nowrap;
}

.contact-value {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(233, 226, 212, .86);
  overflow-wrap: anywhere;
}

.footer-note {
  margin-top: 16px;
  max-width: 32ch;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-faint);
}

.footer-base {
  width: min(var(--wrap), calc(100% - var(--gutter) * 2));
  margin: clamp(32px, 5vw, 58px) auto 0;
  padding-block: 20px 28px;
  border-top: 1px solid rgba(243, 235, 221, .10);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 28px;
}

.footer-base-item {
  font-size: 12.5px;
  letter-spacing: .04em;
  color: rgba(233, 226, 212, .45);
}

.footer-base-item.mono { color: rgba(200, 162, 74, .72); }

/* ---------- responsive ---------- */
@media (min-width: 860px) {
  .footer-inner {
    grid-template-columns:
      minmax(0, 1.45fr)
      minmax(0, .85fr)
      minmax(0, .85fr)
      minmax(0, 1.2fr);
    gap: clamp(24px, 3vw, 56px);
  }
}

@media (max-width: 1180px) {
  .nav-link { padding: 9px 9px; font-size: 13.5px; }
  .nav-link::after { left: 9px; right: 9px; }
  .header-cta--quiet { display: none; }
}

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }

  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: block;
    flex: 0 0 auto;
    max-height: calc(100dvh - 68px);
    overflow-y: auto;
    padding: 8px var(--gutter) 24px;
    background: linear-gradient(180deg, rgba(9, 22, 36, .99), rgba(8, 19, 31, .99));
    border-bottom: 1px solid var(--line);
    box-shadow: 0 30px 44px -26px rgba(0, 0, 0, .95);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity var(--ease), transform var(--ease), visibility var(--ease);
  }

  .site-header[data-open] .primary-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-link {
    justify-content: flex-start;
    padding: 15px 4px;
    font-size: 15px;
    border-radius: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .nav-link::after { display: none; }

  .nav-link[aria-current="page"] {
    background: transparent;
    color: var(--gold-bright);
  }

  .nav-index { font-size: 11px; }

  .header-inner { min-height: 62px; }
}

@media (max-width: 640px) {
  .header-inner { gap: 10px; }
  .brand-mark { width: 34px; height: 34px; font-size: 17px; }
  .brand-name { font-size: 14px; letter-spacing: .10em; }
  .brand-sub { display: none; }
  .header-cta { --btn-h: 32px; padding: 0 11px; font-size: 12px; }
  .nav-toggle { padding: 0 10px; }
  .nav-toggle-text { display: none; }
  .footer-base { justify-content: flex-start; }
}

/* ---------- reduced motion ---------- */
@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:hover,
  .card--hover:focus-within { transform: none; }

  .link-arrow:hover::after,
  .link-arrow:focus-visible::after { transform: none; }
}
