/* =========================================================
   HTH赛场 · 共享样式 /assets/site.css
   ========================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

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

ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a { color: inherit; }

:root {
  --ink: #07131F;
  --ink-2: #0C1E2E;
  --ice: #F7FBFF;
  --paper: #F3EBDD;
  --cold: #2B6F97;
  --mist: #7A93A6;
  --cyan: #38F2D0;
  --orange: #FF7A1A;
  --red: #E5484D;
  --deep: #101820;
  --pale: #BFE8F6;

  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shell-max: 1280px;
  --gutter: clamp(18px, 4vw, 48px);
  --line: rgba(122, 147, 166, 0.28);
  --line-strong: rgba(122, 147, 166, 0.5);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 74px;
}

body {
  min-height: 100vh;
  background: var(--ink);
  color: var(--ice);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

.visually-hidden {
  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(--font-mono);
  letter-spacing: 0.08em;
}

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 300;
  padding: 10px 20px;
  background: var(--cyan);
  color: var(--deep);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: top 0.18s var(--ease);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.skip-link:focus {
  top: 12px;
}

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  background: var(--ink);
  color: var(--ice);
  border-bottom: 1px solid var(--line);
}

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(122, 147, 166, 0.2);
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--cyan), var(--pale) 55%, var(--orange));
  transition: transform 0.12s linear;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 22px);
  min-height: var(--header-h);
  padding-block: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  padding: 6px 2px;
  text-decoration: none;
  color: var(--ice);
}

.brand-sigil {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  background: linear-gradient(150deg, var(--cyan), var(--cold) 62%, var(--orange));
  clip-path: polygon(0 0, 100% 0, 100% 62%, 62% 100%, 0 100%);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.brand-note {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--mist);
}

.header-divider {
  width: 1px;
  height: 34px;
  flex: 0 0 auto;
  background: linear-gradient(180deg, transparent, var(--line-strong), transparent);
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--mist);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(56, 242, 208, 0.14);
  animation: status-pulse 2.6s var(--ease) infinite;
}

.status-tag {
  padding: 1px 6px;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--orange);
  border: 1px solid rgba(255, 122, 26, 0.45);
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ---------- 主导航 ---------- */
.nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.4vw, 20px);
  margin-left: auto;
}

.nav-eyebrow { display: none; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 11px;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: rgba(247, 251, 255, 0.78);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
}

.nav-num {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--mist);
}

.nav-link:hover {
  color: var(--cyan);
  background: rgba(56, 242, 208, 0.09);
}

.nav-link:hover .nav-num { color: var(--cyan); }

.nav-link[aria-current="page"] {
  color: var(--cyan);
  background: rgba(56, 242, 208, 0.1);
}

.nav-link[aria-current="page"] .nav-num { color: var(--cyan); }

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 3px;
  height: 2px;
  background: var(--cyan);
}

.nav-foot { display: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%);
  transition: background-color 0.22s var(--ease), color 0.22s var(--ease),
    border-color 0.22s var(--ease), transform 0.22s var(--ease);
}

.btn-primary {
  background: var(--orange);
  color: var(--deep);
}

.btn-primary:hover {
  background: #FF9445;
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(7, 19, 31, 0.25);
  border-color: var(--line-strong);
  color: var(--ice);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(56, 242, 208, 0.1);
}

.btn-cyan {
  background: var(--cyan);
  color: var(--deep);
}

.btn-cyan:hover { background: #6BF7DD; }

.btn-block { width: 100%; }

.header-cta {
  flex: 0 0 auto;
  margin-left: 6px;
}

/* ---------- 移动端索引开关 ---------- */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ice);
  border: 1px solid var(--line-strong);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.nav-toggle:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 16px;
}

.nav-toggle-bars span {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform 0.24s var(--ease), opacity 0.24s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:first-child {
  transform: translateY(3px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

/* ---------- 页脚 ---------- */
.site-footer {
  position: relative;
  background: var(--deep);
  color: var(--ice);
}

.footer-slab {
  background: var(--paper);
  color: var(--deep);
  padding-block: clamp(38px, 5vw, 72px) clamp(58px, 7vw, 98px);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 34px));
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 1.6fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--cold);
  border: 1px solid rgba(43, 111, 151, 0.45);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
}

.footer-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--orange);
}

.footer-brandline {
  margin-top: 18px;
  max-width: 26ch;
  font-size: clamp(18px, 2.1vw, 24px);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: var(--deep);
}

.footer-meta {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  line-height: 1.9;
  color: #4A5A66;
}

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

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

.footer-heading {
  padding-bottom: 12px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--cold);
  border-bottom: 1px solid rgba(16, 24, 32, 0.18);
}

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

.footer-links a {
  display: inline-block;
  font-size: 13.5px;
  text-decoration: none;
  color: #1B2A33;
  padding-bottom: 1px;
  box-shadow: inset 0 -1px 0 rgba(16, 24, 32, 0.2);
  transition: color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.footer-links a:hover {
  color: var(--orange);
  box-shadow: inset 0 -1px 0 var(--orange);
}

.footer-contact li {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  color: #33454F;
  word-break: break-word;
}

.footer-contact li:first-child {
  font-family: var(--font-sans);
  font-size: 13.5px;
}

.footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 26px;
  padding-block: 20px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--mist);
  border-top: 1px solid rgba(122, 147, 166, 0.22);
}

.footer-legal { color: var(--mist); }
.footer-copy { color: var(--mist); }

.footer-bar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-bar-nav a {
  text-decoration: none;
  color: var(--mist);
  transition: color 0.18s var(--ease);
}

.footer-bar-nav a:hover { color: var(--cyan); }

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--mist);
  border: 1px solid var(--line-strong);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.to-top:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

/* ---------- 通用正文与章节 ---------- */
.section { padding-block: clamp(48px, 7vw, 104px); }
.section--paper { background: var(--paper); color: var(--deep); }
.section--cold { background: var(--cold); color: var(--ice); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(24px, 3.6vw, 44px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--cyan);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: currentColor;
}

.section--paper .eyebrow { color: var(--cold); }

.section-title {
  font-size: clamp(26px, 3.6vw, 42px);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.24;
}

.section-index {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(36px, 6vw, 68px);
  font-weight: 200;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--mist);
  opacity: 0.55;
}

.lede {
  max-width: 62ch;
  font-size: clamp(15px, 1.4vw, 17.5px);
  line-height: 1.85;
  color: rgba(247, 251, 255, 0.74);
}

.section--paper .lede { color: #3A4A56; }

/* ---------- 网格 ---------- */
.grid {
  display: grid;
  gap: clamp(16px, 2.2vw, 26px);
}

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

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

/* ---------- 面板与标签 ---------- */
.panel {
  padding: clamp(18px, 2.4vw, 30px);
  background: var(--paper);
  color: var(--deep);
  border: 1px solid rgba(16, 24, 32, 0.14);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}

.panel--dark {
  background: var(--ink-2);
  color: var(--ice);
  border-color: var(--line);
}

.panel--cold {
  background: rgba(43, 111, 151, 0.18);
  color: var(--ice);
  border-color: rgba(43, 111, 151, 0.5);
}

.panel-title {
  margin-bottom: 10px;
  font-size: clamp(17px, 1.8vw, 21px);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.panel-text {
  font-size: 14.5px;
  line-height: 1.8;
  color: #3A4A56;
}

.panel--dark .panel-text,
.panel--cold .panel-text {
  color: rgba(247, 251, 255, 0.72);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--cold);
  border: 1px solid currentColor;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);
}

.tag--on-dark {
  color: var(--cyan);
  background: rgba(56, 242, 208, 0.12);
  border-color: rgba(56, 242, 208, 0.45);
}

.tag--orange {
  color: var(--orange);
  background: rgba(255, 122, 26, 0.12);
  border-color: rgba(255, 122, 26, 0.5);
}

/* ---------- 面包屑 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--mist);
}

.crumbs a {
  text-decoration: none;
  color: var(--mist);
  transition: color 0.18s var(--ease);
}

.crumbs a:hover { color: var(--cyan); }

.crumbs li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crumbs li + li::before {
  content: "/";
  color: rgba(122, 147, 166, 0.5);
}

/* ---------- 可复用图片容器 ---------- */
.figure-slot {
  position: relative;
  display: block;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(145deg, rgba(43, 111, 151, 0.42), rgba(7, 19, 31, 0.94) 78%);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
}

.figure-slot img,
.figure-slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.figure-slot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 19, 31, 0) 42%, rgba(7, 19, 31, 0.82));
}

.figure-slot figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ice);
}

.figure-slot--wide { aspect-ratio: 21 / 9; }
.figure-slot--tall { aspect-ratio: 4 / 5; }
.figure-slot--square { aspect-ratio: 1 / 1; }

/* ---------- 滚动显现 ---------- */
.reveal {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
  will-change: opacity, transform;
}

.reveal[data-visible="true"] {
  opacity: 1;
  transform: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .nav-num { display: none; }
  .nav-link { padding: 9px 8px; font-size: 13.5px; }
  .header-status { display: none; }
}

@media (max-width: 940px) {
  .header-divider,
  .header-cta { display: none; }

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

  .nav {
    position: fixed;
    inset: 0;
    z-index: 130;
    margin: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: calc(var(--header-h) + 18px) var(--gutter) 32px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
      radial-gradient(120% 70% at 100% 0%, rgba(43, 111, 151, 0.4), transparent 62%),
      linear-gradient(170deg, var(--ink), #0A1D2B 58%, #07131F);
    border-top: 1px solid var(--line);
  }

  .nav[data-open="true"] { display: flex; }

  .nav-eyebrow {
    display: block;
    padding-bottom: 14px;
    margin-bottom: 8px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.26em;
    color: var(--mist);
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-link {
    width: 100%;
    justify-content: flex-start;
    gap: 14px;
    padding: 15px 4px;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 0.06em;
    clip-path: none;
    border-bottom: 1px solid rgba(122, 147, 166, 0.18);
  }

  .nav-num {
    display: inline;
    font-size: 11px;
    color: var(--cyan);
  }

  .nav-link[aria-current="page"] { background: transparent; }
  .nav-link[aria-current="page"]::after { display: none; }

  .nav-foot {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: auto;
    padding-top: 30px;
  }

  .nav-foot-note {
    font-size: 12px;
    line-height: 1.6;
    color: var(--mist);
  }

  body.is-nav-open { overflow: hidden; }

  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }

  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brandline { max-width: 34ch; }
}

@media (max-width: 620px) {
  .brand-note { display: none; }
  .brand-name { font-size: 16px; letter-spacing: 0.12em; }
  .footer-cols { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .footer-bar { justify-content: flex-start; font-size: 11px; }
  .footer-bar-nav { gap: 12px; }
  .footer-slab { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 22px)); }
  .section-index { opacity: 0.42; }
}

@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
