/* ==========================================================================
   HTH赛事 · 大屏访问 2.0  共享外壳样式表  /assets/site.css
   1 reset  2 变量  3 排版  4 跳过链接与进度条  5 头部与胶囊导航
   6 页脚  7 通用组件  8 响应式与偏好
   ========================================================================== */

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

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ---------- 2 变量 ---------- */
:root {
  --ink: #0B0E13;
  --surface: #141C2B;
  --jade: #0E2E33;
  --wine: #4A1220;
  --wine-deep: #2A1216;
  --red: #C8102E;
  --red-lit: #E4223A;
  --gold-flag: #F2B705;
  --gold: #D9A441;
  --sky: #2E9BD6;
  --paper: #F5F1E8;
  --mist: #9AA3AF;

  --line: rgba(217, 164, 65, 0.28);
  --line-soft: rgba(217, 164, 65, 0.14);

  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 28px;

  --shell: 1280px;

  --font-body: "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", "JetBrains Mono", "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;
  --font-num: "Barlow Condensed", "Oswald", "Arial Narrow", Impact,
    var(--font-body);

  --ease: 200ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 3 排版 ---------- */
body {
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#main-content {
  display: block;
  padding-top: 112px;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.prose {
  max-width: 62ch;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--paper);
}

.prose p { margin-bottom: 1.4em; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 { font-size: 1.5rem; margin: 2em 0 0.7em; }
.prose h3 { font-size: 1.2rem; margin: 1.6em 0 0.6em; }
.prose ul { list-style: disc; padding-left: 1.25em; margin-bottom: 1.4em; }
.prose ol { list-style: decimal; padding-left: 1.4em; margin-bottom: 1.4em; }
.prose li { margin-bottom: 0.5em; }
.prose a { color: var(--sky); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--gold-flag); }
.prose strong { color: var(--gold-flag); font-weight: 700; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--gold);
  background: rgba(20, 28, 43, 0.9);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}

::selection { background: var(--red); color: var(--paper); }

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

/* ---------- 4 跳过链接与阅读进度 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 120;
  transform: translateY(-180%);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform var(--ease);
}

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

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 110;
  background: rgba(245, 241, 232, 0.07);
  pointer-events: none;
}

.read-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--red) 0%, var(--red-lit) 55%, var(--gold-flag) 100%);
  transition: width 120ms linear;
}

/* ---------- 5 头部与胶囊导航 ---------- */
.site-header {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 16px;
  pointer-events: none;
}

.header__shell {
  pointer-events: auto;
  max-width: var(--shell);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 12px 9px 16px;
  border-radius: 999px;
  background: rgba(11, 14, 19, 0.8);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  transition: padding var(--ease), background var(--ease),
    box-shadow var(--ease), border-color var(--ease);
}

.site-header.is-compact .header__shell {
  padding: 5px 8px 5px 12px;
  background: rgba(11, 14, 19, 0.95);
  border-color: rgba(217, 164, 65, 0.34);
  box-shadow: 0 20px 44px -24px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(217, 164, 65, 0.1);
}

/* 品牌 */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--paper);
}

.brand__mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-family: var(--font-num);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--paper);
  background: linear-gradient(150deg, var(--red), #7d0b1e);
  box-shadow: inset 0 0 0 1px rgba(245, 241, 232, 0.2),
    0 12px 26px -18px rgba(228, 34, 58, 0.95);
  transition: transform var(--ease);
}

.brand:hover .brand__mark { transform: translateY(-1px); }

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

.brand__name {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand__tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.brand--stacked { flex-direction: column; align-items: flex-start; gap: 14px; }
.brand--stacked .brand__mark { width: 54px; height: 54px; font-size: 1.7rem; border-radius: 18px; }
.brand--stacked .brand__text { gap: 4px; }
.brand--stacked .brand__name { font-size: 1.15rem; }

/* 导航 */
.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
}

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

.nav__item { display: block; }

.nav__link {
  display: block;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  color: var(--mist);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--ease), background var(--ease), border-color var(--ease);
}

.nav__link:hover {
  color: var(--paper);
  background: rgba(46, 155, 214, 0.16);
}

.nav__link[aria-current="page"] {
  color: var(--paper);
  background: linear-gradient(180deg, rgba(200, 16, 46, 0.95), rgba(125, 11, 30, 0.95));
  border-color: rgba(242, 183, 5, 0.5);
  box-shadow: 0 10px 24px -16px rgba(228, 34, 58, 0.95);
}

/* 轮次状态胶囊 */
.round-flag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px dashed rgba(242, 183, 5, 0.55);
  background: rgba(242, 183, 5, 0.08);
  color: var(--gold-flag);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  transition: background var(--ease), border-color var(--ease);
}

.round-flag:hover {
  background: rgba(242, 183, 5, 0.18);
  border-color: var(--gold-flag);
}

.round-flag__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red-lit);
  box-shadow: 0 0 0 4px rgba(228, 34, 58, 0.18);
  animation: hth-pulse 2.4s ease-in-out infinite;
}

@keyframes hth-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.32; }
}

/* 移动端菜单按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid rgba(217, 164, 65, 0.4);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  transition: border-color var(--ease), background var(--ease);
}

.nav-toggle:hover {
  border-color: var(--gold-flag);
  background: rgba(242, 183, 5, 0.1);
}

.nav-toggle__bars {
  display: inline-grid;
  gap: 4px;
  width: 16px;
}

.nav-toggle__bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--ease), opacity var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) {
  opacity: 0;
}

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

.nav-toggle__label { display: inline-block; }

/* ---------- 6 页脚 ---------- */
.site-footer {
  margin-top: 96px;
  color: var(--mist);
  border-top: 1px solid var(--line-soft);
  background:
    radial-gradient(1100px 380px at 10% -20%, rgba(14, 46, 51, 0.9), transparent 70%),
    radial-gradient(900px 340px at 90% -10%, rgba(74, 18, 32, 0.85), transparent 72%),
    var(--ink);
}

.footer__shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 72px 24px 44px;
}

.footer__top {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px 32px;
  align-items: start;
}

.footer__brand { display: flex; flex-direction: column; gap: 18px; }

.footer__line {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--mist);
  max-width: 26ch;
}

.footer__col { display: flex; flex-direction: column; }

.footer__title {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__link {
  display: inline-block;
  color: var(--mist);
  font-size: 0.94rem;
  text-decoration: none;
  transition: color var(--ease), transform var(--ease);
}

.footer__link:hover {
  color: var(--paper);
  transform: translateX(2px);
}

.footer__contact { margin-top: 52px; }

.footer__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.footer__fact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px 17px;
  border-radius: var(--radius-m);
  background: rgba(20, 28, 43, 0.72);
  border: 1px solid var(--line-soft);
  transition: border-color var(--ease), transform var(--ease);
}

.footer__fact:hover {
  border-color: var(--line);
  transform: translateY(-1px);
}

.footer__fact-key {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
}

.footer__fact-val {
  color: var(--paper);
  font-size: 0.95rem;
  word-break: break-word;
}

.footer__rule {
  height: 1px;
  margin: 40px 0 20px;
  background: linear-gradient(90deg, transparent, rgba(217, 164, 65, 0.6), transparent);
}

.footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--mist);
}

.footer__icp,
.footer__region,
.footer__note { margin: 0; }

.footer__region {
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid rgba(242, 183, 5, 0.45);
  color: var(--gold-flag);
}

/* ---------- 7 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform var(--ease), background var(--ease),
    color var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(140deg, var(--red), #8d0d21);
  color: var(--paper);
  box-shadow: 0 18px 34px -22px rgba(228, 34, 58, 0.95);
}

.btn--primary:hover {
  background: linear-gradient(140deg, var(--red-lit), var(--red));
  box-shadow: 0 22px 40px -20px rgba(228, 34, 58, 0.95);
}

.btn--ghost {
  border-color: var(--line);
  color: var(--paper);
}

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

.label-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(217, 164, 65, 0.35);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.label-tag__num { color: var(--gold-flag); }

.panel {
  position: relative;
  padding: 24px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, rgba(20, 28, 43, 0.95), rgba(11, 14, 19, 0.92));
}

.panel--jade {
  background: linear-gradient(160deg, rgba(14, 46, 51, 0.95), rgba(11, 14, 19, 0.92));
}

.panel--wine {
  background: linear-gradient(160deg, rgba(74, 18, 32, 0.9), rgba(42, 18, 22, 0.95));
}

.grid {
  display: grid;
  gap: 20px;
}

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

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.crumbs__item { display: inline-flex; align-items: center; gap: 6px; }

.crumbs__item::after {
  content: "/";
  color: rgba(217, 164, 65, 0.5);
}

.crumbs__item:last-child::after { display: none; }

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

.crumbs__item a:hover { color: var(--gold-flag); }

/* 左侧编号轴 / 章节索引 */
.chapter-counter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
}

.chapter-counter__link {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 12px;
  padding: 10px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 12px 12px 0;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  color: var(--mist);
  text-decoration: none;
  transition: color var(--ease), background var(--ease),
    border-color var(--ease), transform var(--ease);
}

.chapter-counter__link:hover {
  color: var(--paper);
  background: rgba(46, 155, 214, 0.1);
}

.chapter-counter__link.is-active {
  color: var(--paper);
  border-left-color: var(--red);
  background: linear-gradient(90deg, rgba(200, 16, 46, 0.24), transparent 82%);
  transform: translateX(2px);
}

.chapter-counter__num { color: var(--gold-flag); }

.chapter-scroll { position: relative; }

/* 图片容器：供页面阶段放入真实图片 */
.figure {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-m);
  isolation: isolate;
  background-color: var(--jade);
  background-image:
    radial-gradient(120% 90% at 12% 8%, rgba(46, 155, 214, 0.22), transparent 62%),
    linear-gradient(150deg, var(--jade), var(--wine-deep) 72%);
  background-size: cover;
  background-position: center;
}

.figure::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 90px rgba(200, 16, 46, 0.24),
    inset 0 0 0 1px rgba(217, 164, 65, 0.16);
}

.figure__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.figure__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 16px 18px 14px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--paper);
  background: linear-gradient(180deg, transparent, rgba(11, 14, 19, 0.9));
}

.figure--panorama { aspect-ratio: 2.39 / 1; }
.figure--wide { aspect-ratio: 21 / 9; }
.figure--grid { aspect-ratio: 4 / 3; }
.figure--square { aspect-ratio: 1 / 1; }

/* ---------- 8 响应式与偏好 ---------- */
@media (max-width: 1100px) {
  .nav__link { padding: 8px 10px; font-size: 0.86rem; }
  .footer__top { gap: 30px 20px; }
}

@media (max-width: 960px) {
  html { scroll-padding-top: 100px; }
  #main-content { padding-top: 96px; }

  .site-header { top: 10px; padding: 0 12px; }

  .header__shell { gap: 10px; }

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

  .nav {
    position: fixed;
    top: 76px;
    left: 12px;
    right: 12px;
    display: block;
    margin-left: 0;
    padding: 10px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(11, 14, 19, 0.97);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: 0 34px 64px -32px rgba(0, 0, 0, 0.98);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px) scale(0.985);
    transition: opacity var(--ease), transform var(--ease), visibility var(--ease);
  }

  .nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    max-height: 68vh;
    overflow-y: auto;
  }

  .nav__link {
    padding: 13px 15px;
    border-radius: 16px;
    font-size: 1rem;
  }

  .round-flag { padding: 7px 11px; font-size: 0.6rem; }

  .footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
  .footer__line { max-width: 46ch; }
}

@media (max-width: 760px) {
  .shell { padding-left: 18px; padding-right: 18px; }
  .footer__shell { padding: 56px 18px 36px; }
  .grid--3,
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .brand__tag { display: none; }
  .round-flag__text { display: none; }
  .round-flag { padding: 9px; border-radius: 999px; }
  .nav-toggle__label { display: none; }
  .nav-toggle { padding: 10px 13px; }

  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: minmax(0, 1fr); }

  .footer__top { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .footer__facts { grid-template-columns: minmax(0, 1fr); }
  .footer__meta { letter-spacing: 0.1em; }
}

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