/* ============================================================
   皇冠真人娱乐 · 内容中心  —  共享样式 /assets/site.css
   ============================================================ */

/* ---- 1. 设计令牌 ---- */
:root {
  --ink: #0E2A24;
  --ink-2: #17453B;
  --gold: #C8A96A;
  --gold-hi: #E6D3A3;
  --crimson: #7A2B2B;
  --paper: #EFEAE1;
  --paper-hi: #FBF8F2;
  --text: #1B1F1D;
  --muted: #5A625D;
  --slate: #8FA39B;
  --zebra: #E7E0D4;

  --line: rgba(200, 169, 106, 0.45);
  --line-soft: rgba(27, 31, 29, 0.12);
  --line-dark: rgba(200, 169, 106, 0.26);

  --rail-w: 88px;
  --idbar-h: 44px;
  --maxw: 1280px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --font-serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", STSong, "SimSun", Georgia, serif;
  --font-sans: "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---- 2. 重置与基础排版 ---- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--idbar-h) + 20px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--paper);
  background-image: linear-gradient(90deg, rgba(14, 42, 36, 0.035) 1px, transparent 1px);
  background-size: 72px 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--text);
}

p { margin: 0; }

::selection { background: var(--gold); color: var(--ink); }

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

.sr-only {
  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: fixed;
  top: 10px; left: 10px;
  z-index: 999;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--gold-hi);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-decoration: none;
  border: 1px solid var(--gold);
  transform: translateY(-180%);
  transition: transform 160ms var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---- 3. 头部编号条 ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--paper-hi);
}

.idbar {
  position: relative;
  background: var(--paper-hi);
  border-bottom: 1px solid var(--line);
}

.idbar__inner {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
  min-height: var(--idbar-h);
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 clamp(14px, 3vw, 40px);
}

.idbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
}

.idbar__seal {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  font-size: 12px;
  line-height: 1;
  color: var(--ink);
  border: 1px solid var(--gold);
  background: linear-gradient(160deg, rgba(200, 169, 106, 0.35), rgba(200, 169, 106, 0.06));
}

.idbar__name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.idbar__meta {
  margin: 0 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.idbar__code {
  color: var(--ink);
  border-bottom: 0.5px solid var(--gold);
  padding-bottom: 1px;
}

.idbar__note { color: var(--muted); }

.idbar__cta { flex: none; }

.idbar__progress {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-hi));
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---- 4. 移动开关 ---- */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 7px 11px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.nav-toggle:hover { background: rgba(200, 169, 106, 0.16); border-color: var(--gold); }

.nav-toggle__box {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 16px;
  height: 11px;
}
.nav-toggle__box span {
  display: block;
  height: 1.5px;
  background: currentColor;
  transition: transform 180ms var(--ease), opacity 180ms var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__box span:nth-child(1) { transform: translateY(4.75px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__box span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__box span:nth-child(3) { transform: translateY(-4.75px) rotate(-45deg); }

/* ---- 5. 左侧纵向索引轨 ---- */
.rail {
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 95;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: calc(var(--idbar-h) + 14px) 0 18px;
  background: var(--ink);
  color: var(--paper);
  border-right: 1px solid var(--line-dark);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rail__label {
  margin: 0 0 4px;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.34em;
  color: rgba(200, 169, 106, 0.7);
}

.rail__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.rail__link {
  display: block;
  writing-mode: vertical-rl;
  padding: 14px 6px;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.3em;
  text-decoration: none;
  color: rgba(239, 234, 225, 0.7);
  border-left: 2px solid transparent;
  transition: color 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.rail__link:hover,
.rail__link:focus-visible {
  color: var(--gold-hi);
  background-color: rgba(200, 169, 106, 0.1);
}
.rail__link[aria-current="page"] {
  color: var(--gold-hi);
  background-color: rgba(200, 169, 106, 0.16);
  border-left-color: var(--gold);
}

.rail__foot {
  margin: auto 0 0;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: rgba(239, 234, 225, 0.35);
}

.nav-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(14, 42, 36, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease);
}

@media (min-width: 961px) {
  body { padding-left: var(--rail-w); }
}

@media (max-width: 1080px) {
  .idbar__note { display: none; }
}

@media (max-width: 960px) {
  body { padding-left: 0; }

  .nav-toggle { display: inline-flex; }
  .idbar__meta { display: none; }
  .idbar__cta { display: none; }

  .nav-scrim { display: block; }
  .site-header[data-open] .nav-scrim { opacity: 1; pointer-events: auto; }

  .rail {
    top: 0;
    width: min(78vw, 320px);
    align-items: stretch;
    gap: 0;
    padding: 18px 0 26px;
    border-right: 1px solid var(--line-dark);
    transform: translateX(-104%);
    transition: transform 220ms var(--ease);
    z-index: 120;
  }
  .site-header[data-open] .rail { transform: translateX(0); }

  .rail__label {
    writing-mode: horizontal-tb;
    margin: 0 0 10px;
    padding: 0 22px 14px;
    border-bottom: 1px solid var(--line-dark);
    letter-spacing: 0.3em;
  }
  .rail__list { align-items: stretch; }
  .rail__link {
    writing-mode: horizontal-tb;
    padding: 16px 22px;
    font-size: 17px;
    letter-spacing: 0.14em;
    color: rgba(239, 234, 225, 0.82);
    border-left: 2px solid transparent;
    border-bottom: 1px solid rgba(200, 169, 106, 0.1);
  }
  .rail__foot {
    writing-mode: horizontal-tb;
    margin: 18px 0 0;
    padding: 0 22px;
  }
}

@media (max-width: 520px) {
  .idbar__name { font-size: 13px; letter-spacing: 0.04em; }
  .idbar__seal { width: 20px; height: 20px; font-size: 11px; }
}

/* ---- 6. 通用按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 12px 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease),
              border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.btn:hover { border-color: var(--gold); }

.btn--gold { border-color: var(--gold); color: var(--ink); }
.btn--gold:hover { background: var(--gold); color: var(--ink); }

.btn--solid { background: var(--ink); color: var(--paper-hi); border-color: var(--ink); }
.btn--solid:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--gold-hi); }

.btn--ghost { border-color: var(--line-soft); color: var(--muted); }
.btn--ghost:hover { border-color: var(--gold); color: var(--ink); background: rgba(200, 169, 106, 0.12); }

.btn--sm { padding: 7px 12px; font-size: 12px; letter-spacing: 0.06em; }

/* ---- 7. 索引文本 / 面包屑 / 标签 ---- */
.idx {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 0.5px solid var(--gold);
  padding-bottom: 1px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em;
  padding: 18px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.crumbs a { color: var(--muted); text-decoration: none; border-bottom: 0.5px solid transparent; }
.crumbs a:hover { color: var(--ink); border-bottom-color: var(--gold); }
.crumbs [aria-current="page"] { color: var(--ink); border-bottom: 0.5px solid var(--gold); }
.crumbs__sep { color: var(--gold); }

.tag {
  display: inline-block;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: rgba(200, 169, 106, 0.22);
  border: 1px solid rgba(200, 169, 106, 0.5);
}
.tag--alert {
  color: #FBF8F2;
  background: var(--crimson);
  border-color: var(--crimson);
}

/* ---- 8. 容器 / 网格 / 章节节奏 ---- */
.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 48px);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}

.section { padding-block: clamp(40px, 6vw, 88px); }
.section--tight { padding-block: clamp(26px, 4vw, 52px); }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 18px;
  margin-bottom: clamp(20px, 3vw, 32px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.section__title {
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: 0.03em;
}
.section__meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ---- 9. 正文与注释 ---- */
.prose { max-width: 34em; font-size: 17px; line-height: 1.75; }
.prose p { margin: 0 0 1.2em; }
.prose p:last-child { margin-bottom: 0; }
.prose h3 {
  margin: 1.8em 0 0.6em;
  font-size: 20px;
  letter-spacing: 0.03em;
}
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose li { margin-bottom: 0.4em; }
.prose a { color: var(--ink-2); text-decoration: none; border-bottom: 0.5px solid var(--gold); }
.prose a:hover { color: var(--crimson); }

.note {
  padding-left: 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  border-left: 2px solid var(--gold);
}
.note--alert { border-left-color: var(--crimson); color: var(--crimson); }

/* ---- 10. 表格母版 ---- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.table caption {
  caption-side: top;
  padding-bottom: 12px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.table thead th {
  padding: 12px 14px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--paper-hi);
  background: var(--ink-2);
  white-space: nowrap;
}
.table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.table tbody tr:nth-child(even) { background: var(--zebra); }
.table tbody tr:hover { background: rgba(200, 169, 106, 0.18); }
.table tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--gold); }
.table a { text-decoration: none; border-bottom: 0.5px solid var(--gold); }

/* ---- 11. 分段标签页 ---- */
.segment { border-bottom: 1px solid var(--line-soft); }

.segment__btn {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 12px 18px;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  transition: color 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.segment__btn:hover { color: var(--ink); background: rgba(200, 169, 106, 0.12); }
.segment__btn[aria-selected="true"] {
  color: var(--ink);
  background: rgba(200, 169, 106, 0.18);
  border-bottom-color: var(--gold);
}
.segment__panel { padding-top: 24px; }
.segment__panel[hidden] { display: none; }

/* ---- 12. 手风琴 ---- */
.fold { border-bottom: 1px solid var(--line-soft); }
.fold__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 2px;
  background: transparent;
  border: 0;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: color 160ms var(--ease);
}
.fold__btn:hover { color: var(--ink-2); }
.fold__mark {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold);
  transition: transform 180ms var(--ease);
}
.fold__btn[aria-expanded="true"] .fold__mark { transform: rotate(45deg); }
.fold__panel { padding: 0 2px 20px; font-size: 15px; color: var(--muted); }
.fold__panel[hidden] { display: none; }

/* ---- 13. 索引过滤 ---- */
.filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.filter__input {
  flex: 1 1 240px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  background: var(--paper-hi);
  border: 1px solid var(--line-soft);
  border-radius: 0;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.filter__input:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-hi);
}
.filter__hint {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---- 14. 图片容器基础（页面阶段放占位用） ---- */
.figure { margin: 0; }

.figure__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background:
    repeating-linear-gradient(135deg, rgba(27, 31, 29, 0.05) 0 1px, transparent 1px 8px),
    var(--paper-hi);
  border: 1px solid var(--line-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 12px 26px -20px rgba(14, 42, 36, 0.65);
}
.figure__frame--wide { aspect-ratio: 21 / 9; }
.figure__frame--tall { aspect-ratio: 3 / 4; }
.figure__frame--square { aspect-ratio: 1 / 1; }

.figure__frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.figure__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14, 42, 36, 0) 58%, rgba(14, 42, 36, 0.3));
  pointer-events: none;
}

.figure__cap {
  margin-top: 10px;
  padding-left: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-left: 2px solid var(--gold);
}

/* ---- 15. 显现动效 ---- */
html[data-reveal-ready] [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 240ms var(--ease), transform 240ms var(--ease);
}
html[data-reveal-ready] [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---- 16. 页脚 ---- */
.site-footer {
  margin-top: clamp(56px, 8vw, 104px);
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid var(--gold);
}

.footer__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(40px, 6vw, 76px) clamp(18px, 4vw, 48px) clamp(32px, 4vw, 52px);
}

.footer__eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.26em;
  color: var(--gold);
}

.footer__title {
  margin: 0 0 clamp(24px, 3vw, 36px);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--paper-hi);
}

.footer__index {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-dark);
  border: 1px solid var(--line-dark);
}

.footer__cell { background: var(--ink); }

.footer__cell > a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 18px 20px;
  text-decoration: none;
  color: var(--paper);
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.footer__cell > a:hover { background: var(--ink-2); color: var(--gold-hi); }
.footer__cell > a:hover .footer__no { color: var(--gold-hi); }

.footer__no {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--gold);
  border-bottom: 0.5px solid var(--gold);
  padding-bottom: 1px;
  align-self: flex-start;
}
.footer__cat {
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.06em;
}
.footer__count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(239, 234, 225, 0.55);
}

.footer__contact {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px 24px;
  margin-top: clamp(28px, 4vw, 44px);
  padding-top: clamp(24px, 3vw, 36px);
  border-top: 1px solid var(--line-dark);
}

.footer__field { display: flex; flex-direction: column; gap: 6px; }
.footer__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--gold);
}
.footer__value {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(239, 234, 225, 0.86);
  overflow-wrap: anywhere;
}

.footer__base { background: #0A1F1B; border-top: 1px solid var(--line-dark); }

.footer__base-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 26px;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 18px clamp(18px, 4vw, 48px);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: rgba(239, 234, 225, 0.6);
}
.footer__copy { margin: 0; }

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-left: auto;
}
.footer__legal a {
  color: rgba(239, 234, 225, 0.82);
  text-decoration: none;
  border-bottom: 0.5px solid rgba(200, 169, 106, 0.55);
  padding-bottom: 1px;
}
.footer__legal a:hover { color: var(--gold-hi); border-bottom-color: var(--gold-hi); }

.footer__icp { margin: 0; color: rgba(239, 234, 225, 0.45); }

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

@media (max-width: 560px) {
  .footer__index { grid-template-columns: 1fr; }
  .footer__contact { grid-template-columns: 1fr; }
  .footer__legal { margin-left: 0; }
}

/* ---- 17. 降级动效 ---- */
@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;
  }
  html[data-reveal-ready] [data-reveal] { opacity: 1; transform: none; }
  .rail { transition: none; }
  .idbar__progress { transition: none; }
}
