@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;1,400&display=swap');

/* ============================================================
   CSS 变量 & 重置
   ============================================================ */
:root {
  --green: #69ff69;
  --cyan: #00ffff;
  --dark: #172617;
  --dark2: #0e1a0e;
  --dark3: #1f3320;
  --mid: #2a4a2a;
  --text: #d4ffd4;
  --text-dim: #8ab88a;
  --chrome1: #c8ffc8;
  --chrome2: #69ff69;
  --chrome3: #00ffff;
  --font: 'JetBrains Mono', 'Courier New', Courier, monospace;
  --radius: 10px;
  --nav-h: 56px;
  --announce-h: 36px;
  --anchor-h: 44px;
  --glow-green: 0 0 8px #69ff69, 0 0 20px #69ff6966;
  --glow-cyan: 0 0 8px #00ffff, 0 0 20px #00ffff55;
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 17px;
  background: var(--dark2);
  color: var(--text);
}

body {
  font-family: var(--font);
  line-height: 1.7;
  background: var(--dark2);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ============================================================
   公告条
   ============================================================ */
.announce-bar {
  width: 100%;
  height: var(--announce-h);
  background: linear-gradient(90deg, var(--dark3), var(--mid), var(--dark3));
  border-bottom: 1px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.announce-text {
  font-size: 0.75rem;
  color: var(--green);
  letter-spacing: 0.12em;
  text-shadow: var(--glow-green);
  white-space: nowrap;
  animation: marquee 22s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(40vw); }
  100% { transform: translateX(-100%); }
}

/* ============================================================
   主导航 Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  background: linear-gradient(180deg, rgba(23,38,23,0.98) 0%, rgba(14,26,14,0.95) 100%);
  border-bottom: 1px solid var(--green);
  backdrop-filter: blur(8px);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

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

.logo-text {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--green);
  text-shadow: var(--glow-green);
  letter-spacing: 0.05em;
}

.logo-img {
  height: 36px;
  width: auto;
}

.hamburger-btn {
  background: none;
  border: 1px solid var(--green);
  border-radius: 6px;
  cursor: pointer;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  transition: box-shadow var(--transition);
}

.hamburger-btn:hover,
.hamburger-btn:focus-visible {
  box-shadow: var(--glow-green);
  outline: none;
}

.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--green);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   全屏遮罩菜单
   ============================================================ */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(14, 26, 14, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.nav-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(105,255,105,0.04) 0%, transparent 50%),
    linear-gradient(225deg, rgba(0,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.overlay-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: var(--font);
  font-size: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  cursor: pointer;
  transition: box-shadow var(--transition);
}

.overlay-close:hover,
.overlay-close:focus-visible {
  box-shadow: var(--glow-cyan);
  outline: none;
}

.overlay-aside {
  width: 100%;
  max-width: 480px;
  padding: 2rem;
}

.overlay-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.overlay-nav li {
  border-left: 3px solid var(--green);
  transition: border-color var(--transition);
}

.overlay-nav li:hover {
  border-left-color: var(--cyan);
}

.overlay-nav a {
  display: block;
  padding: 0.85rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color var(--transition), text-shadow var(--transition);
  min-height: 44px;
}

.overlay-nav a:hover,
.overlay-nav a:focus-visible {
  color: var(--green);
  text-shadow: var(--glow-green);
  outline: none;
}

/* ============================================================
   二级粘性锚点条
   ============================================================ */
.sticky-anchors {
  position: sticky;
  top: var(--nav-h);
  z-index: 150;
  height: var(--anchor-h);
  background: linear-gradient(90deg, var(--dark3) 0%, var(--dark2) 50%, var(--dark3) 100%);
  border-bottom: 1px solid rgba(105,255,105,0.3);
  overflow-x: auto;
  scrollbar-width: none;
}

.sticky-anchors::-webkit-scrollbar { display: none; }

.anchors-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
  padding: 0 1rem;
  min-width: max-content;
}

.anchor-link {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  border-right: 1px solid rgba(105,255,105,0.15);
  transition: color var(--transition), background var(--transition);
  min-height: 44px;
}

.anchor-link:last-child { border-right: none; }

.anchor-link:hover,
.anchor-link:focus-visible {
  color: var(--green);
  background: rgba(105,255,105,0.07);
  outline: none;
}

/* ============================================================
   Hero 区域
   ============================================================ */
.hero-wrap {
  position: relative;
  min-height: 45vh;
  background: linear-gradient(135deg, var(--dark) 0%, #0d2a0d 60%, #0a1f1f 100%);
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 3rem 2rem;
}

/* 左侧媒体装饰 */
.hero-media {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-chrome-box {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-glow-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--green);
  box-shadow: var(--glow-green), inset 0 0 30px rgba(105,255,105,0.1);
  animation: ring-pulse 3s ease-in-out infinite;
}

@keyframes ring-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.7; }
}

.chrome-label {
  font-size: 2.5rem;
  font-weight: 500;
  color: var(--chrome1);
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, #ffffff 0%, var(--green) 40%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(105,255,105,0.6));
  position: relative;
  z-index: 2;
}

.chrome-accent {
  color: var(--cyan);
  background: linear-gradient(180deg, #ffffff 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.spark {
  position: absolute;
  font-size: 0.9rem;
  animation: sparkle 2.5s ease-in-out infinite;
}

.s1 { top: 10%; left: 15%; color: var(--green); animation-delay: 0s; }
.s2 { top: 15%; right: 10%; color: var(--cyan); animation-delay: 0.6s; }
.s3 { bottom: 15%; left: 10%; color: var(--cyan); animation-delay: 1.2s; }
.s4 { bottom: 10%; right: 15%; color: var(--green); animation-delay: 1.8s; }

@keyframes sparkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* 右侧文案 */
.hero-content {
  flex: 1 1 auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

.hero-h1 {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 500;
  color: var(--green);
  text-shadow: var(--glow-green);
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.hero-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  max-width: 420px;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 2rem;
  min-height: 44px;
  background: linear-gradient(135deg, rgba(105,255,105,0.15), rgba(0,255,255,0.1));
  border: 1px solid var(--green);
  border-radius: var(--radius);
  color: var(--green);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-shadow: var(--glow-green);
  box-shadow: var(--glow-green);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.hero-cta:hover,
.hero-cta:focus-visible {
  background: linear-gradient(135deg, rgba(105,255,105,0.3), rgba(0,255,255,0.2));
  box-shadow: 0 0 16px #69ff69, 0 0 40px #69ff6955;
  transform: translateY(-2px);
  outline: none;
}

/* 斜切色带分割 */
.hero-slash {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--dark2);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  z-index: 3;
}

.hero-slash::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

/* ============================================================
   正文主容器
   ============================================================ */
.site-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.wrap {
  display: flex;
  gap: 0;
}

/* 由于单页站，aside 由 content-section 内的结构处理 */
/* 下方覆盖：给 article 留侧边空间用于锚点滚动 */
article[id] {
  scroll-margin-top: calc(var(--nav-h) + var(--anchor-h) + 1rem);
}

.content-section {
  flex: 1 1 auto;
  min-width: 0;
}

.content-article {
  width: 100%;
}

/* ============================================================
   正文内容样式（page.content 的内部元素）
   ============================================================ */

/* 正文 h2 前 small 眉题（build 自动补，CSS 让它好看） */
small + h2,
small + h3 {
  margin-top: 0.25rem;
}

.content-article small {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  opacity: 0.8;
}

.content-article h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  color: var(--green);
  text-shadow: var(--glow-green);
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(105,255,105,0.25);
}

.content-article h3 {
  font-size: 1.1rem;
  color: var(--cyan);
  letter-spacing: 0.06em;
  margin: 1.5rem 0 0.75rem;
}

.content-article p {
  margin-bottom: 1.1rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
}

.content-article a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition), text-shadow var(--transition);
}

.content-article a:hover {
  color: var(--green);
  text-shadow: var(--glow-green);
}

.content-article ul,
.content-article ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.content-article li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.content-article ul li::marker {
  color: var(--green);
}

.content-article ol li::marker {
  color: var(--cyan);
}

.content-article blockquote {
  border-left: 3px solid var(--cyan);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  background: rgba(0,255,255,0.04);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-dim);
}

.content-article code {
  font-family: var(--font);
  font-size: 0.88em;
  background: rgba(105,255,105,0.08);
  color: var(--green);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.content-article pre {
  background: rgba(14,26,14,0.8);
  border: 1px solid rgba(105,255,105,0.2);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.content-article pre code {
  background: none;
  padding: 0;
}

.content-article img {
  max-width: 100%;
  border-radius: var(--radius);
  display: block;
  margin: 1rem 0;
}

/* Section 区块分隔（页内 article） */
.content-article article {
  padding: 3rem 0;
  border-bottom: 1px solid rgba(105,255,105,0.12);
  position: relative;
}

.content-article article:last-child {
  border-bottom: none;
}

.content-article article::before {
  content: '';
  position: absolute;
  top: 0;
  left: -1.5rem;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--green), transparent);
  opacity: 0.3;
}

/* 卡片样式（若正文有卡片） */
.content-article .card {
  background: linear-gradient(135deg, rgba(23,38,23,0.9), rgba(31,51,32,0.8));
  border: 1px solid rgba(105,255,105,0.2);
  border-bottom: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: box-shadow var(--transition), transform var(--transition);
}

.content-article .card:hover {
  box-shadow: 0 0 20px rgba(105,255,105,0.15);
  transform: translateY(-2px);
}

/* ============================================================
   Stagger List 动效
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .content-article ul li,
  .content-article ol li {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeUp 0.4s ease forwards;
  }

  .content-article ul li:nth-child(1) { animation-delay: 0.05s; }
  .content-article ul li:nth-child(2) { animation-delay: 0.1s; }
  .content-article ul li:nth-child(3) { animation-delay: 0.15s; }
  .content-article ul li:nth-child(4) { animation-delay: 0.2s; }
  .content-article ul li:nth-child(5) { animation-delay: 0.25s; }
  .content-article ul li:nth-child(n+6) { animation-delay: 0.3s; }

  @keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
  }

  .content-article article {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .content-article article.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .content-article article,
  .content-article ul li,
  .content-article ol li {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  .announce-text {
    animation: none;
  }

  .hero-glow-ring {
    animation: none;
  }

  .spark {
    animation: none;
    opacity: 0.7;
  }
}

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  background: linear-gradient(180deg, var(--dark3) 0%, var(--dark2) 100%);
  border-top: 1px solid rgba(105,255,105,0.3);
  padding: 1.25rem 0;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand a {
  color: var(--green);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  text-shadow: var(--glow-green);
  letter-spacing: 0.05em;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  height: 44px;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.06em;
  border-right: 1px solid rgba(105,255,105,0.15);
  transition: color var(--transition);
}

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

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--green);
  outline: none;
}

.footer-copy {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --nav-h: 52px;
    --anchor-h: 40px;
  }

  .hero-inner {
    flex-direction: column;
    padding: 2rem 1rem;
    gap: 1.5rem;
    text-align: center;
    align-items: center;
  }

  .hero-content {
    align-items: center;
    text-align: center;
  }

  .hero-chrome-box {
    width: 140px;
    height: 140px;
  }

  .chrome-label {
    font-size: 2rem;
  }

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

  .site-main {
    padding: 2rem 1rem 3rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
    text-align: left;
  }

  .footer-nav {
    width: 100%;
  }

  .footer-nav a {
    padding: 0 0.5rem;
    font-size: 0.7rem;
  }

  .footer-copy {
    white-space: normal;
  }

  .content-article article::before {
    display: none;
  }
}

@media (max-width: 480px) {
  .announce-text {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }

  .logo-text {
    font-size: 1.05rem;
  }

  .anchor-link {
    font-size: 0.7rem;
    padding: 0 0.7rem;
  }

  .footer-nav a {
    font-size: 0.65rem;
    padding: 0 0.4rem;
  }
}

/* ============================================================
   聚焦样式（无障碍）
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ============================================================
   滚动条美化
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--dark2);
}

::-webkit-scrollbar-thumb {
  background: var(--mid);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--green);
}

/* ============================================================
   金属光泽装饰线（全局）
   ============================================================ */
.site-header::after {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), var(--cyan), transparent);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  opacity: 0.6;
}
