/* ============================================================
   神殿棋牌局 · 共享样式表 /assets/site.css
   重置 · 变量 · 中文排版 · 头部 · 页脚 · 通用组件 · 响应式
   ============================================================ */

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

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

body { margin: 0; }

h1, h2, h3, h4, h5, 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 { font: inherit; color: inherit; background: none; border: 0; }

a { color: inherit; }

table { border-collapse: collapse; }

/* ---------- 2. 变量 ---------- */
:root {
  --temple: #0E3B43;
  --ink-green: #102A23;
  --gold: #C9A253;
  --sand: #E7D9BE;
  --cream: #F6F1E6;
  --silver: #C7D1D4;
  --indigo: #1C2B4A;
  --wine: #6B2C35;
  --ink: #161A18;

  --shell-width: 1240px;
  --gutter: clamp(18px, 4vw, 56px);

  --hair: 1px solid rgba(22, 26, 24, 0.16);
  --frame: 2px solid var(--ink);
  --shadow-block: 10px 10px 0 rgba(14, 59, 67, 0.14);
  --shadow-gold: 8px 8px 0 rgba(201, 162, 83, 0.32);

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

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

/* ---------- 3. 基础排版 ---------- */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  color: var(--ink);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.18;
}

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

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

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- 4. 布局骨架 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.page-main {
  display: block;
  padding-block: 0 clamp(48px, 7vw, 104px);
}

.section { padding-block: clamp(48px, 7vw, 104px); }
.section--framed { border-block: 1px solid rgba(22, 26, 24, 0.16); }
.section--temple { background-color: var(--temple); color: var(--cream); }
.section--sand { background-color: var(--sand); color: var(--ink); }
.section--indigo { background-color: var(--indigo); color: var(--cream); }
.section--wine { background-color: var(--wine); color: var(--cream); }

.grid { display: grid; gap: clamp(20px, 3vw, 44px); }
.grid--5-7 { grid-template-columns: 5fr 7fr; }
.grid--7-5 { grid-template-columns: 7fr 5fr; }
.grid--aside { grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); }
.grid--thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- 5. 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 12px 20px;
  background-color: var(--gold);
  color: var(--ink-green);
  border: 2px solid var(--ink-green);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 200ms var(--ease);
}

.skip-link:focus { transform: translateY(0); }

/* ---------- 6. 品牌标记 ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand__glyph {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 2px solid var(--gold);
  background-color: rgba(201, 162, 83, 0.1);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
}

.brand__lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0.16em;
}

.brand__tag {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.2em;
  opacity: 0.72;
}

.brand--footer .brand__glyph {
  background-color: var(--gold);
  border-color: var(--gold);
  color: var(--ink-green);
}

.brand--footer .brand__name { color: var(--sand); font-size: 19px; }
.brand--footer .brand__tag { color: rgba(231, 217, 190, 0.7); opacity: 1; }

/* ---------- 7. 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  background-color: var(--cream);
  border-bottom: 2px solid var(--ink);
}

.scroll-progress {
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background-color: rgba(201, 162, 83, 0.18);
  z-index: 3;
  pointer-events: none;
}

.scroll-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(90deg, var(--gold), var(--wine));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.header-top {
  background-color: var(--temple);
  color: var(--sand);
  box-shadow: inset 0 3px 0 rgba(201, 162, 83, 0.55);
}

.header-top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 32px);
  min-height: 68px;
  padding-block: 10px;
}

.header-edition {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: rgba(231, 217, 190, 0.82);
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-bottom { background-color: var(--cream); }

.header-bottom__inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(12px, 3vw, 40px);
  min-height: 60px;
}

/* 主导航 */
.primary-nav { display: flex; align-items: center; }

.nav-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(4px, 1.4vw, 26px);
}

.nav-link {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 12px 4px;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.nav-link:hover {
  color: var(--temple);
  border-bottom-color: var(--gold);
}

.nav-link[aria-current="page"] {
  color: var(--temple);
  font-weight: 500;
  border-bottom-color: var(--gold);
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.1em;
  color: var(--wine);
}

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

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 2px solid var(--gold);
  background-color: transparent;
  color: var(--sand);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background-color: rgba(201, 162, 83, 0.16);
}

.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
  height: 14px;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 100%;
  background-color: currentColor;
  transition: transform var(--dur) var(--ease), opacity 160ms linear;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-toggle__text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
}

/* ---------- 8. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 2px solid var(--ink);
  background-color: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.12em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), transform 160ms var(--ease);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

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

.btn--gold:hover { background-color: #d8b264; border-color: #d8b264; }

.btn--ghost {
  border-color: rgba(231, 217, 190, 0.55);
  color: var(--sand);
}

.btn--ghost:hover {
  background-color: var(--sand);
  border-color: var(--sand);
  color: var(--temple);
}

.btn--line {
  border-color: var(--temple);
  color: var(--temple);
}

.btn--line:hover {
  background-color: var(--temple);
  color: var(--cream);
}

/* ---------- 9. 页脚 ---------- */
.site-footer {
  background-color: var(--ink-green);
  color: var(--sand);
  border-top: 4px solid var(--gold);
  padding-top: clamp(44px, 6vw, 84px);
  font-size: 15px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.72fr) minmax(0, 0.72fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 60px);
  padding-bottom: clamp(36px, 5vw, 64px);
  border-bottom: 1px solid rgba(231, 217, 190, 0.2);
}

.footer-lede {
  margin-top: 20px;
  max-width: 34ch;
  color: rgba(231, 217, 190, 0.86);
  font-size: 14.5px;
  line-height: 1.9;
}

.footer-stamp {
  display: inline-flex;
  margin-top: 20px;
  padding: 8px 12px;
  border: 1px solid rgba(201, 162, 83, 0.5);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
}

.footer-col__title {
  margin-bottom: 18px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1.4;
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-list a {
  display: inline-block;
  padding-bottom: 1px;
  color: rgba(231, 217, 190, 0.88);
  font-size: 14.5px;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), padding-left var(--dur) var(--ease);
}

.footer-list a:hover {
  color: var(--gold);
  padding-left: 6px;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-contact__row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-contact__key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(201, 162, 83, 0.9);
}

.footer-contact__val {
  color: var(--sand);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.footer-note {
  margin-top: 2px;
  color: rgba(231, 217, 190, 0.64);
  font-size: 12.5px;
  line-height: 1.8;
}

.footer-base { padding-block: 22px 28px; }

.footer-base__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 26px;
  color: rgba(231, 217, 190, 0.72);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
}

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

.footer-legal a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(231, 217, 190, 0.32);
  padding-bottom: 2px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

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

/* ---------- 10. 索引与标签 ---------- */
.index-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--wine);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  line-height: 1.4;
}

.index-tag::before {
  content: "";
  display: block;
  width: 26px;
  height: 2px;
  background-color: currentColor;
}

.section--temple .index-tag,
.section--indigo .index-tag,
.section--wine .index-tag { color: var(--gold); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid rgba(22, 26, 24, 0.35);
  background-color: rgba(199, 209, 212, 0.4);
  color: var(--ink-green);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  line-height: 1.4;
}

.chip--gold {
  border-color: var(--gold);
  background-color: rgba(201, 162, 83, 0.24);
  color: var(--ink-green);
}

.chip--wine {
  border-color: var(--wine);
  background-color: rgba(107, 44, 53, 0.08);
  color: var(--wine);
}

/* ---------- 11. 卡片与数据 ---------- */
.card {
  padding: clamp(18px, 2.4vw, 30px);
  background-color: var(--cream);
  border: var(--frame);
  box-shadow: var(--shadow-block);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.card--flat { box-shadow: none; }

.card--gold {
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}

.card__meta {
  margin-bottom: 12px;
  color: var(--wine);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
}

.card__title {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.2vw, 25px);
  font-weight: 400;
  line-height: 1.38;
  letter-spacing: 0.02em;
}

.data-figure {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.data-figure__value {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--temple);
}

.data-figure__label {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: rgba(22, 26, 24, 0.68);
}

.section--temple .data-figure__value,
.section--indigo .data-figure__value,
.section--wine .data-figure__value { color: var(--gold); }

.section--temple .data-figure__label,
.section--indigo .data-figure__label,
.section--wine .data-figure__label { color: rgba(246, 241, 230, 0.74); }

/* 图例（地图/坐标隐喻） */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.legend__key {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
}

.legend__key--solid { background-color: currentColor; }
.legend__key--half { background-image: linear-gradient(90deg, currentColor 50%, transparent 50%); }

/* ---------- 12. 表格 ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: var(--frame);
  background-color: var(--cream);
}

.data-table {
  width: 100%;
  min-width: 520px;
  font-size: 14px;
  text-align: left;
}

.data-table caption {
  padding: 14px 16px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-green);
  border-bottom: 1px solid rgba(22, 26, 24, 0.16);
}

.data-table th {
  padding: 12px 14px;
  background-color: var(--sand);
  color: var(--ink-green);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  border-bottom: 1px solid rgba(22, 26, 24, 0.24);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(22, 26, 24, 0.1);
  vertical-align: top;
}

.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background-color: rgba(201, 162, 83, 0.1); }

.data-table .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- 13. 面包屑 ---------- */
.breadcrumbs {
  padding-block: 18px;
  border-bottom: var(--hair);
}

.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(22, 26, 24, 0.6);
}

.breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumbs__item + .breadcrumbs__item::before {
  content: "/";
  color: rgba(22, 26, 24, 0.34);
}

.breadcrumbs__link {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.breadcrumbs__link:hover {
  color: var(--wine);
  border-bottom-color: var(--wine);
}

.breadcrumbs__current { color: var(--ink); }

/* ---------- 14. 正文阅读区 ---------- */
.prose {
  max-width: 72ch;
  font-size: 16.5px;
  line-height: 1.9;
}

.prose > * + * { margin-top: 1.1em; }

.prose h2 {
  margin-top: 2em;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.prose h3 {
  margin-top: 1.7em;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(18px, 2vw, 22px);
}

.prose ul,
.prose ol {
  list-style: disc;
  padding-left: 1.4em;
}

.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.5em; }

.prose a {
  color: var(--wine);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose blockquote {
  padding: 16px 22px;
  border-left: 4px solid var(--gold);
  background-color: rgba(231, 217, 190, 0.42);
  font-family: var(--font-display);
  font-size: 17px;
}

/* ---------- 15. 图片容器基础规则 ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: var(--frame);
  background-color: var(--sand);
  box-shadow: var(--shadow-block);
}

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

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

.media-frame__caption {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: 100%;
  padding: 8px 14px;
  background-color: var(--ink-green);
  color: var(--sand);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
}

/* ---------- 16. 滚动显现 ---------- */
[data-reveal] {
  transition: opacity 480ms var(--ease), transform 480ms var(--ease);
}

[data-reveal].is-hidden {
  opacity: 0;
  transform: translateY(16px);
}

/* ---------- 17. 响应式 ---------- */
@media (max-width: 1100px) {
  .header-edition { display: none; }
}

@media (max-width: 960px) {
  .grid--5-7,
  .grid--7-5,
  .grid--aside { grid-template-columns: 1fr; }

  .grid--thirds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .site-header { position: sticky; }

  .header-top__inner {
    min-height: 58px;
    padding-block: 8px;
  }

  .header-actions { display: none; }
  .nav-toggle { display: inline-flex; }

  .header-bottom {
    background-color: transparent;
    border-top: 0;
  }

  .header-bottom__inner {
    display: block;
    min-height: 0;
    padding-inline: 0;
  }

  .primary-nav { display: none; width: 100%; }

  .primary-nav[data-open] {
    display: block;
    background-color: var(--ink-green);
    border-top: 1px solid rgba(231, 217, 190, 0.2);
  }

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

  .nav-list li { border-bottom: 1px solid rgba(231, 217, 190, 0.14); }
  .nav-list li:last-child { border-bottom: 0; }

  .nav-link {
    display: flex;
    width: 100%;
    padding: 15px var(--gutter);
    color: var(--sand);
    font-size: 16px;
    border-bottom: 0;
  }

  .nav-link:hover {
    color: var(--gold);
    background-color: rgba(201, 162, 83, 0.1);
    border-bottom-color: transparent;
  }

  .nav-link[aria-current="page"] {
    color: var(--gold);
    background-color: rgba(201, 162, 83, 0.14);
    border-bottom-color: transparent;
  }

  .nav-index { color: rgba(201, 162, 83, 0.9); }
}

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

@media (max-width: 640px) {
  .grid--thirds,
  .grid--halves { grid-template-columns: 1fr; }

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

  .footer-base__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .footer-legal { gap: 14px; }

  .data-table { min-width: 460px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

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

  .btn:hover,
  .card:hover { transform: none; }
}
