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

:root {
  --ink-900: #070B1C;
  --ink-800: #101736;
  --ink-700: #0B1229;
  --line: #1B2450;
  --line-soft: rgba(27, 36, 80, 0.6);
  --text: #E9EEFB;
  --text-dim: #9BA8CC;
  --text-mute: #7C89AE;
  --cyan: #2FE3D0;
  --gold: #F6B93B;
  --gold-soft: #FFCB5C;
  --magenta: #E24FA8;
  --green: #4ADE80;
  --teal-deep: #0F2E33;

  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  --font-mono: "JetBrains Mono", "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --maxw: 1280px;
  --gutter: clamp(18px, 4vw, 56px);
  --radius: 4px;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --shadow-panel: 0 1px 0 rgba(255, 255, 255, 0.02), 0 18px 40px -34px rgba(0, 0, 0, 0.9);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--ink-900);
  background-image:
    linear-gradient(to right, rgba(27, 36, 80, 0.34) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(27, 36, 80, 0.34) 1px, transparent 1px);
  background-size: 96px 96px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, p, figure, blockquote { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; }
strong, b { font-weight: 700; color: var(--text); }

::selection { background: rgba(47, 227, 208, 0.28); color: #FFFFFF; }

:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 10px 18px;
  background: var(--cyan);
  color: #04140F;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  border-radius: 3px;
  transform: translateY(-180%);
  transition: transform 0.16s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ============================================================
   页头：两端分置的索引条
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(7, 11, 28, 0.94);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.header-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  text-decoration: none;
}
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: linear-gradient(155deg, #141C3F, #0A1026);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.brand-mark::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  background: var(--cyan);
  border-radius: 0 3px 0 0;
  opacity: 0.9;
}
.brand:hover .brand-mark,
.brand:focus-visible .brand-mark {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(47, 227, 208, 0.12);
}
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--text);
}
.brand-sub {
  font-family: var(--font-body);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  line-height: 1.3;
  color: var(--text-dim);
}

/* 移动菜单按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--ink-800);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s;
}
.nav-toggle:hover { color: var(--cyan); border-color: var(--cyan); }
.nav-toggle-bars { display: grid; gap: 3px; width: 16px; }
.nav-toggle-bars span {
  display: block;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.14s var(--ease), opacity 0.14s;
}
.nav-toggle[aria-expanded="true"] { color: var(--cyan); border-color: var(--cyan); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { transform: translateY(4.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(-4.5px) rotate(-45deg); }

/* 导航 */
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 22px);
  margin-left: auto;
}
.nav-list { display: flex; align-items: center; gap: 2px; }
.nav-item { display: block; }
.nav-link {
  position: relative;
  display: inline-block;
  padding: 9px 10px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 2px;
  transition: color 0.16s;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 3px;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.18s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link[aria-current="page"] { color: var(--cyan); }
.nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  width: 4px;
  height: 4px;
  background: var(--gold);
}
.nav-cta { padding: 10px 16px; font-size: 13.5px; white-space: nowrap; }

/* 阅读进度 */
.progress-track {
  height: 2px;
  background: rgba(27, 36, 80, 0.55);
  overflow: hidden;
}
.progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  box-shadow: 0 0 10px rgba(47, 227, 208, 0.55);
}

/* ============================================================
   页脚：档案夹封底
   ============================================================ */
.site-footer {
  margin-top: clamp(56px, 8vw, 120px);
  background: linear-gradient(180deg, #0A1024 0%, var(--ink-900) 62%);
  border-top: 1px solid var(--line);
}
.footer-scale {
  height: 9px;
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 28px);
  opacity: 0.9;
}
.footer-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(34px, 5vw, 64px) var(--gutter) clamp(26px, 3vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
}
.footer-brand { min-width: 0; }
.footer-mark {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: linear-gradient(160deg, #141C3F, #0B1129);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.footer-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}
.footer-blurb {
  margin-top: 10px;
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dim);
}
.footer-note {
  margin-top: 12px;
  max-width: 34ch;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-mute);
}
.footer-col { min-width: 0; }
.footer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1.4;
  color: var(--cyan);
}
.footer-title::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--cyan);
  opacity: 0.85;
}
.footer-list li + li { margin-top: 9px; }
.footer-link {
  font-size: 14px;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.16s, border-color 0.16s;
}
.footer-link:hover { color: var(--cyan); border-bottom-color: var(--cyan); }
.footer-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}
.footer-contact li:first-child {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.footer-bottom { border-top: 1px solid var(--line); }
.footer-bottom-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px var(--gutter) 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
}
.footer-legal {
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--text-mute);
}
.footer-icp {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0;
  color: var(--text-dim);
}
.footer-bottom-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-bottom-links .footer-link { font-size: 12.5px; }

/* ============================================================
   通用排版与容器
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(34px, 5vw, 72px); }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: clamp(18px, 2.5vw, 32px);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.22em;
  line-height: 1.5;
  color: var(--cyan);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}
.mono-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--gold);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s, background-color 0.16s, box-shadow 0.16s;
}
.btn:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #20160A;
  box-shadow: 0 8px 22px -14px rgba(246, 185, 59, 0.9);
}
.btn-gold:hover {
  background: var(--gold-soft);
  border-color: var(--gold-soft);
  color: #20160A;
}
.btn-ghost {
  color: var(--cyan);
  border-color: rgba(47, 227, 208, 0.45);
  background: rgba(47, 227, 208, 0.04);
}
.btn-ghost:hover {
  background: rgba(47, 227, 208, 0.12);
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ---------- 面包屑 ---------- */
.breadcrumbs {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
}
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}
.breadcrumbs li:not(:last-child)::after {
  content: "/";
  font-family: var(--font-mono);
  font-size: 11px;
  color: #3A4370;
}
.breadcrumbs a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.16s, border-color 0.16s;
}
.breadcrumbs a:hover { color: var(--cyan); border-bottom-color: var(--cyan); }
.breadcrumbs [aria-current="page"] { color: var(--text); }

/* ---------- 面板与卡片 ---------- */
.panel {
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-800);
  box-shadow: var(--shadow-panel);
}
.card {
  position: relative;
  padding: clamp(18px, 2.2vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(170deg, #111A3C, var(--ink-700) 72%);
  box-shadow: var(--shadow-panel);
  transition: border-color 0.16s, transform 0.16s, box-shadow 0.16s;
}
.card:hover,
.card:focus-within {
  border-color: rgba(47, 227, 208, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 22px 44px -34px rgba(47, 227, 208, 0.55);
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(27, 36, 80, 0.5);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  line-height: 1.6;
  color: var(--text-dim);
}
.tag-cyan { color: var(--cyan); border-color: rgba(47, 227, 208, 0.45); background: rgba(47, 227, 208, 0.08); }
.tag-gold { color: var(--gold); border-color: rgba(246, 185, 59, 0.45); background: rgba(246, 185, 59, 0.08); }
.tag-magenta { color: var(--magenta); border-color: rgba(226, 79, 168, 0.5); background: rgba(226, 79, 168, 0.1); }

/* ---------- 蓝图装饰 ---------- */
.blueprint-grid {
  background-image:
    linear-gradient(to right, rgba(27, 36, 80, 0.6) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(27, 36, 80, 0.6) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center;
}
.rule-scale {
  height: 9px;
  margin-block: clamp(24px, 3vw, 40px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 28px);
  opacity: 0.9;
}

/* ---------- 网格 ---------- */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
  align-items: start;
}
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

/* ---------- 图片容器 ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 80% 10%, rgba(47, 227, 208, 0.1), transparent 60%),
    linear-gradient(150deg, #10193B, #080E22);
}
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(27, 36, 80, 0.55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(27, 36, 80, 0.55) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.7;
}
.media-frame img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.06);
}
.media-frame[data-ratio="16x9"] { aspect-ratio: 16 / 9; }
.media-frame[data-ratio="4x3"] { aspect-ratio: 4 / 3; }
.media-frame[data-ratio="1x1"] { aspect-ratio: 1 / 1; }
.media-frame[data-ratio="3x4"] { aspect-ratio: 3 / 4; }

/* ---------- 手风琴 ---------- */
.accordion {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-800);
  overflow: hidden;
}
.accordion + .accordion { margin-top: 10px; }
.accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  transition: color 0.16s, background-color 0.16s;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "+";
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--cyan);
}
.accordion summary:hover { color: var(--cyan); background: rgba(47, 227, 208, 0.05); }
.accordion[open] summary { color: var(--cyan); border-bottom: 1px solid var(--line); }
.accordion[open] summary::after { content: "−"; }
.accordion-body {
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-dim);
}

/* ---------- 标签筛选 ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filter-button {
  appearance: none;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(16, 23, 54, 0.8);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 1.5;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background-color 0.12s;
}
.filter-button:hover { color: var(--text); border-color: #2B3768; }
.filter-button[aria-pressed="true"] {
  color: #04140F;
  background: var(--cyan);
  border-color: var(--cyan);
}
[data-filter-item][hidden] { display: none; }

/* ---------- 工具 ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: 8px var(--gutter) 22px;
    background: linear-gradient(180deg, #0C1229, #080D20);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -30px #000000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.12s ease, transform 0.16s var(--ease), visibility 0.12s;
  }
  .site-nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: 6px 0 14px; }
  .nav-item { width: 100%; }
  .nav-link {
    display: block;
    width: 100%;
    padding: 14px 4px;
    font-size: 15px;
    border-bottom: 1px solid rgba(27, 36, 80, 0.8);
    border-radius: 0;
  }
  .nav-link::after { left: 4px; right: auto; width: 26px; bottom: 8px; }
  .nav-link[aria-current="page"]::before { display: none; }
  .nav-cta { width: 100%; margin-top: 6px; }

  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }

  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand-sub { display: none; }
  .brand-mark { width: 40px; height: 40px; font-size: 15px; }
  .brand-name { font-size: 16px; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .footer-bottom-inner { justify-content: flex-start; }
  .footer-blurb, .footer-note { max-width: none; }
}

@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;
  }
  .card:hover,
  .card:focus-within { transform: none; }
  .site-nav,
  .site-nav[data-open="true"] { transform: none; }
  .skip-link { transition: none; }
}
