/* ============================================================
   YUN赛场 · /assets/site.css
   共享外壳：reset / 变量 / 中文排版 / 头部 / 页脚 / 基础组件
   ============================================================ */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { margin: 0; padding: 0; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; }
table { width: 100%; border-collapse: collapse; }
[hidden] { display: none !important; }

/* ---------- 2. 变量 ---------- */
:root {
  --ink-900: #06121F;
  --ink-700: #0D2338;
  --cyan: #35F0D0;
  --amber: #FF7A2F;
  --mist: #E8EEF2;
  --stone: #8A93A0;
  --moss: #5C7A5A;
  --clay: #B4653F;
  --line: #1E3A52;

  --font-display: 'Source Han Sans SC Heavy', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Source Han Sans SC', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shell: 1280px;
  --gutter: clamp(16px, 3vw, 40px);
  --header-h: 72px;

  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --reveal-shift: 16px;
}

/* ---------- 3. 基底与夜色氛围 ---------- */
body {
  background-color: var(--ink-900);
  color: var(--mist);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(30, 58, 82, 0.34) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 58, 82, 0.34) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.55;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(120% 80% at 78% -10%, rgba(53, 240, 208, 0.10), transparent 60%),
    radial-gradient(90% 70% at 10% 6%, rgba(255, 122, 47, 0.07), transparent 58%);
}

main, .site-footer, .site-header { position: relative; z-index: 1; }
.site-header { z-index: 60; }

/* ---------- 4. 排版 ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--mist);
}
h1 { font-size: clamp(40px, 5.4vw, 72px); line-height: 1.05; }
h2 { font-size: clamp(28px, 3.2vw, 44px); line-height: 1.15; }
h3 { font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; }
h4 { font-size: 18px; line-height: 1.35; letter-spacing: 0; }
p { max-width: 68ch; }
strong { font-weight: 800; color: var(--mist); }

.display {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(64px, 11vw, 168px);
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.lede { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.7; color: var(--mist); max-width: 60ch; }
.muted { color: var(--stone); }
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.index-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
}

a.text-link { color: var(--cyan); text-decoration: none; border-bottom: 1px solid rgba(53, 240, 208, 0.35); }
a.text-link:hover { border-bottom-color: var(--cyan); }

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

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

/* ---------- 5. 布局骨架 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell--narrow { max-width: 720px; }

.section { position: relative; z-index: 1; padding-block: clamp(48px, 7vw, 104px); }
.section--tight { padding-block: clamp(32px, 4vw, 56px); }

.divider { height: 1px; background: var(--line); border: 0; }
.rule-cyan { width: 56px; height: 2px; background: var(--cyan); border: 0; }

.split { display: grid; grid-template-columns: 62fr 38fr; gap: clamp(20px, 3vw, 48px); align-items: start; }
.split--70 { grid-template-columns: 70fr 30fr; }

.grid { display: grid; gap: clamp(20px, 2.4vw, 36px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 6. 容器与装饰 ---------- */
.panel {
  position: relative;
  background: var(--ink-700);
  border: 1px solid var(--line);
  padding: clamp(20px, 2.4vw, 32px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.panel--flush { background: transparent; }

.ghost-index {
  position: absolute;
  top: -0.12em;
  right: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(120px, 22vw, 320px);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px var(--line);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* ---------- 7. 媒体容器（页面阶段放图片） ---------- */
.media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ink-700);
  border: 1px solid var(--line);
}
.media--wide { aspect-ratio: 21 / 9; }
.media--square { aspect-ratio: 1 / 1; }
.media--portrait { aspect-ratio: 3 / 4; }
.media > img,
.media > video,
.media > svg { width: 100%; height: 100%; object-fit: cover; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: clamp(10px, 1.4vw, 18px); }
.media-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
}

/* ---------- 8. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.24s var(--ease), color 0.24s var(--ease), border-color 0.24s var(--ease), transform 0.24s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--ink-900); }
.btn-primary:hover { background: var(--cyan); border-color: var(--cyan); color: var(--ink-900); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--mist); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---------- 9. 标签与筛选 ---------- */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--stone);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tag:hover { color: var(--mist); border-color: var(--stone); }
.tag[aria-pressed="true"],
.tag.is-active { color: var(--cyan); border-color: var(--cyan); }

/* ---------- 10. 面包屑 ---------- */
.breadcrumb { padding-block: 20px 0; }
.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
}
.breadcrumb-item { display: inline-flex; align-items: baseline; gap: 8px; }
.breadcrumb-item::after { content: "/"; color: var(--stone); opacity: 0.5; }
.breadcrumb-item:last-child::after { content: ""; }
.breadcrumb-link { color: var(--stone); text-decoration: none; }
.breadcrumb-link:hover { color: var(--cyan); }
.breadcrumb-current { color: var(--mist); }

/* ---------- 11. 显现协议 ---------- */
[data-reveal] {
  transition: opacity 0.42s var(--ease), transform 0.42s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-hidden { opacity: 0; transform: translateY(var(--reveal-shift)); }

/* ---------- 12. 跳转与焦点 ---------- */
.skip-link {
  position: absolute;
  left: 8px;
  top: -72px;
  z-index: 90;
  padding: 10px 16px;
  background: var(--cyan);
  color: var(--ink-900);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 2px; }
#main-content { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ============================================================
   13. 头部
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(6, 18, 31, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-shell {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 48px);
  width: 100%;
  max-width: var(--shell);
  min-height: var(--header-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  flex: 0 0 auto;
  min-width: 0;
}

.brand-mark { display: inline-flex; flex-direction: column; gap: 3px; text-decoration: none; }
.brand-cn {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--mist);
  transition: color 0.24s var(--ease);
}
.brand-en {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone);
}
.brand-mark:hover .brand-cn { color: var(--cyan); }

.channel-status {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 22px);
  padding-left: clamp(12px, 1.6vw, 24px);
  border-left: 1px solid var(--line);
}
.channel {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 7px;
  align-items: center;
}
.channel-dot {
  grid-row: 1 / 3;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(53, 240, 208, 0.14);
  animation: yun-pulse 2.4s ease-in-out infinite;
}
.channel[data-channel="china"] .channel-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 122, 47, 0.16);
  animation-delay: 1.2s;
}
.channel-text { font-size: 12px; line-height: 1.25; color: var(--mist); white-space: nowrap; }
.channel-en {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.25;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  white-space: nowrap;
}

@keyframes yun-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.78); }
}

.header-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 24px);
  margin-left: auto;
}
.nav-list { display: flex; align-items: center; gap: clamp(2px, 0.6vw, 10px); }
.nav-item { display: flex; }

.nav-link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  border-radius: 2px;
  text-decoration: none;
  color: var(--mist);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 1px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s var(--ease);
}
.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

.nav-index {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.16em;
  color: var(--stone);
  transition: color 0.24s var(--ease);
}
.nav-label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  transition: color 0.24s var(--ease);
}
.nav-link:hover .nav-index,
.nav-link[aria-current="page"] .nav-index { color: var(--cyan); }
.nav-link:hover .nav-label { color: var(--mist); }
.nav-link[aria-current="page"] .nav-label { color: var(--cyan); }

.header-cta { white-space: nowrap; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: border-color 0.24s var(--ease), color 0.24s var(--ease);
}
.nav-toggle:hover { border-color: var(--cyan); color: var(--cyan); }
.nav-toggle-bars { display: inline-flex; flex-direction: column; justify-content: center; gap: 4px; width: 16px; }
.nav-toggle-bar { display: block; height: 1px; width: 100%; background: currentColor; transition: transform 0.24s var(--ease); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(2.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { transform: translateY(-2.5px) rotate(-45deg); }
.nav-toggle-text { line-height: 1; }

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
}
.scroll-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.12s linear;
}

/* ============================================================
   14. 页脚
   ============================================================ */
.site-footer {
  margin-top: clamp(56px, 8vw, 120px);
  background: var(--ink-900);
  border-top: 1px solid var(--line);
}
.footer-shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(40px, 5vw, 72px) var(--gutter) 24px;
}
.footer-top {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(150px, 1fr));
  gap: clamp(24px, 3vw, 56px);
}

.footer-brand-cn {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--mist);
}
.footer-brand-en {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
}
.footer-note {
  margin-top: 18px;
  max-width: 36ch;
  font-size: 14px;
  line-height: 1.7;
  color: var(--stone);
}

.footer-col-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mist);
}
.footer-col-index { color: var(--cyan); }
.footer-list { display: grid; gap: 10px; margin-top: 16px; }

.footer-link {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--mist);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.footer-link:hover { color: var(--cyan); }
.footer-link-index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--stone);
}
.footer-link:hover .footer-link-index { color: var(--cyan); }

.footer-contact-item { display: grid; gap: 3px; }
.footer-contact-key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
}
.footer-contact-val {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--mist);
  word-break: break-all;
}
.footer-contact-val.is-text { font-family: var(--font-body); font-size: 14px; word-break: normal; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 28px;
  margin-top: clamp(32px, 4vw, 56px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.footer-record {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--stone);
}
.footer-record::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--moss);
}
.footer-legal {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--stone);
}

/* ============================================================
   15. 响应式
   ============================================================ */
@media (max-width: 1100px) {
  :root { --header-h: 64px; }

  .nav-toggle { display: inline-flex; }

  .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 8px var(--gutter) 28px;
    background: rgba(6, 18, 31, 0.98);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  }
  .site-header[data-open] .header-nav { display: flex; }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-item { display: block; }
  .nav-link {
    flex-direction: row;
    align-items: baseline;
    gap: 14px;
    padding: 15px 4px;
    border-bottom: 1px solid var(--line);
  }
  .nav-link::after { display: none; }
  .nav-link[aria-current="page"] .nav-label { color: var(--cyan); }
  .nav-index { font-size: 11px; }
  .nav-label { font-size: 16px; }

  .header-cta { width: 100%; margin-top: 20px; padding: 14px 20px; }

  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }

  .split, .split--70 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  body::before { background-size: 56px 56px; }
}

@media (max-width: 720px) {
  .channel-en { display: none; }
  .channel-status { gap: 12px; padding-left: 12px; }
  .ghost-index { font-size: clamp(96px, 34vw, 180px); }
}

@media (max-width: 560px) {
  .brand-cn { font-size: 19px; }
  .channel-text {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .channel { grid-template-rows: auto; }
  .channel-dot { grid-row: auto; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   16. 降级：减少动效
   ============================================================ */
@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;
    transition-delay: 0ms !important;
  }
  .channel-dot { animation: none; }
  [data-reveal].is-hidden { opacity: 1; transform: none; }
  .btn:hover { transform: none; }
}
