/* ==========================================================================
   KAIYUN 安装站 · 共享样式表 /assets/site.css
   高原赛场夜航感 · 越位线切割版面 · 档案夹式信息系统
   ========================================================================== */

:root {
  /* 色板 —— 面积受控 */
  --c-night: #0B1A33;      /* 高原夜靛 */
  --c-panel: #122A4D;      /* 深靛面板 */
  --c-lake: #0E6E7A;       /* 湖青蓝 · 主品牌 */
  --c-cyan: #17A2B8;       /* 亮青蓝 · 链接与表头 */
  --c-flag: #E8FF3A;       /* 越位荧光黄 · 信号 */
  --c-whistle: #FF7A33;    /* 哨音橙 · 行动与客队 */
  --c-teal: #2FBF9E;       /* 青绿指标 · 主队与正向 */
  --c-line: #C9D4DC;       /* 冷灰分隔 */
  --c-paper: #F5F8F9;      /* 冰纸白 */
  --c-slate: #5A6B7A;      /* 石板灰 */

  /* 结构 */
  --rail-w: 104px;
  --shell: 1180px;
  --gutter: clamp(18px, 4vw, 56px);

  /* 字体栈（全部本地回退，不引入远程字体） */
  --font-sans: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Heiti SC", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", ui-monospace,
    "Menlo", Consolas, "Courier New", monospace;
  --font-hand: "ZCOOL KuaiLe", "Yuanti SC", "Hanzipen SC", "Kaiti SC", "STKaiti", cursive;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --dur: 240ms;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--c-paper);
  color: var(--c-night);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.85;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html.nav-open { overflow: hidden; }

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

button { font: inherit; color: inherit; }

ul, ol { margin: 0; padding: 0; }

::selection { background: var(--c-flag); color: var(--c-night); }

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

.site-header :focus-visible,
.site-footer :focus-visible,
.site-nav :focus-visible {
  outline-color: var(--c-flag);
}

/* ---------- 中文排版 ---------- */
h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--c-night);
}

h1 { font-size: clamp(34px, 5vw, 56px); }
h2 { font-size: clamp(26px, 3.4vw, 40px); }
h3 { font-size: clamp(20px, 2.2vw, 28px); }
h4 { font-size: 20px; letter-spacing: -0.01em; }

p { margin: 0; }

a { color: var(--c-lake); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--c-cyan); }

strong { font-weight: 700; }

.mono,
[data-num] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.note {
  font-family: var(--font-hand);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--c-slate);
}

.prose {
  max-width: 68ch;
  font-size: 16px;
  line-height: 1.85;
}
.prose > * + * { margin-top: 1.4em; }
.prose h2, .prose h3 { margin-top: 2em; }

/* ---------- 布局容器 ---------- */
.wrap {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 780px; }

.section { padding-block: clamp(56px, 8vw, 104px); }

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: absolute;
  top: -120px;
  left: 10px;
  z-index: 120;
  display: inline-block;
  padding: 10px 20px;
  background: var(--c-flag);
  color: var(--c-night);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: top 160ms var(--ease);
}
.skip-link:focus { top: 10px; color: var(--c-night); }

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--c-night);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease),
    border-color 160ms var(--ease);
}
.btn:hover { text-decoration: none; }

.btn--ghost {
  border-color: rgba(201, 212, 220, 0.42);
  color: var(--c-paper);
}
.btn--ghost:hover {
  border-color: var(--c-flag);
  color: var(--c-flag);
}

.btn--flag {
  background: var(--c-flag);
  border-color: var(--c-flag);
  color: var(--c-night);
}
.btn--flag:hover {
  background: var(--c-whistle);
  border-color: var(--c-whistle);
  color: var(--c-night);
}

.btn--solid {
  background: var(--c-lake);
  border-color: var(--c-lake);
  color: var(--c-paper);
}
.btn--solid:hover { background: var(--c-cyan); border-color: var(--c-cyan); color: var(--c-paper); }

/* ==========================================================================
   页头
   ========================================================================== */
.site-header {
  position: relative;
  z-index: 30;
  color: var(--c-paper);
  background-color: var(--c-night);
  background-image:
    linear-gradient(rgba(201, 212, 220, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 212, 220, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  border-bottom: 2px solid var(--c-flag);
}

.masthead {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 22px var(--gutter) 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px 28px;
}

.masthead__lead {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-right: auto;
  min-width: 0;
}

.brand {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--c-paper);
  text-decoration: none;
}
.brand:hover { color: var(--c-flag); }

.brand__tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(245, 248, 249, 0.5);
}

.masthead__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 汉堡按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(201, 212, 220, 0.42);
  border-radius: 0;
  background: transparent;
  color: var(--c-paper);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: border-color 160ms var(--ease), color 160ms var(--ease);
}
.nav-toggle:hover { border-color: var(--c-flag); color: var(--c-flag); }

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  background: var(--c-flag);
  transition: background-color 160ms var(--ease);
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: var(--c-flag);
  transition: transform 200ms var(--ease);
}
.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-5px) rotate(-45deg); }

/* 赛季刻度带 */
.season-band {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 0 var(--gutter) 16px;
}

.season-band__track {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(201, 212, 220, 0.2);
}

.season-band__tick {
  position: relative;
  display: block;
  padding-top: 12px;
  text-align: center;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(245, 248, 249, 0.36);
}
.season-band__tick::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 8px;
  background: rgba(201, 212, 220, 0.4);
}
.season-band__tick.is-current {
  color: var(--c-flag);
}
.season-band__tick.is-current::before {
  top: -4px;
  width: 8px;
  height: 8px;
  background: var(--c-flag);
}

/* 侧边轨道导航 —— 移动端默认：右侧抽屉 */
.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  width: min(320px, 86vw);
  padding: 92px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  background: var(--c-panel);
  border-left: 2px solid var(--c-flag);
  transform: translateX(102%);
  transition: transform var(--dur) var(--ease);
}
.site-nav[data-open] { transform: translateX(0); }

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-nav__link {
  position: relative;
  display: block;
  padding: 13px 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(245, 248, 249, 0.78);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 212, 220, 0.14);
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}
.site-nav__link:hover {
  color: var(--c-flag);
  background: rgba(23, 162, 184, 0.14);
}
.site-nav__link[aria-current="page"] {
  color: var(--c-flag);
  background: rgba(232, 255, 58, 0.08);
}
.site-nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--c-flag);
}

.rail-note {
  margin: 20px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.06em;
  color: rgba(245, 248, 249, 0.4);
}

/* 抽屉遮罩 */
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(11, 26, 51, 0.62);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease);
}
.nav-scrim.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer {
  position: relative;
  margin-top: clamp(64px, 9vw, 120px);
  background-color: var(--c-night);
  background-image:
    linear-gradient(rgba(201, 212, 220, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 212, 220, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  color: var(--c-paper);
  border-top: 2px solid var(--c-flag);
}

.site-footer__inner {
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(48px, 6vw, 72px) var(--gutter) clamp(36px, 4vw, 52px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.foot-brand__mark {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--c-paper);
}
.foot-brand__tagline {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--c-cyan);
}
.foot-brand__badge {
  display: inline-block;
  margin-top: 16px;
  padding: 5px 12px;
  border: 1px solid rgba(232, 255, 58, 0.5);
  color: var(--c-flag);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.foot-col__title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(245, 248, 249, 0.44);
  margin-bottom: 14px;
}

.foot-col__list { list-style: none; margin: 0; padding: 0; }
.foot-col__list li { border-bottom: 1px solid rgba(201, 212, 220, 0.1); }
.foot-col__list a {
  display: inline-block;
  padding: 8px 0;
  font-size: 15px;
  color: rgba(245, 248, 249, 0.78);
  text-decoration: none;
  transition: color 160ms var(--ease), transform 160ms var(--ease);
}
.foot-col__list a::before {
  content: "—";
  margin-right: 8px;
  color: rgba(201, 212, 220, 0.32);
}
.foot-col__list a:hover {
  color: var(--c-flag);
  transform: translateX(4px);
}

.foot-contact__list { list-style: none; margin: 0; padding: 0; }
.foot-contact__list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(201, 212, 220, 0.1);
}
.foot-contact__k {
  flex: 0 0 44px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--c-slate);
  line-height: 1.9;
}
.foot-contact__v {
  flex: 1 1 180px;
  min-width: 0;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(245, 248, 249, 0.84);
  word-break: break-word;
}

.site-footer__base {
  max-width: var(--shell);
  margin-inline: auto;
  padding: 20px var(--gutter) 34px;
  border-top: 1px solid rgba(201, 212, 220, 0.14);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(245, 248, 249, 0.46);
}
.foot-copy { font-variant-numeric: tabular-nums; }
.foot-icp { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   通用内容组件
   ========================================================================== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--c-slate);
}
.breadcrumb li { display: inline-flex; align-items: center; }
.breadcrumb li::after {
  content: "/";
  margin: 0 10px;
  color: var(--c-line);
}
.breadcrumb li:last-child::after { content: none; }
.breadcrumb a { color: var(--c-lake); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-cyan); }
.breadcrumb [aria-current="page"] { color: var(--c-slate); }

/* 图片容器（供页面阶段放置图片占位） */
.media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--c-panel);
}
.media > img,
.media > picture > img,
.media > svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.05) brightness(0.96);
}
.media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(11, 26, 51, 0) 42%, rgba(11, 26, 51, 0.52) 100%);
}
.media--plain::after { content: none; }
.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--3x2 { aspect-ratio: 3 / 2; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--banner { aspect-ratio: 21 / 9; }

.media__caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  z-index: 1;
  font-family: var(--font-hand);
  font-size: 14px;
  line-height: 1.6;
  color: rgba(245, 248, 249, 0.88);
}

/* 折叠数据表 */
.fold {
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
  padding: 14px 0;
}
.fold__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid var(--c-lake);
  border-radius: 0;
  background: transparent;
  color: var(--c-lake);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease),
    border-color 160ms var(--ease);
}
.fold__btn::after {
  content: "＋";
  font-size: 13px;
  line-height: 1;
}
.fold__btn[aria-expanded="true"]::after { content: "－"; }
.fold__btn:hover {
  background: var(--c-lake);
  border-color: var(--c-lake);
  color: var(--c-paper);
}
.fold__panel {
  padding-top: 18px;
}
.fold.is-open .fold__panel { animation: foldIn 260ms var(--ease) both; }

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

/* 入场显现 */
.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 520ms var(--ease), transform 520ms var(--ease);
}
.js-ready [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* 阅读进度胶囊（由 JS 注入） */
.progress-capsule {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 15px;
  border: 0;
  border-radius: 0;
  background: var(--c-flag);
  color: var(--c-night);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(11, 26, 51, 0.9);
  transition: background-color 160ms var(--ease);
}
.progress-capsule[data-visible] { display: inline-flex; }
.progress-capsule:hover { background: var(--c-whistle); }
.progress-capsule__arrow { font-size: 14px; line-height: 1; }

/* 工具类 */
.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;
}

/* ==========================================================================
   断点
   ========================================================================== */

/* 平板 / 小桌面 —— 抽屉保留 */
@media (min-width: 700px) {
  .site-footer__inner {
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 44px;
  }
  .foot-contact { grid-column: 1 / -1; }
}

/* 桌面 —— 侧边轨道 */
@media (min-width: 980px) {
  body { padding-left: var(--rail-w); }
  .masthead,
  .season-band,
  .site-footer__inner,
  .site-footer__base { max-width: var(--shell); }

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

  .site-nav {
    top: 0;
    right: auto;
    left: 0;
    width: var(--rail-w);
    padding: 34px 0 96px;
    justify-content: center;
    align-items: center;
    gap: 0;
    overflow: visible;
    transform: none;
    border-left: 0;
    border-right: 1px solid rgba(201, 212, 220, 0.18);
    background-color: var(--c-night);
    background-image:
      linear-gradient(rgba(201, 212, 220, 0.045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(201, 212, 220, 0.045) 1px, transparent 1px);
    background-size: 52px 52px;
  }

  .site-nav__list {
    gap: 10px;
    width: 100%;
    align-items: stretch;
  }

  .site-nav__link {
    padding: 10px 6px;
    font-size: 14px;
    letter-spacing: 0.04em;
    text-align: center;
    border-bottom: 0;
    color: rgba(245, 248, 249, 0.62);
  }
  .site-nav__link[aria-current="page"]::after {
    left: 0;
    height: 20px;
  }

  .rail-note {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 22px;
    margin: 0;
    padding: 0 10px;
    text-align: center;
    font-size: 10px;
    line-height: 1.65;
    letter-spacing: 0.02em;
  }

  .site-footer__inner {
    grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
    gap: 48px;
  }
  .foot-contact { grid-column: auto; }
}

/* 手机细节 */
@media (max-width: 640px) {
  .masthead { padding-top: 18px; gap: 14px; }
  .brand { font-size: 19px; }
  .brand__tagline { font-size: 10px; letter-spacing: 0.16em; }
  .btn { padding: 9px 14px; font-size: 13px; }
  .season-band__tick { font-size: 9px; letter-spacing: 0; }
  .progress-capsule { right: 12px; bottom: 12px; padding: 8px 12px; }
}

@media (max-width: 420px) {
  .masthead__actions { width: 100%; }
  .masthead__actions .btn { flex: 1 1 0; }
}

/* ==========================================================================
   无障碍：减少动态
   ========================================================================== */
@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;
  }

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

  .fold.is-open .fold__panel { animation: none; }
}
