/* =========================================================
   UC赛场 / site.css
   框架式导航 + 纵向叙事长卷 共享外壳
   ========================================================= */

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

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

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.85;
  padding-top: var(--bar);
  padding-left: var(--rail);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

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

/* ---------- tokens ---------- */
:root {
  --ink-900: #08090A;
  --ink-800: #0F1112;
  --ink-700: #191C1E;
  --line: #2E3335;
  --paper: #F3F5F4;
  --muted: #99A2A0;
  --signal: #2BFF8C;
  --alert: #FF4157;
  --amber: #FFC848;
  --cold: #4DA6FF;
  --violet: #8E7DFF;
  --mist: #C9D2CF;

  --rail: 96px;
  --bar: 52px;
  --gutter: 24px;
  --maxw: 1440px;

  --font-sans: "Inter Tight", "HarmonyOS Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --shadow-hair: 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ---------- 中文排版 ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-wrap: balance;
}

h1 { font-size: clamp(40px, 6vw, 96px); font-weight: 200; letter-spacing: -0.02em; }
h2 { font-size: clamp(28px, 3.4vw, 48px); }
h3 { font-size: clamp(20px, 2vw, 28px); font-weight: 400; line-height: 1.35; }

p { text-wrap: pretty; }

/* ---------- 通用布局 ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 40px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
}

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

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s var(--ease),
              color 0.15s var(--ease),
              border-color 0.15s var(--ease),
              box-shadow 0.15s var(--ease);
}

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

.btn--primary {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--ink-900);
}
.btn--primary:hover {
  background: #5CFFAC;
  border-color: #5CFFAC;
  color: var(--ink-900);
}

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

/* ---------- 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 28px 0 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.breadcrumb__item { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb__sep { color: var(--line); }
.breadcrumb a { transition: color 0.15s var(--ease); }
.breadcrumb a:hover { color: var(--signal); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.tag--green { color: var(--signal); border-color: rgba(43, 255, 140, 0.4); background: rgba(43, 255, 140, 0.08); }
.tag--amber { color: var(--amber); border-color: rgba(255, 200, 72, 0.4); background: rgba(255, 200, 72, 0.08); }
.tag--red   { color: var(--alert); border-color: rgba(255, 65, 87, 0.4); background: rgba(255, 65, 87, 0.08); }
.tag--blue  { color: var(--cold);  border-color: rgba(77, 166, 255, 0.4); background: rgba(77, 166, 255, 0.08); }

/* ---------- 栏目代号 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--violet);
  flex: 0 0 auto;
}

/* ---------- 正文排版 ---------- */
.prose {
  max-width: 38em;
  font-size: 17px;
  line-height: 1.85;
  color: var(--mist);
}
.prose > * + * { margin-top: 1.1em; }
.prose h2,
.prose h3 { color: var(--paper); margin-top: 2.2em; }
.prose a { color: var(--signal); border-bottom: 1px solid rgba(43, 255, 140, 0.35); }
.prose strong { color: var(--paper); font-weight: 700; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--cold);
  background: var(--ink-700);
  padding: 1px 5px;
  border-radius: 2px;
}

/* ---------- 图片容器 ---------- */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  margin: 0;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 2px;
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow-hair);
}
.media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(135deg, rgba(201, 210, 207, 0.06) 0 1px, transparent 1px 100%),
    linear-gradient(45deg, rgba(201, 210, 207, 0.04) 0 1px, transparent 1px 100%);
  background-size: 22px 22px, 22px 22px;
  background-position: 0 0, 11px 11px;
  pointer-events: none;
}
.media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--signal), transparent 65%);
  opacity: 0.5;
  z-index: 2;
  pointer-events: none;
}
.media__img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media__caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.media--wide { aspect-ratio: 21 / 9; }
.media--panorama { aspect-ratio: 3 / 1; }
.media--tall { aspect-ratio: 4 / 5; }
.media--square { aspect-ratio: 1 / 1; }

/* ---------- 手风琴 ---------- */
.accordion {
  border-top: 1px solid var(--line);
}
.accordion__item {
  border-bottom: 1px solid var(--line);
}
.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 20px 0;
  text-align: left;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--paper);
  transition: color 0.15s var(--ease);
}
.accordion__trigger:hover { color: var(--signal); }
.accordion__icon {
  position: relative;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
}
.accordion__icon::before,
.accordion__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--muted);
  transform: translate(-50%, -50%);
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease), background-color 0.2s var(--ease);
}
.accordion__icon::before { width: 8px; height: 1px; }
.accordion__icon::after { width: 1px; height: 8px; }
.accordion__trigger[aria-expanded="true"] .accordion__icon { border-color: var(--signal); }
.accordion__trigger[aria-expanded="true"] .accordion__icon::before,
.accordion__trigger[aria-expanded="true"] .accordion__icon::after { background: var(--signal); }
.accordion__trigger[aria-expanded="true"] .accordion__icon::after { opacity: 0; }
.accordion__panel {
  padding: 0 0 24px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--mist);
  max-width: 42em;
}
.accordion__panel:not([hidden]) {
  animation: accordion-in 0.2s ease-out;
}
@keyframes accordion-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 滚动显现 ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }

/* ---------- skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--signal);
  color: var(--ink-900);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  border-radius: 2px;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

/* ---------- 顶部刻度条 ---------- */
.frame-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px 0 0;
  background: var(--ink-900);
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
.frame-top::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(201, 210, 207, 0.22) 0 1px,
    transparent 1px 24px
  );
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  height: 100%;
  width: var(--rail);
  flex: 0 0 auto;
  padding: 0 14px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}
.brand__mark {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--signal);
  line-height: 1;
}
.brand__name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--paper);
}

.frame-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--signal);
  border: 1px solid rgba(43, 255, 140, 0.35);
  background: rgba(43, 255, 140, 0.06);
  padding: 5px 9px;
  border-radius: 2px;
  white-space: nowrap;
}

.frame-refresh {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
}
.frame-refresh__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px rgba(43, 255, 140, 0.14);
  animation: refresh-pulse 2.4s var(--ease) infinite;
}
@keyframes refresh-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- 移动导航按钮 ---------- */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 14px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--ink-800);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  line-height: 1;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.nav-toggle:hover { border-color: var(--signal); color: var(--signal); }

.nav-toggle__bars {
  position: relative;
  width: 16px;
  height: 10px;
  flex: 0 0 auto;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.2s var(--ease), top 0.2s var(--ease);
}
.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars::after { top: 8px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 4px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 4px; transform: rotate(-45deg); }

.nav-toggle__text { line-height: 1; }

/* ---------- 左侧索引条 ---------- */
.site-nav {
  position: absolute;
  top: var(--bar);
  left: 0;
  bottom: 0;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ink-900);
  border-right: 1px solid var(--line);
  padding: 8px 0 14px;
  z-index: 1;
}

.site-nav__list {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.site-nav__list::-webkit-scrollbar { width: 4px; }
.site-nav__list::-webkit-scrollbar-thumb { background: var(--line); }

.site-nav__item + .site-nav__item { border-top: 1px solid rgba(46, 51, 53, 0.55); }

.site-nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 13px 4px;
  border-left: 3px solid transparent;
  color: var(--muted);
  transition: color 0.18s var(--ease),
              border-color 0.18s var(--ease),
              background-color 0.18s var(--ease);
}
.site-nav__num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--muted);
  opacity: 0.55;
  transition: color 0.18s var(--ease), opacity 0.18s var(--ease);
}
.site-nav__label {
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-align: center;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--paper);
  border-left-color: var(--signal);
  background: rgba(43, 255, 140, 0.05);
}
.site-nav__link:hover .site-nav__num,
.site-nav__link:focus-visible .site-nav__num {
  color: var(--signal);
  opacity: 1;
}

.site-nav__link[aria-current="page"] {
  color: var(--paper);
  border-left-color: var(--violet);
  background: linear-gradient(180deg, rgba(142, 125, 255, 0.14), rgba(142, 125, 255, 0));
}
.site-nav__link[aria-current="page"] .site-nav__num {
  color: var(--violet);
  opacity: 1;
}

.site-nav__cta {
  display: block;
  margin: 12px 8px 0;
  padding: 10px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--ink-900);
  background: var(--signal);
  border-radius: 2px;
  transition: background-color 0.15s var(--ease);
}
.site-nav__cta:hover { background: #5CFFAC; }

/* ---------- 滚动进度 ---------- */
.progress-bar {
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 0;
  background: var(--signal);
  box-shadow: 0 0 8px rgba(43, 255, 140, 0.55);
  pointer-events: none;
  transition: height 0.08s linear;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  position: relative;
  margin-top: 120px;
  background: var(--ink-800);
  border-top: 1px solid var(--line);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 168px;
  height: 3px;
  background: var(--signal);
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 40px 48px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: start;
}

.footer-brand__name {
  font-size: 30px;
  font-weight: 200;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--paper);
}
.footer-brand__closing {
  margin-top: 14px;
  max-width: 22em;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.footer-col__title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 16px;
}
.footer-col__list li + li { margin-top: 10px; }
.footer-col__list a {
  display: inline-block;
  font-size: 14px;
  line-height: 1.6;
  color: var(--mist);
  transition: color 0.15s var(--ease);
}
.footer-col__list a:hover { color: var(--signal); }

.footer-meta {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 40px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.footer-meta__contact { color: var(--mist); }
.footer-meta__note { color: var(--muted); }
.footer-meta__legal { margin-left: auto; color: var(--muted); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
  .container { padding-inline: 32px; }
  .footer-inner { padding: 64px 32px 40px; gap: 40px; }
  .footer-meta { padding: 22px 32px 36px; }
}

@media (max-width: 900px) {
  :root { --bar: 56px; }

  body {
    padding-left: 0;
    padding-top: var(--bar);
  }

  .brand {
    width: auto;
    padding: 0 16px 0 16px;
  }

  .frame-top {
    gap: 12px;
    padding: 0 14px 0 0;
  }

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

  /* 导航变为顶部下拉面板 */
  .site-nav {
    position: fixed;
    top: var(--bar);
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    padding: 0 0 32px;
    border-right: 0;
    border-top: 1px solid var(--line);
    background: var(--ink-900);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s var(--ease),
                transform 0.2s var(--ease),
                visibility 0.2s var(--ease);
  }
  .site-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .site-nav__list {
    flex: 0 0 auto;
    overflow-y: auto;
    max-height: calc(100dvh - var(--bar) - 96px);
  }
  .site-nav__item + .site-nav__item { border-top: 1px solid var(--line); }

  .site-nav__link {
    flex-direction: row;
    justify-content: flex-start;
    align-items: baseline;
    gap: 16px;
    padding: 16px 22px;
    border-left: 3px solid transparent;
  }
  .site-nav__num { font-size: 11px; opacity: 0.7; }
  .site-nav__label { font-size: 16px; text-align: left; }

  .site-nav__cta {
    margin: 16px 22px 0;
    padding: 14px 10px;
    font-size: 13px;
    text-align: center;
  }

  .progress-bar { display: none; }

  .container { padding-inline: 20px; }
  .grid { gap: 16px; }

  .footer-inner {
    grid-template-columns: 1fr;
    padding: 48px 20px 32px;
    gap: 36px;
  }
  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 20px 32px;
    gap: 6px;
  }
  .footer-meta__legal { margin-left: 0; }

  .site-footer { margin-top: 72px; }

  .prose { font-size: 16px; }
}

@media (max-width: 560px) {
  .frame-chip { display: none; }
  .footer-nav { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .footer-brand__name { font-size: 24px; }
  .brand__name { font-size: 14px; }
  .breadcrumb { padding-top: 20px; }
}

/* =========================================================
   MOTION PREFERENCES
   ========================================================= */
@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 [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .frame-refresh__dot { animation: none; opacity: 1; }
  .accordion__panel:not([hidden]) { animation: none; }
  .progress-bar { transition: none; }
}
