/* ==========================================================================
   凯云竞猜 · 共享样式 /assets/site.css
   深海墨蓝基底 · 纸白堆叠画板 · 荧光青数据锚点 · 珊瑚橙节点标记
   ========================================================================== */

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

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

body { margin: 0; }

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

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

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

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

table { border-collapse: collapse; border-spacing: 0; }

a { color: var(--electric); text-decoration: none; }
a:hover { color: var(--neon); }

/* ---------- 2. 设计变量 ---------- */
:root {
  --ink-deep: #06182B;
  --ink-layer: #0E2C47;
  --paper: #F2F5F7;
  --ink-black: #0A1622;
  --neon: #35F0D0;
  --coral: #FF7A45;
  --mist: #7FA8C4;
  --wash: #B9F5EA;
  --electric: #5AD1FF;
  --amber: #FFD166;

  --text-on-ink: #D8E7F1;
  --text-on-ink-dim: #9AB8CE;
  --link-on-paper: #0B5B74;

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

  --shell: 1240px;
  --pad: 24px;
  --header-h: 88px;
  --header-h-compact: 64px;
  --radius: 2px;

  --line: rgba(127, 168, 196, 0.3);
  --line-strong: rgba(127, 168, 196, 0.62);
  --shadow-panel: 0 18px 34px -30px rgba(0, 0, 0, 0.95);
}

/* ---------- 3. 排版与色彩节奏 ---------- */
body {
  background-color: var(--ink-deep);
  color: var(--text-on-ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.012em;
  color: var(--paper);
}

h1 { font-size: clamp(32px, 5.2vw, 72px); }
h2 { font-size: clamp(24px, 3.2vw, 40px); }
h3 { font-size: clamp(18px, 2vw, 24px); }
h4 { font-size: 18px; }

p { line-height: 1.7; }

strong { font-weight: 700; color: var(--paper); }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mist);
}

.lead {
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.75;
  color: #C6DAE8;
  max-width: 62ch;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

/* ---------- 4. 布局骨架 ---------- */
.shell {
  width: min(100% - (var(--pad) * 2), var(--shell));
  margin-inline: auto;
}

#main-content { padding-top: var(--header-h); }
#main-content[data-bleed="true"] { padding-top: 0; }

.grid12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.col-side { grid-column: 1 / span 3; }
.col-main { grid-column: 4 / span 9; }
.col-full { grid-column: 1 / -1; }

.stack { display: grid; gap: 24px; }

.rail {
  position: sticky;
  top: calc(var(--header-h-compact) + 20px);
  display: grid;
  gap: 16px;
  align-content: start;
}

.band {
  background-color: var(--ink-layer);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}

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

/* ---------- 5. 画板 ---------- */
.panel {
  background-color: var(--paper);
  color: var(--text-on-paper, var(--ink-black));
  color: var(--ink-black);
  border: 1px solid rgba(10, 22, 34, 0.18);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-panel);
}

.panel h1,
.panel h2,
.panel h3,
.panel h4 { color: var(--ink-black); }

.panel p { color: #2A3B4C; }

.panel a {
  color: var(--link-on-paper);
  text-decoration: underline;
  text-decoration-color: rgba(53, 240, 208, 0.85);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.panel a:hover {
  color: var(--ink-black);
  text-decoration-color: var(--coral);
}

.panel .btn { text-decoration: none; }
.panel .lead { color: #33475A; }

.panel--layer {
  background-color: var(--ink-layer);
  color: var(--text-on-ink);
  border-color: var(--line);
  box-shadow: none;
}

.panel--layer h1,
.panel--layer h2,
.panel--layer h3,
.panel--layer h4 { color: var(--paper); }
.panel--layer p { color: var(--text-on-ink); }
.panel--layer a { color: var(--electric); text-decoration-color: rgba(53, 240, 208, 0.6); }
.panel--layer a:hover { color: var(--neon); }
.panel--layer .lead { color: #C6DAE8; }

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease,
    border-color 140ms ease;
}

.btn--solid {
  background-color: var(--neon);
  color: var(--ink-deep);
}
.btn--solid:hover {
  background-color: var(--wash);
  color: var(--ink-deep);
  text-decoration: none;
}

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--paper);
}
.btn--ghost:hover {
  border-color: var(--neon);
  color: var(--neon);
  text-decoration: none;
}

.btn--quiet {
  padding-inline: 0;
  color: var(--electric);
}
.btn--quiet:hover { color: var(--neon); text-decoration: none; }

.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ---------- 7. 面包屑与正文容器 ---------- */
.crumb {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--mist);
  margin-bottom: 22px;
}

.crumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

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

.crumb li + li::before {
  content: "/";
  color: rgba(127, 168, 196, 0.45);
}

.crumb a { color: var(--electric); }
.crumb a:hover { color: var(--neon); }
.crumb [aria-current="page"] { color: var(--paper); }

.prose { max-width: 72ch; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 1.9em; }
.prose h3 { margin-top: 1.5em; }

.prose ul li {
  position: relative;
  padding-left: 20px;
}
.prose ul li + li { margin-top: 0.5em; }
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 8px;
  height: 2px;
  background-color: var(--neon);
}

.panel .prose ul li::before { background-color: var(--coral); }

/* ---------- 8. 数字块 / 标签 / 图框 ---------- */
.stat { display: grid; gap: 6px; }

.stat-value {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--paper);
}

.stat-value--neon { color: var(--neon); }
.stat-value--coral { color: var(--coral); }

.panel .stat-value { color: var(--ink-black); }
.panel .stat-value--neon { color: #0B7D6C; }
.panel .stat-value--coral { color: #C24E1E; }

.stat-key {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mist);
}

.panel .stat-key { color: #56697B; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mist);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.tag--neon { border-color: var(--neon); color: var(--neon); }
.tag--coral { border-color: var(--coral); color: var(--coral); }
.tag--solid {
  background-color: var(--neon);
  border-color: var(--neon);
  color: var(--ink-deep);
}

.figure-frame {
  position: relative;
  overflow: hidden;
  background-color: var(--ink-layer);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.figure-frame--16x9 { aspect-ratio: 16 / 9; }
.figure-frame--4x3 { aspect-ratio: 4 / 3; }
.figure-frame--1x1 { aspect-ratio: 1 / 1; }
.figure-frame--3x4 { aspect-ratio: 3 / 4; }

.figure-frame figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 12px 14px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--paper);
  background: linear-gradient(to top, rgba(6, 24, 43, 0.92), rgba(6, 24, 43, 0));
}

/* ---------- 9. 可展开内容组 ---------- */
.expand { border-top: 1px solid var(--line); }
.expand:last-child { border-bottom: 1px solid var(--line); }

.expand-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px;
  text-align: left;
  font-size: clamp(16px, 1.6vw, 18px);
  font-weight: 700;
  color: var(--paper);
  transition: color 140ms ease;
}

.expand-btn:hover { color: var(--neon); }

.expand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--neon);
}

.expand-mark::before,
.expand-mark::after {
  content: "";
  position: absolute;
  background-color: currentColor;
}

.expand-mark::before {
  left: 0;
  right: 0;
  top: 6px;
  height: 2px;
}

.expand-mark::after {
  top: 0;
  bottom: 0;
  left: 6px;
  width: 2px;
  transition: transform 180ms ease, opacity 180ms ease;
}

.expand-btn[aria-expanded="true"] { color: var(--neon); }
.expand-btn[aria-expanded="true"] .expand-mark::after {
  transform: scaleY(0);
  opacity: 0;
}

.expand-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 180ms ease;
}

.expand-body[data-open="true"] { grid-template-rows: 1fr; }

.expand-body > .expand-inner { overflow: hidden; }

.expand-body .expand-inner > * {
  padding-bottom: 20px;
  max-width: 70ch;
}

/* ---------- 10. 页头 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  font-weight: 700;
  color: var(--ink-deep);
  background-color: var(--neon);
  border-radius: var(--radius);
  transform: translateY(-180%);
  transition: transform 160ms ease;
}
.skip-link:focus {
  transform: translateY(0);
  color: var(--ink-deep);
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 80;
  background-image: linear-gradient(
    to bottom,
    rgba(6, 24, 43, 0.92),
    rgba(6, 24, 43, 0)
  );
  background-color: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.site-header[data-scrolled="true"] {
  background-image: none;
  background-color: var(--ink-deep);
  border-bottom-color: var(--line);
}

.header-shell {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-h);
  transition: min-height 180ms ease;
}

.site-header[data-scrolled="true"] .header-shell {
  min-height: var(--header-h-compact);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  flex: 0 0 auto;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--paper);
}

.brand-tagline {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.26em;
  color: var(--mist);
}

.primary-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

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

.nav-list a {
  position: relative;
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #BAD2E2;
  border-bottom: 2px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}
.nav-list a:hover {
  color: var(--paper);
  border-bottom-color: var(--coral);
}

.nav-list a[aria-current="page"] { color: var(--neon); }

.nav-list a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: 2px;
  width: 8px;
  height: 8px;
  background-color: var(--neon);
}

.nav-actions { display: none; }

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

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 11px 13px;
  color: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.nav-toggle-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 18px;
  height: 12px;
}

.nav-toggle-bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  transition: transform 160ms ease, top 160ms ease, bottom 160ms ease;
}

.nav-toggle-bars span:first-child { top: 0; }
.nav-toggle-bars span:last-child { bottom: 0; }

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

.scroll-meter {
  position: absolute;
  left: 0;
  bottom: -1px;
  display: block;
  width: 0;
  height: 2px;
  background-color: var(--neon);
  opacity: 0;
  transition: opacity 160ms ease;
}

.site-header[data-scrolled="true"] .scroll-meter { opacity: 1; }

/* ---------- 11. 页脚 ---------- */
.site-footer {
  margin-top: 96px;
  padding: 64px 0 32px;
  background-color: var(--ink-deep);
  border-top: 1px solid var(--line);
  color: var(--text-on-ink);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 34px 24px;
}

.footer-brand { grid-column: span 3; }

.footer-brand .brand-mark { display: block; margin-bottom: 12px; }

.footer-note {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-on-ink-dim);
}

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

.footer-note--dim {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: rgba(127, 168, 196, 0.78);
}

.footer-col { grid-column: span 2; }
.footer-contact { grid-column: span 3; }

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

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

.footer-col a {
  display: inline-block;
  font-size: 13.5px;
  color: #BAD2E2;
  border-bottom: 1px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}
.footer-col a:hover {
  color: var(--neon);
  border-bottom-color: var(--coral);
  text-decoration: none;
}

.contact-list li {
  font-size: 13px;
  line-height: 1.7;
  color: #BAD2E2;
  overflow-wrap: anywhere;
}

.contact-list li + li { margin-top: 8px; }

.footer-contact .footer-note { margin-top: 12px; }

.version-block {
  margin-top: 56px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
}

.table-scroll::-webkit-scrollbar { height: 6px; }
.table-scroll::-webkit-scrollbar-thumb {
  background-color: var(--line-strong);
  border-radius: 3px;
}

.version-table {
  width: 100%;
  min-width: 620px;
  border: 1px solid var(--line);
}

.version-table th,
.version-table td {
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: left;
  vertical-align: top;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.version-table tr > *:last-child { border-right: 0; }
.version-table tbody tr:last-child th,
.version-table tbody tr:last-child td { border-bottom: 0; }

.version-table thead th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--neon);
  background-color: var(--ink-layer);
}

.version-table tbody th {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--mist);
  background-color: rgba(14, 44, 71, 0.55);
  white-space: nowrap;
}

.version-table tbody td {
  font-family: var(--font-mono);
  color: #C9DCE8;
}

.version-table tbody tr:nth-child(even) td {
  background-color: rgba(127, 168, 196, 0.06);
}

.version-table tbody tr:last-child td { color: var(--amber); }

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--mist);
}

/* ---------- 12. 显现动效 ---------- */
[data-reveal] {
  transition: opacity 400ms ease, transform 400ms ease;
}

html[data-reveal-ready="true"] [data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(8px);
}

/* ---------- 13. 响应式 ---------- */
@media (max-width: 1180px) {
  .header-actions .btn--ghost { display: none; }
}

@media (max-width: 1100px) {
  .nav-list a { padding: 10px 10px; }
  .primary-nav { gap: 10px; }
}

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: repeat(6, 1fr); }
  .footer-brand { grid-column: span 6; }
  .footer-col { grid-column: span 2; }
  .footer-contact { grid-column: span 6; }
}

@media (max-width: 960px) {
  :root { --pad: 20px; --header-h: 72px; }

  #main-content { padding-top: 72px; }

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

  .header-actions { display: none; }

  .primary-nav {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    max-height: 100vh;
    overflow-y: auto;
    padding: calc(var(--header-h) + 20px) var(--pad) 32px;
    background-color: var(--ink-layer);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms;
  }

  .primary-nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

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

  .nav-list a {
    padding: 15px 16px;
    font-size: 17px;
    font-weight: 700;
    color: var(--paper);
    background-color: var(--ink-deep);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .nav-list a:hover {
    border-color: var(--neon);
    color: var(--neon);
  }

  .nav-list a[aria-current="page"] {
    border-color: var(--neon);
    color: var(--neon);
  }

  .nav-list a[aria-current="page"]::after { display: none; }

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

  .nav-actions .btn { width: 100%; padding: 14px 18px; }

  .grid12 { grid-template-columns: repeat(6, 1fr); }
  .col-side { grid-column: 1 / -1; }
  .col-main { grid-column: 1 / -1; }
  .rail {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (max-width: 720px) {
  .site-footer { margin-top: 64px; padding: 48px 0 28px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-brand,
  .footer-contact { grid-column: span 2; }
  .footer-col { grid-column: span 1; }
  .panel { padding: 18px; }
  .footer-base { font-size: 11px; gap: 8px 18px; }
}

@media (max-width: 420px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-col { grid-column: span 1; }
}

/* ---------- 14. 降低动效偏好 ---------- */
@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;
  }

  [data-reveal],
  html[data-reveal-ready="true"] [data-reveal]:not(.is-visible) {
    opacity: 1;
    transform: none;
  }

  .expand-body { transition: none; }
}
