/* ==========================================================================
   长城赛事 · 共享样式 / assets/site.css
   砌筑结构：暖白纸底 + 长城灰砌缝 + 烽火橙点火
   ========================================================================== */

:root {
  --ink: #16150F;
  --stone-deep: #45443D;
  --stone-mid: #8B897E;
  --stone-light: #D7D3C7;
  --paper: #F4F1E9;
  --paper-bright: #FFFFFF;
  --flame: #D9481F;
  --flame-dark: #B63A16;
  --flame-light: #F0A184;
  --pine: #1E3D33;
  --sand: #C39A2B;

  --shell: 1280px;
  --gutter: clamp(18px, 4vw, 56px);

  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --step: 160ms;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: .01em;
}

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

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

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

a { color: inherit; text-decoration: none; }

button { font: inherit; }

hr {
  border: 0;
  border-top: 1px solid var(--stone-light);
  margin: clamp(24px, 4vw, 48px) 0;
}

/* ---------- 焦点与无障碍 ---------- */
:focus-visible {
  outline: 2px solid var(--flame);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 0;
  left: var(--gutter);
  z-index: 400;
  padding: 12px 20px;
  background: var(--flame);
  color: var(--paper-bright);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  transform: translateY(-140%);
  transition: transform var(--step) var(--ease);
}
.skip-link:focus { transform: translateY(0); }

#main-content { display: block; scroll-margin-top: 24px; }
#main-content:focus-visible { outline: 2px solid var(--flame); outline-offset: 8px; }

/* ---------- 容器与栅格 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid {
  display: grid;
  gap: clamp(20px, 3vw, 40px);
}
.grid--split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.grid--tilt  { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }

.measure { max-width: 36em; }

.prose { max-width: 38em; }
.prose p { font-size: 17px; line-height: 1.78; }
.prose a,
.link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--flame);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--step) var(--ease);
}
.prose a:hover,
.link:hover { color: var(--flame); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .05em;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color var(--step) var(--ease),
    color var(--step) var(--ease),
    border-color var(--step) var(--ease),
    transform var(--step) var(--ease);
}

.btn--flame {
  background: var(--flame);
  color: var(--paper-bright);
  border-color: var(--flame);
}
.btn--flame:hover {
  background: var(--flame-dark);
  border-color: var(--flame-dark);
  transform: translateY(-2px);
}
.btn--flame:focus-visible {
  outline: 2px solid var(--flame);
  outline-offset: 3px;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--stone-mid);
}
.btn--ghost:hover {
  background: rgba(217, 72, 31, .07);
  border-color: var(--flame);
  color: var(--flame);
  transform: translateY(-2px);
}
.btn--ghost:focus-visible {
  outline: 2px solid var(--flame);
  outline-offset: 3px;
}

/* ---------- 索引小标 / 标签纸 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--stone-deep);
  text-transform: uppercase;
}
.eyebrow__num {
  color: var(--flame);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tag {
  display: inline-block;
  padding: 3px 9px;
  background: var(--sand);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.5;
  white-space: nowrap;
}
.tag--flame { background: var(--flame); color: var(--paper-bright); }
.tag--paper {
  background: var(--paper-bright);
  color: var(--stone-deep);
  border: 1px solid var(--stone-light);
}

/* ---------- 图片容器 ---------- */
.figure {
  position: relative;
  display: block;
  margin: 0;
  overflow: hidden;
  background: var(--stone-light);
  border: 1px solid var(--stone-mid);
  aspect-ratio: 4 / 3;
}
.figure--wide { aspect-ratio: 16 / 9; }
.figure--tall { aspect-ratio: 3 / 4; }
.figure--band { aspect-ratio: 21 / 9; }

.figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.08) saturate(.74);
}

.figure::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 14px;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(244, 241, 233, .88) 0 18px,
    rgba(244, 241, 233, 0) 18px 34px
  );
}

.figure__caption {
  margin: 10px 0 0;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--stone-deep);
}

/* ---------- 面包屑 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--stone-deep);
}
.crumbs__item { display: inline-flex; align-items: center; gap: 8px; }
.crumbs a {
  border-bottom: 1px solid transparent;
  transition: color var(--step) var(--ease), border-color var(--step) var(--ease);
}
.crumbs a:hover { color: var(--flame); border-bottom-color: var(--flame); }
.crumbs__sep { color: var(--stone-mid); }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 700; }

/* ==========================================================================
   页头
   ========================================================================== */
.site-header {
  position: relative;
  background: var(--paper);
  border-bottom: 1px solid var(--stone-mid);
}

.scroll-meter {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  width: 0;
  height: 3px;
  background: var(--flame);
  pointer-events: none;
  transition: width 120ms linear;
}

/* 上层说明带 */
.header-utility { background: var(--paper); }

.header-utility__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px clamp(16px, 3vw, 40px);
  padding-block: 14px;
}

.header-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  min-width: 0;
}

.header-brand__mark {
  position: relative;
  display: inline-block;
  padding-left: 16px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .12em;
  color: var(--ink);
  line-height: 1.3;
  transition: color var(--step) var(--ease);
}
.header-brand__mark::before {
  content: "";
  position: absolute;
  left: 0;
  top: .52em;
  width: 8px;
  height: 8px;
  background: var(--flame);
}
.header-brand__mark:hover { color: var(--flame); }

.header-brand__descriptor {
  margin: 0;
  font-size: 13px;
  letter-spacing: .03em;
  color: var(--stone-deep);
}

.utility-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--stone-deep);
}
.utility-strip__item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.utility-strip__item + .utility-strip__item::before {
  content: "";
  width: 1px;
  height: 11px;
  background: var(--stone-mid);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

/* 下层砖墙导航 */
.header-nav {
  padding-block: 8px;
  background: var(--stone-light);
  border-top: 1px solid var(--stone-mid);
}

.header-nav__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 clamp(12px, 2vw, 28px);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  background: var(--paper-bright);
  border: 1px solid var(--stone-mid);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
  transition: border-color var(--step) var(--ease), color var(--step) var(--ease);
}
.nav-toggle:hover { border-color: var(--flame); color: var(--flame); }

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

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: background-color var(--step) var(--ease);
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: transform var(--step) var(--ease);
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after  { top: 6px; }

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

.primary-nav { flex: 1 1 auto; min-width: 0; }

.crenel-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.crenel-list__item { margin: 0; }

.crenel-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 clamp(14px, 1.8vw, 22px);
  background: var(--paper);
  color: var(--stone-deep);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.2;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 10px) 0, calc(100% - 10px) 7px, 100% 7px, 100% 100%, 0 100%);
  transition:
    background-color var(--step) var(--ease),
    color var(--step) var(--ease),
    transform var(--step) var(--ease);
}

.crenel-link::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--flame);
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: transform var(--step) var(--ease);
}

.crenel-link:hover {
  background: var(--paper-bright);
  color: var(--ink);
  transform: translateY(-2px);
}
.crenel-link:hover::before { transform: scaleY(1); }

.crenel-link:focus-visible {
  outline: 2px solid var(--flame);
  outline-offset: -4px;
}

.crenel-link[aria-current="page"] {
  background: var(--flame);
  color: var(--paper-bright);
}
.crenel-link[aria-current="page"]::before {
  background: var(--paper-bright);
  transform: scaleY(1);
}
.crenel-link[aria-current="page"]:hover { color: var(--paper-bright); }

.nav-index {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--stone-deep);
}
.nav-index__key { text-transform: uppercase; }
.nav-index__val {
  color: var(--flame);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 6vw, 96px);
  background: var(--pine);
  color: var(--paper);
}

.site-footer::before {
  content: "";
  display: block;
  height: 12px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--paper) 0 26px,
    rgba(244, 241, 233, 0) 26px 46px
  );
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(32px, 5vw, 80px);
  padding-top: clamp(40px, 5vw, 72px);
  padding-bottom: clamp(32px, 4vw, 56px);
}

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

.footer-eyebrow {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--flame-light);
}

.footer-brand {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1.1;
  color: var(--paper-bright);
}

.footer-lede {
  margin: 16px 0 24px;
  max-width: 24em;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(244, 241, 233, .78);
}

.footer-cta { margin-top: 4px; }

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  min-width: 0;
}

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

.footer-col__title {
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(244, 241, 233, .16);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .16em;
  color: rgba(244, 241, 233, .58);
}

.footer-col__list {
  display: grid;
  gap: 10px;
}

.footer-col__list a {
  display: inline-block;
  font-size: 14px;
  letter-spacing: .03em;
  color: var(--paper);
  border-bottom: 1px solid transparent;
  transition: color var(--step) var(--ease), border-color var(--step) var(--ease);
}
.footer-col__list a:hover {
  color: var(--flame-light);
  border-bottom-color: var(--flame-light);
}
.footer-col__list a:focus-visible {
  outline: 2px solid var(--flame-light);
  outline-offset: 3px;
}

.footer-meta {
  padding-top: clamp(24px, 3vw, 36px);
  padding-bottom: clamp(24px, 3vw, 36px);
  border-top: 1px solid rgba(244, 241, 233, .16);
}

.footer-contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px clamp(24px, 3vw, 40px);
}

.footer-contact__line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
}

.footer-contact__k {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--flame-light);
  white-space: nowrap;
}

.footer-contact__v {
  flex: 1 1 auto;
  min-width: 0;
  color: rgba(244, 241, 233, .84);
  word-break: break-word;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 28px;
  padding-top: clamp(16px, 2vw, 24px);
  padding-bottom: clamp(28px, 4vw, 44px);
  border-top: 1px solid rgba(244, 241, 233, .16);
  font-size: 12px;
  letter-spacing: .1em;
  color: rgba(244, 241, 233, .6);
}
.footer-legal__icp,
.footer-legal__copy { margin: 0; }

.footer-legal [data-year] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: rgba(244, 241, 233, .88);
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1080px) {
  .utility-strip { display: none; }
}

@media (max-width: 900px) {
  .header-brand__descriptor { display: none; }
  .footer-main { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .header-utility__inner { padding-block: 12px; }
  .header-actions .btn { min-height: 38px; padding: 8px 14px; font-size: 13px; }

  .header-nav { padding-block: 10px; }
  .header-nav__inner {
    justify-content: space-between;
    gap: 10px 12px;
  }

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

  .primary-nav {
    display: none;
    flex: 1 0 100%;
    width: 100%;
    order: 3;
    margin-top: 10px;
  }
  .primary-nav[data-open] { display: block; }

  .crenel-list { display: block; }

  .crenel-link {
    display: flex;
    width: 100%;
    min-height: 52px;
    padding-inline: 18px;
    clip-path: none;
    background: var(--paper-bright);
    border-bottom: 1px solid var(--stone-light);
  }
  .crenel-list__item:first-child .crenel-link {
    border-top: 1px solid var(--stone-light);
  }
  .crenel-link:hover { transform: none; }
  .crenel-link::before { width: 5px; }

  .grid--split,
  .grid--tilt { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .header-brand__mark { font-size: 19px; }
  .header-utility__inner { gap: 10px 14px; }
  .header-actions { flex: 1 1 100%; }

  .footer-links { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .footer-contact { grid-template-columns: minmax(0, 1fr); }
  .footer-legal {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ---------- 减少动态偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover,
  .crenel-link:hover { transform: none; }
  .skip-link { transition: none; }
  .scroll-meter { transition: none; }
}
