/* ========== CSS Variables ========== */
:root {
  --primary-bg: #0a0e27;
  --secondary-bg: #0f1f14;
  --accent-green: #c6ff00;
  --accent-blue: #00e0ff;
  --text-primary: #ffffff;
  --text-secondary: #b0bec5;
  --border-light: rgba(255, 255, 255, 0.15);
  --highlight-amber: #ffd166;

  --font-display: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-data: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --font-body: "Inter", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  --container-width: 1240px;
  --radius: 4px;
  --header-height: 100px;
}

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

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

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 88% 8%, rgba(0, 224, 255, 0.08), transparent 36%),
    radial-gradient(circle at 6% 82%, rgba(198, 255, 0, 0.05), transparent 28%),
    linear-gradient(180deg, var(--primary-bg) 0%, #0a1026 48%, var(--secondary-bg) 100%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

ul,
ol {
  list-style: none;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.2;
}

p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: rgba(198, 255, 0, 0.25);
  color: #ffffff;
}

/* ========== Typography ========== */
.site-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 72px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.data-text {
  font-family: var(--font-data);
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========== Layout ========== */
.container {
  width: min(100% - 48px, var(--container-width));
  margin-inline: auto;
}

.page-body {
  padding: 48px 0 72px;
  min-height: 60vh;
}

#main-content {
  outline: none;
  scroll-margin-top: calc(var(--header-height) + 16px);
}

/* ========== Breadcrumb ========== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  margin-bottom: 32px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}

.breadcrumb a {
  color: var(--text-secondary);
}

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

.breadcrumb-sep {
  color: rgba(255, 255, 255, 0.3);
}

.breadcrumb-current {
  color: var(--text-primary);
  font-family: var(--font-data);
  font-size: 13px;
}

/* ========== Buttons ========== */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}

.btn-primary {
  background: var(--accent-green);
  color: #0a0e27;
  border-color: var(--accent-green);
}

.btn-primary:hover {
  background: #b5e600;
  color: #0a0e27;
  border-color: #b5e600;
  box-shadow: 0 4px 28px rgba(198, 255, 0, 0.28);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-outline {
  background: transparent;
  color: var(--accent-blue);
  border-color: rgba(0, 224, 255, 0.5);
}

.btn-outline:hover {
  background: rgba(0, 224, 255, 0.12);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  box-shadow: 0 0 24px rgba(0, 224, 255, 0.12);
}

/* ========== Grid ========== */
.grid {
  display: grid;
  gap: 24px;
}

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

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

/* ========== Section ========== */
.section {
  padding: 48px 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 28px;
}

.section-index {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-green);
  letter-spacing: 0.12em;
  line-height: 1;
}

.section-title {
  font-size: clamp(24px, 3vw, 40px);
}

/* ========== Stack Panel ========== */
.stack-panel {
  background: linear-gradient(135deg, rgba(15, 31, 20, 0.85) 0%, rgba(10, 14, 39, 0.6) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.stack-panel:hover {
  border-color: rgba(0, 224, 255, 0.45);
  box-shadow: 0 0 44px rgba(0, 224, 255, 0.08);
}

/* ========== Info Card ========== */
.info-card {
  background: var(--secondary-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.info-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-blue);
  opacity: 0.6;
  transition: opacity 0.3s ease, width 0.3s ease;
}

.info-card:hover {
  border-color: rgba(0, 224, 255, 0.3);
}

.info-card:hover::before {
  opacity: 1;
  width: 4px;
}

/* ========== Data Panel ========== */
.data-panel {
  background: rgba(10, 14, 39, 0.88);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  font-family: var(--font-data);
  transition: border-color 0.3s ease;
}

.data-panel:hover {
  border-color: rgba(198, 255, 0, 0.3);
}

.data-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-body);
}

.data-panel-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.data-panel-value {
  font-family: var(--font-data);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-green);
  line-height: 1;
  letter-spacing: -0.02em;
}

/* ========== Tags ========== */
.tag {
  display: inline-block;
  padding: 4px 10px;
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

.tag-green {
  color: var(--accent-green);
  border-color: rgba(198, 255, 0, 0.3);
  background: rgba(198, 255, 0, 0.06);
}

.tag-blue {
  color: var(--accent-blue);
  border-color: rgba(0, 224, 255, 0.3);
  background: rgba(0, 224, 255, 0.06);
}

.tag-amber {
  color: var(--highlight-amber);
  border-color: rgba(255, 209, 102, 0.3);
  background: rgba(255, 209, 102, 0.06);
}

/* ========== Media Frame ========== */
.media-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  background:
    linear-gradient(45deg, rgba(0, 224, 255, 0.07) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(198, 255, 0, 0.05) 25%, transparent 25%),
    linear-gradient(135deg, rgba(15, 31, 20, 0.9) 0%, rgba(10, 14, 39, 0.7) 100%);
  background-size: 26px 26px, 26px 26px, 100% 100%;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(0, 224, 255, 0.08) 80%);
  pointer-events: none;
}

.media-frame--ratio-16-9 {
  aspect-ratio: 16 / 9;
}

.media-frame--ratio-4-3 {
  aspect-ratio: 4 / 3;
}

.media-frame--ratio-1-1 {
  aspect-ratio: 1 / 1;
}

/* ========== Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 10, 26, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.site-header::before {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-green) 0%, var(--accent-blue) 100%);
}

.header-shell {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 12px;
  gap: 16px;
}

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

.brand:hover {
  color: var(--accent-green);
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-green);
  line-height: 0;
  filter: drop-shadow(0 0 8px rgba(198, 255, 0, 0.35));
}

.brand-svg {
  display: block;
}

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

.brand-zh {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.brand-en {
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: 5px;
}

.masthead-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(198, 255, 0, 0.3);
  border-radius: 2px;
  background: rgba(198, 255, 0, 0.06);
  margin-left: auto;
  white-space: nowrap;
}

.season-year {
  font-family: var(--font-data);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-green);
  line-height: 1;
}

.season-label {
  font-family: var(--font-data);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
  text-transform: uppercase;
  line-height: 1;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: transparent;
  transition: background-color 0.25s, border-color 0.25s;
}

.nav-toggle:hover {
  border-color: rgba(0, 224, 255, 0.5);
  background: rgba(0, 224, 255, 0.08);
}

.nav-toggle-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s 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);
}

.primary-nav {
  border-top: 1px solid var(--border-light);
}

.nav-list {
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 0;
}

.nav-item {
  flex: none;
}

.nav-link {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.nav-link:hover {
  color: var(--accent-blue);
  border-bottom-color: rgba(0, 224, 255, 0.6);
  background: rgba(0, 224, 255, 0.04);
}

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

/* ========== Footer ========== */
.site-footer {
  background: linear-gradient(180deg, rgba(15, 31, 20, 0.5) 0%, #060912 100%);
  border-top: 1px solid var(--border-light);
  margin-top: 80px;
}

.footer-shell {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 56px 24px 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr;
  gap: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-light);
}

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

.footer-brand-col .brand-zh {
  font-size: 24px;
}

.footer-desc {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.footer-trust {
  margin-top: 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  border-left: 2px solid rgba(198, 255, 0, 0.5);
  padding-left: 12px;
  line-height: 1.7;
}

.footer-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-body);
}

.footer-links li + li,
.footer-contact-item + .footer-contact-item {
  margin-top: 10px;
}

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

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

.footer-contact-list {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-contact-item {
  display: flex;
  gap: 10px;
  line-height: 1.7;
  padding: 2px 0;
}

.footer-contact-label {
  flex-shrink: 0;
  min-width: 34px;
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 1px;
}

.footer-contact-value {
  word-break: break-all;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 22px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

.footer-copyright {
  font-family: var(--font-data);
}

.footer-icp {
  font-family: var(--font-data);
}

.footer-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
}

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

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 999;
  padding: 12px 20px;
  background: var(--accent-green);
  color: #0a0e27;
  font-weight: 700;
  font-size: 14px;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.skip-link:hover {
  color: #0a0e27;
  background: var(--accent-green);
}

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

/* ========== Scroll Progress ========== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-green) 100%);
  z-index: 200;
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ========== Return Top ========== */
.return-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 90;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(0, 224, 255, 0.5);
  background: rgba(10, 14, 39, 0.92);
  color: var(--accent-blue);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  cursor: pointer;
}

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

.return-top:hover {
  background: rgba(0, 224, 255, 0.15);
  color: var(--accent-green);
  border-color: rgba(198, 255, 0, 0.5);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .footer-nav-col {
    order: 3;
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 80px;
  }

  .container {
    width: min(100% - 32px, var(--container-width));
  }

  .page-body {
    padding: 32px 0 56px;
  }

  .section {
    padding: 32px 0;
  }

  .section-title {
    font-size: 24px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .stack-panel,
  .info-card,
  .data-panel {
    padding: 20px;
  }

  .masthead {
    padding: 12px 0;
  }

  .masthead-meta {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(7, 10, 26, 0.98);
    border-bottom: 1px solid var(--border-light);
    border-top: 1px solid var(--border-light);
    padding: 8px 24px 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  }

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

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

  .nav-link {
    padding: 14px 12px;
    border-left: 2px solid transparent;
    border-bottom: none;
    font-size: 16px;
  }

  .nav-link:hover,
  .nav-link[aria-current="page"] {
    border-left-color: var(--accent-green);
    border-bottom: none;
    background: rgba(255, 255, 255, 0.04);
    color: var(--accent-green);
  }

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

  .footer-nav-col {
    grid-column: auto;
    order: 0;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    text-align: left;
  }

  .footer-shell {
    padding: 40px 20px 24px;
  }

  .return-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .brand-zh {
    font-size: 19px;
  }

  .brand-en {
    font-size: 9px;
  }

  .brand-mark .brand-svg {
    width: 30px;
    height: 30px;
  }

  .btn {
    width: 100%;
  }
}

/* ========== Motion Preferences ========== */
@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;
  }

  .scroll-progress {
    display: none;
  }

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