/* ==========================================================================
   九游赛场主站 — 共享站点样式 /assets/site.css
   深墨绿承重 · 荧光青提亮 · 琥珀橙反馈 · 灰蓝面板底
   ========================================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  --ink: #0B3B32;
  --ink-deep: #06241F;
  --cyan: #21F3C4;
  --cyan-soft: #8CFFE4;
  --amber: #FFB347;
  --bg: #E7EDF0;
  --bg-2: #C8D3D8;
  --paper: #F7FAF8;
  --muted: #6B7A78;
  --line: #9FB8B3;

  --edge: 2px;
  --radius: 4px;
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);

  --pad: 64px;
  --gutter: 24px;
  --maxw: 1280px;

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

/* ---------- 2. Reset 与基础排版 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(to bottom, rgba(11, 59, 50, 0.055) 1px, transparent 1px);
  background-size: 100% 32px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.14;
}

h1 { font-size: clamp(2.25rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); letter-spacing: -0.02em; }
h4 { font-size: 1.0625rem; letter-spacing: -0.01em; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--ink); text-decoration: none; }

ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
ul:last-child, ol:last-child { margin-bottom: 0; }

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

button { font: inherit; color: inherit; }

strong { font-weight: 800; }

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

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

/* ---------- 3. 通用工具类 ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

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

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

.rule {
  height: 1px;
  margin: 32px 0;
  border: 0;
  background: var(--line);
}

.prose { max-width: 68ch; }
.prose p { max-width: 68ch; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 300;
  padding: 11px 18px;
  background: var(--cyan);
  color: var(--ink-deep);
  border: var(--edge) solid var(--ink);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  transform: translateY(-240%);
  transition: transform 0.16s ease-out;
}
.skip-link:focus,
.skip-link:focus-visible { transform: translateY(0); }

/* ---------- 4. 页头 ---------- */
.site-header {
  position: relative;
  z-index: 40;
  background: var(--paper);
  border-bottom: var(--edge) solid var(--ink);
}

/* 4.1 顶部数据条 */
.header-strip { background: var(--ink-deep); color: var(--paper); }

.header-strip__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  width: 100%;
  max-width: var(--maxw);
  min-height: 38px;
  margin: 0 auto;
  padding: 4px var(--pad);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--cyan-soft);
}

.header-strip__note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--cyan-soft);
}

.pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(33, 243, 196, 0.2);
  animation: dot-breathe 2.4s ease-in-out infinite;
}

@keyframes dot-breathe {
  0%, 100% { box-shadow: 0 0 0 3px rgba(33, 243, 196, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(33, 243, 196, 0.05); }
}

.header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.header-tools__link {
  display: inline-block;
  padding: 4px 14px;
  color: var(--paper);
  border-left: 1px solid rgba(159, 184, 179, 0.35);
  position: relative;
  transition: color 0.14s ease-out;
}
.header-tools__link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 1px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease-out;
}
.header-tools__link:hover { color: var(--cyan); }
.header-tools__link:hover::after { transform: scaleX(1); }

/* 4.2 主操作台 */
.header-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 18px;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 15px var(--pad);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: var(--cyan);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 3px 3px 0 var(--cyan);
  transition: transform 0.14s ease-out, box-shadow 0.14s ease-out;
}
.brand:hover .brand__mark {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--cyan);
}

.brand__stack {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.brand__sub {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

/* CN 常用入口 */
.cn-entry {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  background: var(--cyan);
  color: var(--ink-deep);
  border: var(--edge) solid var(--ink);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease-out, box-shadow 0.14s ease-out, background 0.14s ease-out;
}
.cn-entry:hover { background: var(--cyan-soft); }
.cn-entry:active,
.cn-entry:focus-visible { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.cn-entry__ver {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  opacity: 0.72;
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  background: var(--ink);
  color: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 0.14s ease-out, transform 0.14s ease-out;
}
.nav-toggle:hover { background: var(--ink-deep); }
.nav-toggle:active { transform: translate(1px, 1px); }

.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 17px;
  height: 12px;
}
.nav-toggle__bars span {
  display: block;
  height: 2px;
  background: var(--cyan);
  transform-origin: center;
  transition: transform 0.16s ease-out, opacity 0.16s ease-out;
}
.site-header[data-nav-open] .nav-toggle__bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.site-header[data-nav-open] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.site-header[data-nav-open] .nav-toggle__bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

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

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__item { margin: 0; }

.site-nav__link {
  position: relative;
  display: inline-block;
  padding: 9px 13px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-radius: var(--radius);
  transition: background 0.14s ease-out, color 0.14s ease-out;
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 5px;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease-out;
}
.site-nav__link:hover { background: var(--bg); }
.site-nav__link:hover::after,
.site-nav__link:focus-visible::after { transform: scaleX(1); }

.site-nav__link[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}
.site-nav__link[aria-current="page"]::after {
  background: var(--amber);
  transform: scaleX(1);
}

/* ---------- 5. 页脚 ---------- */
.site-footer {
  margin-top: 72px;
  background: var(--ink-deep);
  color: var(--paper);
  border-top: 3px solid var(--cyan);
}
.site-footer :focus-visible { outline-color: var(--amber); }

.site-footer__frame {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px var(--pad) 26px;
}

.site-footer__top {
  display: grid;
  grid-template-columns: minmax(240px, 1.15fr) 2fr;
  gap: 44px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(159, 184, 179, 0.28);
}

.brand--invert .brand__name { color: var(--paper); }
.brand--invert .brand__sub { color: var(--line); }
.brand--invert .brand__mark {
  background: var(--cyan);
  color: var(--ink-deep);
  box-shadow: 3px 3px 0 rgba(33, 243, 196, 0.28);
}
.brand--invert:hover .brand__mark {
  box-shadow: 4px 4px 0 rgba(255, 179, 71, 0.9);
}

.site-footer__tagline {
  margin: 22px 0 12px;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--paper);
}

.site-footer__note {
  max-width: 36ch;
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--line);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

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

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

.footer-col__list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col__list a {
  position: relative;
  display: inline-block;
  color: var(--paper);
  font-size: 15px;
  transition: color 0.14s ease-out;
}
.footer-col__list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease-out;
}
.footer-col__list a:hover { color: var(--cyan); }
.footer-col__list a:hover::after { transform: scaleX(1); }

.site-footer__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px 32px;
  padding: 28px 0;
  border-bottom: 1px solid rgba(159, 184, 179, 0.28);
}

.meta-item { margin: 0; }

.meta-item__key {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--line);
}

.meta-item__val {
  display: block;
  font-size: 14px;
  line-height: 1.6;
  color: var(--paper);
  word-break: break-word;
}

.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 20px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--line);
}
.site-footer__copy,
.site-footer__icp { margin: 0; }

/* ---------- 6. 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--paper);
  color: var(--ink);
  border: var(--edge) solid var(--ink);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.14s ease-out, transform 0.14s ease-out, box-shadow 0.14s ease-out, border-color 0.14s ease-out;
}
.btn:hover { background: var(--cyan-soft); border-color: var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.btn--primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 3px 3px 0 var(--cyan);
}
.btn--primary:hover { background: var(--ink-deep); }
.btn--primary:active { box-shadow: 1px 1px 0 var(--cyan); }

.btn--solid {
  background: var(--cyan);
  color: var(--ink-deep);
  border-color: var(--ink);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.5;
  white-space: nowrap;
}
.tag--cyan { background: var(--cyan); color: var(--ink-deep); }
.tag--amber { background: var(--amber); color: var(--ink-deep); }
.tag--muted { color: var(--muted); border-color: var(--line); background: transparent; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  flex: 0 0 auto;
  width: 28px;
  height: 2px;
  background: var(--cyan);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 26px;
  padding-bottom: 14px;
  border-bottom: var(--edge) solid var(--ink);
}
.section-head > * { margin: 0; }

.breadcrumb {
  padding: 18px 0 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.breadcrumb li + li::before {
  content: "/";
  color: var(--line);
}
.breadcrumb a {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  transition: border-color 0.14s ease-out, color 0.14s ease-out;
}
.breadcrumb a:hover { color: var(--ink-deep); border-bottom-color: var(--cyan); }
.breadcrumb [aria-current="page"] { color: var(--muted); }

.island {
  padding: 22px;
  background: var(--paper);
  border: var(--edge) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* 图片容器（页面阶段放入 <img> 与浮层） */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-2);
  border: var(--edge) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.94) contrast(1.05);
}
.media--wide { aspect-ratio: 21 / 9; }
.media--tall { aspect-ratio: 3 / 4; }
.media--square { aspect-ratio: 1 / 1; }

.media__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.media__caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  padding: 22px 13px 10px;
  background: linear-gradient(to top, rgba(6, 36, 31, 0.88), rgba(6, 36, 31, 0));
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.6;
}

/* ---------- 7. JS 注入组件 ---------- */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  width: 100%;
  height: 3px;
  background: var(--cyan);
  box-shadow: 0 0 0 1px rgba(33, 243, 196, 0.22);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 110;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  background: var(--ink);
  color: var(--cyan);
  border: var(--edge) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 rgba(33, 243, 196, 0.85);
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.18s ease-out, transform 0.18s ease-out, visibility 0.18s, background 0.14s ease-out;
}
.to-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover { background: var(--ink-deep); }
.to-top:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(33, 243, 196, 0.85); }

/* ---------- 8. 响应式 ---------- */
@media (max-width: 1180px) {
  .site-nav__link { padding: 9px 10px; font-size: 14px; }
  .site-nav__link::after { left: 10px; right: 10px; }
}

@media (max-width: 1024px) {
  :root { --pad: 24px; }

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

  .site-nav {
    order: 6;
    flex: 1 0 100%;
    margin-left: 0;
    display: none;
  }
  .site-nav[data-open] {
    display: block;
    animation: nav-drop 0.18s ease-out both;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 6px;
    padding-top: 8px;
    border-top: var(--edge) solid var(--ink);
  }
  .site-nav__link {
    display: block;
    padding: 13px 10px;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
  }
  .site-nav__link::after { display: none; }
  .site-nav__link:hover { background: var(--bg); }
  .site-nav__link[aria-current="page"] {
    background: var(--cyan);
    color: var(--ink-deep);
    border-bottom-color: var(--ink);
  }

  .site-footer__top {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }
  .footer-nav { gap: 24px; }
}

@keyframes nav-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
  .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__frame { padding-top: 44px; }
  .site-footer { margin-top: 56px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; line-height: 1.78; }

  .header-strip__inner {
    padding: 6px var(--pad);
    font-size: 10px;
    letter-spacing: 0.06em;
  }
  .header-tools__link { padding: 3px 9px; }
  .header-tools__link::after { left: 9px; right: 9px; }

  .header-main { gap: 12px; padding: 13px var(--pad); }

  .site-footer__meta { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .site-footer__bar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
  :root { --pad: 20px; --shadow: 4px 4px 0 var(--ink); }

  body { background-size: 100% 28px; }

  .brand { gap: 9px; }
  .brand__mark { width: 36px; height: 36px; font-size: 17px; box-shadow: 2px 2px 0 var(--cyan); }
  .brand__name { font-size: 16px; }
  .brand__sub { font-size: 9px; letter-spacing: 0.16em; margin-top: 3px; }

  .cn-entry { padding: 5px 9px; gap: 6px; font-size: 12px; box-shadow: 2px 2px 0 var(--ink); }
  .cn-entry__ver { display: none; }

  .nav-toggle { padding: 8px 11px; }
  .nav-toggle__text { display: none; }

  .header-strip__note { font-size: 9.5px; }

  .footer-nav { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .site-footer__tagline { margin-top: 18px; }
  .to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; }
}

/* ---------- 9. 动效降级 ---------- */
@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;
  }

  .pulse-dot { animation: none; }
  .site-nav[data-open] { animation: none; }
}
