/* ==========================================================
   半岛竞技 · 全站共享样式
   File: /assets/site.css
   ========================================================== */

/* ---------- 1. Design Tokens ---------- */
:root {
  --plateau: #0F3A5A;
  --snow: #F4F6F0;
  --heat: #FF6B35;
  --fluoro: #00E676;
  --slate: #2A353E;
  --wine: #7B2D45;
  --indigo: #3B2A55;
  --steel: #7A8E9E;
  --ink: #0A0F14;
  --ice: #E8F0F4;

  --font-head: 'Source Han Sans CN', 'Noto Sans CJK SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-data: 'JetBrains Mono', 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
  --font-body: 'Source Han Sans CN', 'Noto Sans CJK SC', system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif;

  --rail-width: 280px;
  --header-bar-h: 60px;
  --content-max: 1280px;
  --container-pad: 24px;
  --gutter: 24px;

  --z-skip: 5000;
  --z-progress: 4000;
  --z-toggle: 300;
  --z-rail: 200;
  --z-backtop: 190;
  --z-overlay: 150;
  --z-header: 1000;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--snow);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button {
  cursor: pointer;
  background: transparent;
  border: 0;
}

a {
  color: var(--plateau);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--heat);
}

ul,
ol {
  list-style: none;
}

address {
  font-style: normal;
}

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

/* ---------- 3. Base Typography ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-head);
  font-weight: 900;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.625rem); }
h2 { font-size: clamp(1.625rem, 3vw, 2.375rem); }
h3 { font-size: 1.3125rem; }
h4 { font-size: 1.125rem; }

p {
  line-height: 1.8;
}

/* ---------- 4. Utilities ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.numeric,
code,
.nav-index,
.score-chip,
.data-table {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
}

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

/* ---------- 5. Layout ---------- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: 64px;
}

.grid {
  display: grid;
  gap: var(--gutter);
}

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

.divider {
  height: 1px;
  border: 0;
  background: rgba(122, 142, 158, 0.25);
  margin-block: 48px;
}

/* ---------- 6. Section Heading ---------- */
.section-head {
  margin-bottom: 32px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--font-data);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel);
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--heat);
}

.section-title {
  margin-bottom: 8px;
}

.section-desc {
  color: var(--steel);
  max-width: 60ch;
}

/* ---------- 7. Cards ---------- */
.card {
  background: #fff;
  border: 1px solid rgba(122, 142, 158, 0.2);
  border-radius: 0;
  padding: 24px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(122, 142, 158, 0.15);
}

.card-body {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--ink);
}

/* ---------- 8. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

.btn-primary {
  background: var(--heat);
  color: #fff;
}

.btn-primary:hover {
  background: #e75a24;
  color: #fff;
}

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

.btn-ghost:hover {
  background: var(--plateau);
  color: var(--snow);
}

/* ---------- 9. Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-family: var(--font-data);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  border-radius: 0;
  background: var(--ice);
  color: var(--plateau);
  white-space: nowrap;
}

.badge-live {
  background: rgba(0, 230, 118, 0.14);
  color: #0a6b3c;
}

.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--fluoro);
}

.badge-alert {
  background: var(--wine);
  color: #fff;
}

/* ---------- 10. Score Chip ---------- */
.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.875rem;
  font-weight: 700;
  background: var(--ice);
  border-left: 3px solid var(--heat);
  white-space: nowrap;
}

/* ---------- 11. Callout ---------- */
.callout {
  padding: 18px 20px;
  background: var(--ice);
  border-left: 4px solid var(--indigo);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.callout-wine {
  border-left-color: var(--wine);
  background: rgba(123, 45, 69, 0.08);
}

/* ---------- 12. Data Table ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--plateau);
  color: var(--snow);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(122, 142, 158, 0.15);
}

.data-table tbody tr:hover td {
  background: var(--ice);
}

/* ---------- 13. Index List ---------- */
.index-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(122, 142, 158, 0.25);
}

.index-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 6px;
  border-bottom: 1px solid rgba(122, 142, 158, 0.25);
  text-decoration: none;
  color: var(--ink);
  transition: color 200ms ease, padding-left 200ms ease;
}

.index-list a:hover {
  color: var(--heat);
  padding-left: 10px;
}

.index-list .idx {
  font-family: var(--font-data);
  font-size: 0.75rem;
  color: var(--steel);
}

/* ---------- 14. Prose ---------- */
.prose {
  max-width: 70ch;
  font-size: 1rem;
  line-height: 1.9;
}

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

/* ---------- 15. Breadcrumbs ---------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-data);
  font-size: 0.75rem;
  color: var(--steel);
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs li + li::before {
  content: '/';
  color: var(--steel);
}

.breadcrumbs a {
  color: var(--steel);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--heat);
}

/* ---------- 16. Image Frame ---------- */
.image-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ice);
  border: 1px solid rgba(122, 142, 158, 0.25);
}

.image-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- 17. Skip Link ---------- */
.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: var(--z-skip);
  padding: 10px 18px;
  background: var(--heat);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  transform: translateY(-300%);
  transition: transform 200ms ease;
}

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

/* ---------- 18. Scroll Progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: var(--z-progress);
  pointer-events: none;
}

.scroll-progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--fluoro) 0%, var(--heat) 55%, var(--wine) 100%);
  transition: width 120ms ease-out;
}

/* ---------- 19. Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
}

.header-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-bar-h);
  padding: 0 16px;
  background: var(--ink);
  border-bottom: 1px solid rgba(244, 246, 240, 0.08);
  z-index: var(--z-toggle);
}

.site-header.is-scrolled .header-bar {
  box-shadow: 0 2px 16px rgba(10, 15, 20, 0.35);
}

.brand-compact-link {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  text-decoration: none;
  color: var(--snow);
}

.brand-compact-link:hover {
  color: var(--fluoro);
}

.brand-compact-mark {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1;
}

.brand-compact-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--fluoro);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(244, 246, 240, 0.15);
  background: transparent;
}

.nav-toggle-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 20px;
}

.nav-toggle-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--snow);
  transition: transform 250ms ease, opacity 200ms ease;
}

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

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

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

.site-rail {
  position: fixed;
  top: var(--header-bar-h);
  left: 0;
  width: min(300px, 86vw);
  height: calc(100vh - var(--header-bar-h));
  z-index: var(--z-rail);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(rgba(122, 142, 158, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 142, 158, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, var(--ink) 0%, var(--plateau) 100%);
  background-size: 24px 24px, 24px 24px, auto;
  border-right: 1px solid rgba(122, 142, 158, 0.18);
  transform: translateX(-100%);
  transition: transform 250ms ease;
}

.site-rail[data-open] {
  transform: translateX(0);
  box-shadow: 12px 0 32px rgba(10, 15, 20, 0.45);
}

.site-header.is-scrolled .site-rail {
  box-shadow: 6px 0 20px rgba(10, 15, 20, 0.25);
}

body.nav-open {
  overflow: hidden;
}

body.nav-open::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(10, 15, 20, 0.55);
}

body.nav-open .back-top {
  opacity: 0;
  visibility: hidden;
}

.rail-head {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(244, 246, 240, 0.1);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-sigil {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  background: var(--plateau);
  border: 1px solid rgba(244, 246, 240, 0.3);
  overflow: hidden;
}

.brand-sigil::before {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 26px;
  background: var(--heat);
  clip-path: polygon(0 100%, 22% 44%, 40% 68%, 62% 20%, 100% 100%);
}

.brand-sigil::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  background: var(--fluoro);
}

.brand-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-head);
  font-size: 1.375rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--snow);
}

.brand-slogan {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: rgba(244, 246, 240, 0.55);
  margin-top: 4px;
}

.rail-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 0;
}

.rail-menu {
  display: flex;
  flex-direction: column;
}

.rail-item {
  position: relative;
}

.rail-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: rgba(244, 246, 240, 0.72);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color 200ms ease, background-color 200ms ease, border-left-color 200ms ease;
}

.rail-link:hover {
  color: var(--snow);
  background: rgba(244, 246, 240, 0.05);
}

.rail-link[aria-current="page"] {
  color: var(--snow);
  border-left-color: var(--heat);
  background: linear-gradient(90deg, rgba(255, 107, 53, 0.18) 0%, transparent 100%);
}

.nav-index {
  font-family: var(--font-data);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: rgba(244, 246, 240, 0.4);
  min-width: 18px;
}

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

.rail-foot {
  padding: 20px 24px 24px;
  border-top: 1px solid rgba(244, 246, 240, 0.08);
}

.rail-foot::before {
  content: '';
  display: block;
  height: 14px;
  margin-bottom: 16px;
  background: linear-gradient(90deg, var(--wine), var(--heat));
  clip-path: polygon(
    0 100%, 0 42%, 9% 58%, 18% 12%, 29% 48%, 42% 24%,
    55% 70%, 68% 28%, 80% 62%, 100% 20%, 100% 100%
  );
  opacity: 0.55;
}

.refresh-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(244, 246, 240, 0.85);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--fluoro);
  animation: live-pulse 2.4s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.rail-caption {
  margin-top: 8px;
  font-family: var(--font-data);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: rgba(244, 246, 240, 0.4);
}

/* ---------- 20. Back to Top ---------- */
.back-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--z-backtop);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--slate);
  border: 1px solid rgba(244, 246, 240, 0.2);
  color: var(--snow);
  box-shadow: 0 4px 16px rgba(10, 15, 20, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 250ms ease, transform 250ms ease, visibility 250ms, background-color 200ms ease;
}

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

.back-top:hover {
  background: var(--heat);
  border-color: var(--heat);
  color: #fff;
}

.back-top-icon {
  font-size: 1.25rem;
  line-height: 1;
}

/* ---------- 21. Footer ---------- */
.site-footer {
  background: var(--slate);
  color: rgba(244, 246, 240, 0.82);
  border-top: 1px solid rgba(122, 142, 158, 0.2);
}

.site-footer::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--plateau) 0%, var(--indigo) 30%, var(--wine) 55%, var(--heat) 80%, var(--fluoro) 100%);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.3fr 1fr;
  gap: 40px;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 48px 24px 40px;
}

.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.footer-brand-name {
  font-family: var(--font-head);
  font-size: 1.375rem;
  font-weight: 900;
  color: var(--snow);
}

.footer-slogan {
  margin-top: 14px;
  font-size: 0.875rem;
  color: var(--steel);
}

.footer-trust {
  margin-top: 16px;
  font-size: 0.875rem;
  line-height: 1.8;
  color: rgba(244, 246, 240, 0.55);
  max-width: 44ch;
}

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

.footer-heading {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 246, 240, 0.4);
  margin-bottom: 16px;
}

.footer-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-menu a {
  color: rgba(244, 246, 240, 0.75);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 200ms ease;
}

.footer-menu a:hover {
  color: var(--heat);
}

.footer-address p {
  margin-bottom: 14px;
  font-size: 0.875rem;
  color: rgba(244, 246, 240, 0.75);
}

.footer-address .contact-label {
  display: block;
  font-family: var(--font-data);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: rgba(244, 246, 240, 0.35);
  margin-bottom: 2px;
}

.footer-address a {
  color: var(--fluoro);
  text-decoration: none;
}

.footer-address a:hover {
  color: var(--heat);
}

.contact-note {
  margin-top: 12px;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: rgba(244, 246, 240, 0.45);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 20px 24px;
  border-top: 1px solid rgba(244, 246, 240, 0.08);
  font-family: var(--font-data);
  font-size: 0.75rem;
  color: rgba(244, 246, 240, 0.4);
}

/* ---------- 22. Responsive ---------- */
@media (min-width: 1024px) {
  body {
    padding-left: var(--rail-width);
  }

  .site-header {
    right: auto;
    width: var(--rail-width);
    height: 100vh;
  }

  .header-bar {
    display: none;
  }

  .site-rail {
    position: static;
    top: auto;
    left: auto;
    width: 100%;
    height: 100%;
    transform: none;
    transition: none;
    z-index: auto;
    box-shadow: none;
  }

  .site-rail[data-open] {
    transform: none;
    box-shadow: none;
  }

  body.nav-open {
    overflow: auto;
  }

  body.nav-open::before {
    display: none;
  }

  body.nav-open .back-top {
    opacity: 0;
    visibility: hidden;
  }

  .site-header.is-scrolled .site-rail {
    box-shadow: 4px 0 24px rgba(10, 15, 20, 0.28);
  }

  .rail-head {
    padding: 32px 24px 22px;
  }

  .rail-link {
    padding-block: 13px;
  }
}

@media (max-width: 1023px) and (min-width: 768px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .section {
    padding-block: 48px;
  }

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

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- 23. 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;
  }

  .live-dot {
    animation: none;
  }
}
