/* ==========================================================================
   微赢棋牌 · /assets/site.css
   共享层：reset、变量、中文排版、站头、站尾、通用组件、图片容器基础
   ========================================================================== */

/* ---------- 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, h5, h6,
p, ul, ol, li, dl, dt, dd,
figure, blockquote, fieldset, table {
  margin: 0;
}

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

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

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

a { color: inherit; }

table { border-collapse: collapse; }

/* ---------- 2. Variables ---------- */
:root {
  --c-red: #B92F2A;
  --c-red-deep: #7E1F1C;
  --c-ink: #191817;
  --c-ink-2: #2B2926;
  --c-bamboo: #2F6B57;
  --c-bamboo-soft: #DCEBE2;
  --c-gold: #C49A2C;
  --c-paper: #F7F1E6;
  --c-tea: #7A5A3F;
  --c-cyan: #1F9E8F;

  --font-head: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-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", "Noto Sans Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --line: 1px solid rgba(25, 24, 23, 0.14);
  --line-soft: 1px solid rgba(25, 24, 23, 0.08);
  --line-light: 1px solid rgba(247, 241, 230, 0.16);

  --shadow-sm: 0 1px 0 rgba(25, 24, 23, 0.04), 0 10px 26px -20px rgba(25, 24, 23, 0.55);
  --radius: 2px;

  --wrap: 1240px;
  --pad: clamp(16px, 4vw, 40px);
  --header-h: 76px;
}

/* ---------- 3. 中文排版基础 ---------- */
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--c-ink);
  background-color: var(--c-paper);
  background-image:
    linear-gradient(to right, rgba(25, 24, 23, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(25, 24, 23, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.14;
  color: var(--c-ink);
}

h1 { font-size: clamp(2.4rem, 6vw, 5.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.8rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.7rem); }

p { line-height: 1.75; }

strong, b { font-weight: 900; }

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

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

/* ---------- 4. 跳至主要内容 ---------- */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--c-ink);
  color: var(--c-paper);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius);
  transform: translateY(-200%);
  transition: transform 0.2s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}

/* ---------- 5. 站点头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(247, 241, 230, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 3px solid var(--c-red);
  border-bottom: var(--line);
}

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--c-red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.12s linear;
  pointer-events: none;
}

.header-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(10px, 2vw, 28px);
  width: 100%;
  max-width: var(--wrap);
  min-height: var(--header-h);
  margin-inline: auto;
  padding: 14px var(--pad);
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--c-ink);
}

.brand__seal {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--c-red);
  color: #FFFFFF;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 19px;
  line-height: 1;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  transform: skewX(-2deg);
  transition: background 0.18s ease, transform 0.18s ease;
}

.brand:hover .brand__seal,
.brand:focus-visible .brand__seal {
  background: var(--c-red-deep);
  transform: skewX(-2deg) translateY(-2px);
}

.brand__text { display: block; }

.brand__mark {
  display: block;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.16rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand__tag {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--c-tea);
}

/* 中轴索引条 */
.header-index {
  margin: 0 0 0 auto;
  padding: 6px 13px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--c-tea);
  white-space: nowrap;
  border: 1px solid rgba(122, 90, 63, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
}

/* 导航 */
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 22px);
}

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

.nav-item { display: block; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 8px 3px 10px;
  color: var(--c-ink-2);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.nav-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--c-tea);
  opacity: 0.75;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 2px;
  height: 2px;
  background: var(--c-red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.22s ease;
}

.nav-link:hover { color: var(--c-red-deep); }

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

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

.nav-link[aria-current="page"] .nav-num {
  color: var(--c-red);
  opacity: 1;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--c-red);
  color: #FFFFFF;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--c-red-deep);
  border-radius: var(--radius);
  box-shadow: 0 8px 18px -14px rgba(126, 31, 28, 0.95);
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.nav-cta::after {
  content: "›";
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1;
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background: var(--c-red-deep);
  border-color: var(--c-gold);
  transform: translateY(-2px);
}

/* 移动按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  background: transparent;
  color: var(--c-ink);
  border: 1px solid rgba(25, 24, 23, 0.2);
  border-radius: var(--radius);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.nav-toggle:hover {
  border-color: var(--c-gold);
  color: var(--c-red-deep);
}

.nav-toggle__bars {
  display: inline-grid;
  gap: 3px;
  width: 16px;
}

.nav-toggle__bars span {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] {
  border-color: var(--c-red);
  color: var(--c-red);
}

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

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

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

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

/* ---------- 6. 站点尾 ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  margin-top: clamp(48px, 8vw, 104px);
  background-color: var(--c-ink);
  background-image:
    linear-gradient(to right, rgba(196, 154, 44, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(196, 154, 44, 0.055) 1px, transparent 1px);
  background-size: 64px 64px;
  color: var(--c-paper);
  border-top: 3px solid var(--c-red);
}

.footer-rail {
  height: 1px;
  background: linear-gradient(90deg, var(--c-gold), rgba(196, 154, 44, 0) 55%);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.85fr 1.15fr;
  gap: clamp(24px, 4vw, 56px);
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: clamp(40px, 6vw, 72px) var(--pad) clamp(28px, 4vw, 46px);
}

.footer-brand__mark {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--c-paper);
}

.footer-brand__line {
  margin-top: 12px;
  max-width: 22em;
  font-size: 0.95rem;
  line-height: 1.8;
  color: rgba(247, 241, 230, 0.66);
}

.footer-brand__tag {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--c-gold);
}

.footer-nav__title,
.footer-contact__title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(247, 241, 230, 0.5);
}

.footer-nav__list { display: block; }

.footer-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  color: rgba(247, 241, 230, 0.86);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(247, 241, 230, 0.1);
  transition: color 0.18s ease, padding-left 0.18s ease, border-color 0.18s ease;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--c-gold);
  padding-left: 5px;
  border-bottom-color: rgba(196, 154, 44, 0.55);
}

.footer-link__num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(247, 241, 230, 0.38);
}

.footer-contact {
  padding: clamp(18px, 2.6vw, 26px);
  border: 1px solid rgba(196, 154, 44, 0.3);
  border-radius: var(--radius);
  background: linear-gradient(158deg, rgba(126, 31, 28, 0.92) 0%, rgba(126, 31, 28, 0.58) 62%, rgba(43, 41, 38, 0.92) 100%);
}

.footer-contact__title { color: rgba(247, 241, 230, 0.72); }

.footer-contact__list { display: block; }

.footer-contact__row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(247, 241, 230, 0.18);
}

.footer-contact__row:last-child { border-bottom: 0; }

.footer-contact__row dt {
  padding-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(247, 241, 230, 0.55);
}

.footer-contact__row dd {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--c-paper);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.footer-meta {
  border-top: var(--line-light);
  background: rgba(0, 0, 0, 0.24);
}

.footer-meta__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 18px var(--pad) 0;
  font-size: 0.8rem;
  color: rgba(247, 241, 230, 0.55);
}

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

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

.footer-legal__link {
  color: rgba(247, 241, 230, 0.78);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

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

.footer-icp {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: rgba(247, 241, 230, 0.6);
}

.footer-note {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 10px var(--pad) 24px;
  font-size: 0.75rem;
  line-height: 1.75;
  color: rgba(247, 241, 230, 0.42);
}

/* ---------- 7. 页面骨架通用件 ---------- */
.container {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section { padding-block: clamp(44px, 6vw, 88px); }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
}

.prose { max-width: 42em; }
.prose p + p { margin-top: 1em; }
.prose h2, .prose h3 { margin-top: 1.6em; margin-bottom: 0.6em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  line-height: 1.4;
  color: var(--c-tea);
}

.eyebrow::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  background: var(--c-red);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.btn--primary {
  background: var(--c-red);
  color: #FFFFFF;
  border-color: var(--c-red-deep);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--c-red-deep);
  border-color: var(--c-gold);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--c-ink);
  border-color: rgba(25, 24, 23, 0.26);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  color: var(--c-red-deep);
  border-color: var(--c-gold);
  transform: translateY(-2px);
}

.btn--bamboo {
  background: var(--c-bamboo);
  color: #FFFFFF;
  border-color: #255544;
}

.btn--bamboo:hover,
.btn--bamboo:focus-visible {
  background: #255544;
  border-color: var(--c-cyan);
  transform: translateY(-2px);
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--c-tea);
}

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

.breadcrumb li + li::before {
  content: "/";
  color: rgba(25, 24, 23, 0.28);
}

.breadcrumb a {
  color: var(--c-ink-2);
  text-decoration: none;
  border-bottom: 1px solid rgba(25, 24, 23, 0.2);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--c-red);
  border-bottom-color: var(--c-red);
}

.breadcrumb [aria-current="page"] {
  color: var(--c-ink);
  font-weight: 700;
}

/* ---------- 8. 图片容器基础（页面阶段放占位图） ---------- */
.media-frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--c-bamboo-soft);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

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

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

.media-frame__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 14px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--c-paper);
  background: linear-gradient(to top, rgba(25, 24, 23, 0.8), rgba(25, 24, 23, 0));
}

.media-frame__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--c-ink);
  background: var(--c-gold);
  border-radius: 999px;
}

/* ---------- 9. 章节高亮（配合 data-toc-link） ---------- */
[data-toc-link][aria-current="true"] { color: var(--c-red); }
[data-toc-link][aria-current="true"]::after { transform: scaleX(1); }

/* ---------- 10. 响应式 ---------- */
@media (max-width: 1180px) {
  .header-index { display: none; }
}

@media (max-width: 1040px) {
  .header-inner {
    flex-wrap: wrap;
    row-gap: 0;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .site-nav {
    display: none;
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 8px;
    padding: 6px 0 14px;
    border-top: var(--line-soft);
  }

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

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

  .nav-link {
    width: 100%;
    justify-content: flex-start;
    padding: 13px 2px;
    border-bottom: var(--line-soft);
  }

  .nav-link::after {
    left: 0;
    right: auto;
    bottom: 6px;
    width: 42px;
  }

  .nav-cta {
    justify-content: center;
    margin-top: 14px;
    padding: 12px 18px;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: clamp(22px, 4vw, 36px);
  }

  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .grid-12 > * { grid-column: span 12 !important; }
}

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

  .brand__mark { font-size: 1.04rem; }
  .brand__seal { width: 36px; height: 36px; font-size: 17px; }

  .nav-toggle__label { display: none; }

  .footer-inner { grid-template-columns: 1fr; }

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

  .footer-contact__row { grid-template-columns: 44px 1fr; }
}

@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;
  }

  .skip-link { transition: none; }
  .scroll-progress { transition: none; }
}
