/* ============================================================
   77棋牌电玩 · 共享样式表 /assets/site.css
   深墨绿框架 + 象牙白阅读区 + 筹码红序号 + 牌桌金细线
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  color-scheme: dark;
  --ink: #0E2A24;
  --ink-2: #163B32;
  --ink-3: #1E4A3F;
  --ivory: #F4EDDF;
  --paper: #FBF7EE;
  --red: #C8372D;
  --red-deep: #9E2A23;
  --gold: #D6A84F;
  --slate: #7C93A6;
  --slate-deep: #4F6575;
  --grain: #081713;

  --line: rgba(244, 237, 223, .14);
  --line-strong: rgba(244, 237, 223, .26);
  --line-gold: rgba(214, 168, 79, .34);
  --tint-red: rgba(200, 55, 45, .12);
  --tint-gold: rgba(214, 168, 79, .14);
  --tint-slate: rgba(124, 147, 166, .12);

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

  --w-max: 1240px;
  --pad: 64px;
  --ease: cubic-bezier(.22, .7, .28, 1);
  --dur: 160ms;
}

@media (max-width: 1080px) { :root { --pad: 32px; } }
@media (max-width: 720px)  { :root { --pad: 20px; } }

/* ---------- reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--ink);
  background-image:
    linear-gradient(90deg, rgba(124, 147, 166, .055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(124, 147, 166, .045) 1px, transparent 1px);
  background-size: 56px 56px, 56px 56px;
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

main { display: block; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: .01em;
  text-wrap: balance;
}

p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

::selection { background: var(--red); color: var(--paper); }

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

[id] { scroll-margin-top: 148px; }
#main-content { display: block; }
#main-content:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

/* ---------- 无障碍跳过链接 ---------- */
.skip-link {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 200;
  padding: 10px 20px;
  background: var(--red);
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus {
  top: 12px;
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

/* ---------- 页头：框架式导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: linear-gradient(180deg, #102F28 0%, var(--ink) 100%);
  border-bottom: 1px solid var(--line-gold);
  box-shadow: 0 12px 30px rgba(8, 23, 19, .38);
  color: var(--ivory);
}
.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: min(180px, 32%);
  height: 2px;
  background: var(--red);
  z-index: 1;
}

.header-inner {
  width: 100%;
  max-width: var(--w-max);
  margin-inline: auto;
  padding: 14px var(--pad) 0;
}

.header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding-bottom: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--red);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: inset -6px -6px 0 rgba(8, 23, 19, .22);
  transition: background-color var(--dur) var(--ease);
}
.brand:hover .brand-mark { background: var(--red-deep); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: .02em;
  color: var(--ivory);
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  color: var(--gold);
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--slate);
}
.header-status::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--gold);
  flex: none;
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line-gold);
  color: var(--ivory);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.nav-toggle:hover { border-color: var(--red); background: var(--tint-red); }
.nav-toggle-bars {
  display: grid;
  gap: 3px;
  width: 16px;
  flex: none;
}
.nav-toggle-bars span {
  height: 2px;
  background: var(--gold);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.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); }

/* 导航条 */
.site-nav {
  border-top: 1px solid var(--line-gold);
}
.nav-list {
  display: flex;
  flex-wrap: wrap;
}
.nav-item {
  flex: 1 1 0;
  min-width: 0;
  border-right: 1px solid var(--line);
}
.nav-item:first-child { border-left: 1px solid var(--line); }

.nav-link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 16px;
  color: var(--ivory);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 200ms var(--ease);
}
.nav-index {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--gold);
  transition: color var(--dur) var(--ease);
}
.nav-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.nav-link:hover { background: var(--ink-2); }
.nav-link:hover .nav-index { color: var(--red); }
.nav-link:hover::after { transform: scaleX(.4); }

.nav-link[aria-current="page"] { background: var(--ink-2); }
.nav-link[aria-current="page"] .nav-index { color: var(--red); }
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

/* 滚动进度 */
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; margin-top: 2px; }
  .site-nav[data-open] { display: block; }
  .nav-list { flex-direction: column; flex-wrap: nowrap; }
  .nav-item {
    flex: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav-item:first-child { border-left: 0; }
  .nav-link { padding: 13px 4px; }
  .nav-link::after { display: none; }
  .nav-link[aria-current="page"] {
    background: rgba(200, 55, 45, .14);
    border-left: 3px solid var(--red);
    padding-left: 12px;
  }
}

@media (max-width: 720px) {
  .header-status { display: none; }
  .brand-mark { width: 40px; height: 40px; font-size: 17px; }
  .brand-name { font-size: 17px; }
  .nav-label { font-size: 16px; }
}

/* ---------- 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(56px, 8vw, 104px);
  background: linear-gradient(180deg, var(--ink) 0%, var(--grain) 100%);
  border-top: 1px solid var(--line-gold);
  color: var(--ivory);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: min(240px, 42%);
  height: 2px;
  background: var(--red);
}

.footer-inner {
  width: 100%;
  max-width: var(--w-max);
  margin-inline: auto;
  padding: clamp(36px, 5vw, 64px) var(--pad) 22px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: clamp(24px, 3vw, 48px);
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.footer-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--red);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
}
.footer-brandline {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .01em;
}
.footer-note {
  max-width: 30ch;
  font-size: 13px;
  line-height: 1.7;
  color: var(--slate);
}

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

.footer-heading {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2em;
  color: var(--gold);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-links a {
  display: inline-block;
  font-size: 15px;
  color: var(--ivory);
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.footer-links a:hover {
  color: var(--gold);
  border-bottom-color: var(--red);
}

.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.footer-contact-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.footer-contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--slate);
}
.footer-contact-value {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ivory);
  overflow-wrap: anywhere;
}
.footer-mail {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--gold);
}
.footer-cta { min-height: 44px; padding: 10px 18px; font-size: 15px; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--slate);
}
.footer-icp,
.footer-copy { margin: 0; color: var(--slate); }

@media (max-width: 1080px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- 版式容器 ---------- */
.wrap {
  width: 100%;
  max-width: var(--w-max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section { padding-block: clamp(44px, 7vw, 88px); }
.section + .section { border-top: 1px solid var(--line); }

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}
.section-kicker::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--gold);
  flex: none;
}

.section-title {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 900;
  color: var(--ivory);
}

.lede {
  max-width: 60ch;
  margin-top: 14px;
  font-size: 17px;
  line-height: 1.8;
  color: var(--slate);
}

.muted { color: var(--slate); }

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

/* ---------- 面板 ---------- */
.paper-panel {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line-gold);
  padding: clamp(20px, 3.2vw, 48px);
}
.paper-panel :is(h1, h2, h3, h4) { color: var(--ink); }
.paper-panel a {
  color: var(--red-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.paper-panel a:hover { color: var(--red); }
.paper-panel :focus-visible { outline-color: var(--red); }
.paper-panel .muted { color: var(--slate-deep); }

.panel {
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: clamp(18px, 2.6vw, 32px);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.2;
  color: var(--ivory);
  text-align: center;
  transition: background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}
.btn--primary {
  background: var(--red);
  border-color: var(--red);
  color: var(--paper);
}
.btn--primary:hover {
  background: var(--red-deep);
  border-color: var(--red-deep);
}
.btn--ghost {
  border-color: var(--line-gold);
  color: var(--ivory);
}
.btn--ghost:hover {
  border-color: var(--red);
  background: var(--tint-red);
  color: var(--paper);
}

/* ---------- 状态标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ivory);
  white-space: nowrap;
}
.tag--gold {
  border-color: var(--gold);
  background: var(--tint-gold);
  color: var(--gold);
}
.tag--red {
  border-color: rgba(200, 55, 45, .6);
  background: rgba(200, 55, 45, .16);
  color: #F0C0BB;
}
.tag--slate {
  border-color: rgba(124, 147, 166, .5);
  background: var(--tint-slate);
  color: #B9C9D6;
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--slate);
}
.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.breadcrumb li + li::before {
  content: "/";
  color: var(--gold);
  opacitY: .8;
}
.breadcrumb a {
  color: var(--ivory);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.breadcrumb a:hover {
  color: var(--gold);
  border-bottom-color: var(--red);
}
.breadcrumb [aria-current="page"] { color: var(--gold); }

/* ---------- 网格 ---------- */
.grid {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }
}

/* ---------- 图片容器（页面阶段填入 img / svg） ---------- */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line-gold);
  background-color: var(--ink-2);
  background-image:
    linear-gradient(135deg, rgba(214, 168, 79, .10), transparent 62%),
    repeating-linear-gradient(90deg, rgba(124, 147, 166, .10) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(180deg, rgba(124, 147, 166, .08) 0 1px, transparent 1px 40px);
  aspect-ratio: 16 / 10;
}
.media > img,
.media > svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--wide { aspect-ratio: 21 / 9; }
.media--tall { aspect-ratio: 4 / 5; }
.media--square { aspect-ratio: 1 / 1; }

.media > figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ivory);
  background: linear-gradient(180deg, transparent, rgba(8, 23, 19, .88));
}
.media-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--slate);
}

/* ---------- 折叠组件 ---------- */
.disclosure { border-top: 1px solid var(--line); }
.disclosure:last-child { border-bottom: 1px solid var(--line); }

.disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  list-style: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--ivory);
  transition: color var(--dur) var(--ease);
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--gold);
  transition: color var(--dur) var(--ease);
}
.disclosure[open] > summary::after { content: "–"; color: var(--red); }
.disclosure > summary:hover { color: var(--gold); }

.disclosure-body {
  padding-bottom: 20px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--slate);
}
.disclosure[open] .disclosure-body {
  animation: fade-in var(--dur) var(--ease);
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 超大等宽序号 ---------- */
.num-index {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(64px, 10vw, 140px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: .85;
  letter-spacing: -.04em;
  color: var(--gold);
  opacity: .28;
}

/* ---------- 入场提示（data-reveal） ---------- */
[data-reveal].is-pending {
  opacity: 0;
  transform: translateY(10px);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 280ms var(--ease), transform 280ms var(--ease);
}

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