/* =========================================================
   欢云赛事 · 共享站点样式 /assets/site.css
   侧轨编辑部骨架：天青蓝轨道 + 云白阅读区 + 硬边档案卡
   ========================================================= */

:root {
  /* 色彩系统 */
  --cloud: #F8F6EF;
  --cream: #EFE7D6;
  --sky: #0F6E8C;
  --sky-deep: #0A4C61;
  --space: #0B2E3A;
  --compete: #C43D2B;
  --energy: #F08A24;
  --neon: #C7F05A;
  --ink: #2B3135;
  --mist: #5F6B6E;
  --editor: #1B1815;

  /* 字体家族 */
  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;

  /* 版式尺度 */
  --fs-display: clamp(2.5rem, 8.5vw, 8.75rem);
  --fs-h1: clamp(2rem, 5vw, 4rem);
  --fs-h2: clamp(1.5rem, 3vw, 2.5rem);
  --fs-h3: clamp(1.125rem, 1.6vw, 1.5rem);

  /* 骨架尺寸 */
  --rail-w: 224px;
  --shell-max: 1180px;
  --gutter: 20px;

  /* 装饰 */
  --line: 2px solid var(--editor);
  --shadow-hard: 5px 5px 0 var(--editor);
  --shadow-soft: 5px 5px 0 rgba(27, 24, 21, .16);

  /* 动效 */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .28s;
}

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

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

body {
  margin: 0;
  padding-left: 0;
  min-height: 100vh;
  background: var(--cloud);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg,
video { max-width: 100%; }

img { height: auto; }

a { color: var(--sky); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--sky-deep); }

button { font: inherit; color: inherit; }

ul, ol { margin: 0; padding: 0; }
ul { list-style: none; }

[hidden] { display: none !important; }

/* ---------- 中文排版与标题 ---------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .65em;
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -.02em;
  color: var(--editor);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: 0; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

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

.mono,
code,
kbd {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.display {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-display);
  line-height: .9;
  letter-spacing: -.045em;
}

.serif { font-family: var(--font-serif); }

/* ---------- 焦点与可见性 ---------- */
:focus-visible {
  outline: 3px solid var(--compete);
  outline-offset: 2px;
}

.site-header :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--neon);
  outline-offset: 2px;
}

#main-content:focus { outline: none; }

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: -120px;
  left: 14px;
  z-index: 300;
  padding: 12px 22px;
  background: var(--editor);
  color: var(--cloud);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9375rem;
  text-decoration: none;
  border: 2px solid var(--neon);
  transition: top .2s var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 14px;
  color: var(--cloud);
  outline: 3px solid var(--neon);
  outline-offset: 3px;
}

/* =========================================================
   站点头部 / 侧轨
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--sky);
  background-image: linear-gradient(150deg, var(--sky) 0%, var(--sky-deep) 100%);
  color: var(--cloud);
  border-bottom: 3px solid var(--editor);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px var(--gutter);
}

/* 品牌 */
.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  color: var(--cloud);
  text-decoration: none;
  line-height: 1.1;
}

.brand:hover { color: #fff; }

.brand__mark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.375rem;
  letter-spacing: .02em;
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: .5625rem;
  letter-spacing: .16em;
  color: var(--neon);
  line-height: 1.4;
}

/* 汉堡按钮 */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 14px;
  background: var(--cream);
  color: var(--editor);
  border: 2px solid var(--editor);
  box-shadow: 3px 3px 0 var(--editor);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.nav-toggle:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--editor); }
.nav-toggle:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--editor); }

.nav-toggle__icon {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: background .2s var(--ease);
}

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

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

.nav-toggle[aria-expanded="true"] .nav-toggle__icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after { top: 0; transform: rotate(-45deg); }

.nav-toggle__text {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .14em;
}

/* 导航面板（移动端抽屉） */
.site-nav {
  display: none;
  padding: 4px var(--gutter) 20px;
  border-top: 2px solid rgba(248, 246, 239, .28);
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.site-nav[data-open] { display: block; }

.site-nav__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0 0;
}

.site-nav__item { display: block; }

.site-nav__link {
  display: flex;
  align-items: baseline;
  gap: 11px;
  padding: 10px 12px;
  color: rgba(248, 246, 239, .86);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9375rem;
  letter-spacing: .02em;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.site-nav__idx {
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--neon);
  min-width: 1.7em;
  font-variant-numeric: tabular-nums;
}

.site-nav__label { flex: 1 1 auto; }

.site-nav__link:hover,
.site-nav__link:focus-visible {
  background: rgba(11, 46, 58, .38);
  color: #fff;
  border-left-color: var(--energy);
  outline-offset: -3px;
}

.site-nav__link[aria-current="page"] {
  background: var(--cloud);
  color: var(--editor);
  border-left-color: var(--energy);
  box-shadow: 4px 4px 0 rgba(11, 46, 58, .55);
}

.site-nav__link[aria-current="page"] .site-nav__idx { color: var(--sky); }

.site-nav__foot {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 18px;
}

.site-nav__foot .btn {
  width: 100%;
  font-size: .875rem;
  padding: 11px 12px;
}

.site-nav__micro {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(248, 246, 239, .22);
  font-family: var(--font-mono);
  font-size: .625rem;
  letter-spacing: .08em;
  line-height: 1.8;
  color: rgba(248, 246, 239, .62);
}

/* =========================================================
   按钮
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--cream);
  color: var(--editor);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9375rem;
  letter-spacing: .01em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 2px solid var(--editor);
  box-shadow: 4px 4px 0 var(--editor);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--editor);
  color: var(--editor);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--editor);
}

.btn--primary { background: var(--energy); color: var(--editor); }
.btn--primary:hover { background: #FF9C34; color: var(--editor); }

.btn--sky { background: var(--sky); color: var(--cloud); }
.btn--sky:hover { background: var(--sky-deep); color: #fff; }

.btn--ghost {
  background: transparent;
  color: var(--cloud);
  border-color: rgba(248, 246, 239, .55);
  box-shadow: none;
}

.btn--ghost:hover {
  background: rgba(248, 246, 239, .14);
  border-color: var(--cloud);
  color: var(--cloud);
  transform: none;
  box-shadow: none;
}

.btn--block { width: 100%; }

/* =========================================================
   站点页脚
   ========================================================= */
.site-footer {
  position: relative;
  margin-top: 72px;
  background: var(--space);
  color: rgba(248, 246, 239, .82);
  border-top: 4px solid var(--editor);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  display: block;
  height: 8px;
  background: linear-gradient(90deg,
    var(--sky) 0 52%,
    var(--energy) 52% 74%,
    var(--neon) 74% 86%,
    var(--compete) 86% 100%);
}

.site-footer::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 280px;
  height: 280px;
  background: repeating-linear-gradient(135deg,
    rgba(199, 240, 90, .16) 0 8px,
    transparent 8px 20px);
  pointer-events: none;
}

.site-footer__inner {
  position: relative;
  z-index: 1;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 44px var(--gutter) 32px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
}

.site-footer__lead { max-width: 46ch; }

.site-footer__brand {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--cloud);
}

.site-footer__line {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .16em;
  color: var(--neon);
}

.site-footer__summary {
  margin: 0;
  max-width: 38ch;
  font-size: .9375rem;
  line-height: 1.8;
  color: rgba(248, 246, 239, .7);
}

.site-footer__cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.footer-block { min-width: 0; }

.footer-block__title {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: .6875rem;
  letter-spacing: .18em;
  color: var(--energy);
}

.footer-block__title::after {
  content: "";
  display: block;
  width: 26px;
  height: 2px;
  margin-top: 9px;
  background: var(--neon);
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-list__k {
  font-family: var(--font-mono);
  font-size: .5625rem;
  letter-spacing: .16em;
  color: rgba(248, 246, 239, .45);
}

.footer-list__v {
  font-size: .875rem;
  line-height: 1.65;
  color: var(--cloud);
  overflow-wrap: anywhere;
}

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

.footer-links a {
  display: inline-block;
  font-size: .875rem;
  color: rgba(248, 246, 239, .82);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

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

.site-footer__base {
  position: relative;
  z-index: 1;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 18px var(--gutter) 30px;
  border-top: 1px solid rgba(248, 246, 239, .16);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .06em;
  color: rgba(248, 246, 239, .55);
}

.site-footer__copy,
.site-footer__icp { margin: 0; }

/* =========================================================
   通用版式工具
   ========================================================= */
.container {
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: clamp(40px, 6vw, 80px) 0;
}

.section--cream { background: var(--cream); }
.section--space { background: var(--space); color: var(--cloud); }
.section--space h2,
.section--space h3 { color: var(--cloud); }

.rule {
  height: 2px;
  margin: 28px 0;
  background: var(--editor);
  border: 0;
}

.rule--thin {
  height: 1px;
  background: rgba(27, 24, 21, .28);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 18px 0 6px;
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .06em;
  color: var(--mist);
}

.breadcrumbs a {
  color: var(--sky);
  text-decoration: none;
}

.breadcrumbs a:hover { text-decoration: underline; }

.breadcrumbs__sep { color: var(--mist); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--sky);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--energy);
  flex: 0 0 auto;
}

/* =========================================================
   基础组件
   ========================================================= */
.card {
  position: relative;
  padding: 22px;
  background: var(--cream);
  border: var(--line);
  box-shadow: var(--shadow-hard);
}

.card--plain { box-shadow: none; }

.card__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.125rem;
  color: var(--editor);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: var(--cream);
  color: var(--editor);
  font-family: var(--font-mono);
  font-size: .625rem;
  letter-spacing: .1em;
  line-height: 1.6;
  white-space: nowrap;
  border: 1.5px solid var(--editor);
}

.tag--hot { background: var(--compete); color: #fff; border-color: var(--compete); }
.tag--data { background: var(--neon); color: var(--space); border-color: var(--space); }
.tag--sky { background: var(--sky); color: var(--cloud); border-color: var(--editor); }

/* 响应式图片容器（页面阶段放置 img 或留空占位） */
.figure {
  display: block;
  margin: 0;
  background: var(--cream);
  border: var(--line);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
}

.figure__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-image:
    linear-gradient(140deg, rgba(15, 110, 140, .24), rgba(239, 231, 214, .7)),
    repeating-linear-gradient(135deg, transparent 0 15px, rgba(27, 24, 21, .07) 15px 17px);
}

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

.figure__media--wide { aspect-ratio: 21 / 9; }
.figure__media--square { aspect-ratio: 1 / 1; }
.figure__media--tall { aspect-ratio: 3 / 4; }
.figure__media--portrait { aspect-ratio: 4 / 5; }

.figure__caption {
  padding: 12px 16px;
  background: var(--cloud);
  border-top: var(--line);
  font-family: var(--font-mono);
  font-size: .6875rem;
  line-height: 1.7;
  letter-spacing: .04em;
  color: var(--mist);
}

/* 可访问标签页 */
.tabs { display: block; }

.tabs__list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
  padding: 6px;
  background: var(--cream);
  border: 2px solid var(--editor);
  box-shadow: var(--shadow-hard);
}

.tabs__btn {
  padding: 9px 16px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .875rem;
  line-height: 1.3;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}

.tabs__btn:hover:not([aria-selected="true"]) { background: rgba(15, 110, 140, .13); }

.tabs__btn[aria-selected="true"] {
  background: var(--sky);
  color: var(--cloud);
  border-color: var(--editor);
}

.tabs__panel { animation: fadeIn .24s var(--ease) both; }

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

/* =========================================================
   动态注入元素
   ========================================================= */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sky), var(--energy) 62%, var(--neon));
  pointer-events: none;
  transition: width .1s linear;
}

.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 110;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  background: var(--energy);
  color: var(--editor);
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  border: 2px solid var(--editor);
  box-shadow: 3px 3px 0 var(--editor);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .24s var(--ease), transform .24s var(--ease), visibility .24s var(--ease);
}

.to-top.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover { background: #FF9C34; }

/* 显现动画：仅在 JS 可用时隐藏 */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

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

/* =========================================================
   响应式
   ========================================================= */
@media (min-width: 600px) {
  :root { --gutter: 28px; }

  .site-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  :root { --gutter: 32px; }

  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 48px;
    padding-top: 56px;
    padding-bottom: 40px;
  }

  .site-footer__lead { align-self: start; }

  .to-top { right: 24px; bottom: 24px; }
}

@media (min-width: 1024px) {
  body { padding-left: var(--rail-w); }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-w);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 3px solid var(--editor);
    border-bottom: 0;
  }

  .site-header__bar {
    display: block;
    flex: 0 0 auto;
    min-height: 0;
    padding: 30px 20px 20px;
    border-bottom: 1px solid rgba(248, 246, 239, .24);
  }

  .brand__mark { font-size: 1.875rem; }
  .brand__sub { font-size: .5625rem; letter-spacing: .13em; }

  .nav-toggle { display: none; }

  .site-nav {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    max-height: none;
    padding: 16px 10px 0;
    border-top: 0;
    overflow-y: auto;
  }

  .site-nav__link {
    font-size: .9375rem;
    padding: 10px 11px;
  }

  .site-nav__foot {
    margin-top: auto;
    padding: 22px 6px 24px;
  }

  .site-nav__foot .btn { font-size: .8125rem; padding: 10px 8px; }

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

@media (min-width: 1280px) {
  :root { --rail-w: 248px; }

  .site-header__bar { padding: 34px 24px 22px; }
  .brand__mark { font-size: 2rem; }
  .site-nav { padding: 18px 12px 0; }
  .site-nav__link { font-size: 1rem; }
  .to-top { right: 32px; bottom: 32px; }
}

/* =========================================================
   用户偏好：减少动态
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

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

  .read-progress { transition: none; }
}
