/* ==========================================================================
   竞博主页 · 共享样式表 /assets/site.css
   框景导航 + 序号轨道 + 档案资料卡
   ========================================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  --ink-deep: #071A2F;
  --ink-black: #0B0F14;
  --panel: #102B46;
  --slate: #24384C;
  --cyan: #35E0E8;
  --gold: #E7B75F;
  --paper: #F4F7F8;
  --mist: #A6B4C3;
  --violet: #8B7BFF;

  --line: rgba(166, 180, 195, 0.22);
  --line-soft: rgba(166, 180, 195, 0.12);
  --line-strong: rgba(53, 224, 232, 0.45);
  --line-gold: rgba(231, 183, 95, 0.42);

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

  --shell-max: 1320px;
  --gutter: clamp(18px, 4vw, 56px);
  --head-h: 76px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h) + 18px);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  color: var(--paper);
  background-color: var(--ink-deep);
  background-image:
    linear-gradient(rgba(166, 180, 195, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(166, 180, 195, 0.045) 1px, transparent 1px),
    radial-gradient(1100px 560px at 80% -12%, rgba(53, 224, 232, 0.1), transparent 62%);
  background-size: 64px 64px, 64px 64px, 100% 100%;
  background-attachment: fixed, fixed, fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--cyan); }
button { font: inherit; }
table { border-collapse: collapse; }

::selection {
  background: var(--cyan);
  color: var(--ink-black);
}

/* ---------- 3. 焦点与可访问性 ---------- */
:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 2px;
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  transform: translateY(-180%);
  padding: 11px 18px;
  border-radius: 2px;
  background: var(--cyan);
  color: var(--ink-black);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: transform 0.2s var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

/* ---------- 4. 头部框景轨 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 26, 47, 0.95);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.site-header::after {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan) 0%, rgba(53, 224, 232, 0.15) 38%, transparent 62%, var(--gold) 100%);
  opacity: 0.75;
}

.header-frame {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 38px);
  max-width: var(--shell-max);
  min-height: var(--head-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* 品牌 */
.brand {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: var(--paper);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(20px, 2.1vw, 26px);
  line-height: 1.05;
  letter-spacing: 0.06em;
  color: var(--paper);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.4;
  letter-spacing: 0.24em;
  color: var(--mist);
  transition: color 0.2s var(--ease);
}

.brand:hover .brand-sub,
.brand:focus-visible .brand-sub { color: var(--cyan); }

/* 导航轨 */
.nav-rail {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  padding-left: clamp(12px, 2vw, 28px);
  border-left: 1px solid var(--line);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(0px, 0.5vw, 10px);
  list-style: none;
}

.nav-item { display: block; }

.nav-link {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 9px 10px;
  color: var(--mist);
  font-size: 14.5px;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: rgba(53, 224, 232, 0.62);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--paper);
  border-bottom-color: rgba(53, 224, 232, 0.55);
}

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

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

/* 检索锚点 */
.search-dock {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.search-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(16, 43, 70, 0.74);
  color: var(--paper);
  font-size: 13.5px;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
    box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.search-link:hover,
.search-link:focus-visible {
  border-color: var(--line-strong);
  background: rgba(16, 43, 70, 0.95);
  color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(53, 224, 232, 0.12);
}

.search-icon {
  position: relative;
  flex: none;
  width: 13px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 6px;
  height: 1.5px;
  background: currentColor;
  transform: rotate(45deg);
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  grid-template-columns: 16px auto;
  grid-template-rows: 1.5px 1.5px;
  row-gap: 4px;
  column-gap: 9px;
  align-items: center;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(16, 43, 70, 0.74);
  color: var(--paper);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

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

.nav-toggle-bar {
  grid-column: 1;
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
}

.nav-toggle-label {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
}

.site-header[data-open] .nav-toggle {
  border-color: var(--line-strong);
  color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(53, 224, 232, 0.1);
}

/* ---------- 5. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(40px, 7vw, 96px);
  background: var(--ink-black);
  border-top: 1px solid var(--line-gold);
  color: var(--mist);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: min(220px, 34%);
  height: 1px;
  background: var(--gold);
}

.footer-shell {
  display: grid;
  grid-template-columns: 1.5fr 0.85fr 0.85fr 1.1fr;
  gap: clamp(24px, 4vw, 56px);
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: clamp(34px, 5.5vw, 68px) var(--gutter) clamp(22px, 3vw, 34px);
}

.footer-brand { display: grid; gap: 10px; align-content: start; }

.footer-brand-link {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(20px, 2vw, 24px);
  letter-spacing: 0.08em;
  color: var(--paper);
  text-decoration: none;
}

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

.footer-brandline {
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--paper);
  opacity: 0.85;
}

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

.footer-feedback {
  margin-top: 4px;
  padding-left: 12px;
  border-left: 2px solid var(--line-gold);
  font-size: 13px;
  line-height: 1.8;
  color: var(--gold);
}

.footer-col { display: block; }

.footer-col-title {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: var(--cyan);
}

.footer-list {
  display: grid;
  gap: 9px;
  list-style: none;
}

.footer-link {
  display: inline-block;
  color: var(--mist);
  font-size: 14.5px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--paper);
  border-bottom-color: var(--cyan);
}

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

.footer-contact { display: grid; gap: 10px; align-content: start; }

.footer-contact-line {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--mist);
  word-break: break-word;
}

.footer-contact-key {
  display: inline-block;
  min-width: 3.2em;
  margin-right: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 16px var(--gutter) clamp(22px, 3vw, 32px);
  border-top: 1px solid rgba(166, 180, 195, 0.14);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: rgba(166, 180, 195, 0.72);
}

.footer-legal { margin: 0; }
.footer-copy { margin: 0; }

/* ---------- 6. 页面容器与板块 ---------- */
.page-shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: clamp(26px, 4vw, 56px) var(--gutter) clamp(40px, 6vw, 72px);
}

.content-col { max-width: 74ch; }

.lede {
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.85;
  color: var(--mist);
}

.section-head {
  display: grid;
  gap: 6px;
  margin-bottom: clamp(16px, 2.4vw, 28px);
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.section-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--cyan);
}

.section-title {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--paper);
}

.section-note {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--mist);
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
}

.rule-gold {
  height: 1px;
  border: 0;
  margin: clamp(24px, 4vw, 44px) 0;
  background: linear-gradient(90deg, var(--gold), rgba(231, 183, 95, 0));
}

.note-line {
  padding-left: 14px;
  border-left: 2px solid var(--gold);
  font-size: 14px;
  line-height: 1.8;
  color: var(--gold);
}

/* ---------- 7. 面包屑 ---------- */
.breadcrumb { margin: 0 0 clamp(18px, 2.6vw, 30px); }

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--mist);
}

.breadcrumb-list > li + li::before {
  content: "/";
  color: rgba(166, 180, 195, 0.45);
}

.breadcrumb-link {
  color: var(--mist);
  text-decoration: none;
}

.breadcrumb-link:hover,
.breadcrumb-link:focus-visible { color: var(--cyan); }

.breadcrumb-current { color: var(--paper); }

/* ---------- 8. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn--primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--ink-black);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: #63ebf1;
  border-color: #63ebf1;
  box-shadow: 0 0 0 4px rgba(53, 224, 232, 0.14);
}

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

.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--line-strong);
  color: var(--cyan);
}

.btn--gold {
  background: transparent;
  border-color: var(--line-gold);
  color: var(--gold);
}

.btn--gold:hover,
.btn--gold:focus-visible {
  background: rgba(231, 183, 95, 0.1);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- 9. 卡片与标签 ---------- */
.card {
  position: relative;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--line);
  background: rgba(16, 43, 70, 0.6);
}

.card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 34px;
  height: 2px;
  background: var(--cyan);
}

.card--gold::before { background: var(--gold); }

.card-title {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.3;
  color: var(--paper);
}

.card-body {
  margin: 0;
  font-size: 15px;
  line-height: 1.85;
  color: var(--mist);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--mist);
}

.tag--cyan {
  border-color: var(--line-strong);
  color: var(--cyan);
}

.tag--gold {
  border-color: var(--line-gold);
  color: var(--gold);
}

/* ---------- 10. 网格与左轨 ---------- */
.grid {
  display: grid;
  gap: clamp(16px, 2.4vw, 28px);
}

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

.grid--rail {
  grid-template-columns: minmax(180px, 232px) minmax(0, 1fr);
  align-items: start;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
}

.rail-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--cyan);
}

.rail-list {
  display: grid;
  gap: 6px;
  list-style: none;
}

.rail-link {
  display: block;
  padding: 6px 0 6px 10px;
  border-left: 1px solid var(--line);
  color: var(--mist);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.rail-link:hover,
.rail-link:focus-visible {
  color: var(--paper);
  border-left-color: var(--cyan);
}

.rail-link[aria-current="true"],
.rail-link[aria-current="page"] {
  color: var(--cyan);
  border-left-color: var(--cyan);
}

/* ---------- 11. 图片容器 ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--media-ratio, 16 / 10);
  border: 1px solid var(--line);
  background:
    linear-gradient(140deg, rgba(16, 43, 70, 0.9), rgba(11, 15, 20, 0.92));
}

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

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

/* ---------- 12. 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: rgba(16, 43, 70, 0.4);
}

.data-table {
  width: 100%;
  min-width: 560px;
  font-size: 14px;
  line-height: 1.7;
}

.data-table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-align: left;
  color: var(--paper);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--mist);
  vertical-align: top;
}

.data-table tbody tr:nth-child(odd) { background: rgba(36, 56, 76, 0.35); }

.data-table tbody tr:hover { background: rgba(53, 224, 232, 0.06); }

/* ---------- 13. 显现与返回顶部 ---------- */
.reveal { transition: opacity 0.55s var(--ease), transform 0.55s var(--ease); }

@media (prefers-reduced-motion: no-preference) {
  .js-reveal-ready .reveal:not(.is-visible) {
    opacity: 0;
    transform: translateY(12px);
  }
}

.to-top {
  position: fixed;
  right: clamp(14px, 3vw, 32px);
  bottom: clamp(14px, 3vw, 32px);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: rgba(11, 15, 20, 0.92);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease),
    visibility 0.24s var(--ease), border-color 0.24s var(--ease);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

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

/* ---------- 14. 响应式 ---------- */
@media (max-width: 1080px) {
  .nav-link { padding: 9px 7px; font-size: 14px; }
  .search-text { font-size: 13px; }
}

@media (max-width: 900px) {
  .header-frame {
    flex-wrap: wrap;
    gap: 10px 12px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .brand { order: 1; flex: 1 1 auto; }
  .nav-toggle { order: 2; display: grid; }
  .search-dock { order: 3; }

  .nav-rail {
    order: 4;
    flex: 1 1 100%;
    display: none;
    justify-content: flex-start;
    padding: 10px 0 4px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

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

  .nav-item { width: 100%; }

  .nav-link {
    width: 100%;
    padding: 13px 12px;
    border-bottom: 1px solid var(--line-soft);
    border-left: 2px solid transparent;
    font-size: 15px;
  }

  .nav-link:hover,
  .nav-link:focus-visible { border-bottom-color: var(--line-soft); border-left-color: var(--cyan); }
  .nav-link[aria-current="page"] { border-bottom-color: var(--line-soft); border-left-color: var(--cyan); }

  .grid--two,
  .grid--three,
  .grid--rail { grid-template-columns: minmax(0, 1fr); }

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

@media (max-width: 560px) {
  body { font-size: 15px; }
  .brand-sub { font-size: 10px; letter-spacing: 0.18em; }
  .search-link { padding: 9px 11px; font-size: 13px; }
  .footer-shell { grid-template-columns: minmax(0, 1fr); }
  .footer-meta { flex-direction: column; align-items: flex-start; }
  .btn { width: 100%; }
  .btn-row { flex-direction: column; }
  .to-top { width: 44px; height: 44px; }
}

@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,
  .js-reveal-ready .reveal:not(.is-visible) {
    opacity: 1 !important;
    transform: none !important;
  }

  .to-top { transform: none !important; }
}

/* ---------- 15. 打印 ---------- */
@media print {
  body {
    background: #fff;
    color: #101820;
    background-image: none;
  }

  .site-header,
  .site-footer,
  .to-top,
  .scroll-progress,
  .nav-toggle { display: none !important; }

  .card,
  .data-table th,
  .table-wrap { border-color: #b9c3cc; background: #fff; }

  .card-title,
  .section-title,
  .data-table th,
  .data-table td { color: #101820; }

  a { color: #101820; text-decoration: underline; }
}
