/* ============================================================
   /assets/site.css — 半岛体育 · 共享站点样式
   夜蓝仪表盘 / 展览画册 / 精密网格
   ============================================================ */

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

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

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

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

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

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

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

[hidden] { display: none !important; }

/* ---------- 2. 变量 ---------- */
:root {
  --night: #0B1B2B;
  --deep: #071320;
  --grid: #1E3448;
  --ice: #7FC4E8;
  --ice-pale: #D6E9F5;
  --paper: #F7FAFC;
  --signal: #FF5A1F;
  --sand: #C9A24B;
  --proof: #C0392B;
  --turf: #3C6B57;
  --muted: #8FA6B8;
  --muted-deep: #6B849A;

  --font-display: "Barlow Condensed", "Oswald", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", "Roboto Mono", Menlo, Consolas, monospace;

  --w-max: 1180px;
  --gutter: 20px;
  --radius: 0;
  --ease: cubic-bezier(.2, .6, .2, 1);
}

/* ---------- 3. 基础排版 ---------- */
html { background-color: var(--night); }

body {
  min-height: 100vh;
  padding: 0;
  color: var(--ice-pale);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .01em;
  background-color: var(--night);
  background-image:
    linear-gradient(to right, rgba(30, 52, 72, .32) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 52, 72, .32) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--paper);
}

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

strong { color: var(--paper); font-weight: 700; }
em { font-style: normal; color: var(--sand); }

::selection { background: var(--signal); color: var(--night); }

:where(a, button, [tabindex], summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* ---------- 4. 布局容器 ---------- */
.container,
.header-inner,
.footer-inner {
  width: min(var(--w-max), 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

.container--narrow { width: min(820px, 100% - (var(--gutter) * 2)); }

.section { padding: 56px 0; }
.section:first-of-type { padding-top: 40px; }

.rule {
  height: 1px;
  border: 0;
  background: var(--grid);
  margin: 0;
}

/* ---------- 5. 章节头 ---------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  padding: 14px 0 0;
  border-top: 1px solid var(--grid);
  margin-bottom: 24px;
}

.section-num {
  font-family: var(--font-mono);
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--sand);
  font-variant-numeric: tabular-nums;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 800;
  letter-spacing: .01em;
  color: var(--paper);
  margin: 0;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ice);
  margin-left: auto;
}

.lede {
  max-width: 62ch;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.8;
  color: var(--ice-pale);
}

/* ---------- 6. 网格 ---------- */
.grid--12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}

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

/* ---------- 7. 按钮与标签 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ice-pale);
  background: transparent;
  transition: border-color .18s var(--ease), background-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}

.btn:hover {
  border-color: var(--ice);
  color: var(--paper);
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--night);
  font-weight: 700;
}

.btn--primary:hover {
  background: #FF7742;
  border-color: #FF7742;
  color: var(--night);
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  background: transparent;
  transition: border-color .18s var(--ease), color .18s var(--ease), background-color .18s var(--ease);
}

.chip:hover { border-color: var(--ice); color: var(--ice-pale); }

.chip[aria-pressed="true"] {
  border-color: var(--signal);
  background: rgba(255, 90, 31, .12);
  color: var(--signal);
}

/* ---------- 8. 面包屑 ---------- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted-deep);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.breadcrumb-item { display: inline-flex; align-items: center; gap: 8px; }

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  color: var(--grid);
}

.breadcrumb-link { color: var(--ice); transition: color .18s var(--ease); }
.breadcrumb-link:hover { color: var(--paper); }

/* ---------- 9. 面板 ---------- */
.panel {
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  background: rgba(7, 19, 32, .62);
  padding: 24px;
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}

.panel:hover { border-color: var(--ice); transform: translateY(-2px); }

.panel--paper {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--night);
}

.panel--paper :where(h2, h3, h4) { color: var(--night); }
.panel--paper :where(strong) { color: var(--night); }
.panel--paper .section-num { color: var(--proof); }

/* ---------- 10. 旁注 ---------- */
.note {
  border-left: 2px solid var(--sand);
  padding: 4px 0 4px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: .02em;
  color: var(--muted);
}

.note :where(a) { color: var(--ice); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 11. 数据表 ---------- */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--grid);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ice-pale);
}

.data-table caption {
  caption-side: top;
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--muted);
  border-bottom: 1px solid var(--grid);
}

.data-table th,
.data-table td {
  height: 44px;
  padding: 0 12px;
  text-align: left;
  border-bottom: 1px solid var(--grid);
  white-space: nowrap;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--deep);
  color: var(--ice);
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.data-table tbody tr { transition: background-color .15s var(--ease); }
.data-table tbody tr:hover { background: rgba(127, 196, 232, .07); }
.data-table tbody tr:last-child :where(th, td) { border-bottom: 0; }

/* ---------- 12. 图片容器 ---------- */
.media-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  background: var(--deep);
  overflow: hidden;
}

.media-frame > img,
.media-frame > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame::before,
.media-frame::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--ice);
  opacity: .55;
  pointer-events: none;
}

.media-frame::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.media-frame::after { right: 8px; bottom: 8px; border-left: 0; border-top: 0; }

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

.media-caption {
  display: block;
  padding-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted-deep);
}

/* ---------- 13. Skip link ---------- */
.skip-link {
  position: absolute;
  top: 0;
  left: -9999px;
  z-index: 999;
  padding: 12px 18px;
  background: var(--signal);
  color: var(--night);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
}

.skip-link:focus { left: 12px; top: 12px; outline: 2px solid var(--paper); outline-offset: 2px; }

/* ---------- 14. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: linear-gradient(180deg, #0A1826 0%, #0B1B2B 100%);
  border-bottom: 1px solid var(--grid);
}

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
}

.scroll-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--signal);
  transition: width .12s linear;
}

.header-inner { position: relative; }

.header-rail {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--grid);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
}

.rail-link {
  margin-right: auto;
  color: var(--ice);
  transition: color .18s var(--ease);
}

.rail-link:hover { color: var(--paper); }

.rail-btn {
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  transition: color .18s var(--ease);
}

.rail-btn:hover { color: var(--signal); }

.version-badge {
  padding: 2px 6px;
  border: 1px solid var(--signal);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--signal);
  white-space: nowrap;
}

.rail-feedback {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  padding: 4px 8px;
  border: 1px solid var(--grid);
  background: var(--deep);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--signal);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease);
}

.rail-feedback[data-visible] { opacity: 1; }

.masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 0 16px;
  text-align: center;
}

.masthead-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.brand-cn {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 4.6vw, 54px);
  line-height: 1;
  letter-spacing: .06em;
  color: var(--paper);
  transition: color .2s var(--ease);
}

.masthead-brand:hover .brand-cn { color: var(--ice); }

.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .36em;
  text-indent: .36em;
  text-transform: uppercase;
  color: var(--ice);
}

.masthead-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted-deep);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 2px;
  border-top: 1px solid var(--grid);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ice);
}

.nav-toggle-bar {
  width: 18px;
  height: 1px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 -5px 0 currentColor;
}

.nav-toggle[aria-expanded="true"] { color: var(--signal); }

.site-nav { border-top: 1px solid var(--grid); }

.nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
}

.nav-item { display: flex; }

.nav-link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  color: var(--ice-pale);
  transition: color .18s var(--ease), border-color .18s var(--ease), background-color .18s var(--ease);
}

.nav-link:hover {
  color: var(--paper);
  background: rgba(127, 196, 232, .07);
  border-bottom-color: var(--ice);
}

.nav-link[aria-current="page"] {
  color: var(--paper);
  border-bottom-color: var(--signal);
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--sand);
}

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

/* ---------- 15. 页脚 ---------- */
.site-footer {
  margin-top: 64px;
  background: var(--deep);
  border-top: 1px solid var(--grid);
  color: var(--muted);
}

.footer-inner { padding: 48px 0 28px; }

.footer-masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--grid);
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: .08em;
  color: var(--paper);
  transition: color .18s var(--ease);
}

.footer-brand:hover { color: var(--ice); }

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--ice);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  padding: 32px 0 28px;
}

.footer-col-title {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--sand);
}

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

.footer-item { font-size: 12px; line-height: 1.7; }

.footer-link {
  font-size: 12px;
  color: var(--ice-pale);
  transition: color .18s var(--ease);
}

.footer-link:hover { color: var(--signal); }

.footer-text {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .01em;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--grid);
}

.footer-legal {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted-deep);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ---------- 16. 响应式 ---------- */
@media (max-width: 1024px) {
  .footer-grid { gap: 24px; }
  .nav-link { padding: 12px 12px; }
}

@media (max-width: 900px) {
  :root { --gutter: 16px; }

  .nav-toggle { display: flex; }

  .site-nav { display: none; }

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

  .nav-list {
    flex-direction: column;
    justify-content: flex-start;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid var(--grid);
  }

  .nav-item:last-child { border-bottom: 0; }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 14px 2px;
    font-size: 15px;
    border-bottom: 2px solid transparent;
  }

  .nav-link:hover { border-bottom-color: var(--ice); }

  .nav-link[aria-current="page"] { border-bottom-color: var(--signal); }

  .masthead { padding: 16px 0 14px; }

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

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

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

  .section { padding: 40px 0; }

  .site-footer { margin-top: 48px; }
}

@media (max-width: 620px) {
  .header-rail { flex-wrap: wrap; gap: 10px; }
  .rail-link { margin-right: 0; width: 100%; }
  .version-badge { margin-left: auto; }

  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-inner { padding: 36px 0 24px; }

  .grid--12 { grid-template-columns: 1fr; }
  .col-4, .col-6, .col-8 { grid-column: span 1; }

  .section-kicker { margin-left: 0; width: 100%; }
}

/* ---------- 17. 动效偏好 ---------- */
@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,
  .panel:hover { transform: none; }

  .scroll-progress-bar { transition: none; }
}
