/* =========================================================
   7安装的游戏 — /assets/site.css
   共享外壳：reset / 变量 / 头部轨道 / 页脚 / 基础组件
   ========================================================= */

/* ---------- 1. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

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

/* ---------- 2. 变量 ---------- */
:root {
  --ink: #0B1220;
  --steel: #111A2B;
  --white: #E8EEF7;
  --mist: #93A3B8;
  --cyan: #2FE3C8;
  --orange: #FF8A3D;
  --magenta: #C24BF0;
  --rail-line: #1E2A3D;
  --yellow: #FFD24A;
  --indigo: #6C7CF0;

  --rail-w: 288px;
  --gutter: 20px;
  --content-max: 1180px;
  --read-max: 40em;

  --cut: 18px;
  --cut-sm: 12px;

  --sans: "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans SC",
          "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Mono", "Roboto Mono",
          Consolas, "Noto Sans Mono CJK SC", ui-monospace, monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --fast: 120ms;
  --base: 240ms;
}

/* ---------- 3. 中文排版基础 ---------- */
body {
  min-height: 100vh;
  background: var(--ink);
  color: var(--white);
  font-family: var(--sans);
  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(720px 460px at 82% -6%, rgba(47, 227, 200, .10), transparent 66%),
    radial-gradient(560px 420px at 4% 94%, rgba(194, 75, 240, .09), transparent 64%),
    radial-gradient(520px 360px at 50% 40%, rgba(255, 138, 61, .04), transparent 70%);
}

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.24;
  letter-spacing: -.02em;
}

h1 { font-size: clamp(30px, 5vw, 56px); }
h2 { font-size: clamp(24px, 3.4vw, 40px); }
h3 { font-size: clamp(19px, 2.2vw, 28px); }
h4 { font-size: 20px; }

p { max-width: var(--read-max); }

::selection {
  background: rgba(47, 227, 200, .32);
  color: #ffffff;
}

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

/* ---------- 4. 通用容器 ---------- */
.wrap {
  width: min(var(--content-max), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.wrap--narrow { width: min(880px, 100% - var(--gutter) * 2); }

main { display: block; }

/* ---------- 5. 头部轨道 ---------- */
.skip-link {
  position: fixed;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 10px 18px;
  background: var(--cyan);
  color: #04211C;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #0B1220;
  border-bottom: 1px solid var(--rail-line);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(47, 227, 200, .85);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
  z-index: 90;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px var(--gutter);
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
}

.brand-badge {
  flex: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: #04211C;
  background: linear-gradient(140deg, var(--cyan) 0%, #17A891 100%);
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 11px 100%, 0 calc(100% - 11px));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.3;
}

.brand-entry {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--mist);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 汉堡按钮 */
.nav-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--steel);
  border: 1px solid var(--rail-line);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

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

.nav-toggle-bars {
  display: grid;
  gap: 3px;
  width: 16px;
}

.nav-toggle-bars i {
  display: block;
  height: 2px;
  background: var(--cyan);
  transition: transform var(--fast) var(--ease), opacity var(--fast) var(--ease);
}

.site-header[data-open] .nav-toggle-bars i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.site-header[data-open] .nav-toggle-bars i:nth-child(2) { opacity: 0; }
.site-header[data-open] .nav-toggle-bars i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* 抽屉导航（移动端基准） */
.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  width: min(84vw, 340px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 78px 22px 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #0D1626;
  border-left: 1px solid var(--rail-line);
  transform: translateX(102%);
  transition: transform var(--base) var(--ease);
}

.site-header[data-open] .site-nav { transform: none; }

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(4, 8, 15, .74);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--base) var(--ease), visibility var(--base) var(--ease);
}

.site-header[data-open] .nav-scrim {
  opacity: 1;
  visibility: visible;
}

/* 速览宣言标签（斜切 -8°） */
.rail-claim {
  align-self: flex-start;
  max-width: none;
  padding: 5px 14px;
  background: rgba(47, 227, 200, .10);
  border: 1px solid rgba(47, 227, 200, .38);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
}

.rail-claim > span {
  display: block;
  transform: skewX(8deg);
}

.rail-claim { transform: skewX(-8deg); }

/* 主导航 */
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  text-decoration: none;
  background: transparent;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.nav-link::before {
  content: "";
  flex: none;
  width: 3px;
  height: 18px;
  background: var(--rail-line);
  transition: background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.nav-link:hover { background: rgba(232, 238, 247, .05); }

.nav-link[aria-current="page"] {
  background: rgba(47, 227, 200, .09);
  color: var(--cyan);
}

.nav-link[aria-current="page"]::before {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(47, 227, 200, .9);
}

/* 快捷链 */
.rail-jump {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--rail-line);
}

.rail-jump-title {
  margin-bottom: 4px;
  max-width: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--mist);
}

.quick-link {
  position: relative;
  display: block;
  padding: 6px 0 6px 15px;
  font-size: 13.5px;
  color: var(--mist);
  text-decoration: none;
  transition: color var(--fast) var(--ease);
}

.quick-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 7px;
  height: 1px;
  background: var(--rail-line);
  transition: background var(--fast) var(--ease), width var(--fast) var(--ease);
}

.quick-link:hover { color: var(--white); }
.quick-link:hover::before { width: 10px; background: var(--orange); }

/* 图例 */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.rail-legend {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--rail-line);
}

.legend--footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--rail-line);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--mist);
}

.legend-dot {
  width: 8px;
  height: 8px;
  flex: none;
  transform: rotate(45deg);
}

.legend-item.is-body .legend-dot { background: var(--cyan); box-shadow: 0 0 8px rgba(47, 227, 200, .75); }
.legend-item.is-config .legend-dot { background: var(--orange); box-shadow: 0 0 8px rgba(255, 138, 61, .75); }
.legend-item.is-update .legend-dot { background: var(--magenta); box-shadow: 0 0 8px rgba(194, 75, 240, .75); }

/* ---------- 6. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: 72px;
  padding: 54px 0 26px;
  background: #0A1120;
  border-top: 1px solid var(--rail-line);
}

.footer-inner {
  width: min(var(--content-max), 100% - var(--gutter) * 2);
  margin-inline: auto;
  display: grid;
  gap: 38px;
  grid-template-columns: 1fr;
}

.footer-slogan {
  margin-top: 18px;
  max-width: 34em;
  font-size: 14px;
  line-height: 1.8;
  color: var(--white);
}

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

.footer-col-title {
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--rail-line);
  color: var(--mist);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  display: inline-block;
  font-size: 14px;
  color: var(--white);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.footer-links a:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.footer-meta-title {
  margin-bottom: 12px;
  max-width: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--mist);
}

.footer-meta-line {
  max-width: none;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--white);
  line-height: 1.9;
}

.footer-meta-note {
  margin-top: 10px;
  max-width: 30em;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--mist);
}

.footer-base {
  width: min(var(--content-max), 100% - var(--gutter) * 2);
  margin: 34px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--rail-line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 26px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--mist);
}

.footer-base p { max-width: none; }

/* ---------- 7. 基础组件 ---------- */
.panel {
  background: var(--steel);
  box-shadow: inset 0 0 0 1px rgba(47, 227, 200, .12);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--mist);
}

.crumbs li { display: inline-flex; align-items: center; }

.crumbs li::after {
  content: "/";
  margin: 0 9px;
  color: var(--rail-line);
}

.crumbs li:last-child::after { content: none; }

.crumbs a {
  text-decoration: none;
  color: var(--mist);
  transition: color var(--fast) var(--ease);
}

.crumbs a:hover { color: var(--cyan); }

.crumbs [aria-current="page"] { color: var(--white); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
              border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.btn--primary { background: var(--orange); color: #1A0C04; }
.btn--primary:hover { background: #FFA05F; }

.btn--cyan { background: var(--cyan); color: #04211C; }
.btn--cyan:hover { background: #5CF0DA; }

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

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

.tag {
  display: inline-block;
  padding: 3px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--mist);
  border: 1px solid var(--rail-line);
  transform: skewX(-8deg);
}

.tag > span { display: block; transform: skewX(8deg); }

.tag[data-tone="body"] { color: var(--cyan); border-color: rgba(47, 227, 200, .45); background: rgba(47, 227, 200, .08); }
.tag[data-tone="config"] { color: var(--orange); border-color: rgba(255, 138, 61, .45); background: rgba(255, 138, 61, .08); }
.tag[data-tone="update"] { color: var(--magenta); border-color: rgba(194, 75, 240, .45); background: rgba(194, 75, 240, .08); }
.tag[data-tone="check"] { color: var(--yellow); border-color: rgba(255, 210, 74, .45); background: rgba(255, 210, 74, .08); }
.tag[data-tone="save"] { color: var(--indigo); border-color: rgba(108, 124, 240, .45); background: rgba(108, 124, 240, .08); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--mist);
  background: var(--steel);
  border: 1px solid var(--rail-line);
  cursor: pointer;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.chip:hover { color: var(--white); border-color: var(--mist); }

.chip[aria-pressed="true"] {
  color: var(--magenta);
  border-color: rgba(194, 75, 240, .55);
  background: rgba(194, 75, 240, .10);
}

[data-tabs] [role="tablist"] {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

[data-tabs] [role="tab"] {
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--mist);
  background: var(--steel);
  border: 1px solid var(--rail-line);
  cursor: pointer;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}

[data-tabs] [role="tab"]:hover { color: var(--white); }

[data-tabs] [role="tab"][aria-selected="true"] {
  color: #04211C;
  background: var(--cyan);
  border-color: var(--cyan);
}

[data-tabs] [role="tabpanel"] { padding-top: 22px; }

[data-tabs] [role="tabpanel"][hidden] { display: none; }

/* 字段语义色与等宽数字 */
.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.field { font-family: var(--mono); letter-spacing: .04em; }
[data-field="size"] { color: var(--cyan); }
[data-field="config"] { color: var(--orange); }
[data-field="update"] { color: var(--magenta); }
[data-field="save"] { color: var(--indigo); }
[data-field="check"] { color: var(--yellow); }

/* 图片容器（页面阶段填充实际图片或占位） */
.media {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: var(--steel);
  box-shadow: inset 0 0 0 1px var(--rail-line);
}

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

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(11, 18, 32, 0) 0 3px,
    rgba(11, 18, 32, .16) 3px 4px
  );
}

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

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  min-width: 640px;
  font-size: 14px;
}

.table-scroll th,
.table-scroll td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--rail-line);
  vertical-align: top;
}

.table-scroll thead th {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--mist);
  white-space: nowrap;
}

/* 显现 */
html.js [data-reveal] {
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}

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

/* ---------- 8. 平板 ---------- */
@media (min-width: 720px) {
  :root { --gutter: 28px; }

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

/* ---------- 9. 桌面：左侧常驻轨道 ---------- */
@media (min-width: 1080px) {
  :root { --gutter: 34px; }

  body { padding-left: var(--rail-w); }

  .site-header {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail-w);
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 30px 24px 24px;
    background: linear-gradient(180deg, #0E1A2C 0%, #0B1220 46%);
    border-bottom: 0;
    border-right: 1px solid var(--rail-line);
  }

  .scroll-progress { left: var(--rail-w); }

  .header-bar {
    display: block;
    padding: 0;
  }

  .nav-toggle { display: none; }
  .nav-scrim { display: none; }

  .site-nav {
    position: static;
    width: auto;
    transform: none;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 22px;
    margin-top: 28px;
    padding: 0;
    overflow: visible;
    background: transparent;
    border-left: 0;
    transition: none;
  }

  .site-header[data-open] .site-nav { transform: none; }

  .brand-name { font-size: 18px; }

  .rail-claim { margin-top: 2px; }

  .nav-link { font-size: 15px; padding: 12px 15px; }

  .rail-legend { margin-top: auto; }

  .footer-inner { grid-template-columns: 1.15fr 2fr 1.35fr; }
  .footer-brand { grid-column: auto; }
  .footer-meta { grid-column: auto; }
}

/* 矮屏轨道压缩 */
@media (min-width: 1080px) and (max-height: 660px) {
  .rail-jump { display: none; }
}

/* ---------- 10. 无障碍与动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }

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

  .site-nav { transition: none; }
}
