/* ============ 根变量 ============ */
:root {
  --color-primary: #FF6B00;
  --color-bg-dark: #0A1E3C;
  --color-bg-card: #12294B;
  --color-accent: #D4FF00;
  --color-purple-start: #8B5CF6;
  --color-purple-end: #D946EF;
  --color-text-light: #F0F4F8;
  --color-text-muted: #A0B0C0;
  --color-bg-light: #F8FAFC;
  --color-border: #293B56;
  --font-title: "Noto Sans SC Black", "Arial Black", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Roboto Mono", monospace;
  --container: 1200px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  background: var(--color-bg-dark);
  color: var(--color-text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

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

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

a,
button {
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.08);
}

ul,
ol {
  list-style: none;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-title);
  font-weight: 900;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: inherit;
}

h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  letter-spacing: -0.5px;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(255, 107, 0, 0.15);
}

/* ============ 容器与正文区 ============ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.site-main {
  flex: 1 0 auto;
  background: var(--color-bg-dark);
}

#main-content {
  scroll-margin-top: 80px;
}

#main-content:focus {
  outline: none;
}

.content-shell {
  position: relative;
  background: var(--color-bg-light);
  color: #1A2436;
  padding: clamp(24px, 4vw, 56px);
  margin: 32px auto;
  max-width: var(--container);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.content-shell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 96px;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

.content-shell h1,
.content-shell h2,
.content-shell h3,
.content-shell h4 {
  color: var(--color-bg-dark);
}

.content-shell h2 {
  margin-top: 40px;
}

.content-shell h3 {
  margin-top: 24px;
}

.content-shell li {
  line-height: 1.9;
}

.content-shell a:not([class]) {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.content-shell a:not([class]):hover {
  text-decoration-thickness: 2px;
}

.content-shell .btn-ghost {
  color: var(--color-bg-dark);
}

.content-shell .btn-ghost:hover {
  background: rgba(10, 30, 60, 0.06);
  color: var(--color-bg-dark);
}

/* ============ 通用网格 ============ */
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 24px;
}

@media (min-width: 769px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

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

/* ============ 共享头部 ============ */
.skip-link {
  position: fixed;
  left: -9999px;
  top: 0;
  z-index: 300;
  background: var(--color-accent);
  color: var(--color-bg-dark);
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 14px;
  padding: 12px 24px;
  text-decoration: none;
}

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

.skip-link:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg-dark);
}

.site-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
  clip-path: polygon(0 0, 84% 0, 100% 100%, 0% 100%);
  z-index: 1;
}

.progress-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  z-index: 20;
}

.progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

.header-shell {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-title);
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--color-text-light);
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 32px;
  background: var(--color-primary);
  color: var(--color-bg-dark);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  transform: skewX(-12deg);
}

.brand-mark > span {
  display: inline-block;
  transform: skewX(12deg);
}

.brand-name {
  font-weight: 900;
}

.nav {
  display: flex;
  align-items: center;
}

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

.nav-item {
  margin: 0;
}

.nav-link {
  display: block;
  position: relative;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--color-text-muted);
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover {
  color: var(--color-text-light);
  background: rgba(255, 255, 255, 0.04);
}

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

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 3px;
  background: var(--color-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 48px;
  height: 44px;
  border: 1px solid var(--color-border);
  background: transparent;
  padding: 8px;
}

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

.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

.nav-toggle[aria-expanded="true"] .toggle-bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============ 共享页脚 ============ */
.site-footer {
  position: relative;
  flex-shrink: 0;
  background: #050F1F;
  color: var(--color-text-muted);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-primary) 100%);
  clip-path: polygon(0 0, 100% 0, calc(100% - 22%) 100%, 0% 100%);
}

.footer-shell {
  padding-top: 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.2fr;
  gap: 32px;
  padding-bottom: 40px;
}

.footer-brand-cell,
.footer-link-cell,
.footer-contact-cell {
  min-width: 0;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 24px;
  color: var(--color-text-light);
}

.footer-brand::before {
  content: "";
  width: 12px;
  height: 24px;
  background: var(--color-primary);
  transform: skewX(-12deg);
  flex-shrink: 0;
}

.footer-trust {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-text-muted);
  max-width: 38em;
}

.footer-heading {
  font-family: var(--font-title);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-primary);
  margin: 0 0 14px;
}

.footer-links li {
  margin-bottom: 6px;
}

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

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

.footer-contact-line {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.6;
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding: 16px 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
}

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

/* ============ 通用按钮 ============ */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border: 2px solid var(--color-primary);
  background: var(--color-primary);
  color: var(--color-bg-dark);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.btn:hover {
  background: #ff8533;
  border-color: #ff8533;
  box-shadow: 0 8px 24px rgba(255, 107, 0, 0.3);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-bg-dark);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-light);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn-skew {
  transform: skewX(-12deg);
}

.btn-skew:hover {
  transform: skewX(-12deg) translateY(-2px);
}

.btn-skew > span {
  display: inline-block;
  transform: skewX(12deg);
}

/* ============ 面包屑 ============ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  margin-right: 8px;
  color: var(--color-border);
  font-family: var(--font-mono);
}

.breadcrumb-item a {
  color: inherit;
}

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

.breadcrumb-item[aria-current="page"] {
  color: var(--color-primary);
  font-weight: 700;
}

/* ============ 图片容器 ============ */
.img-frame {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-card);
  display: block;
}

.img-frame::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}

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

.img-frame--square::before {
  padding-top: 100%;
}

.img-frame--portrait::before {
  padding-top: 133%;
}

.img-frame--wide::before {
  padding-top: 62.5%;
}

.img-frame--clipped {
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
}

/* ============ 数据叙事组件 ============ */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-primary);
}

.section-label::before {
  content: "";
  width: 24px;
  height: 2px;
  background: currentColor;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--color-bg-card);
  color: var(--color-text-light);
  border: 1px solid var(--color-border);
}

.tag--primary {
  background: var(--color-primary);
  color: var(--color-bg-dark);
  border-color: var(--color-primary);
}

.tag--accent {
  background: var(--color-accent);
  color: var(--color-bg-dark);
  border-color: var(--color-accent);
}

.tag--purple {
  background: linear-gradient(90deg, var(--color-purple-start), var(--color-purple-end));
  color: #ffffff;
  border-color: transparent;
}

.mega-index {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .mega-index {
    background: linear-gradient(135deg, var(--color-primary), var(--color-purple-start), var(--color-purple-end));
    color: transparent;
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
  }
}

.divider {
  height: 1px;
  border: none;
  margin: 32px 0;
  background: currentColor;
  opacity: 0.12;
}

/* ============ 滚动显现 ============ */
[data-reveal].will-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease var(--reveal-delay, 0ms), transform 0.5s ease var(--reveal-delay, 0ms);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

@media (max-width: 768px) {
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .site-header::before {
    height: 3px;
  }

  .header-shell {
    min-height: 56px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg-dark);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.4);
    max-height: calc(100vh - 56px);
    overflow-y: auto;
  }

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

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

  .nav-link {
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border);
  }

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

  .nav-link[aria-current="page"] {
    background: rgba(255, 107, 0, 0.08);
  }

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

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

  .content-shell {
    margin: 20px auto;
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .container,
  .header-shell.container,
  .footer-shell.container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .content-shell {
    padding: 20px;
  }

  .brand-name {
    font-size: 18px;
  }

  .brand-mark {
    width: 36px;
    height: 30px;
    font-size: 13px;
  }
}

/* ============ Reduced Motion ============ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal].will-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn:hover {
    transform: none;
  }

  .btn-skew:hover {
    transform: skewX(-12deg);
  }

  .nav-toggle[aria-expanded="true"] .toggle-bar {
    transition: none;
  }
}
