/* ==========================================================================
   贝博艾弗森赛场 · 全站共享样式
   文件位置 /assets/site.css
   ========================================================================== */

/* ---------- 01. Design Tokens ---------- */
:root {
  --color-primary: #1A0B2E;
  --color-secondary: #3B1F4B;
  --color-accent: #FF4D00;
  --color-accent-alt: #FFB300;
  --color-text: #F8F9FA;
  --color-text-sub: #E5E0D8;
  --color-tag-red: #D32F2F;
  --color-tag-green: #2E7D32;
  --color-tag-blue: #1565C0;
  --color-tag-yellow: #FFC107;

  --font-title: 'Arial Black', 'Noto Sans SC', sans-serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'Roboto Mono', 'Courier New', monospace;

  --header-height: 60px;
  --container-width: 1200px;
  --gutter: 24px;
  --radius: 6px;
  --line-thin: rgba(248, 249, 250, 0.12);
  --grid-line: rgba(248, 249, 250, 0.06);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* ---------- 02. Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-primary);
  padding-top: var(--header-height);
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font-family: inherit;
}

main {
  display: block;
  min-height: 70vh;
  animation: pageEnter 0.3s ease both;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- 03. Typography ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-title);
  line-height: 1.25;
  color: var(--color-text);
  margin: 0 0 0.5em;
}

h1 {
  font-size: 48px;
  font-weight: 900;
}

h2 {
  font-size: 32px;
  font-weight: 900;
}

h3 {
  font-size: 24px;
  font-weight: 900;
}

p {
  margin: 0 0 1em;
}

.prose {
  max-width: 72ch;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-sub);
}

.prose p {
  margin-bottom: 1.2em;
}

.prose a {
  color: var(--color-tag-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--color-accent);
}

[data-year] {
  font-variant-numeric: tabular-nums;
}

/* ---------- 04. Layout & Containers ---------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: 56px;
}

.section-tight {
  padding-block: 32px;
}

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

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

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
  .grid-cols-2,
  .grid-cols-3 {
    grid-template-columns: 1fr;
  }
}

.tech-grid {
  background-color: var(--color-primary);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
  position: relative;
}

/* ---------- 05. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 20px;
  border: none;
  border-radius: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-accent {
  background-color: var(--color-accent);
  color: var(--color-primary);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.btn-accent:hover,
.btn-accent:focus-visible {
  background-color: #ff6a1a;
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 77, 0, 0.3);
}

.btn-ghost {
  background-color: rgba(248, 249, 250, 0.08);
  color: var(--color-text);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background-color: rgba(248, 249, 250, 0.14);
  color: var(--color-accent-alt);
}

.btn-lg {
  min-height: 48px;
  padding: 12px 32px;
  font-size: 16px;
}

/* ---------- 06. Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: rgba(26, 11, 46, 0.97);
  border-bottom: 1px solid rgba(255, 77, 0, 0.25);
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(248, 249, 250, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(248, 249, 250, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.header-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--color-text);
}

.brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  background: var(--color-accent);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  display: inline-block;
}

.brand-mark::after {
  content: '';
  position: absolute;
  inset: 6px;
  background: var(--color-primary);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

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

.brand-text strong {
  font-family: var(--font-title);
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--color-text);
}

.brand-text em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-accent-alt);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

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

.header-actions .btn {
  min-height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

/* ---------- 07. Navigation ---------- */
.site-nav {
  display: flex;
  align-items: center;
}

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

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-sub);
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--color-text);
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-accent-alt);
  opacity: 0.7;
}

.nav-link[aria-current="page"] {
  color: var(--color-text);
  font-weight: 700;
}

.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--color-accent);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 77, 0, 0.4);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-of-type(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-of-type(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-of-type(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- 08. Progress Bar ---------- */
.header-progress {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-alt));
  transition: width 0.08s linear;
}

/* ---------- 09. Back to Top ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-primary);
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.back-to-top small {
  font-size: 10px;
  line-height: 1;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: #ff6a1a;
}

.back-to-top.is-visible::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  pointer-events: none;
  animation: pulseGrow 2s ease-out infinite;
}

@keyframes pulseGrow {
  0% {
    transform: scale(0.85);
    opacity: 0.8;
  }
  70%,
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

/* ---------- 10. Skip Link ---------- */
.skip-link {
  position: absolute;
  top: -48px;
  left: 8px;
  z-index: 2000;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 16px;
  background: var(--color-accent);
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* ---------- 11. Footer ---------- */
.site-footer {
  position: relative;
  margin-top: 48px;
  background-color: var(--color-primary);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  border-top: 1px solid rgba(255, 77, 0, 0.35);
}

.site-footer::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent) 0%, transparent 55%);
  pointer-events: none;
}

.site-footer::after {
  content: 'N29°39′ E91°07′ · ARENA GRID';
  position: absolute;
  right: 24px;
  bottom: 44px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(248, 249, 250, 0.25);
  letter-spacing: 0.12em;
  pointer-events: none;
  white-space: nowrap;
}

.footer-route {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0 0;
}

.route-line {
  flex: 1;
  border-top: 1px dashed rgba(248, 249, 250, 0.22);
}

.route-line:first-child {
  border-top-color: rgba(255, 77, 0, 0.6);
}

.route-coord {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-accent-alt);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 48px;
  padding: 40px 0 48px;
}

.footer-col {
  min-width: 0;
}

.footer-col-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: var(--color-accent);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  display: inline-block;
}

.footer-brand-name {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
  color: var(--color-text);
  margin: 0;
}

.footer-brand-line {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-accent-alt);
  letter-spacing: 0.05em;
  margin: 0;
}

.footer-trust {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-sub);
  border-left: 3px solid var(--color-accent);
  padding-left: 12px;
  margin: 0;
}

.footer-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-accent-alt);
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.footer-title span {
  color: var(--color-accent);
  margin-right: 4px;
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

.footer-list a {
  color: var(--color-text-sub);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-list a:hover {
  color: var(--color-accent);
  padding-left: 4px;
}

.footer-contact-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  color: var(--color-text-sub);
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-accent-alt);
  letter-spacing: 0.05em;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  border-top: 1px solid var(--line-thin);
  padding-block: 16px;
  font-size: 12px;
  color: var(--color-text-sub);
}

.footer-copy,
.footer-icp {
  margin: 0;
}

/* ---------- 12. Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-block: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-sub);
}

.breadcrumb a {
  color: var(--color-text-sub);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--color-accent);
}

.breadcrumb-sep {
  color: var(--color-accent);
  opacity: 0.6;
}

/* ---------- 13. Section Header ---------- */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-thin);
  padding-bottom: 12px;
  margin-bottom: 32px;
}

.section-header h1,
.section-header h2,
.section-header h3 {
  margin: 0;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-accent-alt);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ---------- 14. Cards ---------- */
.card {
  background: var(--color-secondary);
  border: 1px solid var(--line-thin);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: rgba(255, 77, 0, 0.3);
}

.data-card {
  position: relative;
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-primary) 100%);
  border: 1px solid var(--line-thin);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 20px;
}

.data-card[data-coord]::after {
  content: attr(data-coord);
  position: absolute;
  top: 8px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(248, 249, 250, 0.3);
  letter-spacing: 0.05em;
}

/* ---------- 15. Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  background: rgba(248, 249, 250, 0.12);
  color: var(--color-text);
  white-space: nowrap;
}

.tag[data-tag="hot"] {
  background: var(--color-tag-yellow);
  color: var(--color-primary);
}

.tag[data-tag="new"] {
  background: var(--color-tag-green);
  color: #ffffff;
}

.tag[data-tag="alert"] {
  background: var(--color-tag-red);
  color: #ffffff;
}

.tag[data-tag="info"] {
  background: var(--color-tag-blue);
  color: #ffffff;
}

/* ---------- 16. Responsive ---------- */
@media (max-width: 1024px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .footer-col-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 960px) {
  .site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--color-primary);
    border-bottom: 2px solid var(--color-accent);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  }

  .site-nav[data-open] {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 16px;
  }

  .nav-link {
    padding: 14px 8px;
    border-bottom: 1px solid var(--line-thin);
    font-size: 15px;
    justify-content: space-between;
  }

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

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

  .nav-toggle {
    display: flex;
  }

  .brand-text em {
    display: none;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 28px;
  }

  h3 {
    font-size: 22px;
  }

  .section {
    padding-block: 40px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-col-brand {
    grid-column: auto;
  }
}

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

  .header-actions .btn {
    min-height: 32px;
    padding: 0 12px;
    font-size: 12px;
  }

  .brand-text strong {
    font-size: 14px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .route-coord {
    font-size: 10px;
  }
}

/* ---------- 17. Focus Visible ---------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------- 18. Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  main {
    animation: none;
  }

  .back-to-top {
    transition: none;
  }

  .back-to-top.is-visible::before {
    animation: none;
    display: none;
  }

  .header-progress {
    transition: none;
  }
}
