/* ============================================================
   SE棋牌 · /assets/site.css
   共享外壳：reset / 变量 / 中文排版 / 头部 / 页脚 / 通用组件
   ============================================================ */

/* ---------- 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;
  padding: 0;
}

ul, ol { list-style: none; }

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

/* ---------- 变量 ---------- */
:root {
  --se-ink: #0E1A16;
  --se-ink-layer: #16281F;
  --se-paper: #F2E9D8;
  --se-paper-deep: #E2D5BC;
  --se-cinnabar: #C8322B;
  --se-gold: #D9A03C;
  --se-blue: #6E8CA0;
  --se-neutral: #8FA39B;
  --se-coal: #080D0B;
  --se-warm-white: #F7F1E4;

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

  --se-fs-12: 12px;
  --se-fs-14: 14px;
  --se-fs-16: 16px;
  --se-fs-20: 20px;
  --se-fs-28: 28px;
  --se-fs-40: 40px;
  --se-fs-64: 64px;
  --se-fs-96: 96px;

  --se-header-h: 96px;
  --se-maxw: 1280px;
  --se-gutter: 32px;
  --se-radius: 3px;
  --se-ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- 中文排版基底 ---------- */
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background-color: var(--se-ink);
  color: var(--se-warm-white);
  font-family: var(--se-sans);
  font-size: var(--se-fs-16);
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--se-serif);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

.mono {
  font-family: var(--se-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* ---------- skip link ---------- */
.se-skip {
  position: absolute;
  top: -120px;
  left: 16px;
  z-index: 999;
  padding: 10px 18px;
  background: var(--se-gold);
  color: var(--se-coal);
  font-family: var(--se-mono);
  font-size: var(--se-fs-14);
  border-radius: var(--se-radius);
  transition: top .2s var(--se-ease);
}
.se-skip:focus { top: 12px; }

/* ---------- 滚动进度轨 ---------- */
.progress-rail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 80;
  background: rgba(217, 160, 60, .14);
  pointer-events: none;
}
.progress-rail__bar {
  display: block;
  height: 100%;
  width: calc(var(--se-progress, 0) * 100%);
  background: linear-gradient(90deg, var(--se-cinnabar), var(--se-gold));
  transform-origin: left center;
  transition: width .12s linear;
}

/* ---------- 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  background: var(--se-ink-layer);
  border-bottom: 1px solid rgba(226, 213, 188, .16);
  box-shadow: 0 1px 0 rgba(8, 13, 11, .5), 0 14px 28px -22px rgba(8, 13, 11, .9);
  padding-top: 2px;
}

.header-inner {
  position: relative;
  max-width: var(--se-maxw);
  margin: 0 auto;
  padding: 14px var(--se-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--se-header-h);
}

/* 印章式品牌块 */
.brand-seal {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}

.brand-seal__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 6px;
  border: 1px solid rgba(200, 50, 43, .55);
  box-shadow: inset 0 0 0 3px var(--se-ink-layer), inset 0 0 0 4px rgba(200, 50, 43, .32);
  background: rgba(200, 50, 43, .07);
  border-radius: var(--se-radius);
  transition: background .2s var(--se-ease), border-color .2s var(--se-ease);
}
.brand-seal__link:hover,
.brand-seal__link:focus-visible {
  background: rgba(200, 50, 43, .16);
  border-color: var(--se-cinnabar);
}

.brand-seal__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--se-cinnabar);
  color: var(--se-paper);
  font-size: var(--se-fs-20);
  font-weight: 700;
  border-radius: 2px;
  letter-spacing: 0.02em;
}

.brand-seal__word {
  font-family: var(--se-serif);
  font-size: var(--se-fs-20);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--se-warm-white);
  white-space: nowrap;
}

.brand-seal__chapter {
  font-family: var(--se-mono);
  font-size: var(--se-fs-12);
  color: var(--se-neutral);
  letter-spacing: 0.08em;
  padding-left: 4px;
}

/* 三栏等宽导航 */
.nav-grid {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.nav-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 84px;
  padding-left: 14px;
  border-left: 1px solid rgba(226, 213, 188, .18);
}
.nav-col--anchor {
  position: relative;
  padding-left: 18px;
  border-left: 1px solid rgba(217, 160, 60, .34);
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 3px 2px;
  font-size: var(--se-fs-14);
  color: var(--se-neutral);
  white-space: nowrap;
  transition: color .2s var(--se-ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--se-cinnabar);
  transition: width .22s var(--se-ease);
}
.nav-link:hover { color: var(--se-warm-white); }
.nav-link:hover::after { width: 100%; }

.nav-link[aria-current="page"] {
  color: var(--se-warm-white);
  font-weight: 700;
}
.nav-link[aria-current="page"]::after { width: 100%; }

.nav-link--accent {
  color: var(--se-warm-white);
  padding-left: 12px;
  font-weight: 700;
}
.nav-link--accent::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 15px;
  background: var(--se-cinnabar);
  border-radius: 1px;
}

.header-cta { flex: 0 0 auto; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--se-sans);
  font-size: var(--se-fs-14);
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: var(--se-radius);
  border: 1px solid transparent;
  transition: background .2s var(--se-ease), color .2s var(--se-ease),
              border-color .2s var(--se-ease), transform .2s var(--se-ease);
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--se-gold);
  color: var(--se-coal);
  border-color: var(--se-gold);
  box-shadow: 0 2px 0 rgba(8, 13, 11, .55);
}
.btn--primary:hover {
  background: var(--se-paper);
  border-color: var(--se-paper);
  color: var(--se-coal);
}

.btn--ghost {
  background: transparent;
  color: var(--se-warm-white);
  border-color: rgba(226, 213, 188, .34);
}
.btn--ghost:hover {
  border-color: var(--se-gold);
  color: var(--se-gold);
}

/* ---------- 移动导航按钮 ---------- */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(226, 213, 188, .3);
  border-radius: var(--se-radius);
  background: rgba(8, 13, 11, .4);
  color: var(--se-warm-white);
  font-size: var(--se-fs-14);
  font-weight: 700;
}
.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
  height: 14px;
}
.nav-toggle__bars i {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--se-gold);
  transition: transform .22s var(--se-ease), opacity .18s var(--se-ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 96px;
  background: var(--se-coal);
  color: var(--se-neutral);
  border-top: 1px solid rgba(217, 160, 60, .28);
  box-shadow: inset 0 1px 0 rgba(217, 160, 60, .12);
}

.footer-inner {
  max-width: var(--se-maxw);
  margin: 0 auto;
  padding: 56px var(--se-gutter) 32px;
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.25fr;
  gap: 40px 48px;
  align-items: start;
}

.footer-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--se-cinnabar);
  color: var(--se-paper);
  font-size: var(--se-fs-16);
  font-weight: 700;
  border-radius: 2px;
}

.footer-brand__word {
  margin-top: 14px;
  font-family: var(--se-serif);
  font-size: var(--se-fs-28);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--se-warm-white);
}

.footer-brand__note {
  margin-top: 10px;
  max-width: 24em;
  font-size: var(--se-fs-14);
  line-height: 1.8;
  color: var(--se-neutral);
}

.footer-links__title,
.footer-contact__title {
  font-size: var(--se-fs-12);
  color: var(--se-gold);
  letter-spacing: 0.24em;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(226, 213, 188, .16);
}

.footer-links ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
}

.footer-link {
  display: inline-block;
  padding: 3px 0;
  font-size: var(--se-fs-14);
  color: var(--se-neutral);
  border-bottom: 1px solid transparent;
  transition: color .2s var(--se-ease), border-color .2s var(--se-ease);
}
.footer-link:hover,
.footer-link:focus-visible {
  color: var(--se-paper);
  border-bottom-color: var(--se-cinnabar);
}

.footer-contact__row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: var(--se-fs-14);
  line-height: 1.9;
  color: var(--se-warm-white);
  word-break: break-word;
}
.footer-contact__row .mono {
  flex: 0 0 auto;
  min-width: 34px;
  font-size: var(--se-fs-12);
  color: var(--se-blue);
}
.footer-contact__row--wide { align-items: flex-start; }

.footer-contact__note {
  margin-top: 12px;
  font-size: var(--se-fs-12);
  line-height: 1.8;
  color: var(--se-neutral);
  padding-left: 12px;
  border-left: 2px solid rgba(110, 140, 160, .55);
}

.footer-meta {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid rgba(226, 213, 188, .14);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 28px;
}

.footer-stamp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--se-mono);
  font-size: var(--se-fs-12);
  color: var(--se-neutral);
  letter-spacing: 0.06em;
}
.footer-stamp__sep { color: rgba(217, 160, 60, .5); }
.footer-stamp--time .mono { color: var(--se-gold); }

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 75;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--se-ink-layer);
  color: var(--se-warm-white);
  border: 1px solid rgba(217, 160, 60, .45);
  border-radius: var(--se-radius);
  box-shadow: 0 10px 24px -14px rgba(8, 13, 11, .95);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .22s var(--se-ease), transform .22s var(--se-ease),
              visibility .22s var(--se-ease), border-color .2s var(--se-ease);
}
.to-top[data-visible="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover { border-color: var(--se-gold); }
.to-top__arrow { color: var(--se-gold); font-size: var(--se-fs-16); line-height: 1; }
.to-top__text { font-size: var(--se-fs-12); letter-spacing: 0.14em; }

/* ---------- 页面骨架 / 栅格 ---------- */
.page-shell {
  max-width: var(--se-maxw);
  margin: 0 auto;
  padding: 0 var(--se-gutter);
}

.page-grid {
  display: grid;
  grid-template-columns: 3fr 9fr;
  gap: 0 48px;
  align-items: start;
}

.page-aside {
  position: sticky;
  top: calc(var(--se-header-h) + 28px);
  padding: 28px 0 40px;
  border-right: 1px solid rgba(226, 213, 188, .14);
  padding-right: 24px;
}

.page-main {
  min-width: 0;
  padding: 28px 0 40px;
}

/* ---------- 章节色带与大编号 ---------- */
.section-band {
  position: relative;
  border-top: 8px solid var(--se-ink-layer);
  padding: 40px 0 8px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.section-num {
  font-family: var(--se-mono);
  font-size: var(--se-fs-40);
  font-weight: 700;
  line-height: 1;
  color: var(--se-cinnabar);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.section-kicker {
  font-family: var(--se-mono);
  font-size: var(--se-fs-12);
  letter-spacing: 0.26em;
  color: var(--se-gold);
  text-transform: uppercase;
}

.section-title {
  font-size: var(--se-fs-28);
  color: var(--se-warm-white);
}

.rule-line {
  height: 1px;
  margin-top: 40px;
  background: linear-gradient(90deg, var(--se-gold), rgba(217, 160, 60, .06));
}

/* ---------- 纸卡 / 标签 ---------- */
.paper-card {
  position: relative;
  background: var(--se-paper);
  color: var(--se-ink);
  border: 1px solid var(--se-paper-deep);
  border-radius: var(--se-radius);
  padding: 22px 24px;
  box-shadow: 0 1px 0 var(--se-paper-deep), 6px 6px 0 -2px rgba(226, 213, 188, .22),
              0 18px 34px -26px rgba(8, 13, 11, .9);
}
.paper-card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(14, 26, 22, .14);
  border-radius: 2px;
  pointer-events: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-family: var(--se-mono);
  font-size: var(--se-fs-12);
  letter-spacing: 0.06em;
  border-radius: 2px;
  border: 1px solid var(--se-paper-deep);
  background: var(--se-paper-deep);
  color: var(--se-ink);
}
.tag--seal { background: var(--se-cinnabar); border-color: var(--se-cinnabar); color: var(--se-paper); }
.tag--gold { background: var(--se-gold); border-color: var(--se-gold); color: var(--se-coal); }
.tag--blue { background: var(--se-blue); border-color: var(--se-blue); color: var(--se-warm-white); }

/* ---------- 可复用图片容器 ---------- */
.img-frame {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--se-ink-layer);
  border: 1px solid rgba(226, 213, 188, .18);
  border-radius: var(--se-radius);
}
.img-frame--wide { aspect-ratio: 16 / 9; }
.img-frame--tall { aspect-ratio: 3 / 4; }
.img-frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.92) contrast(1.04);
}
.img-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 13, 11, 0) 45%, rgba(8, 13, 11, .45));
  pointer-events: none;
}

/* ---------- 显现 / 动效钩子 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s var(--se-ease), transform .5s var(--se-ease);
}
.reveal[data-revealed="true"] {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  :root { --se-gutter: 24px; }
  .navbar, .nav-grid { gap: 14px; }
  .nav-col { min-width: 72px; padding-left: 10px; }
  .brand-seal__word { font-size: var(--se-fs-16); letter-spacing: 0.08em; }
  .brand-seal__mark { width: 36px; height: 36px; font-size: var(--se-fs-16); }
}

@media (max-width: 1023px) {
  :root { --se-header-h: 72px; }

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

  .nav-grid {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--se-gutter) 22px;
    background: var(--se-ink-layer);
    border-bottom: 1px solid rgba(217, 160, 60, .3);
    box-shadow: 0 22px 34px -24px rgba(8, 13, 11, .95);
  }
  .nav-grid[data-open="true"] { display: flex; }

  .nav-col {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 18px;
    min-width: 0;
    padding: 14px 0;
    border-left: 0;
    border-top: 1px solid rgba(226, 213, 188, .14);
  }
  .nav-col--anchor { border-top-color: rgba(217, 160, 60, .3); }
  .nav-link { font-size: var(--se-fs-16); padding: 6px 0; }

  .header-cta { padding: 16px 0 4px; }
  .header-cta .btn { width: 100%; }

  .page-grid { grid-template-columns: 1fr; gap: 0; }
  .page-aside {
    position: static;
    border-right: 0;
    border-bottom: 1px solid rgba(226, 213, 188, .14);
    padding-right: 0;
    padding-bottom: 24px;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding-top: 44px;
  }
  .footer-contact { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root {
    --se-gutter: 16px;
    --se-fs-40: 32px;
    --se-fs-28: 24px;
    --se-fs-20: 18px;
  }

  .header-inner { gap: 12px; padding-top: 10px; padding-bottom: 10px; }
  .brand-seal__chapter { display: none; }
  .brand-seal__word { font-size: var(--se-fs-14); }
  .brand-seal__link { gap: 8px; padding: 5px 9px 5px 5px; }
  .brand-seal__mark { width: 30px; height: 30px; font-size: var(--se-fs-14); }
  .nav-toggle__text { display: none; }

  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-links ul { grid-template-columns: 1fr 1fr; }
  .footer-brand__word { font-size: var(--se-fs-20); }
  .footer-meta { flex-direction: column; align-items: flex-start; }

  .to-top { right: 14px; bottom: 14px; padding: 8px 11px; }
  .to-top__text { display: none; }

  .paper-card { padding: 18px 16px; }
}

/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .to-top { transform: none; }
}
