/* ==========================================================================
   瑞祥真人会馆 · 全站共享样式
   文件位置：/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, figcaption, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

/* ---------- 2. 设计变量 ---------- */
:root {
  /* 色板 */
  --night: #0B1B33;
  --night-2: #16294D;
  --cinnabar: #C4362A;
  --cinnabar-2: #E0664F;
  --gold: #C9A24B;
  --warm: #F6F1E7;
  --sand: #E4DCCD;
  --ink: #12161C;
  --slate: #5C6B84;
  --celadon: #2F6E6A;

  /* 结构 */
  --rail-w: 0px;
  --shell: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --border: 2px solid var(--ink);
  --border-night: 2px solid rgba(246, 241, 231, .28);
  --shadow-hard: 10px 10px 0 rgba(11, 27, 51, .12);
  --shadow-hard-sm: 5px 5px 0 rgba(11, 27, 51, .16);
  --shadow-lift: 7px 7px 0 rgba(11, 27, 51, .22);

  /* 字体 */
  --font-head: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --font-num: "Roboto Mono", "JetBrains Mono", ui-monospace, monospace;

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

/* ---------- 3. 基础排版 ---------- */
body {
  padding-left: var(--rail-w);
  background: var(--warm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--night);
}

h1 { font-size: clamp(30px, 4.6vw, 52px); }
h2 { font-size: clamp(22px, 2.6vw, 30px); }
h3 { font-size: clamp(18px, 2vw, 22px); }
h4 { font-size: 17px; }

strong, b { font-weight: 800; color: var(--night); }

.num, .stat__num, .rail-num, .footer-icp {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

/* ---------- 4. 焦点与可见性 ---------- */
:focus { outline: none; }

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

.site-header :focus-visible,
.site-footer :focus-visible,
.brand-rail :focus-visible,
.page-band :focus-visible {
  outline-color: var(--gold);
}

.header-nav :focus-visible { outline-color: var(--cinnabar); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: calc(var(--rail-w) + 10px);
  top: -120px;
  z-index: 300;
  padding: 10px 18px;
  background: var(--cinnabar);
  color: var(--warm);
  font-weight: 700;
  font-size: 15px;
  border: 2px solid var(--warm);
  box-shadow: 4px 4px 0 rgba(11, 27, 51, .35);
  transition: top .18s var(--ease);
}

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

/* ---------- 5. 容器与网格 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); }

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .02em;
  background: var(--warm);
  color: var(--night);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(18, 22, 28, .2);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease), color .16s var(--ease);
}

.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(18, 22, 28, .26); }
.btn:active { transform: translate(0, 0); box-shadow: 2px 2px 0 rgba(18, 22, 28, .2); }

.btn--cinnabar { background: var(--cinnabar); color: var(--warm); border-color: var(--cinnabar); }
.btn--gold { background: var(--gold); color: var(--ink); border-color: var(--ink); }
.btn--ghost { background: transparent; color: var(--warm); border-color: var(--warm); box-shadow: none; }
.btn--ghost:hover { background: var(--warm); color: var(--night); }
.btn--sm { padding: 9px 14px; font-size: 13.5px; box-shadow: 3px 3px 0 rgba(11, 27, 51, .45); }

/* ==========================================================================
   7. 页头
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--warm);
}

/* --- 7.1 左侧品牌轨道（装饰，桌面常驻） --- */
.brand-rail { display: none; }

/* --- 7.2 第一层横条 --- */
.header-top {
  position: relative;
  background: var(--night);
  color: var(--warm);
  border-bottom: 3px solid var(--cinnabar);
}

.header-top__inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  min-height: 76px;
  padding-block: 10px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand-seal {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  background: var(--cinnabar);
  color: var(--warm);
  border: 2px solid var(--gold);
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 3px 3px 0 rgba(201, 162, 75, .35);
}

.brand-text { display: block; }

.brand-name {
  display: block;
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: .04em;
  color: var(--warm);
}

.brand-sub {
  display: block;
  margin-top: 2px;
  font-family: var(--font-num);
  font-size: 11.5px;
  letter-spacing: .16em;
  color: var(--gold);
}

.header-note {
  flex: 1 1 auto;
  max-width: 46ch;
  padding-left: 22px;
  border-left: 1px solid rgba(246, 241, 231, .22);
  font-size: 14.5px;
  line-height: 1.6;
  color: #C7D0E0;
}

.header-utility {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.util-link {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--warm);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--gold);
  transition: color .18s var(--ease);
}

.util-link:hover { color: var(--gold); }

/* --- 7.3 移动导航按钮 --- */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 10px 12px;
  color: var(--warm);
  border: 2px solid var(--warm);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
}

.nav-toggle:hover { background: rgba(246, 241, 231, .1); }

.nav-toggle__bars { display: grid; gap: 4px; width: 20px; }

.nav-toggle__bars span {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* --- 7.4 阅读进度条 --- */
.scroll-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(246, 241, 231, .14);
  pointer-events: none;
}

.scroll-meter__fill {
  display: block;
  height: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .12s linear;
}

/* --- 7.5 第二层栏目导航 --- */
.header-nav {
  background: var(--warm);
  border-bottom: 3px solid var(--ink);
}

.header-nav__inner {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.nav-list a {
  position: relative;
  display: block;
  padding: 14px 20px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--night);
  border-right: 1px solid var(--sand);
  transition: background .18s var(--ease), color .18s var(--ease);
}

.nav-list a:hover { background: var(--sand); }

.nav-list a[aria-current="page"] {
  background: var(--cinnabar);
  color: var(--warm);
}

.nav-list a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 3px;
  background: var(--gold);
}

.nav-foot {
  align-self: center;
  margin-left: auto;
  padding: 0 18px;
  white-space: nowrap;
  font-family: var(--font-num);
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--slate);
}

/* ==========================================================================
   8. 页脚
   ========================================================================== */
.site-footer {
  background: var(--night);
  color: var(--warm);
  border-top: 4px solid var(--cinnabar);
}

.footer-return {
  background: var(--night-2);
  border-bottom: 1px solid rgba(246, 241, 231, .16);
}

.footer-return__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-block: 16px;
}

.footer-return__label {
  font-family: var(--font-num);
  font-size: 13.5px;
  letter-spacing: .1em;
  color: #C7D0E0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.25fr .95fr;
  gap: clamp(20px, 3vw, 46px);
  padding-block: clamp(32px, 5vw, 62px);
}

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

.footer-brand {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .05em;
  color: var(--warm);
}

.footer-desc {
  max-width: 34ch;
  margin-top: 12px;
  font-size: 14.5px;
  line-height: 1.7;
  color: #B9C4D6;
}

.footer-seal {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-top: 18px;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 900;
}

.footer-title {
  margin-bottom: 16px;
  font-family: var(--font-num);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--gold);
}

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

.footer-links a {
  font-size: 15px;
  color: #DCE2EE;
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}

.footer-links a:hover { color: var(--gold); border-bottom-color: var(--gold); }

.footer-links--sub {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(246, 241, 231, .16);
}

.footer-contact li {
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
}

.contact-key {
  font-family: var(--font-num);
  font-size: 11.5px;
  letter-spacing: .16em;
  color: #8FA0BA;
}

.contact-value {
  font-size: 15px;
  color: #ECE6D9;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.footer-note {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #8FA0BA;
}

.footer-base { border-top: 1px solid rgba(246, 241, 231, .16); }

.footer-base__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 18px;
  font-size: 13px;
  color: #8FA0BA;
}

.footer-copy { font-size: 13px; }

.footer-icp { color: var(--gold); letter-spacing: .02em; }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-legal a { transition: color .18s var(--ease); }
.footer-legal a:hover { color: var(--gold); }

/* ==========================================================================
   9. 正文容器与通用组件（页面阶段复用）
   ========================================================================== */
.page-band {
  background: var(--night);
  color: var(--warm);
  border-bottom: 4px solid var(--cinnabar);
  padding-block: clamp(28px, 5vw, 54px);
}

.page-band__kicker {
  font-family: var(--font-num);
  font-size: 12px;
  letter-spacing: .24em;
  color: var(--gold);
}

.page-band h1 { margin-top: 10px; color: var(--warm); }

.page-band__lead {
  max-width: 62ch;
  margin-top: 12px;
  font-size: 16.5px;
  color: #C7D0E0;
}

.breadcrumb { padding-block: 14px; }

.crumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--slate);
}

.crumb-list li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--sand);
}

.crumb-list a { border-bottom: 1px solid var(--sand); transition: color .18s var(--ease), border-color .18s var(--ease); }
.crumb-list a:hover { color: var(--cinnabar); border-color: var(--cinnabar); }
.crumb-current { color: var(--ink); font-weight: 700; }

.prose { max-width: 66ch; }
.prose p + p { margin-top: 1.05em; }
.prose h2 {
  margin: 2em 0 .7em;
  padding-left: 14px;
  font-size: 26px;
  border-left: 6px solid var(--cinnabar);
}
.prose h3 { margin: 1.6em 0 .5em; font-size: 20px; }
.prose ul, .prose ol { margin: 1em 0; }
.prose li { position: relative; margin-bottom: .5em; padding-left: 22px; }
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .78em;
  width: 10px;
  height: 2px;
  background: var(--cinnabar);
}

.card {
  background: #FFFDF8;
  border: var(--border);
  padding: clamp(18px, 2.4vw, 28px);
  box-shadow: var(--shadow-hard-sm);
}

.card--night {
  background: var(--night-2);
  border-color: var(--night);
  color: var(--warm);
}

.card--night h2, .card--night h3, .card--night strong { color: var(--warm); }

.card--offset { margin-top: 24px; }

.sidenote {
  padding-top: 14px;
  border-top: 3px solid var(--ink);
  font-size: 14px;
  line-height: 1.7;
  color: var(--slate);
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .06em;
  background: var(--sand);
  color: var(--ink);
  border: 1px solid var(--ink);
}

.tag--cinnabar { background: var(--cinnabar); color: var(--warm); border-color: var(--cinnabar); }
.tag--gold { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.tag--celadon { background: var(--celadon); color: var(--warm); border-color: var(--celadon); }

.stat { padding-left: 18px; border-left: 6px solid var(--cinnabar); }

.stat__num {
  display: block;
  font-size: clamp(44px, 7vw, 84px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--night);
}

.stat__label { margin-top: 8px; font-size: 14px; color: var(--slate); }

/* 图像容器基础规则（供页面阶段放置图片占位） */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--night-2);
  border: var(--border);
  box-shadow: var(--shadow-hard-sm);
}

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

.media-frame--screen { aspect-ratio: 16 / 10; }
.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame--square { aspect-ratio: 1 / 1; }

.media-frame__cap {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 6px 12px;
  background: var(--night);
  color: var(--warm);
  border-top: 2px solid var(--gold);
  font-size: 12.5px;
  letter-spacing: .04em;
}

.figure-note { margin-top: 10px; font-size: 13px; color: var(--slate); }

/* ---------- 10. 滚动显现 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .32s ease-out, transform .32s ease-out;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   11. 响应式
   ========================================================================== */
@media (min-width: 1080px) {
  :root { --rail-w: 112px; }

  .brand-rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 70;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: var(--rail-w);
    padding: 22px 0 24px;
    background: var(--night);
    border-right: 3px solid var(--cinnabar);
    overflow: hidden;
  }

  .rail-mark {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .rail-glyph {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    background: var(--cinnabar);
    border: 2px solid var(--gold);
    color: var(--warm);
    font-family: var(--font-head);
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
  }

  .rail-name {
    writing-mode: vertical-rl;
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 900;
    letter-spacing: .26em;
    color: var(--warm);
  }

  .rail-lang {
    writing-mode: vertical-rl;
    font-family: var(--font-num);
    font-size: 11px;
    letter-spacing: .34em;
    color: var(--gold);
  }

  .rail-steps {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    margin: 20px 0;
  }

  .rail-steps::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 16px;
    bottom: 16px;
    width: 2px;
    background: rgba(246, 241, 231, .14);
  }

  .rail-step {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 8px 10px 12px;
  }

  .rail-step::before {
    content: "";
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    background: rgba(246, 241, 231, .22);
    box-shadow: 0 0 0 4px var(--night);
  }

  .rail-step.is-done::before { background: var(--celadon); }
  .rail-step.is-current::before {
    background: var(--gold);
    box-shadow: 0 0 0 4px var(--night), 0 0 0 6px rgba(201, 162, 75, .35);
  }

  .rail-num {
    font-size: 11px;
    color: rgba(246, 241, 231, .5);
  }

  .rail-label {
    font-size: 10.5px;
    letter-spacing: .06em;
    color: rgba(246, 241, 231, .5);
  }

  .rail-step.is-done .rail-num,
  .rail-step.is-done .rail-label { color: rgba(246, 241, 231, .78); }

  .rail-step.is-current .rail-num,
  .rail-step.is-current .rail-label { color: var(--gold); }

  .rail-seal {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 2px solid rgba(201, 162, 75, .7);
    color: var(--gold);
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 900;
  }
}

@media (max-width: 1180px) {
  .header-note { display: none; }
  .nav-foot { display: none; }
}

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

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

  .header-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 65;
    display: none;
    max-height: 78vh;
    overflow-y: auto;
    background: var(--night);
    border-bottom: 4px solid var(--cinnabar);
  }

  .header-nav[data-open] { display: block; }

  .header-nav__inner { display: block; }

  .nav-list { display: block; padding-block: 6px; }

  .nav-list a {
    padding: 15px 6px;
    font-size: 16px;
    color: var(--warm);
    border-right: 0;
    border-bottom: 1px solid rgba(246, 241, 231, .14);
  }

  .nav-list li:last-child a { border-bottom: 0; }

  .nav-list a:hover {
    background: rgba(246, 241, 231, .08);
    color: var(--warm);
  }

  .nav-list a[aria-current="page"] { background: var(--cinnabar); color: var(--warm); }
  .nav-list a[aria-current="page"]::after { display: none; }

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

  .card--offset { margin-top: 0; }
}

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

  .grid--2, .grid--3 { gap: 16px; }
}

@media (max-width: 640px) {
  .header-utility .btn { display: none; }
  .brand-sub { display: none; }
  .header-top__inner { min-height: 64px; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-base__inner { flex-direction: column; align-items: flex-start; }
  .footer-return__inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- 12. 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

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