@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap');

/* ============================================================
   CSS 变量与基础重置
   ============================================================ */
:root {
  --c-red: #ff0000;
  --c-pink: #ff006e;
  --c-dark: #1a1a2e;
  --c-dark2: #0d0d1a;
  --c-dark3: #12122a;
  --c-cyan: #00e5ff;
  --c-text: #e8e8f0;
  --c-text-dim: #9090b0;
  --c-glass: rgba(255, 255, 255, 0.04);
  --c-glass-border: rgba(255, 0, 110, 0.25);
  --nav-w: 220px;
  --hero-h: 45vh;
  --radius: 4px;
  --font-main: 'Atkinson Hyperlegible', 'Courier New', monospace;
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--c-dark2);
}

body.dark-body {
  font-family: var(--font-main);
  background: var(--c-dark2);
  color: var(--c-text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ============================================================
   CRT 扫描线效果
   ============================================================ */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  animation: crt-flicker 8s infinite;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.4) 100%);
}

@keyframes crt-flicker {
  0%, 95%, 100% { opacity: 1; }
  96% { opacity: 0.85; }
  97% { opacity: 1; }
  98% { opacity: 0.9; }
}

/* ============================================================
   左侧固定竖排导航：details > summary + menu > li > a
   ============================================================ */
.sidebar-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: rgba(13, 13, 26, 0.97);
  border-right: 1px solid var(--c-glass-border);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-nav[open] {
  display: flex;
}

.nav-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--c-glass-border);
  list-style: none;
  user-select: none;
  min-height: 64px;
}

.nav-brand::-webkit-details-marker { display: none; }

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--c-red);
  text-shadow: 0 0 8px var(--c-red), 0 0 20px rgba(255,0,0,0.4);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.nav-toggle-icon {
  color: var(--c-pink);
  font-size: 1rem;
  text-shadow: 0 0 6px var(--c-pink);
}

.nav-menu {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--c-pink) transparent;
}

.nav-menu li {
  width: 100%;
}

.nav-link {
  display: block;
  padding: 12px 20px;
  color: var(--c-text-dim);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  transition: color var(--transition), background var(--transition), padding-left var(--transition);
  border-left: 2px solid transparent;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--c-cyan);
  background: rgba(0, 229, 255, 0.05);
  border-left-color: var(--c-cyan);
  padding-left: 26px;
  text-shadow: 0 0 8px var(--c-cyan);
  outline: none;
}

.nav-footer-contact {
  padding: 14px 20px;
  border-top: 1px solid var(--c-glass-border);
}

.contact-label {
  font-size: 0.75rem;
  color: var(--c-text-dim);
  letter-spacing: 0.05em;
}

/* ============================================================
   页面主体包裹（避开左侧导航）
   ============================================================ */
.page-wrapper {
  margin-left: var(--nav-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   Hero：大图斜切底边 + 文案居中 + 超大背景文字
   ============================================================ */
.site-hero {
  position: relative;
  min-height: var(--hero-h);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(26,26,46,0.95) 0%, rgba(13,13,26,0.9) 100%),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 20px,
      rgba(255,0,110,0.03) 20px,
      rgba(255,0,110,0.03) 40px
    );
  border-bottom: 1px solid var(--c-glass-border);
}

.hero-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: 700;
  color: rgba(255, 0, 0, 0.04);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
  max-width: 800px;
}

.hero-title {
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--c-text);
  text-shadow:
    0 0 10px var(--c-red),
    0 0 30px rgba(255,0,0,0.5),
    0 0 60px rgba(255,0,0,0.2);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero-sub {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--c-text-dim);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* 斜切底边 */
.hero-arc {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 48px;
  background: var(--c-dark2);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  z-index: 2;
}

/* ============================================================
   Glitch 动效
   ============================================================ */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  color: var(--c-cyan);
  animation: glitch-a 4s infinite linear;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  opacity: 0.7;
}

.glitch::after {
  color: var(--c-pink);
  animation: glitch-b 4s infinite linear;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  opacity: 0.7;
}

@keyframes glitch-a {
  0%, 90%, 100% { transform: none; opacity: 0; }
  92% { transform: skewX(-4deg) translateX(3px); opacity: 0.7; }
  94% { transform: skewX(2deg) translateX(-2px); opacity: 0.7; }
  96% { transform: none; opacity: 0; }
}

@keyframes glitch-b {
  0%, 88%, 100% { transform: none; opacity: 0; }
  90% { transform: skewX(3deg) translateX(-3px); opacity: 0.7; }
  93% { transform: skewX(-2deg) translateX(2px); opacity: 0.7; }
  95% { transform: none; opacity: 0; }
}

/* ============================================================
   内容网格：main + aside
   ============================================================ */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 0;
  flex: 1;
  align-items: start;
  padding: 40px 32px 40px 32px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================================
   正文容器：main > section.wrap > div > article
   ============================================================ */
.main-content {
  min-width: 0;
}

.wrap {
  width: 100%;
}

.primary-section {
  width: 100%;
}

.page-article {
  background: var(--c-glass);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(8px);
}

/* ============================================================
   正文内容样式（page.content 的子元素）
   ============================================================ */
.page-article h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--c-red);
  text-shadow: 0 0 8px rgba(255,0,0,0.4);
  margin: 40px 0 12px;
  letter-spacing: 0.04em;
  border-left: 3px solid var(--c-red);
  padding-left: 12px;
}

.page-article h2:first-child {
  margin-top: 0;
}

.page-article h3 {
  font-size: 1.1rem;
  color: var(--c-pink);
  text-shadow: 0 0 6px rgba(255,0,110,0.35);
  margin: 28px 0 10px;
  letter-spacing: 0.03em;
}

.page-article p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-text);
  margin-bottom: 16px;
}

.page-article a {
  color: var(--c-cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,229,255,0.3);
  transition: color var(--transition), text-shadow var(--transition);
}

.page-article a:hover {
  color: #fff;
  text-shadow: 0 0 8px var(--c-cyan);
  border-bottom-color: var(--c-cyan);
}

.page-article ul,
.page-article ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.page-article li {
  line-height: 1.8;
  margin-bottom: 6px;
  color: var(--c-text);
}

.page-article strong {
  color: var(--c-pink);
  font-weight: 700;
}

.page-article div {
  scroll-margin-top: 80px;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,0,110,0.1);
}

.page-article div:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.page-article blockquote {
  border-left: 3px solid var(--c-pink);
  padding: 12px 20px;
  margin: 20px 0;
  background: rgba(255,0,110,0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--c-text-dim);
  font-style: italic;
}

.page-article table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.page-article th,
.page-article td {
  padding: 10px 14px;
  border: 1px solid var(--c-glass-border);
  text-align: left;
}

.page-article th {
  background: rgba(255,0,0,0.1);
  color: var(--c-red);
}

/* ============================================================
   侧边 aside
   ============================================================ */
.sidebar-aside {
  position: sticky;
  top: 24px;
  margin-left: 24px;
}

.aside-inner {
  background: var(--c-glass);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
}

.aside-eyebrow {
  display: block;
  font-size: 0.72rem;
  color: var(--c-pink);
  text-shadow: 0 0 6px rgba(255,0,110,0.5);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.aside-title {
  font-size: 1rem;
  color: var(--c-text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-glass-border);
  letter-spacing: 0.04em;
}

.aside-nav-list {
  list-style: none;
  margin-bottom: 20px;
}

.aside-nav-list li {
  margin-bottom: 2px;
}

.aside-link {
  display: block;
  padding: 8px 10px;
  font-size: 0.83rem;
  color: var(--c-text-dim);
  text-decoration: none;
  border-radius: var(--radius);
  border-left: 2px solid transparent;
  transition: all var(--transition);
  min-height: 40px;
  display: flex;
  align-items: center;
}

.aside-link:hover,
.aside-link:focus {
  color: var(--c-cyan);
  background: rgba(0,229,255,0.06);
  border-left-color: var(--c-cyan);
  padding-left: 14px;
  text-shadow: 0 0 6px var(--c-cyan);
  outline: none;
}

.aside-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--c-text-dim);
  padding: 10px;
  background: rgba(255,0,0,0.06);
  border: 1px solid rgba(255,0,0,0.15);
  border-radius: var(--radius);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-red);
  box-shadow: 0 0 6px var(--c-red);
  animation: pulse-dot 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 4px var(--c-red); }
  50% { box-shadow: 0 0 12px var(--c-red), 0 0 20px rgba(255,0,0,0.4); }
}

/* ============================================================
   小标签 small + h2/h3 组合（契约要求同级紧邻）
   ============================================================ */
small.aside-eyebrow + h2.aside-title,
small.footer-eyebrow + h2.footer-form-title {
  margin-top: 0;
}

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  background: rgba(13, 13, 26, 0.98);
  border-top: 1px solid var(--c-glass-border);
  margin-top: auto;
}

.footer-form-block {
  padding: 36px 32px 24px;
  border-bottom: 1px solid var(--c-glass-border);
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.footer-eyebrow {
  display: block;
  font-size: 0.72rem;
  color: var(--c-pink);
  text-shadow: 0 0 6px rgba(255,0,110,0.5);
  letter-spacing: 0.12em;
  margin-bottom: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.footer-form-title {
  font-size: 1.1rem;
  color: var(--c-text);
  margin-bottom: 18px;
  letter-spacing: 0.04em;
}

.subscribe-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.subscribe-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius);
  color: var(--c-text);
  font-family: var(--font-main);
  font-size: 0.9rem;
  min-height: 44px;
  outline: none;
  transition: border-color var(--transition);
}

.subscribe-input::placeholder {
  color: var(--c-text-dim);
}

.subscribe-input:focus {
  border-color: var(--c-pink);
  box-shadow: 0 0 8px rgba(255,0,110,0.25);
}

.subscribe-btn {
  padding: 10px 24px;
  background: var(--c-red);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  transition: background var(--transition), box-shadow var(--transition);
  text-shadow: 0 0 6px rgba(255,0,0,0.5);
  box-shadow: 0 0 10px rgba(255,0,0,0.3);
  letter-spacing: 0.05em;
}

.subscribe-btn:hover,
.subscribe-btn:focus {
  background: var(--c-pink);
  box-shadow: 0 0 16px rgba(255,0,110,0.5);
  outline: none;
}

/* 页脚三列 dl */
.footer-dl-row {
  display: flex;
  gap: 0;
  padding: 28px 32px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.footer-dl {
  flex: 1;
  padding: 0 20px;
  border-right: 1px solid rgba(255,0,110,0.1);
}

.footer-dl:first-child {
  padding-left: 0;
}

.footer-dl:last-child {
  border-right: none;
}

.footer-dl dt {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-red);
  text-shadow: 0 0 6px rgba(255,0,0,0.4);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.footer-dl dd {
  font-size: 0.82rem;
  color: var(--c-text-dim);
  margin-bottom: 6px;
  line-height: 1.6;
}

.footer-dl dd a {
  color: var(--c-text-dim);
  text-decoration: none;
  transition: color var(--transition);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.footer-dl dd a:hover {
  color: var(--c-cyan);
  text-shadow: 0 0 6px var(--c-cyan);
}

.footer-bottom {
  padding: 16px 32px;
  border-top: 1px solid rgba(255,0,110,0.1);
  text-align: center;
}

.copyright {
  font-size: 0.78rem;
  color: var(--c-text-dim);
  letter-spacing: 0.04em;
}

/* ============================================================
   Stagger 列表入场动效
   ============================================================ */
@keyframes stagger-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.nav-menu li {
  animation: stagger-in 0.3s both;
}

.nav-menu li:nth-child(1) { animation-delay: 0.05s; }
.nav-menu li:nth-child(2) { animation-delay: 0.1s; }
.nav-menu li:nth-child(3) { animation-delay: 0.15s; }
.nav-menu li:nth-child(4) { animation-delay: 0.2s; }
.nav-menu li:nth-child(5) { animation-delay: 0.25s; }
.nav-menu li:nth-child(6) { animation-delay: 0.3s; }
.nav-menu li:nth-child(7) { animation-delay: 0.35s; }

/* ============================================================
   scroll-margin-top（给 div 预留固定导航高度）
   ============================================================ */
div[id] {
  scroll-margin-top: 80px;
}

/* ============================================================
   prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .crt-overlay,
  .glitch::before,
  .glitch::after,
  .badge-dot,
  .nav-menu li {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

/* ============================================================
   响应式断点
   ============================================================ */

/* 平板 */
@media (max-width: 900px) {
  :root {
    --nav-w: 200px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    padding: 24px 20px;
  }

  .sidebar-aside {
    margin-left: 0;
    margin-top: 24px;
    position: static;
  }

  .footer-dl-row {
    padding: 20px;
  }
}

/* 手机 */
@media (max-width: 640px) {
  :root {
    --nav-w: 0px;
    --hero-h: auto;
  }

  .sidebar-nav {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--c-glass-border);
  }

  .nav-menu {
    display: flex;
    flex-wrap: wrap;
    padding: 8px;
    gap: 4px;
  }

  .nav-menu li {
    animation: none;
  }

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

  .nav-link:hover,
  .nav-link:focus {
    padding-left: 14px;
    border-bottom-color: var(--c-cyan);
    border-left-color: transparent;
  }

  .page-wrapper {
    margin-left: 0;
  }

  .site-hero {
    min-height: 40vh;
    padding: 20px 0;
  }

  .hero-inner {
    padding: 24px 16px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .page-article {
    padding: 20px 16px;
  }

  .content-grid {
    padding: 16px;
  }

  .footer-dl-row {
    flex-direction: column;
    padding: 16px;
    gap: 16px;
  }

  .footer-dl {
    padding: 0;
    border-right: none;
    border-bottom: 1px solid rgba(255,0,110,0.1);
    padding-bottom: 16px;
  }

  .footer-dl:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .footer-form-block {
    padding: 24px 16px;
  }

  .footer-bottom {
    padding: 12px 16px;
  }

  .subscribe-form {
    flex-direction: column;
    align-items: stretch;
  }

  .subscribe-input,
  .subscribe-btn {
    width: 100%;
  }
}

/* 375px 专项 */
@media (max-width: 390px) {
  .hero-title {
    font-size: 1.3rem;
  }

  .brand-text {
    font-size: 0.75rem;
  }

  .page-article {
    padding: 16px 12px;
  }
}
