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

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

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: #E8F0FF;
  background-color: #0A0E27;
  background-image: linear-gradient(160deg, #0A0E27 0%, #0D1730 55%, #102A1F 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

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

ul,
ol {
  list-style: none;
}

a {
  color: #39FF88;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #E8F0FF;
}

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

:focus-visible {
  outline: 2px solid #39FF88;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============ CSS Variables ============ */
:root {
  --bg-primary: #0A0E27;
  --bg-secondary: #102A1F;
  --bg-card: rgba(14, 22, 45, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.08);
  --accent-green: #39FF88;
  --accent-orange: #FF6A00;
  --accent-data: #00E5FF;
  --text-primary: #E8F0FF;
  --text-secondary: #A0B0CC;
  --border-green: rgba(57, 255, 136, 0.25);
  --border-soft: rgba(255, 255, 255, 0.08);
  --font-heading: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-number: "Roboto Mono", "JetBrains Mono", SFMono-Regular, Consolas, monospace;
  --container: 1280px;
  --header-capsule-radius: 999px;
  --header-top-offset: 16px;
  --transition-fast: 0.2s ease;
}

/* ============ Container ============ */
.site-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ Header ============ */
.site-header {
  position: fixed;
  top: var(--header-top-offset);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: min(calc(100% - 32px), 1320px);
  border-radius: var(--header-capsule-radius);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 16px 10px 14px;
  background: rgba(10, 14, 39, 0.78);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(57, 255, 136, 0.18);
  border-radius: var(--header-capsule-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.scroll-progress {
  position: absolute;
  top: -1px;
  left: 12px;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-data) 65%, var(--accent-orange));
  border-radius: 999px;
  z-index: 10;
  pointer-events: none;
}

/* ============ Skip Link ============ */
.skip-link {
  position: fixed;
  top: calc(var(--header-top-offset) + 8px);
  left: 16px;
  transform: translateY(-200%);
  z-index: 2000;
  padding: 10px 20px;
  background: #39FF88;
  color: #0A0E27;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  transition: transform 0.2s ease;
  box-shadow: 0 4px 20px rgba(57, 255, 136, 0.4);
}

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

/* ============ Brand ============ */
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.site-brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--accent-green);
  color: #0A0E27;
  font-family: var(--font-number);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  border-radius: 10px;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%);
  box-shadow: 0 0 20px rgba(57, 255, 136, 0.25);
}

.site-brand__text {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  white-space: nowrap;
}

/* ============ Navigation ============ */
.site-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.site-nav__link {
  position: relative;
  display: block;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 0;
  height: 2px;
  background: var(--accent-green);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 0.2s ease;
}

.site-nav__link:hover {
  color: var(--text-primary);
  background: rgba(57, 255, 136, 0.08);
}

.site-nav__link:hover::after {
  width: 60%;
}

.site-nav__link[aria-current="page"] {
  color: var(--accent-green);
  background: rgba(57, 255, 136, 0.1);
  font-weight: 600;
}

.site-nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--accent-green);
  border-radius: 2px;
}

/* ============ Header Meta ============ */
.site-header__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.refresh-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: rgba(57, 255, 136, 0.06);
  border: 1px solid rgba(57, 255, 136, 0.14);
  border-radius: 999px;
  white-space: nowrap;
}

.refresh-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 rgba(57, 255, 136, 0.5);
  animation: refresh-pulse 3s ease-in-out infinite;
}

.refresh-status__text {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

@keyframes refresh-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(57, 255, 136, 0.4);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(57, 255, 136, 0);
  }
}

/* ============ Mobile Nav Toggle ============ */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(57, 255, 136, 0.08);
  border: 1px solid rgba(57, 255, 136, 0.2);
  border-radius: 999px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-toggle:hover {
  background: rgba(57, 255, 136, 0.15);
  border-color: rgba(57, 255, 136, 0.35);
}

.nav-toggle__icon {
  position: relative;
  display: block;
  width: 14px;
  height: 12px;
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 14px;
  height: 2px;
  background: var(--accent-green);
  border-radius: 2px;
  transition: transform 0.25s ease, top 0.25s ease, bottom 0.25s ease;
}

.nav-toggle__icon::before {
  top: 1px;
}

.nav-toggle__icon::after {
  bottom: 1px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before {
  top: 5px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after {
  bottom: 5px;
  transform: rotate(-45deg);
}

.nav-toggle__text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ============ Mobile Nav State ============ */
@media (max-width: 760px) {
  .site-header {
    width: calc(100% - 20px);
    top: 10px;
  }

  .site-header__inner {
    gap: 12px;
    padding: 8px 12px 8px 10px;
  }

  .site-brand__text {
    font-size: 18px;
  }

  .site-brand__mark {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

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

  .refresh-status {
    padding: 5px 10px;
  }

  .refresh-status__text {
    display: none;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: rgba(10, 14, 39, 0.9);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid rgba(57, 255, 136, 0.2);
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }

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

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .site-nav__link {
    display: block;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 14px;
  }

  .site-nav__link::after,
  .site-nav__link[aria-current="page"]::after {
    left: 16px;
    bottom: auto;
    top: 50%;
    width: 3px;
    height: 14px;
    transform: translateY(-50%);
    border-radius: 3px;
  }

  .site-nav__link[aria-current="page"] {
    background: rgba(57, 255, 136, 0.12);
  }

  .site-nav__link:hover::after {
    width: 3px;
  }
}

/* ============ Footer ============ */
.site-footer {
  position: relative;
  background: linear-gradient(180deg, #0A0E27 0%, #0C1226 60%, #102A1F 100%);
  border-top: 1px solid rgba(57, 255, 136, 0.15);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(57, 255, 136, 0.5) 50%, transparent 100%);
}

.site-footer__inner {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 24px 28px;
}

.footer-main {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 48px;
  padding-bottom: 44px;
}

/* Footer Brand */
.footer-brand__logo {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin-bottom: 14px;
  position: relative;
  padding-bottom: 6px;
}

.footer-brand__logo::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36px;
  height: 3px;
  background: var(--accent-green);
  border-radius: 3px;
}

.footer-brand__desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 380px;
}

.footer-brand__slogan {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--font-number);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(57, 255, 136, 0.4);
  text-transform: uppercase;
}

/* Footer Links */
.footer-links__title,
.footer-contact__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  position: relative;
  padding-bottom: 8px;
}

.footer-links__title::before,
.footer-contact__title::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 20px;
  height: 2px;
  background: var(--accent-orange);
  border-radius: 2px;
}

.footer-links__list,
.footer-contact__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links__list a {
  display: inline-block;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 3px 0;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

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

/* Footer Contact */
.footer-contact__list li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 20px;
  position: relative;
}

.footer-contact__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: rgba(0, 229, 255, 0.6);
  transform: rotate(45deg);
}

/* Footer Legal */
.footer-legal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  color: rgba(160, 176, 204, 0.7);
}

/* ============ Common Components ============ */

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.glass-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-green);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 20px rgba(57, 255, 136, 0.04);
}

/* Common Button */
.common-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.common-btn--primary {
  background: var(--accent-green);
  color: #0A0E27;
  box-shadow: 0 4px 16px rgba(57, 255, 136, 0.25);
}

.common-btn--primary:hover {
  background: #52ff9a;
  color: #0A0E27;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(57, 255, 136, 0.35);
}

.common-btn--ghost {
  background: rgba(57, 255, 136, 0.04);
  border: 1px solid var(--border-green);
  color: var(--accent-green);
}

.common-btn--ghost:hover {
  background: rgba(57, 255, 136, 0.12);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* Section Title */
.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
}

.section-title__zh {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  position: relative;
  padding-left: 16px;
}

.section-title__zh::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 24px;
  background: var(--accent-orange);
  border-radius: 4px;
}

.section-title__en {
  font-family: var(--font-number);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(160, 176, 204, 0.6);
}

/* Breadcrumbs */
.breadcrumbs {
  margin-bottom: 24px;
}

.breadcrumbs__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.breadcrumbs__item {
  font-size: 14px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs__item:not(:last-child)::after {
  content: "›";
  color: rgba(160, 176, 204, 0.4);
  font-size: 16px;
  line-height: 1;
}

.breadcrumbs__link {
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

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

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

/* Media Frame */
.media-frame {
  position: relative;
  display: block;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(57, 255, 136, 0.08), rgba(0, 229, 255, 0.05));
  border: 1px solid var(--border-soft);
  aspect-ratio: 16 / 9;
}

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

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

/* Corner Decorative Block */
.corner-block {
  position: absolute;
  width: 52px;
  height: 52px;
  background: var(--accent-green);
  opacity: 0.85;
  z-index: 0;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

.corner-block--orange {
  background: var(--accent-orange);
}

/* Motion Lines Decoration */
.motion-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    45deg,
    transparent 0,
    transparent 12px,
    rgba(57, 255, 136, 0.03) 12px,
    rgba(57, 255, 136, 0.03) 13px
  );
}

/* ============ Responsive Footer ============ */
@media (max-width: 900px) {
  .footer-main {
    grid-template-columns: 1.5fr 1fr;
    gap: 36px;
  }

  .footer-contact {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .site-footer__inner {
    padding: 44px 20px 24px;
  }

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

  .footer-contact {
    grid-column: auto;
  }

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

/* ============ 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;
    transition-delay: 0s !important;
  }

  .glass-card:hover {
    transform: none;
  }

  .common-btn--primary:hover,
  .common-btn--ghost:hover {
    transform: none;
  }
}

/* ============ Print ============ */
@media print {
  .site-header {
    position: static;
    transform: none;
  }

  .site-footer {
    break-inside: avoid;
  }
}
