/* =========================================================
   HAHABET 棋牌 · 电玩档案室 — /assets/site.css
   共享层：reset / 变量 / 中文排版 / 头部 / 页脚 / 通用组件
   ========================================================= */

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

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

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, li, figure, figcaption, blockquote, dl, dd {
  margin: 0;
}

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

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

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

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

main:focus { outline: none; }

::selection {
  background: rgba(61, 232, 210, .3);
  color: #FFFFFF;
}

/* ---------- 变量 ---------- */
:root {
  --ink: #060A16;
  --panel: #0C152B;
  --float: #13203D;
  --line: #2B3A5D;
  --cyan: #3DE8D2;
  --violet: #8B6CFF;
  --gold: #FFC46B;
  --text: #EDF4FF;
  --muted: #9EB1D2;
  --alert: #FF7A8A;

  --shell: 1240px;
  --gutter: clamp(16px, 3.4vw, 44px);

  --radius-pill: 999px;
  --radius-panel: 2px;

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

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 基础排版 ---------- */
body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  padding-block-start: 96px;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(920px 520px at 84% -8%, rgba(139, 108, 255, .16), transparent 70%),
    radial-gradient(760px 460px at 4% 2%, rgba(61, 232, 210, .09), transparent 72%),
    linear-gradient(180deg, rgba(12, 21, 43, .55), rgba(6, 10, 22, 0) 46%);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: .01em;
}

h1 { font-size: clamp(2.5rem, 6.2vw, 5.5rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 3rem); }
h3 { font-size: clamp(1.15rem, 1.7vw, 1.5rem); line-height: 1.3; }

p { max-width: 72ch; }

strong { font-weight: 700; color: #FFFFFF; }

/* ---------- 通用工具 ---------- */
.wrap {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.mono {
  font-family: var(--font-mono);
  letter-spacing: .08em;
}

.index-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--violet);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

/* ---------- 网格 ---------- */
.grid {
  display: grid;
  gap: clamp(16px, 2.4vw, 32px);
}

.grid--7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.grid--8-4 { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.grid--5-7 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 面板 ---------- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}

.panel--float { background: var(--float); }

.panel--pad { padding: clamp(18px, 2.4vw, 30px); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--muted);
  white-space: nowrap;
}

.tag--cyan { color: var(--cyan); border-color: rgba(61, 232, 210, .45); }
.tag--violet { color: var(--violet); border-color: rgba(139, 108, 255, .45); }
.tag--gold { color: var(--gold); border-color: rgba(255, 196, 107, .45); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background-color .12s linear, color .12s linear,
              border-color .12s linear, transform .12s linear;
}

.btn--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #211302;
}

.btn--gold:hover {
  background: #FFD79A;
  border-color: #FFD79A;
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn--compact {
  padding: 9px 16px;
  font-size: 13px;
}

.btn:active { transform: translateY(1px); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}

/* ---------- 面包屑 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-block: 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--muted);
}

.crumbs a { color: var(--muted); transition: color .12s linear; }
.crumbs a:hover { color: var(--cyan); }
.crumbs__sep { color: var(--line); }
.crumbs [aria-current="page"] { color: var(--text); }

/* ---------- 日期轨道（档案流基础件） ---------- */
.rail {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: clamp(14px, 2vw, 28px);
}

.rail__stub {
  align-self: start;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--cyan);
}

/* ---------- 图片容器基础规则 ---------- */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background-color: var(--float);
  background-image:
    repeating-linear-gradient(90deg, rgba(43, 58, 93, .45) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, rgba(43, 58, 93, .45) 0 1px, transparent 1px 44px),
    linear-gradient(160deg, rgba(19, 32, 61, .96), rgba(9, 16, 33, .96));
  background-size: 44px 44px, 44px 44px, 100% 100%;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(61, 232, 210, .14), transparent 44%, rgba(139, 108, 255, .16));
  mix-blend-mode: screen;
}

.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--wide { aspect-ratio: 21 / 9; }

.media__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--text);
  background: linear-gradient(180deg, rgba(6, 10, 22, 0), rgba(6, 10, 22, .9));
}

/* ---------- 跳至主内容 ---------- */
.skip-link {
  position: fixed;
  top: -120px;
  left: var(--gutter);
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: #211302;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  transition: top .18s var(--ease);
}

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

/* ---------- 焦点状态 ---------- */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

/* =========================================================
   头部：悬浮胶囊浮岛 + 阅读进度
   ========================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: 14px var(--gutter) 0;
  transition: padding .24s var(--ease);
}

.header-shell {
  position: relative;
  max-width: var(--shell);
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(12, 21, 43, .86);
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
  box-shadow: 0 22px 52px -30px rgba(0, 0, 0, .95);
  transition: background-color .24s var(--ease), border-color .24s var(--ease);
}

.site-header[data-compact] { padding-top: 6px; }

.site-header[data-compact] .header-shell {
  background: rgba(8, 14, 28, .96);
  border-color: rgba(61, 232, 210, .24);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 22px);
  min-height: 58px;
  padding: 8px clamp(12px, 1.6vw, 20px);
  transition: min-height .24s var(--ease);
}

.site-header[data-compact] .header-inner { min-height: 50px; }

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 2px 4px;
}

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--cyan);
  border-radius: 1px;
}

.brand-mark::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(61, 232, 210, .9);
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 6px;
  height: 6px;
  background: var(--gold);
}

.brand-name {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text);
}

.brand-tag {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: .16em;
  color: var(--muted);
  transition: opacity .24s var(--ease);
}

.site-header[data-compact] .brand-tag { opacity: .55; }

/* 导航 */
.site-nav { margin-left: auto; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  display: inline-block;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  line-height: 1.2;
  letter-spacing: .02em;
  color: var(--muted);
  white-space: nowrap;
  transition: color .12s linear, background-color .12s linear;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(61, 232, 210, .09);
}

.nav-link[aria-current="page"] {
  color: #041512;
  background: var(--cyan);
  box-shadow: 0 0 18px -6px rgba(61, 232, 210, .85);
}

/* 头部 CTA */
.header-cta { flex: 0 0 auto; }

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
  transition: color .12s linear, border-color .12s linear;
}

.nav-toggle:hover { color: var(--cyan); border-color: var(--cyan); }

.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 16px;
}

.nav-toggle__bars span {
  display: block;
  height: 1.5px;
  background: currentColor;
}

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

/* 阅读进度 */
.header-progress {
  max-width: var(--shell);
  height: 2px;
  margin: 8px auto 0;
  border-radius: 2px;
  background: rgba(43, 58, 93, .55);
  overflow: hidden;
}

.header-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  box-shadow: 0 0 12px rgba(61, 232, 210, .6);
  transition: width .1s linear;
}

/* =========================================================
   页脚
   ========================================================= */
.site-footer {
  position: relative;
  margin-top: clamp(56px, 8vw, 120px);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 21, 43, .92), rgba(6, 10, 22, 1) 72%);
}

.footer-shell {
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(32px, 5vw, 64px) var(--gutter) 22px;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr);
  gap: clamp(24px, 4vw, 56px);
}

.footer-brand__lockup {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text);
}

.footer-brand__tag {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .22em;
  color: var(--cyan);
}

.footer-brand__lede {
  margin-top: 14px;
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.85;
  color: var(--muted);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 36px);
}

.footer-col__title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--cyan);
}

.footer-col__title::before {
  content: "/ ";
  color: var(--violet);
}

.footer-link {
  display: inline-block;
  padding: 5px 0;
  font-size: 14px;
  color: var(--muted);
  transition: color .12s linear, transform .12s linear;
}

.footer-link:hover {
  color: var(--text);
  transform: translateX(2px);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 30px;
  margin-top: clamp(28px, 4vw, 48px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--muted);
}

.footer-meta__contact { color: var(--muted); }
.footer-meta__note { color: var(--violet); }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--muted);
  opacity: .82;
}

.footer-legal__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* =========================================================
   显现（页面阶段使用 data-reveal）
   ========================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .24s var(--ease), transform .24s var(--ease);
}

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

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1100px) {
  .nav-link { padding: 8px 10px; font-size: 13px; }
  .brand-tag { letter-spacing: .12em; }
}

@media (max-width: 980px) {
  body { padding-block-start: 86px; }

  .site-header { padding: 10px var(--gutter) 0; }

  .header-shell { border-radius: 16px; }

  .header-inner { min-height: 54px; gap: 10px; }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none;
    margin-left: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(9, 15, 30, .98);
    box-shadow: 0 30px 64px -32px rgba(0, 0, 0, .96);
    max-height: min(70vh, 460px);
    overflow-y: auto;
  }

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

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

  .nav-link {
    display: block;
    padding: 12px 14px;
    border-radius: 4px;
    font-size: 15px;
    white-space: normal;
  }

  .nav-link[aria-current="page"] { border-radius: 4px; }

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

  .header-progress { margin-top: 6px; }

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

@media (max-width: 900px) {
  .grid--7-5,
  .grid--8-4,
  .grid--5-7 { grid-template-columns: minmax(0, 1fr); }

  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

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

@media (max-width: 720px) {
  .header-cta { display: none; }
  .brand-tag { display: none; }
  .brand-name { font-size: 14px; letter-spacing: .12em; }
}

@media (max-width: 700px) {
  body { padding-block-start: 80px; }

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

  .rail__stub {
    padding: 0 0 6px;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  body { font-size: 15.5px; }

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

  .footer-cols { grid-template-columns: minmax(0, 1fr); gap: 20px; }

  .footer-legal { font-size: 11px; }
  .footer-legal__status { margin-left: 0; }

  .footer-meta { font-size: 11.5px; }
}

/* =========================================================
   降低动效
   ========================================================= */
@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;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .skip-link { transition: none; }
}
