/* =========================================================
   哈狗游戏玩家 · /assets/site.css
   共享外壳：reset / tokens / 头部 / 页脚 / 通用组件
   ========================================================= */

:root {
  --ink: #0E0F13;
  --surface: #1A1D24;
  --deep: #0A1A2F;
  --yellow: #FFD23F;
  --blue: #2D9CFF;
  --magenta: #FF3D8B;
  --orange: #FF7A1A;
  --paper: #F5F1E6;
  --muted: #8B93A7;
  --yellow-soft: #FFE9A8;
  --link: #7CC4FF;

  --line: rgba(245, 241, 230, 0.14);
  --line-strong: rgba(245, 241, 230, 0.30);

  --header-h: 64px;
  --shell: 1180px;
  --gutter: clamp(16px, 4vw, 48px);
  --speed: 160ms;

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Source Han Sans SC", "Microsoft YaHei", system-ui, -apple-system,
    "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, "JetBrains Mono",
    "Cascadia Mono", Consolas, "Liberation Mono", "Courier New", monospace;
}

@media (min-width: 900px) {
  :root { --header-h: 76px; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  scroll-behavior: smooth;
}

html.is-nav-open { overflow: hidden; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: clamp(15.5px, 1.02vw, 17px);
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg, video, picture { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

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

#main-content { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ---------- skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  border-radius: 2px;
  transform: translateY(-180%);
  transition: transform var(--speed) ease;
}
.skip-link:focus { transform: translateY(0); }

/* =========================================================
   头部
   ========================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 200ms ease, border-color 200ms ease,
    box-shadow 200ms ease;
}

.site-header[data-scrolled="true"],
.site-header[data-open="true"] {
  background: rgba(14, 15, 19, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 24px);
  min-height: var(--header-h);
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* 品牌 2×2 像素块 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 6px 2px;
  transition: opacity var(--speed) ease;
}
.brand:hover { opacity: 0.88; }

.brand__mark {
  display: grid;
  grid-template-columns: repeat(2, 7px);
  grid-template-rows: repeat(2, 7px);
  gap: 2px;
  flex: 0 0 auto;
}
.brand__pixel { display: block; background: var(--paper); }
.brand__pixel:nth-child(1) { background: var(--yellow); }
.brand__pixel:nth-child(2) { background: var(--blue); }
.brand__pixel:nth-child(3) { background: var(--magenta); }
.brand__pixel:nth-child(4) { background: var(--paper); }

.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.brand__tag {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* 坐标读数 */
.coord {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  white-space: nowrap;
}
.coord__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--magenta);
  animation: pixel-blink 2.4s steps(2, end) infinite;
}
@keyframes pixel-blink {
  0%, 60% { opacity: 1; }
  61%, 100% { opacity: 0.22; }
}
@media (min-width: 1180px) {
  .coord { display: inline-flex; }
}

/* 移动导航按钮 */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  transition: border-color var(--speed) ease, color var(--speed) ease,
    background-color var(--speed) ease;
}
.nav-toggle:hover {
  border-color: var(--yellow);
  color: var(--yellow);
  background: rgba(255, 210, 63, 0.08);
}
.nav-toggle__box { display: grid; gap: 3px; width: 16px; }
.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  transition: transform var(--speed) ease, opacity 120ms ease;
}
.nav-toggle__label { font-family: var(--font-mono); }

.site-header[data-open="true"] .nav-toggle {
  color: var(--yellow);
  border-color: var(--yellow);
}
.site-header[data-open="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.site-header[data-open="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.site-header[data-open="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* 导航（移动优先：全宽目录面板） */
.site-nav {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  display: none;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 6px var(--gutter) 24px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.55);
}
.site-header[data-open="true"] .site-nav { display: block; }

.site-nav__list { display: flex; flex-direction: column; }
.site-nav__item { border-bottom: 1px solid var(--line); }

.site-nav__link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 2px;
  font-size: 16px;
  color: rgba(245, 241, 230, 0.86);
  transition: color var(--speed) ease, padding-left var(--speed) ease;
}
.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--yellow);
  padding-left: 8px;
}
.site-nav__index {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.site-nav__link[aria-current="page"] { color: var(--yellow); }
.site-nav__link[aria-current="page"] .site-nav__index { color: var(--yellow); }

.site-nav__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}
.site-nav__actions .btn { width: 100%; }

/* 桌面导航 */
@media (min-width: 900px) {
  .nav-toggle { display: none; }

  .site-nav {
    position: static;
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.4vw, 22px);
    max-height: none;
    overflow: visible;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .site-nav__list { flex-direction: row; align-items: center; gap: 2px; }
  .site-nav__item { border-bottom: 0; }

  .site-nav__link {
    position: relative;
    padding: 10px;
    font-size: 13.5px;
    letter-spacing: 0.02em;
  }
  .site-nav__link:hover { padding-left: 10px; }

  .site-nav__link::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 4px;
    height: 2px;
    background: var(--yellow);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform var(--speed) ease;
  }
  .site-nav__link:hover::after,
  .site-nav__link:focus-visible::after,
  .site-nav__link[aria-current="page"]::after { transform: scaleX(1); }

  .site-nav__actions {
    flex-direction: row;
    align-items: center;
    margin-top: 0;
    padding-left: clamp(10px, 1.6vw, 22px);
    border-left: 1px solid var(--line);
  }
  .site-nav__actions .btn { width: auto; }
}

@media (min-width: 900px) and (max-width: 1159px) {
  .site-nav__index { display: none; }
}

/* 滚动进度像素线 */
.site-header__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
  background: linear-gradient(
    90deg,
    var(--yellow) 0%,
    var(--magenta) 55%,
    var(--blue) 100%
  );
  opacity: 0.95;
}

/* =========================================================
   通用按钮
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  transition: background-color var(--speed) ease, color var(--speed) ease,
    border-color var(--speed) ease, transform var(--speed) ease;
}
.btn:hover { transform: translateY(-1px); }

.btn--primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #1A0E02;
}
.btn--primary:hover {
  background: #FF8E3D;
  border-color: #FF8E3D;
  color: #120900;
}

.btn--ghost { border-color: var(--line-strong); color: var(--paper); }
.btn--ghost:hover {
  border-color: var(--yellow);
  color: var(--yellow);
  background: rgba(255, 210, 63, 0.08);
}

.btn--small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
}
.btn--block { width: 100%; }

/* =========================================================
   布局与章节
   ========================================================= */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.page-top { padding-top: calc(var(--header-h) + clamp(28px, 5vw, 64px)); }

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

.section__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: clamp(10px, 2vw, 24px);
  padding-bottom: 14px;
  margin-bottom: clamp(20px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
}
.section__index {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--yellow);
}
.section__title {
  font-size: clamp(24px, 3.4vw, 40px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.index-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 52px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--yellow);
}

.panel {
  padding: clamp(16px, 2.4vw, 28px);
  background: var(--deep);
  border: 1px solid var(--line);
}

.grid { display: grid; gap: clamp(14px, 2vw, 24px); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
@media (min-width: 680px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 面包屑 ---------- */
.crumbs { padding-top: 14px; }
.crumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.crumbs__list li { display: inline-flex; align-items: center; gap: 8px; }
.crumbs__list li + li::before {
  content: "/";
  color: rgba(139, 147, 167, 0.6);
}
.crumbs__list a { color: var(--muted); transition: color var(--speed) ease; }
.crumbs__list a:hover { color: var(--yellow); }
.crumbs__list [aria-current="page"] { color: var(--paper); }

/* ---------- 正文排版 ---------- */
.prose {
  max-width: 68ch;
  font-size: clamp(15.5px, 1.02vw, 17px);
  line-height: 1.8;
  color: rgba(245, 241, 230, 0.84);
}
.prose > * + * { margin-top: 1em; }
.prose h2 {
  margin-top: 2em;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--paper);
}
.prose h3 {
  margin-top: 1.6em;
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 600;
  color: var(--paper);
}
.prose ul { list-style: disc; padding-left: 1.2em; }
.prose ol { list-style: decimal; padding-left: 1.2em; }
.prose li + li { margin-top: 0.4em; }
.prose a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--yellow); }
.prose strong { color: var(--paper); }
.prose code {
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--surface);
  border: 1px solid var(--line);
}

/* ---------- 资料卡与标签 ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(16px, 2vw, 26px);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color var(--speed) ease, transform var(--speed) ease,
    background-color var(--speed) ease;
}
.card:hover {
  border-color: rgba(255, 210, 63, 0.5);
  transform: translateY(-2px);
}
.card:focus-within { border-color: var(--yellow); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.tag--yellow {
  border-color: rgba(255, 210, 63, 0.5);
  color: var(--yellow);
  background: rgba(255, 210, 63, 0.1);
}
.tag--blue {
  border-color: rgba(45, 156, 255, 0.5);
  color: var(--blue);
  background: rgba(45, 156, 255, 0.1);
}
.tag--magenta {
  border-color: rgba(255, 61, 139, 0.5);
  color: var(--magenta);
  background: rgba(255, 61, 139, 0.1);
}

/* ---------- 图片容器基础规则 ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: var(--media-ratio, 16 / 10);
  background: var(--deep);
  border: 1px solid var(--line);
}
.media-frame--square { --media-ratio: 1 / 1; }
.media-frame--wide { --media-ratio: 21 / 9; }

.media-frame > img,
.media-frame > picture,
.media-frame > picture > img,
.media-frame > svg,
.media-frame > video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(245, 241, 230, 0.055) 0 1px,
    transparent 1px 3px
  );
  opacity: 0.6;
}

/* ---------- 扫描线 ---------- */
.scanlines { position: relative; }
.scanlines::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(245, 241, 230, 0.05) 0 1px,
    transparent 1px 4px
  );
  opacity: 0.55;
  animation: scan-drift 8s linear infinite;
}
@keyframes scan-drift {
  from { transform: translateY(0); }
  to { transform: translateY(4px); }
}

/* ---------- 显现 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 420ms ease, transform 420ms ease;
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* =========================================================
   页脚
   ========================================================= */
.site-footer {
  position: relative;
  margin-top: clamp(56px, 9vw, 120px);
  color: var(--paper);
  background-color: var(--deep);
  background-image:
    linear-gradient(rgba(245, 241, 230, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 241, 230, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  border-top: 1px solid var(--line);
}

.site-footer__stripe {
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--yellow) 0 24%,
    var(--magenta) 24% 50%,
    var(--blue) 50% 76%,
    var(--orange) 76% 100%
  );
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 3vw, 40px);
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(36px, 5vw, 64px) var(--gutter) clamp(28px, 4vw, 48px);
}
@media (min-width: 640px) {
  .site-footer__inner { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .site-footer__inner {
    grid-template-columns: 1.6fr 0.8fr 0.8fr 1.2fr;
  }
}

.footer__brand { display: flex; flex-direction: column; }
.footer__wordmark {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 600;
  letter-spacing: 0.08em;
}
.footer__sub {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--yellow);
}
.footer__coords {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.footer__note {
  margin-top: 14px;
  max-width: 34ch;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.footer__col { min-width: 0; }
.footer__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper);
}
.footer__title::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--yellow);
}

.footer__links { display: flex; flex-direction: column; gap: 2px; }
.footer__links a {
  display: inline-block;
  padding: 5px 0;
  font-size: 14px;
  color: rgba(245, 241, 230, 0.72);
  transition: color var(--speed) ease, transform var(--speed) ease;
}
.footer__links a:hover {
  color: var(--yellow);
  transform: translateX(3px);
}

.footer__meta { display: flex; flex-direction: column; gap: 10px; }
.footer__meta li { display: flex; flex-direction: column; gap: 2px; }
.footer__meta-key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer__meta-val {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--paper);
  word-break: break-word;
}

.footer__service {
  margin-top: 16px;
  padding-left: 12px;
  border-left: 2px solid var(--magenta);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 16px var(--gutter) 30px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.footer__legal { flex: 1 1 260px; }
.footer__icp { color: var(--muted); }
.footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.footer__legal-links a {
  color: var(--muted);
  transition: color var(--speed) ease;
}
.footer__legal-links a:hover { color: var(--yellow); }

/* =========================================================
   减弱动效
   ========================================================= */
@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;
  }
  .scanlines::after { animation: none; }
  [data-reveal] { opacity: 1; transform: none; }
}
