/* ==========================================================================
   金鼎娱乐入口 · 收录档案 共享样式 (site.css)
   深墨底 + 鎏金刻度 + 厅别色块 / 框架式页眉 / 四栏脚注
   ========================================================================== */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
table { border-collapse: collapse; }

/* ---------- 2. Tokens ---------- */
:root {
  --ink: #0E0E10;
  --ink-2: #16161A;
  --line: #26262C;
  --paper: #F5F1E6;
  --gold: #C9A227;
  --gold-bright: #E4C765;

  --jade: #0F6B4F;      --jade-l: #2E9C78;
  --cinnabar: #C0392B;  --cinnabar-l: #E06B5E;
  --inkjade: #3E5C76;   --inkjade-l: #6E93B5;
  --brocade: #8A6FB0;   --brocade-l: #A98FD0;
  --starlan: #2E8B8B;   --starlan-l: #58B4B4;
  --muted: #8A8A93;

  --max: 1440px;
  --pad: clamp(20px, 3vw, 40px);
  --gutter: 24px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  --sans: "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ---------- 3. Base ---------- */
body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: clamp(16px, 0.35vw + 15px, 17px);
  line-height: 1.85;
  letter-spacing: .01em;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
#main-content { scroll-margin-top: 96px; }

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

/* ---------- 4. Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.container--narrow { max-width: 920px; }

.section {
  position: relative;
  padding-block: clamp(48px, 7vw, 104px);
}
.section--tight { padding-block: clamp(32px, 4vw, 56px); }
.section--raised {
  background: var(--ink-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section--paper {
  background: var(--paper);
  color: var(--ink);
  border-top: 1px solid var(--gold);
}
.section--paper .lede,
.section--paper .note,
.section--paper .section__note { color: #5A574E; }
.section--paper .eyebrow { color: #8A6E14; }
.section--paper .rule { background: rgba(14, 14, 16, .16); }

.section__head {
  display: grid;
  gap: 14px;
  max-width: 78ch;
  margin-bottom: clamp(24px, 3vw, 44px);
}
.section__title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(26px, 3.4vw, 44px);
  line-height: 1.2;
  letter-spacing: -.01em;
}
.section__note {
  max-width: 70ch;
  font-size: 14px;
  color: var(--muted);
}

.grid { display: grid; gap: var(--gutter); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

.rule {
  height: 1px;
  border: 0;
  background: var(--line);
}
.rule--gold { background: linear-gradient(90deg, var(--gold), transparent); }

/* ---------- 5. Typography helpers ---------- */
.mono { font-family: var(--mono); letter-spacing: .02em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .32em;
  color: var(--gold);
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--gold);
  flex: 0 0 auto;
}

.display {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(34px, 6.2vw, 76px);
  line-height: 1.06;
  letter-spacing: -.01em;
}
.display--sm {
  font-size: clamp(24px, 3.4vw, 42px);
  line-height: 1.2;
}

.data-figure {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--gold);
}

.lede {
  max-width: 62ch;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.9;
  color: #D8D4C8;
}
.note {
  max-width: 62ch;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

/* ---------- 6. Board(研究板) ---------- */
.board {
  display: grid;
  grid-template-columns: 3fr 9fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}
.board__aside { min-width: 0; }
.board__main { min-width: 0; }
@media (max-width: 960px) {
  .board { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 7. Panel / Tag / Meta / Term ---------- */
.panel {
  position: relative;
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: clamp(18px, 2.2vw, 30px);
}
.panel--raised {
  box-shadow:
    4px 4px 0 rgba(245, 241, 230, .05),
    8px 8px 0 rgba(201, 162, 39, .10);
}
.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.panel__title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.3;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--muted);
  background: var(--ink-2);
  border: 1px solid var(--line);
}
.tag--gold { color: var(--gold); border-color: rgba(201, 162, 39, .5); }
.tag--jade { color: var(--jade-l); border-color: rgba(46, 156, 120, .5); }
.tag--cinnabar { color: var(--cinnabar-l); border-color: rgba(224, 107, 94, .45); }
.tag--blue { color: var(--inkjade-l); border-color: rgba(110, 147, 181, .45); }
.tag--brocade { color: var(--brocade-l); border-color: rgba(169, 143, 208, .45); }
.tag--starlan { color: var(--starlan-l); border-color: rgba(88, 180, 180, .45); }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
}
.meta-row__item { display: inline-flex; gap: 8px; align-items: baseline; }
.meta-row__key { color: var(--muted); letter-spacing: .12em; }
.meta-row__val { color: var(--paper); }

.term {
  border: 1px dashed var(--line);
  background: rgba(22, 22, 26, .6);
  padding: 10px 14px;
}
.term[open] {
  border-style: solid;
  border-color: rgba(201, 162, 39, .45);
}
.term__word {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--paper);
}
.term__word::-webkit-details-marker { display: none; }
.term__word::after { content: "+"; color: var(--gold); }
.term[open] .term__word::after { content: "−"; }
.term__body {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

.hall-strip { display: flex; gap: 2px; height: 6px; }
.hall-strip__cell { flex: 1 1 0; background: var(--line); }
.hall-strip__cell--jade { background: var(--jade); }
.hall-strip__cell--cinnabar { background: var(--cinnabar); }
.hall-strip__cell--blue { background: var(--inkjade); }
.hall-strip__cell--brocade { background: var(--brocade); }
.hall-strip__cell--starlan { background: var(--starlan); }

/* ---------- 8. Media frame(页面阶段放图) ---------- */
.media-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: radial-gradient(120% 100% at 20% 0%, #1C1C22 0%, #0E0E10 70%);
  border: 1px solid var(--line);
}
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .35;
}
.media-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame--wide { aspect-ratio: 16 / 9; }
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame__caption {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--muted);
}

/* ---------- 9. Buttons / Breadcrumb / TOC ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .18em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { background: rgba(201, 162, 39, .12); color: var(--gold-bright); border-color: var(--gold-bright); }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: var(--gold-bright); color: var(--ink); border-color: var(--gold-bright); }
.btn--ghost { border-color: var(--line); color: var(--paper); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-bright); background: rgba(201, 162, 39, .08); }

.breadcrumb { padding-block: 18px 0; }
.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--muted);
}
.breadcrumb__item { display: inline-flex; align-items: center; gap: 10px; }
.breadcrumb__item + .breadcrumb__item::before { content: "/"; color: var(--line); }
.breadcrumb__item a { text-decoration: none; }
.breadcrumb__item a:hover { color: var(--gold); }

.toc { position: sticky; top: 96px; }
.toc__list { display: grid; gap: 2px; }
.toc__link {
  display: block;
  padding: 8px 0 8px 14px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color .2s var(--ease), border-color .2s var(--ease), padding-left .2s var(--ease);
}
.toc__link:hover { color: var(--paper); }
.toc__link.is-active,
.toc__link[aria-current="true"] {
  padding-left: 13px;
  border-left: 2px solid var(--gold);
  color: var(--gold);
}
@media (max-width: 960px) {
  .toc { position: static; }
}

/* ---------- 10. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(14, 14, 16, .95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-rule {
  height: 1px;
  background: linear-gradient(90deg, var(--gold) 0%, rgba(201, 162, 39, .35) 40%, rgba(201, 162, 39, .06) 100%);
}
.header-inner {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  max-width: var(--max);
  margin-inline: auto;
  padding: 16px var(--pad);
  transition: padding .28s var(--ease);
}
.site-header.is-condensed .header-inner { padding-top: 8px; padding-bottom: 8px; }

.skip-link {
  position: absolute;
  top: -64px;
  left: 12px;
  z-index: 120;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .1em;
  text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 8px; }

/* 铭牌 */
.brand-plate {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.brand-plate__link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.brand-plate__seal {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #1C1C22, #0E0E10);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--serif);
  font-weight: 900;
  font-size: 17px;
  line-height: 1;
}
.brand-plate__text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-plate__name {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(17px, 1.5vw, 21px);
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand-plate__sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .36em;
  color: var(--gold);
  transition: opacity .2s var(--ease);
}
.site-header.is-condensed .brand-plate__sub { opacity: .65; }

.counter-strip {
  max-height: 30px;
  overflow: hidden;
  padding-left: 48px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--muted);
  transition: max-height .28s var(--ease), opacity .2s linear, padding .28s var(--ease);
}
.site-header.is-condensed .counter-strip {
  max-height: 0;
  opacity: 0;
  padding-block: 0;
}
.counter-strip__num { color: var(--gold); }

/* 栏目条 */
.primary-nav { justify-self: end; min-width: 0; }
.primary-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px;
}
.primary-nav__link {
  position: relative;
  display: block;
  padding: 10px 13px;
  border: 1px solid transparent;
  color: #C6C3BA;
  font-size: 14px;
  letter-spacing: .06em;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
}
.primary-nav__link:hover {
  color: var(--paper);
  background: var(--ink-2);
  border-color: var(--line);
}
.primary-nav__link[aria-current="page"] { color: var(--gold); }
.primary-nav__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--gold);
}

/* 移动按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .18em;
  cursor: pointer;
  justify-self: end;
}
.nav-toggle__bars {
  position: relative;
  width: 16px;
  height: 2px;
  background: var(--gold);
  flex: 0 0 auto;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: var(--gold);
}
.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }
.site-header[data-open] .nav-toggle {
  border-color: var(--gold);
  color: var(--gold);
}

/* 滚动进度 */
.scroll-progress { height: 2px; background: transparent; }
.scroll-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width .12s linear;
}

@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px var(--pad);
  }
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    display: none;
    grid-column: 1 / -1;
    justify-self: stretch;
    border-top: 1px solid var(--line);
    margin-top: 4px;
    padding-top: 6px;
  }
  .site-header[data-open] .primary-nav { display: block; }
  .primary-nav__list { flex-direction: column; justify-content: flex-start; }
  .primary-nav__link {
    padding: 13px 14px;
    font-size: 16px;
    border-bottom: 1px solid var(--line);
    border-left: 1px solid transparent;
  }
  .primary-nav__link[aria-current="page"]::before { top: 13px; bottom: 13px; }
  .counter-strip { padding-left: 48px; }
  .toc { top: 84px; }
}

/* ---------- 11. Footer ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(56px, 8vw, 120px);
  background: #0B0B0D;
  border-top: 1px solid var(--line);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: clamp(120px, 18vw, 240px);
  height: 1px;
  background: var(--gold);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr 1fr;
  gap: clamp(24px, 3vw, 48px);
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(40px, 5vw, 72px) var(--pad) 0;
}
.footer-brand__name {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(19px, 1.8vw, 23px);
  line-height: 1.3;
}
.footer-brand__sub {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .24em;
  color: var(--gold);
}
.footer-brand__note {
  margin-top: 14px;
  max-width: 42ch;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}
.footer-col__title {
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .28em;
  color: var(--paper);
}
.footer-links { display: grid; gap: 8px; font-size: 14px; }
.footer-links a {
  color: #B9B7AE;
  text-decoration: none;
  transition: color .2s var(--ease);
}
.footer-links a:hover { color: var(--gold); }
.footer-links--plain li { display: grid; gap: 2px; color: #B9B7AE; line-height: 1.7; }
.footer-key {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--gold);
}
.footer-note {
  margin-top: 14px;
  max-width: 40ch;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: var(--max);
  margin: clamp(32px, 4vw, 56px) auto 0;
  padding: 18px var(--pad) 28px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--muted);
}
.footer-legal__item { margin: 0; }

@media (max-width: 1100px) {
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .footer-legal { flex-direction: column; }
}

/* ---------- 12. To top / Reveal ---------- */
.to-top {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 55;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: rgba(14, 14, 16, .92);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s var(--ease), visibility .28s var(--ease), background-color .2s var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { background: rgba(201, 162, 39, .16); color: var(--gold-bright); }

.js [data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- 13. 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;
  }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .scroll-progress__bar { transition: none; }
  .to-top { transition: opacity .001ms linear; }
}
