/* ==========================================================================
   金鼎娱乐会馆 · 共享样式 /assets/site.css
   暗厅托金 · 纵向叙事长卷
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

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

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

button { font: inherit; color: inherit; }

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

[hidden] { display: none !important; }

/* ---------- 2. 变量 ---------- */
:root {
  --ink: #0E0F10;
  --lacquer: #16181A;
  --gold: #C8A45C;
  --gold-light: #E8D5A3;
  --cinnabar: #B5342B;
  --celadon: #4E7A6A;
  --paper: #F2EAD9;
  --brown: #241E18;
  --mute: #A9A29A;
  --hair: #3A3630;
  --body-ink: #D7D0C5;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 180ms;

  --font-display: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC", "SimSun", "Georgia", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", system-ui, sans-serif;
  --font-accent: "FangSong", "STFangsong", "FangSong_GB2312", "KaiTi", "SimSun", serif;

  --shell: min(1200px, 100% - 40px);
}

/* ---------- 3. 基础与中文排版 ---------- */
html { scroll-behavior: smooth; }

body {
  isolation: isolate;
  background-color: var(--ink);
  color: var(--body-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 暗纹屏风 + 极细金箔网格 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(90deg, rgba(200, 164, 92, 0.055) 0 1px, transparent 1px 160px),
    repeating-linear-gradient(0deg, rgba(200, 164, 92, 0.03) 0 1px, transparent 1px 160px);
  opacity: 0.6;
}

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

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

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

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: 10px 20px;
  background: var(--paper);
  color: var(--brown);
  font-size: 14px;
  letter-spacing: 0.14em;
  border-radius: 2px;
  transition: top 160ms var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- 4. 布局工具 ---------- */
.shell {
  width: var(--shell);
  margin-inline: auto;
}

.grid {
  display: grid;
  gap: clamp(18px, 3vw, 32px);
}
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.section-band {
  height: 2px;
  background: linear-gradient(90deg, var(--gold), rgba(200, 164, 92, 0) 78%);
}

/* ---------- 5. 刊头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, #0E0F10 0%, #101214 100%);
  border-bottom: 1px solid var(--hair);
}

.header-rule {
  height: 3px;
  background: linear-gradient(90deg,
    rgba(200, 164, 92, 0) 0%,
    var(--gold) 18%,
    var(--gold-light) 50%,
    var(--gold) 82%,
    rgba(200, 164, 92, 0) 100%);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 18px 0 12px;
  transition: padding 200ms var(--ease);
}

.header-side {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-side--left { justify-content: flex-start; }
.header-side--right { justify-content: flex-end; }

.header-tag {
  writing-mode: vertical-rl;
  font-family: var(--font-accent);
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--mute);
  max-height: 76px;
  overflow: hidden;
  transition: opacity 200ms var(--ease);
}

.site-header[data-scrolled="true"] .header-inner { padding: 10px 0 6px; }
.site-header[data-scrolled="true"] .header-tag { opacity: 0; }

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  justify-self: center;
  padding: 2px 6px;
}

.brand__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(181, 52, 43, 0.55);
  border-radius: 2px;
  background: rgba(181, 52, 43, 0.14);
  color: #E4A79E;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.brand:hover .brand__glyph {
  border-color: rgba(181, 52, 43, 0.9);
  background: rgba(181, 52, 43, 0.22);
}

.brand__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.brand__name {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.3vw, 26px);
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--paper);
  text-shadow: 0 1px 0 rgba(232, 213, 163, 0.18);
}

.brand__sub {
  font-family: var(--font-accent);
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--mute);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.site-header[data-scrolled="true"] .brand__sub {
  opacity: 0;
  transform: translateY(-4px);
}

/* 刊头按钮 */
.header-cta {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border: 1px solid var(--hair);
  border-radius: 2px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.16em;
  white-space: nowrap;
  box-shadow: inset 0 0 0 0.5px rgba(200, 164, 92, 0.35);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
              background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.header-cta:hover {
  color: var(--gold-light);
  border-color: rgba(200, 164, 92, 0.7);
  background: rgba(200, 164, 92, 0.08);
  box-shadow: inset 0 0 0 1.25px rgba(232, 213, 163, 0.85);
}

/* 移动开关 */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--hair);
  border-radius: 2px;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.nav-toggle:hover { border-color: var(--gold); background: rgba(200, 164, 92, 0.08); }

.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 16px;
}
.nav-toggle__bars span {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform var(--dur) var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:first-child { transform: translateY(3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:last-child { transform: translateY(-3px) rotate(-45deg); }

/* ---------- 6. 导航 ---------- */
.site-nav {
  border-top: 1px solid var(--hair);
  background: rgba(22, 24, 26, 0.6);
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(14px, 3vw, 42px);
}

.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 2px;
  font-size: 15px;
  letter-spacing: 0.18em;
  color: var(--mute);
  transition: color var(--dur) var(--ease);
}
.site-nav__link::before {
  content: "";
  width: 0;
  height: 5px;
  border-radius: 50%;
  background: var(--cinnabar);
  transition: width var(--dur) var(--ease);
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 8px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 200ms var(--ease);
}
.site-nav__link:hover,
.site-nav__link:focus-visible { color: var(--gold-light); }
.site-nav__link:hover::after,
.site-nav__link:focus-visible::after { transform: scaleX(1); }

.site-nav__link[aria-current="page"] { color: var(--gold-light); }
.site-nav__link[aria-current="page"]::before { width: 5px; }

/* ---------- 7. 滚动指示 ---------- */
.scroll-meter {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 2px;
  pointer-events: none;
}
.scroll-meter span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

/* ---------- 8. 页脚 ---------- */
.site-footer {
  position: relative;
  background: var(--brown);
  border-top: 1px solid var(--hair);
  color: var(--paper);
}

.footer-band {
  height: 4px;
  background: linear-gradient(90deg,
    var(--cinnabar) 0 12%,
    var(--gold) 12% 56%,
    var(--celadon) 56% 68%,
    var(--gold-light) 68% 100%);
  opacity: 0.9;
}

.footer-inner { padding: 58px 0 30px; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.3fr 1.1fr 1fr;
  gap: clamp(20px, 3vw, 38px);
}

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

.footer-mark {
  display: block;
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: 0.24em;
  color: var(--paper);
}

.footer-line {
  margin-top: 14px;
  max-width: 28ch;
  font-size: 14px;
  line-height: 1.9;
  color: var(--mute);
}

.footer-title {
  font-family: var(--font-accent);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.32em;
  color: var(--gold);
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--hair);
}

.footer-list {
  display: grid;
  gap: 10px;
}
.footer-list a {
  display: inline-block;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--mute);
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.footer-list a:hover {
  color: var(--gold-light);
  transform: translateX(3px);
}

.footer-list--meta { gap: 14px; }
.footer-list--meta li {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.foot-key {
  font-family: var(--font-accent);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--celadon);
}
.foot-val {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--mute);
  word-break: break-word;
}

.footer-note {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--mute);
}

.footer-action {
  display: inline-block;
  margin-top: 14px;
  padding: 9px 15px;
  border: 1px solid rgba(200, 164, 92, 0.5);
  border-radius: 2px;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--gold-light);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.footer-action:hover {
  border-color: var(--gold-light);
  background: rgba(200, 164, 92, 0.12);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 26px;
  margin-top: 46px;
  padding-top: 20px;
  border-top: 1px solid var(--hair);
}
.footer-bottom__item {
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--mute);
}

/* 回到顶部 */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  font-family: var(--font-accent);
  font-size: 12.5px;
  letter-spacing: 0.26em;
  color: var(--gold);
  background: rgba(22, 24, 26, 0.94);
  border: 1px solid var(--hair);
  border-radius: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease),
              visibility 200ms var(--ease), border-color var(--dur) var(--ease);
}
.to-top[data-visible="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover { border-color: var(--gold); color: var(--gold-light); }

/* ---------- 9. 章节与正文 ---------- */
.chapter {
  position: relative;
  padding: clamp(56px, 9vw, 118px) 0;
}

.chapter__no {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 520px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.38em;
  color: var(--gold);
}
.chapter__no::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--hair), rgba(58, 54, 48, 0));
}

.chapter__title {
  margin-top: 20px;
  font-size: clamp(30px, 4.4vw, 54px);
  color: var(--paper);
}

.chapter__lead {
  margin-top: 18px;
  max-width: 46ch;
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.85;
  color: var(--mute);
}

.chapter--paper {
  background: var(--paper);
  color: #322A22;
}
.chapter--paper .chapter__title { color: var(--brown); }
.chapter--paper .chapter__no { color: #8A6B2C; }
.chapter--paper .chapter__no::after { background: linear-gradient(90deg, rgba(36, 30, 24, 0.28), rgba(36, 30, 24, 0)); }
.chapter--paper .chapter__lead { color: #5A4E42; }
.chapter--paper .prose { color: #3A3229; }
.chapter--paper .prose h2 { color: var(--brown); }
.chapter--paper .prose h3 { color: #8A6B2C; }
.chapter--paper .prose strong { color: #7A4A22; }

.prose {
  max-width: 68ch;
  font-size: 16.5px;
  line-height: 1.95;
  color: var(--body-ink);
}
.prose p + p { margin-top: 1.1em; }
.prose h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  color: var(--paper);
  margin: 2.2em 0 0.8em;
}
.prose h3 {
  font-family: var(--font-accent);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin: 1.8em 0 0.6em;
}
.prose strong { color: var(--gold-light); font-weight: 600; }
.prose a {
  color: var(--gold);
  border-bottom: 1px solid rgba(200, 164, 92, 0.4);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.prose a:hover { color: var(--gold-light); border-color: var(--gold-light); }

/* ---------- 10. 通用组件 ---------- */
.card {
  position: relative;
  padding: 24px 24px 26px;
  background: var(--lacquer);
  border: 1px solid var(--hair);
  border-radius: 2px;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.card:hover,
.card:focus-within {
  transform: translateY(-2px);
  border-color: rgba(200, 164, 92, 0.75);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.38);
}

.card__side {
  position: absolute;
  top: 16px;
  right: 14px;
  writing-mode: vertical-rl;
  font-family: var(--font-accent);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--gold);
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card:hover .card__side,
.card:focus-within .card__side {
  opacity: 1;
  transform: translateY(0);
}

.plate {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hair);
}
.plate__key {
  flex: 0 0 auto;
  min-width: 8em;
  font-family: var(--font-accent);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--gold);
}
.plate__val {
  flex: 1 1 240px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--body-ink);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid var(--hair);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-accent);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--mute);
}
.tag--gold {
  color: var(--gold-light);
  border-color: rgba(200, 164, 92, 0.5);
  background: rgba(200, 164, 92, 0.1);
}
.tag--cinnabar {
  color: #E3A79E;
  border-color: rgba(181, 52, 43, 0.55);
  background: rgba(181, 52, 43, 0.13);
}
.tag--celadon {
  color: #9FC4B4;
  border-color: rgba(78, 122, 106, 0.55);
  background: rgba(78, 122, 106, 0.13);
}

.vertical-tag {
  display: inline-block;
  writing-mode: vertical-rl;
  padding: 10px 6px;
  border-left: 1px solid var(--hair);
  font-family: var(--font-accent);
  font-size: 12px;
  letter-spacing: 0.34em;
  color: var(--mute);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border: 1px solid var(--gold);
  border-radius: 2px;
  background: transparent;
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
}
.btn:hover {
  color: var(--gold-light);
  border-color: var(--gold-light);
  background: rgba(200, 164, 92, 0.12);
}
.btn--solid {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-color: transparent;
  color: #1A1408;
  font-weight: 600;
}
.btn--solid:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1A1408;
}

.crumb {
  padding: 22px 0 0;
}
.crumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: var(--mute);
}
.crumb__list li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.crumb__list li + li::before {
  content: "/";
  color: var(--hair);
}
.crumb__list a {
  color: var(--mute);
  transition: color var(--dur) var(--ease);
}
.crumb__list a:hover { color: var(--gold-light); }
.crumb__list [aria-current="page"] { color: var(--gold); }

.frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--lacquer);
  border: 1px solid var(--hair);
  border-radius: 2px;
}
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(14, 15, 16, 0) 42%, rgba(14, 15, 16, 0.62) 100%);
}
.frame__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 5;
  background: linear-gradient(160deg, #1B1D1F, #0E0F10);
}
.frame--wide .frame__img { aspect-ratio: 16 / 9; }
.frame--tall .frame__img { aspect-ratio: 3 / 4; }

/* ---------- 11. 显现 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 12. 响应式 ---------- */
@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-col--brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 14px 0 10px;
  }
  .header-side--left { display: none; }
  .header-side--right { justify-self: end; gap: 10px; }
  .header-side--right .header-tag { display: none; }
  .brand { justify-self: start; gap: 10px; }
  .brand__glyph { width: 34px; height: 34px; font-size: 15px; }
  .brand__name { letter-spacing: 0.2em; }
  .brand__sub { letter-spacing: 0.22em; }

  .nav-toggle { display: inline-flex; }

  .site-nav {
    display: none;
    border-top: 1px solid var(--hair);
    background: var(--lacquer);
  }
  .site-nav[data-open="true"] { display: block; }

  .site-nav__list {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 24px;
    padding: 2px 20px 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav__list::-webkit-scrollbar { display: none; }

  .site-nav__link {
    padding: 13px 0;
    white-space: nowrap;
  }
  .site-nav__link::after { display: none; }

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

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .footer-bottom { margin-top: 34px; }
  .footer-bottom__item { flex: 1 1 100%; }
  .to-top { right: 14px; bottom: 16px; padding: 9px 14px; letter-spacing: 0.18em; }
}

@media (max-width: 600px) {
  .header-side--right .header-cta { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .chapter { padding: 52px 0; }
  .plate__key { min-width: 6em; }
}

/* ---------- 13. 减弱动效 ---------- */
@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;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .to-top { transform: none !important; }
}
