/* ==========================================================================
   华悦棋牌 · 共享站点样式 /assets/site.css
   墨绿框架 · 暖金细线 · 纸感阅读区 · 朱砂印记
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 108px;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

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

button, input, select, textarea { font: inherit; color: inherit; }

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a { color: inherit; }

table { border-collapse: collapse; width: 100%; }

/* ---------- 2. Design tokens ---------- */
:root {
  --ink-green: #123C2F;
  --ink-deep: #081F18;
  --gold: #C7A34B;
  --gold-light: #E9D9A8;
  --paper: #F6F0E4;
  --paper-shadow: #E5D8C0;
  --cinnabar: #B33A2B;
  --electric: #21B6A8;
  --ink-black: #1B1A16;
  --mist: #6E8075;

  --font-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-body: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;

  --rail-w: clamp(206px, 16.5vw, 250px);
  --line: 2px;
  --radius-s: 2px;
  --shadow-hard: 7px 7px 0 rgba(8, 31, 24, .14);
  --gap: clamp(16px, 2.4vw, 30px);
  --pad-x: clamp(18px, 3.4vw, 58px);
}

/* ---------- 3. Base ---------- */
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink-black);
  background-color: var(--paper);
  background-image:
    radial-gradient(115% 80% at 6% 0%, rgba(199, 163, 75, .14), transparent 62%),
    radial-gradient(90% 70% at 100% 100%, rgba(18, 60, 47, .09), transparent 60%),
    repeating-linear-gradient(0deg, rgba(27, 26, 22, .022) 0 1px, transparent 1px 5px);
  padding-left: var(--rail-w);
}

/* 顶部细金线：与左侧轨道共同构成页面边框 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold) 58%, rgba(199, 163, 75, .38) 100%);
  z-index: 60;
  pointer-events: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .02em;
  color: var(--ink-green);
}

h1 { font-size: clamp(2.8rem, 6vw, 5.2rem); line-height: 1.08; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
h4 { font-size: 1.05rem; letter-spacing: .06em; }

main { display: block; }

:where(main) a:not([class]) {
  color: var(--ink-green);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

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

.site-footer :focus-visible { outline-color: var(--gold-light); }

/* ---------- 4. Skip link ---------- */
.skip-link {
  position: fixed;
  top: -90px;
  left: calc(var(--rail-w) + 16px);
  z-index: 200;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--ink-deep);
  background: var(--gold);
  border: var(--line) solid var(--ink-deep);
  text-decoration: none;
  transition: top .18s ease;
}

.skip-link:focus { top: 14px; }

/* ---------- 5. Header / 左侧品牌轨道 ---------- */
.site-header {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--rail-w);
  z-index: 80;
  display: flex;
  background-color: var(--ink-green);
  background-image: linear-gradient(180deg, rgba(8, 31, 24, .55) 0%, rgba(18, 60, 47, 0) 42%);
  border-right: var(--line) solid var(--gold);
  color: var(--paper);
  box-shadow: 8px 0 26px -20px rgba(8, 31, 24, .95);
}

.rail {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.4vw, 30px);
  width: 100%;
  height: 100%;
  padding: clamp(22px, 2.6vw, 36px) 26px clamp(20px, 2.2vw, 30px) clamp(18px, 2vw, 24px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.rail::-webkit-scrollbar { width: 0; height: 0; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: clamp(14px, 1.8vw, 20px);
  border-bottom: 1px solid rgba(199, 163, 75, .35);
  color: var(--paper);
  text-decoration: none;
}

.brand__seal {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  color: var(--paper);
  background: var(--cinnabar);
  border-radius: var(--radius-s);
  box-shadow: inset 0 0 0 1px rgba(246, 240, 228, .45);
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.25;
}

.brand__eyebrow {
  font-size: 10.5px;
  letter-spacing: .16em;
  line-height: 1.4;
  color: var(--gold);
}

.rail-note {
  position: absolute;
  top: 42%;
  right: 6px;
  writing-mode: vertical-rl;
  font-size: 10px;
  letter-spacing: .42em;
  color: rgba(233, 217, 168, .42);
  pointer-events: none;
  user-select: none;
}

.nav-toggle { display: none; }

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: background-color .18s ease;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: transform .18s ease, top .18s ease;
}

.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

.nav-toggle__label { line-height: 1; }

.site-nav { position: relative; }

.site-nav__list {
  counter-reset: navidx;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-nav__item { counter-increment: navidx; }

.site-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 12px;
  font-size: 14.5px;
  letter-spacing: .1em;
  color: rgba(233, 217, 168, .82);
  text-decoration: none;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.site-nav__link::before {
  content: counter(navidx, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  line-height: 1;
  color: rgba(199, 163, 75, .7);
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: #fff;
  background: rgba(199, 163, 75, .14);
  border-left-color: rgba(199, 163, 75, .55);
}

.site-nav__link[aria-current="page"] {
  color: #fff;
  background: linear-gradient(90deg, rgba(199, 163, 75, .28), rgba(199, 163, 75, 0) 94%);
  border-left-color: var(--gold);
}

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

.rail-tools {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: clamp(14px, 2vw, 20px);
  border-top: 1px solid rgba(199, 163, 75, .28);
}

.rail-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .1em;
  text-decoration: none;
  color: var(--gold-light);
  background: rgba(233, 217, 168, .07);
  border: 1px solid rgba(199, 163, 75, .42);
  border-radius: var(--radius-s);
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.rail-tool:hover,
.rail-tool:focus-visible {
  color: #fff;
  background: rgba(233, 217, 168, .17);
  border-color: var(--gold);
}

.rail-tool[aria-pressed="true"] {
  color: var(--paper);
  background: var(--cinnabar);
  border-color: var(--cinnabar);
}

/* ---------- 6. Footer ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(40px, 6vw, 88px);
  background-color: var(--ink-deep);
  background-image: linear-gradient(180deg, rgba(18, 60, 47, .85) 0%, rgba(8, 31, 24, 1) 62%);
  border-top: var(--line) solid var(--gold);
  color: var(--paper-shadow);
}

.footer-frame {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(24px, 3.4vw, 52px);
  max-width: 1240px;
  margin-inline: auto;
  padding: clamp(34px, 4.6vw, 64px) var(--pad-x) clamp(22px, 3vw, 40px);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-brand__seal {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--paper);
  background: var(--cinnabar);
  border-radius: var(--radius-s);
  box-shadow: inset 0 0 0 1px rgba(246, 240, 228, .4);
}

.footer-brand__name {
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--gold-light);
}

.footer-brand__text {
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(233, 217, 168, .72);
}

.footer-brand__cta { margin-top: 18px; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 3vw, 44px);
}

.footer-nav__group { flex: 1 1 132px; min-width: 0; }

.footer-title {
  margin-bottom: 12px;
  padding-bottom: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--gold);
  border-bottom: 1px solid rgba(199, 163, 75, .3);
}

.footer-list li + li { margin-top: 7px; }

.footer-link {
  display: inline-block;
  padding: 2px 0;
  font-size: 14.5px;
  letter-spacing: .04em;
  color: rgba(233, 217, 168, .84);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .16s ease, border-color .16s ease;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}

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

.footer-contact__item {
  max-width: 32ch;
  font-size: 13.5px;
  line-height: 1.75;
  color: rgba(233, 217, 168, .82);
  overflow-wrap: anywhere;
}

.footer-contact__item + .footer-contact__item { margin-top: 10px; }

.footer-contact__label {
  display: block;
  font-size: 10.5px;
  letter-spacing: .22em;
  color: rgba(199, 163, 75, .85);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 28px;
  max-width: 1240px;
  margin-inline: auto;
  padding: 16px var(--pad-x) clamp(20px, 3vw, 30px);
  font-size: 12.5px;
  letter-spacing: .06em;
  color: rgba(233, 217, 168, .58);
  border-top: 1px solid rgba(199, 163, 75, .26);
}

.footer-meta__copy,
.footer-meta__icp { max-width: none; }

.footer-meta__icp { font-family: var(--font-mono); letter-spacing: .04em; }

/* ---------- 7. 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  color: var(--paper);
  background: var(--cinnabar);
  border: var(--line) solid var(--ink-deep);
  border-radius: var(--radius-s);
  box-shadow: 5px 5px 0 rgba(8, 31, 24, .85);
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(8, 31, 24, .85);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(8, 31, 24, .85);
}

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

.btn--ghost {
  color: var(--ink-green);
  background: transparent;
  border-color: var(--ink-green);
  box-shadow: 5px 5px 0 rgba(18, 60, 47, .18);
}

.btn--ghost:hover {
  background: rgba(18, 60, 47, .06);
  box-shadow: 8px 8px 0 rgba(18, 60, 47, .18);
}

.btn--on-dark {
  color: var(--gold-light);
  background: transparent;
  border-color: var(--gold);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .45);
}

.btn--on-dark:hover { background: rgba(199, 163, 75, .16); }

.btn--block { width: 100%; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: .1em;
  color: var(--mist);
}

.crumbs a {
  padding-bottom: 1px;
  color: var(--ink-green);
  text-decoration: none;
  border-bottom: 1px solid rgba(199, 163, 75, .7);
}

.crumbs a:hover { border-bottom-color: var(--ink-green); }

.crumbs__sep {
  font-family: var(--font-mono);
  color: rgba(110, 128, 117, .8);
}

.crumbs [aria-current="page"] {
  font-weight: 500;
  color: var(--ink-black);
}

.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section { padding-block: clamp(30px, 5vw, 68px); }

.prose { max-width: 68ch; }
.prose p + p { margin-top: 1.1em; }
.prose ul,
.prose ol { margin-top: 1em; padding-left: 1.35em; list-style: revert; }
.prose li + li { margin-top: .5em; }
.prose strong { color: var(--ink-green); }

.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid--split { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }

.card {
  position: relative;
  padding: clamp(16px, 2vw, 26px);
  background: var(--paper);
  border: var(--line) solid var(--ink-green);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-hard);
}

.card--paper { background: #FBF7EE; }

.card--dark {
  color: var(--paper-shadow);
  background: var(--ink-green);
  border-color: var(--ink-deep);
}

.card--dark h2,
.card--dark h3,
.card--dark h4 { color: var(--gold-light); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  line-height: 1.7;
  color: var(--ink-black);
  background: var(--gold-light);
  border-radius: 999px;
}

.tag--live { color: #0E6E65; background: rgba(33, 182, 168, .18); }
.tag--ink { color: var(--gold-light); background: var(--ink-green); }
.tag--seal { color: var(--paper); background: var(--cinnabar); }

.img-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--paper-shadow);
  border: var(--line) solid var(--ink-deep);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-hard);
}

.img-frame > img,
.img-frame > picture > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(90deg, rgba(27, 26, 22, .05) 0 1px, transparent 1px 7px);
  mix-blend-mode: multiply;
  opacity: .3;
}

.img-frame--wide { aspect-ratio: 16 / 9; }
.img-frame--tall { aspect-ratio: 3 / 4; }
.img-frame--square { aspect-ratio: 1 / 1; }
.img-frame--fill { min-height: clamp(180px, 26vw, 320px); }

/* ---------- 8. 滚动显现协议 ---------- */
.js-reveal [data-reveal],
.js-reveal [data-reveal-scale] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.js-reveal [data-reveal-scale] { transform: scale(.96); }

.js-reveal [data-reveal].is-visible,
.js-reveal [data-reveal-scale].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 9. 响应式 ---------- */
@media (max-width: 1180px) {
  .footer-frame { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) minmax(0, 1fr); }
}

@media (max-width: 1024px) {
  :root { --rail-w: 0px; }

  html { scroll-padding-top: 128px; }

  body { padding-left: 0; }

  .skip-link { left: 16px; }

  .site-header {
    position: sticky;
    top: 0;
    bottom: auto;
    left: auto;
    right: auto;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: var(--line) solid var(--gold);
    box-shadow: 0 12px 30px -24px rgba(8, 31, 24, .95);
  }

  .rail {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    height: auto;
    padding: 10px clamp(14px, 3.5vw, 26px) 12px;
    overflow: visible;
  }

  .brand {
    margin-right: auto;
    padding-bottom: 0;
    border-bottom: 0;
  }

  .brand__seal { width: 36px; height: 36px; font-size: 18px; }
  .brand__name { font-size: 17px; letter-spacing: .12em; }
  .brand__eyebrow { display: none; }

  .rail-note { display: none; }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 14px;
    font-size: 12.5px;
    letter-spacing: .14em;
    color: var(--gold-light);
    background: transparent;
    border: 1px solid rgba(199, 163, 75, .55);
    border-radius: var(--radius-s);
  }

  .nav-toggle:hover { background: rgba(199, 163, 75, .14); }

  .site-nav {
    flex: 0 0 100%;
    display: none;
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid rgba(199, 163, 75, .3);
  }

  .site-nav[data-open] { display: block; }

  .site-nav__list { gap: 1px; }

  .site-nav__link {
    min-height: 48px;
    padding: 10px 12px;
    font-size: 15px;
  }

  .rail-tools {
    flex: 0 0 100%;
    flex-direction: row;
    gap: 8px;
    margin-top: 0;
    padding-top: 10px;
    border-top: 1px solid rgba(199, 163, 75, .18);
  }

  .rail-tool { flex: 1 1 0; }

  .footer-frame { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand__text { max-width: 52ch; }
}

@media (max-width: 860px) {
  .grid--split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  body { font-size: 16px; }

  .footer-frame { grid-template-columns: minmax(0, 1fr); }

  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .btn { width: 100%; }
  .footer-brand__cta { width: auto; }
}

@media (min-width: 1025px) {
  html { scroll-padding-top: 28px; }
}

/* ---------- 10. 动效偏好 ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@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-reveal [data-reveal],
  .js-reveal [data-reveal-scale] {
    opacity: 1 !important;
    transform: none !important;
  }
}
