/* ==========================================================================
   半岛赛事通 /assets/site.css
   共享外壳：命令行页头 + 档案式页脚 + 通用组件
   语言：锐利直角 / 1px 精密网格 / 冷底暖光
   ========================================================================== */

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

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

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

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

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

button, input, select, textarea { font: inherit; color: inherit; }

a { color: inherit; }

/* ---------- 2. 设计令牌 ---------- */
:root {
  --c-ink: #0A1030;
  --c-ink-2: #141D4B;
  --c-paper: #F5F7FF;
  --c-mist: #A9B4D6;
  --c-saffron: #C8322F;
  --c-saffron-deep: #A92523;
  --c-amber: #F6B73C;
  --c-orange: #E8752B;
  --c-yellow: #F2C94C;
  --c-green: #2F9B75;
  --c-blue: #3A78F2;
  --c-void: #050814;

  --line-1: rgba(169, 180, 214, .16);
  --line-2: rgba(169, 180, 214, .32);
  --line-hot: rgba(246, 183, 60, .5);

  --font-display: "Inter Tight", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: Georgia, "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", "SimSun", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --shell: 1360px;
  --gap: 24px;
  --pad: clamp(18px, 4vw, 48px);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 180ms;
  --t-mid: 260ms;

  --header-h: 74px;
}

/* ---------- 3. 基础排版 ---------- */
body {
  min-height: 100vh;
  background-color: var(--c-ink);
  background-image:
    repeating-linear-gradient(90deg, rgba(169, 180, 214, .065) 0 1px, transparent 1px 120px),
    linear-gradient(105deg, rgba(20, 29, 75, .9) 0%, rgba(10, 16, 48, 0) 58%),
    radial-gradient(1200px 620px at 88% -12%, rgba(200, 50, 47, .10), transparent 72%);
  background-attachment: fixed;
  color: var(--c-paper);
  font-family: var(--font-body);
  font-size: clamp(15.5px, calc(14px + .4vw), 17px);
  line-height: 1.75;
  letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, .h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 4.4vw, 60px);
  line-height: 1.08;
  letter-spacing: .03em;
}

h2, .h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.16;
  letter-spacing: .03em;
}

h3, .h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(19px, 1.8vw, 24px);
  line-height: 1.32;
  letter-spacing: .02em;
}

p { text-wrap: pretty; }

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

.ed-title {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: .01em;
}

.lede {
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.8;
  color: var(--c-mist);
}

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

/* ---------- 4. 布局容器 ---------- */
.shell,
.page-shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.page-shell { padding-block: clamp(32px, 4vw, 56px); }

.grid,
.grid-12,
.bento {
  display: grid;
  gap: var(--gap);
}

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

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

.bento-card {
  position: relative;
  background: var(--c-ink-2);
  border: 1px solid var(--line-1);
  padding: clamp(18px, 2vw, 28px);
}

.section { padding-block: clamp(36px, 5vw, 76px); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 28px;
  margin-bottom: clamp(22px, 3vw, 38px);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--c-amber);
}

.kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--c-saffron);
}

/* ---------- 5. 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}

.btn-primary {
  background: var(--c-saffron);
  border-color: var(--c-saffron);
  color: var(--c-paper);
}

.btn-primary:hover {
  background: var(--c-saffron-deep);
  border-color: var(--c-saffron-deep);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--c-paper);
}

.btn-ghost:hover {
  border-color: var(--c-amber);
  color: var(--c-amber);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(245, 247, 255, .22);
}

/* ---------- 6. 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line-2);
  color: var(--c-mist);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1.4;
}

.tag-saffron {
  background: var(--c-saffron);
  border-color: var(--c-saffron);
  color: var(--c-paper);
}

.tag-amber {
  color: var(--c-amber);
  border-color: var(--line-hot);
}

.tag-green {
  color: #7FD6B6;
  border-color: rgba(47, 155, 117, .55);
}

/* ---------- 7. 面包屑 ---------- */
.breadcrumb {
  padding-block: 16px;
  font-size: 12.5px;
  color: var(--c-mist);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-family: var(--font-mono);
  letter-spacing: .06em;
}

.breadcrumb li { display: flex; align-items: center; }

.breadcrumb li + li::before {
  content: "/";
  margin-inline: 8px;
  color: rgba(169, 180, 214, .45);
}

.breadcrumb a {
  color: var(--c-mist);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.breadcrumb a:hover {
  color: var(--c-amber);
  border-bottom-color: var(--line-hot);
}

.breadcrumb a:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 2px;
}

.breadcrumb [aria-current="page"] { color: var(--c-paper); }

/* ---------- 8. 图片容器（页面阶段放图） ---------- */
.media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(150deg, #1B2658 0%, var(--c-ink-2) 55%, #0D1538 100%);
  border: 1px solid var(--line-1);
}

.media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--c-saffron), var(--c-amber) 55%, transparent);
  opacity: .8;
  pointer-events: none;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-wide { aspect-ratio: 21 / 9; }
.media-tall { aspect-ratio: 4 / 5; }

.media-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--c-mist);
}

/* ---------- 9. 正文与档案纸面 ---------- */
.prose {
  max-width: 42rem;
  line-height: 1.9;
  color: var(--c-mist);
}

.prose > * + * { margin-top: 1em; }

.prose h2,
.prose h3 {
  color: var(--c-paper);
  margin-top: 1.9em;
  margin-bottom: .55em;
}

.prose ul { margin-block: 1em; }

.prose li {
  position: relative;
  padding-left: 20px;
  margin-block: .45em;
}

.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .8em;
  width: 8px;
  height: 1px;
  background: var(--c-amber);
}

.prose a {
  color: #8FB4FF;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.paper {
  background: var(--c-paper);
  color: #131A35;
  padding: clamp(24px, 4vw, 56px);
  border: 1px solid rgba(10, 16, 48, .12);
  box-shadow: 0 24px 60px rgba(5, 8, 20, .45);
}

.paper h1,
.paper h2,
.paper h3 { color: var(--c-ink); }

.paper a {
  color: #1F4FC4;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 10. 跳过链接 ---------- */
.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  padding: 12px 20px;
  background: var(--c-paper);
  color: var(--c-ink);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transform: translateY(-130%);
  transition: transform var(--t-fast) var(--ease);
}

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

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

/* --- 公告条 --- */
.announce {
  background: linear-gradient(90deg, #141D4B 0%, #1C2A63 52%, #141D4B 100%);
  border-bottom: 1px solid var(--line-1);
}

.announce[hidden] { display: none; }

.announce-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
}

.announce-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  background: var(--c-yellow);
  box-shadow: 0 0 0 3px rgba(242, 201, 76, .18);
  animation: announce-pulse 3.2s var(--ease) infinite;
}

@keyframes announce-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(242, 201, 76, .18); }
  50%      { box-shadow: 0 0 0 6px rgba(242, 201, 76, .04); }
}

.announce-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13.5px;
  color: var(--c-mist);
  letter-spacing: .01em;
}

.announce-link {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  color: var(--c-yellow);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast) var(--ease);
}

.announce-link:hover { border-bottom-color: currentColor; }

.announce-close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--c-mist);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.announce-close:hover {
  color: var(--c-paper);
  border-color: var(--c-mist);
}

.announce-close:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 2px;
}

/* --- 命令栏 --- */
.command-bar { background: var(--c-ink); }

.command-inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  min-height: var(--header-h);
}

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

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--c-saffron);
  color: var(--c-paper);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  line-height: 1;
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 5px;
  background: var(--c-amber);
}

.brand-text { display: block; }

.brand-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: .06em;
}

.brand-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.5;
  letter-spacing: .26em;
  color: var(--c-mist);
}

.brand:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 4px;
}

/* 导航 */
.nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

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

.nav-item { display: flex; }

.nav-link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--c-mist);
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}

.nav-idx {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .05em;
  color: var(--c-mist);
  opacity: .55;
  transition: color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}

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

.nav-link:hover {
  color: var(--c-paper);
  background: rgba(169, 180, 214, .09);
}

.nav-link:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: -2px;
}

.nav-link[aria-current="page"] {
  color: var(--c-paper);
  background: linear-gradient(180deg, rgba(200, 50, 47, .05), rgba(200, 50, 47, .16));
}

.nav-link[aria-current="page"] .nav-idx {
  color: var(--c-amber);
  opacity: 1;
}

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

/* 行动按钮组 */
.command-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 移动端开关 */
.nav-toggle {
  position: relative;
  z-index: 140;
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--c-paper);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease);
}

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

.nav-toggle:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(245, 247, 255, .2);
}

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: background-color var(--t-fast) var(--ease);
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform var(--t-fast) 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); }

/* 滚动进度 */
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  z-index: 3;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--c-saffron) 0%, var(--c-amber) 100%);
  transition: width 120ms linear;
  pointer-events: none;
}

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 7vw, 96px);
  background: var(--c-void);
  border-top: 1px solid var(--line-2);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--c-saffron) 0 18%,
    var(--c-amber) 18% 34%,
    var(--c-orange) 34% 46%,
    var(--c-green) 46% 58%,
    var(--c-blue) 58% 72%,
    transparent 72%);
  opacity: .9;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.55fr .9fr .9fr 1.4fr;
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(44px, 6vw, 80px);
}

.footer-brand .brand { margin-bottom: 18px; }

.footer-summary {
  max-width: 38ch;
  font-size: 14px;
  line-height: 1.85;
  color: var(--c-mist);
}

.footer-home { margin-top: 22px; }

.footer-col-title {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-1);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--c-amber);
}

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

.footer-list a {
  display: inline-block;
  font-size: 14px;
  color: var(--c-mist);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.footer-list a:hover {
  color: var(--c-paper);
  border-bottom-color: var(--c-amber);
}

.footer-list a:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 3px;
}

.contact-list { font-size: 13.5px; }

.contact-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-block: 9px;
  border-bottom: 1px solid var(--line-1);
}

.contact-row:first-child { padding-top: 0; }

.contact-key {
  flex: 0 0 40px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--c-amber);
  text-transform: uppercase;
}

.contact-val {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.65;
  color: var(--c-mist);
  word-break: break-word;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  padding-block: 20px;
  border-top: 1px solid var(--line-1);
  font-size: 12.5px;
  color: rgba(169, 180, 214, .78);
}

.legal-line {
  font-family: var(--font-mono);
  letter-spacing: .03em;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.legal-links a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.legal-links a:hover {
  color: var(--c-paper);
  border-bottom-color: var(--c-amber);
}

.legal-links a:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 3px;
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1180px) {
  .nav-link { padding: 10px 9px; font-size: 13px; }
  .command-actions .btn-sm { padding: 8px 11px; font-size: 12.5px; }
}

@media (max-width: 1080px) {
  :root { --header-h: 64px; }

  .command-actions { display: none; }
  .nav-toggle { display: grid; }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 130;
    display: block;
    width: min(340px, 86vw);
    margin: 0;
    padding: 84px 0 40px;
    background: var(--c-ink-2);
    border-left: 1px solid var(--line-2);
    box-shadow: -24px 0 60px rgba(5, 8, 20, .6);
    overflow-y: auto;
    transform: translateX(101%);
    visibility: hidden;
    transition: transform var(--t-mid) var(--ease), visibility 0s linear var(--t-mid);
  }

  .nav[data-open] {
    transform: translateX(0);
    visibility: visible;
    transition: transform var(--t-mid) var(--ease), visibility 0s linear 0s;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    padding-inline: clamp(16px, 5vw, 28px);
  }

  .nav-item {
    border-bottom: 1px solid var(--line-1);
  }

  .nav-link {
    width: 100%;
    padding: 15px 4px;
    font-size: 16px;
    gap: 10px;
  }

  .nav-idx { font-size: 11px; }

  .nav-link[aria-current="page"] {
    background: linear-gradient(90deg, rgba(200, 50, 47, .22), transparent 72%);
  }

  .nav-link[aria-current="page"]::after {
    left: 4px;
    right: auto;
    bottom: 8px;
    width: 22px;
    height: 2px;
    background: var(--c-amber);
  }
}

@media (max-width: 920px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px 32px;
  }
  .footer-brand { grid-column: 1 / -1; }
  .footer-contact { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .span-4, .span-6, .span-8 { grid-column: span 12; }
  .bento-card { padding: 18px; }
}

@media (max-width: 640px) {
  .announce-inner { gap: 10px; min-height: 40px; }
  .announce-text { font-size: 12px; line-height: 1.5; }
  .announce-link { display: none; }
  .brand-mark { width: 34px; height: 34px; font-size: 15px; }
  .brand-name { font-size: 15px; }
  .brand-sub { font-size: 8.5px; letter-spacing: .2em; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-legal { justify-content: flex-start; }
  .legal-links { gap: 16px; }
}

/* ==========================================================================
   降低动态效果
   ========================================================================== */
@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;
  }
}
