/* =========================================================
   优乐赛场 · 共享站点样式 /assets/site.css
   分段：Reset / 变量 / 基础排版 / 通用组件 / 头部 / 页脚 / 响应式
   ========================================================= */

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

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

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, li, dl, dt, dd,
figure, blockquote {
  margin: 0;
  padding: 0;
}

ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; }
img, svg, video { display: block; max-width: 100%; }
table { border-collapse: collapse; }

/* ---------- 2. 变量 ---------- */
:root {
  --ink-950: #071626;
  --ink-800: #0F2739;
  --slate-000: #F5F7F8;
  --line-200: #C7D1D9;
  --orange-500: #FF6A1A;
  --orange-200: #FFC49B;
  --cyan-400: #14D2C8;
  --cyan-900: #0A4F55;
  --lemon-300: #FFE15C;
  --mint-400: #56D89B;
  --violet-600: #5B4BE0;

  --text-hi: #EEF4F7;
  --text-md: #A3B8C4;
  --text-lo: #6E8695;

  --hairline: rgba(199, 209, 217, 0.14);
  --hairline-soft: rgba(199, 209, 217, 0.08);

  --rail-w: 96px;
  --bar-h: 96px;
  --cell: 24px;
  --maxw: 1360px;
  --pad: clamp(20px, 4vw, 56px);

  --f-sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --f-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  --ease: 120ms linear;
}

/* ---------- 3. 基础排版 ---------- */
body {
  min-height: 100vh;
  padding-left: var(--rail-w);
  padding-top: var(--bar-h);
  background: transparent;
  color: var(--text-hi);
  font-family: var(--f-sans);
  font-size: 17px;
  font-weight: 450;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 精密网格底纹 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(199, 209, 217, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(199, 209, 217, 0.055) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-hi);
}

h1 { font-size: clamp(32px, 4.6vw, 72px); }
h2 { font-size: clamp(24px, 3vw, 48px); }
h3 { font-size: 22px; line-height: 1.25; }
h4 { font-size: 17px; letter-spacing: -0.01em; line-height: 1.4; }

p { max-width: 62ch; }

strong { font-weight: 700; color: var(--text-hi); }

hr {
  height: 1px;
  border: 0;
  background: var(--hairline);
}

::selection {
  background: var(--orange-500);
  color: var(--ink-950);
}

[id] { scroll-margin-top: calc(var(--bar-h) + 16px); }

/* ---------- 4. 通用工具类 ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

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

.col-main { grid-column: 1 / span 8; }
.col-aside { grid-column: 10 / span 3; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  border: 1px solid var(--cyan-400);
  color: var(--cyan-400);
  background: transparent;
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease), border-color var(--ease);
}

.btn:hover {
  background: var(--cyan-400);
  border-color: var(--cyan-400);
  color: var(--ink-950);
}

.btn--primary {
  background: var(--orange-500);
  border-color: var(--orange-500);
  color: var(--ink-950);
}

.btn--primary:hover {
  background: var(--orange-200);
  border-color: var(--orange-200);
  color: var(--ink-950);
}

.btn--ghost {
  border-color: rgba(199, 209, 217, 0.35);
  color: var(--text-hi);
}

.btn--ghost:hover {
  background: rgba(199, 209, 217, 0.08);
  border-color: var(--text-hi);
  color: var(--text-hi);
}

/* 面包屑 */
.breadcrumb {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
}

.breadcrumb__item {
  color: var(--text-lo);
}

.breadcrumb__item:not(:first-child)::before {
  content: "/";
  margin-right: 8px;
  color: rgba(199, 209, 217, 0.28);
}

.breadcrumb__item a {
  color: var(--cyan-400);
  border-bottom: 1px solid transparent;
  transition: color var(--ease), border-color var(--ease);
}

.breadcrumb__item a:hover {
  color: var(--orange-500);
  border-bottom-color: var(--orange-500);
}

/* 图片容器基类（页面阶段放入 img / svg / 占位） */
.media-frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--ink-800);
  border: 1px solid var(--hairline);
}

.media-frame > img,
.media-frame > svg,
.media-frame > picture {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame__ph {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 16px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-lo);
  text-align: center;
  background-image:
    linear-gradient(to right, rgba(199, 209, 217, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(199, 209, 217, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}

.media-frame--wide > .media-frame__ph { aspect-ratio: 21 / 9; }
.media-frame--tall > .media-frame__ph { aspect-ratio: 3 / 4; }
.media-frame--square > .media-frame__ph { aspect-ratio: 1 / 1; }

/* ---------- 5. 头部 ---------- */
.site-header {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  grid-template-rows: var(--bar-h) minmax(0, 1fr);
  pointer-events: none;
}

.site-header a,
.site-header button,
.site-header nav { pointer-events: auto; }

/* 跳转链接 */
.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  padding: 12px 20px;
  background: var(--orange-500);
  color: var(--ink-950);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-130%);
  transition: transform var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

/* 左侧品牌轨道 */
.brand-rail {
  grid-column: 1;
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  overflow: hidden;
  background: var(--ink-950);
  border-right: 1px solid var(--hairline);
}

.brand-rail__mark {
  display: grid;
  place-items: center;
  width: var(--rail-w);
  height: var(--bar-h);
  flex: none;
}

.brand-rail__glyph {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  background: var(--orange-500);
  color: var(--ink-950);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  transition: background-color var(--ease), color var(--ease);
}

.brand-rail__mark:hover .brand-rail__glyph,
.brand-rail__mark:focus-visible .brand-rail__glyph {
  background: var(--cyan-400);
  color: var(--ink-950);
}

.brand-rail__spine {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--text-lo);
  white-space: nowrap;
}

/* 顶部导航条 */
.header-bar {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding-right: var(--pad);
  background: var(--ink-950);
  border-bottom: 1px solid var(--hairline);
}

.header-nav {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.header-nav::-webkit-scrollbar { display: none; }

.header-nav__list {
  display: flex;
  align-items: stretch;
  height: 100%;
  min-width: max-content;
}

.header-nav__item { display: flex; }

.header-nav__link {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 clamp(12px, 1.5vw, 22px);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: var(--text-md);
  border-right: 1px solid var(--hairline-soft);
  border-bottom: 2px solid transparent;
  transition: color var(--ease), background-color var(--ease), border-color var(--ease);
}

.header-nav__link:hover {
  color: var(--cyan-400);
  background: rgba(20, 210, 200, 0.07);
  border-bottom-color: var(--cyan-400);
}

.header-nav__link[aria-current="page"] {
  background: var(--orange-500);
  color: var(--ink-950);
  border-bottom-color: var(--orange-500);
}

.header-nav__idx {
  font-size: 11px;
  line-height: 1;
  color: var(--lemon-300);
}

.header-nav__link[aria-current="page"] .header-nav__idx {
  color: rgba(7, 22, 38, 0.55);
}

/* 次级入口 */
.header-utils {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.util-link {
  display: inline-flex;
  align-items: center;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: var(--cyan-400);
  border: 1px solid rgba(20, 210, 200, 0.4);
  transition: color var(--ease), background-color var(--ease), border-color var(--ease);
}

.util-link:hover {
  background: var(--cyan-400);
  border-color: var(--cyan-400);
  color: var(--ink-950);
}

.util-link--solid {
  background: var(--orange-500);
  border-color: var(--orange-500);
  color: var(--ink-950);
}

.util-link--solid:hover {
  background: var(--orange-200);
  border-color: var(--orange-200);
  color: var(--ink-950);
}

/* 移动菜单按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-hi);
  border-left: 1px solid var(--hairline);
  cursor: pointer;
  transition: color var(--ease), background-color var(--ease);
}

.nav-toggle:hover { color: var(--orange-500); }

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: var(--orange-500);
  transition: background-color var(--ease);
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--orange-500);
  transition: transform var(--ease);
}

.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

.site-header[data-open] .nav-toggle__bars { background: transparent; }
.site-header[data-open] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.site-header[data-open] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

.nav-toggle__text { letter-spacing: 0.04em; }

/* 阅读进度条 */
.scroll-progress {
  position: fixed;
  top: var(--bar-h);
  left: var(--rail-w);
  right: 0;
  z-index: 70;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--orange-500), var(--cyan-400));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- 6. 页脚 ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: clamp(64px, 8vw, 128px);
  padding: clamp(40px, 5vw, 72px) var(--pad) 0;
  background: var(--ink-950);
  border-top: 1px solid var(--hairline);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(200px, 1.1fr) minmax(0, 2fr) minmax(240px, 1.3fr);
  gap: clamp(24px, 3vw, 56px);
  max-width: var(--maxw);
  margin-inline: auto;
  padding-bottom: clamp(32px, 4vw, 56px);
}

.footer-brand__mark {
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-hi);
}

.footer-brand__tag {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--cyan-400);
}

.footer-brand__mark:hover .footer-brand__tag { color: var(--orange-500); }

.footer-brand__note {
  max-width: 36ch;
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-lo);
}

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

.footer-col__title {
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.14em;
  color: var(--lemon-300);
}

.footer-col__list li + li { margin-top: 10px; }

.footer-col__list a {
  display: inline-block;
  font-size: 15px;
  color: var(--text-md);
  border-bottom: 1px solid transparent;
  transition: color var(--ease), border-color var(--ease);
}

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

.footer-contact {
  align-self: start;
  padding: 18px 20px;
  background: var(--ink-800);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--orange-500);
}

.footer-contact__item {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-md);
}

.footer-contact__item + .footer-contact__item { margin-top: 10px; }

.footer-contact__label {
  display: inline-block;
  min-width: 70px;
  margin-right: 8px;
  font-size: 12px;
  color: var(--cyan-400);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 20px 0 28px;
  border-top: 1px solid var(--hairline-soft);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-lo);
}

.footer-icp { color: var(--text-lo); }
.footer-meta { color: var(--text-lo); }

/* ---------- 7. 响应式 ---------- */
@media (max-width: 1180px) {
  .footer-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  }
  .footer-contact { grid-column: 1 / -1; }
}

@media (max-width: 1100px) {
  .col-main { grid-column: 1 / -1; }
  .col-aside { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  :root {
    --rail-w: 56px;
    --bar-h: 64px;
    --pad: 20px;
  }

  body { font-size: 16px; }

  .brand-rail { padding-bottom: 16px; }

  .brand-rail__glyph {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }

  .brand-rail__spine {
    font-size: 10px;
    letter-spacing: 0.18em;
  }

  .header-utils { display: none; }
  .nav-toggle { display: flex; }

  .header-nav {
    position: fixed;
    top: var(--bar-h);
    left: var(--rail-w);
    right: 0;
    bottom: 0;
    flex: none;
    padding-bottom: 32px;
    background: var(--ink-800);
    border-left: 1px solid var(--hairline);
    border-top: 1px solid var(--hairline);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--ease), opacity var(--ease), visibility var(--ease);
  }

  .site-header[data-open] .header-nav {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  .header-nav__list {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    min-width: 0;
  }

  .header-nav__item { width: 100%; }

  .header-nav__link {
    width: 100%;
    height: auto;
    padding: 18px 20px;
    font-size: 17px;
    border-right: 0;
    border-bottom: 1px solid var(--hairline-soft);
  }

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

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

@media (max-width: 640px) {
  .grid-12 { gap: 16px; }

  .footer-cols { grid-template-columns: minmax(0, 1fr); gap: 28px; }

  .footer-bottom { font-size: 11px; }

  .btn { width: 100%; justify-content: center; }

  .footer-contact__label { min-width: 62px; }
}

/* ---------- 8. 焦点与动效偏好 ---------- */
:focus-visible {
  outline: 2px solid var(--cyan-400);
  outline-offset: 2px;
}

.site-header :focus-visible,
.site-footer :focus-visible {
  outline: 2px solid var(--lemon-300);
  outline-offset: -2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
  }

  .skip-link { transition: none; }
}
