@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

/* ── 重置 & 基础 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #80ff00;
  --green2: #00ff00;
  --dark: #1f2617;
  --dark2: #151c0e;
  --dark3: #272f1a;
  --dark4: #2f3820;
  --muted: #4a5a30;
  --text: #c8e89a;
  --text2: #8faa5a;
  --sidebar-w: 220px;
  --font-mono: 'Share Tech Mono', 'Fira Code', 'Courier New', monospace;
  --radius-card: 28px;
  --marquee-h: 32px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  line-height: 1.6;
  background: var(--dark2);
  color: var(--text);
}

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

a { color: var(--green); text-decoration: none; transition: color 0.2s, opacity 0.2s; }
a:hover { color: var(--green2); opacity: 0.85; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
button, input { font-family: var(--font-mono); }

/* ── 滚动边距（固定侧边栏补偿） ── */
section[id] { scroll-margin-top: 20px; }

/* ── 布局根 ── */
.layout-root {
  display: flex;
  min-height: 100vh;
}

/* ── 侧边栏 ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--dark3);
  border-right: 1px solid var(--green);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green), var(--green2), var(--green));
  animation: scanTop 3s linear infinite;
}

@keyframes scanTop {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--muted);
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--green));
}

.logo-text {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 2px;
  text-shadow: 0 0 12px var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--green);
  border-radius: 8px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  opacity: 0;
  animation: navReveal 0.4s ease forwards;
  animation-delay: calc(var(--i) * 0.07s + 0.2s);
}

@keyframes navReveal {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  color: var(--text2);
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  border-left: 2px solid transparent;
  transition: all 0.2s;
  min-height: 44px;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--green);
  border-left-color: var(--green);
  background: rgba(128, 255, 0, 0.06);
  text-shadow: 0 0 8px var(--green);
}

.nav-icon {
  font-size: 1rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.nav-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-link {
  font-size: 0.78rem;
  color: var(--text2);
  padding: 8px 10px;
  border: 1px solid var(--muted);
  border-radius: 6px;
  text-align: center;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.contact-link:hover {
  border-color: var(--green);
  color: var(--green);
}

.sys-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--muted);
}

.sys-text { letter-spacing: 1px; }

/* ── 状态点 ── */
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.blink {
  animation: blinkAnim 1.2s step-end infinite;
}

@keyframes blinkAnim {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── 页面包裹 ── */
.page-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── 跑马灯 ── */
.marquee-bar {
  height: var(--marquee-h);
  background: var(--green);
  color: var(--dark);
  overflow: hidden;
  display: flex;
  align-items: center;
  font-size: 0.78rem;
  letter-spacing: 2px;
  font-weight: 600;
  flex-shrink: 0;
}

.marquee-track {
  display: flex;
  white-space: nowrap;
  animation: marqueeScroll 22s linear infinite;
}

.marquee-track span { padding-right: 60px; }

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Hero ── */
.hero-section {
  display: flex;
  align-items: center;
  min-height: 45vh;
  padding: 32px 40px;
  gap: 40px;
  background: var(--dark3);
  border-bottom: 1px solid var(--muted);
  position: relative;
  overflow: hidden;
}

.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(128,255,0,0.02) 3px,
    rgba(128,255,0,0.02) 4px
  );
  pointer-events: none;
}

.hero-media {
  flex: 0 0 340px;
  max-width: 340px;
}

.hero-hud-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--dark2);
  border: 1px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hud-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--green);
  border-style: solid;
}

.hud-corner.tl { top: 6px; left: 6px; border-width: 2px 0 0 2px; }
.hud-corner.tr { top: 6px; right: 6px; border-width: 2px 2px 0 0; }
.hud-corner.bl { bottom: 6px; left: 6px; border-width: 0 0 2px 2px; }
.hud-corner.br { bottom: 6px; right: 6px; border-width: 0 2px 2px 0; }

.hud-center-text {
  text-align: center;
  z-index: 2;
}

.hud-label {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.hud-value {
  font-size: 1.3rem;
  color: var(--green);
  text-shadow: 0 0 16px var(--green);
  letter-spacing: 2px;
  animation: jitter 4s infinite;
}

@keyframes jitter {
  0%, 90%, 100% { transform: translate(0,0); }
  91% { transform: translate(-1px, 1px); }
  92% { transform: translate(1px, -1px); }
  93% { transform: translate(-1px, 0); }
  94% { transform: translate(0, 1px); }
  95% { transform: translate(1px, 0); }
}

.hud-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text2);
  margin-top: 10px;
}

.scanline {
  position: absolute;
  top: -100%;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(128,255,0,0.04),
    transparent
  );
  animation: scanMove 3s linear infinite;
  pointer-events: none;
}

@keyframes scanMove {
  from { top: -40%; }
  to   { top: 110%; }
}

/* 贴纸 */
.sticker {
  position: absolute;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 1px;
  z-index: 3;
  pointer-events: none;
}

.sticker-1 {
  top: 10px;
  right: 10px;
  background: var(--green);
  color: var(--dark);
  transform: rotate(8deg);
  animation: stickerWiggle 2.5s ease-in-out infinite;
}

.sticker-2 {
  bottom: 14px;
  left: 14px;
  background: var(--dark);
  color: var(--green);
  border: 1px solid var(--green);
  transform: rotate(-5deg);
  animation: stickerWiggle 3s ease-in-out infinite reverse;
}

.sticker-3 {
  bottom: 14px;
  right: 14px;
  background: #ff003c;
  color: #fff;
  transform: rotate(3deg);
}

@keyframes stickerWiggle {
  0%, 100% { transform: rotate(8deg); }
  50% { transform: rotate(12deg) scale(1.05); }
}

/* Hero 文案 */
.hero-copy {
  flex: 1;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.hero-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 3px;
  color: var(--green);
  text-transform: uppercase;
  border: 1px solid var(--green);
  padding: 4px 10px;
  display: inline-block;
}

.hero-h1 {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 0 20px rgba(128,255,0,0.3);
  max-width: 480px;
}

.hero-sub {
  font-size: 0.9rem;
  color: var(--text2);
  max-width: 400px;
  line-height: 1.6;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 13px 28px;
  background: var(--green);
  color: var(--dark);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 2px;
  border: none;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  transition: all 0.2s;
  min-height: 44px;
  text-decoration: none;
}

.cta-btn:hover {
  background: var(--green2);
  box-shadow: 0 0 24px rgba(128,255,0,0.6);
  transform: translateY(-1px);
}

/* ── 主内容 ── */
.main-content {
  flex: 1;
  padding: 0;
}

.content-article {
  width: 100%;
}

.content-section {
  padding: 20px 40px 40px;
}

/* ── 正文内容样式（page.content 里的结构） ── */
.content-section h2 {
  font-size: clamp(1.15rem, 2.5vw, 1.6rem);
  color: var(--green);
  letter-spacing: 1px;
  margin: 48px 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--muted);
  position: relative;
}

.content-section h2::before {
  content: '//';
  color: var(--muted);
  margin-right: 10px;
  font-size: 0.9em;
}

.content-section .subtitle,
.content-section h2 + p {
  color: var(--text2);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.content-section h3 {
  font-size: 1rem;
  color: var(--green2);
  margin: 24px 0 8px;
  letter-spacing: 0.5px;
}

.content-section p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 14px;
  max-width: 800px;
}

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

.content-section ul { list-style: disc; }
.content-section ol { list-style: decimal; }

.content-section li {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 6px;
}

.content-section a {
  color: var(--green);
  border-bottom: 1px solid var(--muted);
  padding-bottom: 1px;
}

.content-section a:hover { border-bottom-color: var(--green); }

.content-section strong { color: var(--green2); font-weight: 600; }
.content-section em { color: var(--text2); }

.content-section blockquote {
  border-left: 3px solid var(--green);
  padding: 10px 16px;
  margin: 20px 0;
  background: rgba(128,255,0,0.04);
  color: var(--text2);
  font-style: italic;
}

.content-section code {
  background: var(--dark4);
  color: var(--green2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.content-section pre {
  background: var(--dark4);
  border: 1px solid var(--muted);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 16px;
}

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

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

.content-section th {
  background: var(--dark4);
  color: var(--green);
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--muted);
}

.content-section td {
  padding: 9px 14px;
  border: 1px solid var(--muted);
  color: var(--text);
}

.content-section tr:nth-child(even) td { background: rgba(128,255,0,0.03); }

/* section 分区 */
.content-section > section {
  margin-bottom: 60px;
  padding-bottom: 40px;
  border-bottom: 1px dashed var(--muted);
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.content-section > section.revealed {
  opacity: 1;
  transform: translateY(0);
}

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

/* 玻璃卡片（如有） */
.glass-card {
  background: rgba(31,38,23,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(128,255,0,0.2);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 20px;
}

/* ── 页脚 ── */
.site-footer {
  background: var(--dark3);
  border-top: 1px solid var(--green);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
}

.site-footer > section {
  padding: 32px 28px;
  border-right: 1px solid var(--muted);
}

.site-footer > section:last-of-type { border-right: none; }

.footer-heading {
  font-size: 0.85rem;
  color: var(--green);
  letter-spacing: 2px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.footer-heading + .subtitle {
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.footer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-nav-list a {
  font-size: 0.82rem;
  color: var(--text2);
  padding: 6px 0;
  display: block;
  min-height: 32px;
  border-bottom: 1px solid transparent;
  transition: all 0.2s;
}

.footer-nav-list a:hover {
  color: var(--green);
  border-bottom-color: var(--muted);
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sub-input {
  background: var(--dark2);
  border: 1px solid var(--muted);
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.82rem;
  border-radius: 6px;
  outline: none;
  min-height: 40px;
  transition: border-color 0.2s;
}

.sub-input:focus { border-color: var(--green); }
.sub-input::placeholder { color: var(--muted); }

.sub-btn {
  background: var(--green);
  color: var(--dark);
  border: none;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 6px;
  min-height: 40px;
  transition: all 0.2s;
}

.sub-btn:hover { background: var(--green2); box-shadow: 0 0 14px rgba(128,255,0,0.4); }

.footer-contact-line {
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: 10px;
}

.footer-bar {
  grid-column: 1 / -1;
  padding: 14px 28px;
  border-top: 1px solid var(--muted);
  font-size: 0.74rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 1px;
}

/* ── 响应式 ── */
@media (max-width: 1024px) {
  .site-footer {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer > section:nth-child(2) { border-right: none; }
  .site-footer > section:nth-child(4) { border-right: none; }
  .site-footer > section:nth-child(3) { border-top: 1px solid var(--muted); }
  .site-footer > section:nth-child(4) { border-top: 1px solid var(--muted); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--green);
    z-index: 200;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar::before { display: none; }

  .sidebar-brand { display: none; }

  .sidebar-nav {
    flex: 1;
    padding: 0;
    overflow-x: auto;
  }

  .nav-list {
    flex-direction: row;
    gap: 0;
    white-space: nowrap;
  }

  .nav-item { opacity: 1; animation: none; }

  .nav-link {
    flex-direction: column;
    gap: 3px;
    padding: 8px 12px;
    font-size: 0.68rem;
    border-left: none;
    border-top: 2px solid transparent;
    min-height: 56px;
    justify-content: center;
  }

  .nav-link:hover, .nav-link:focus {
    border-left: none;
    border-top-color: var(--green);
  }

  .nav-icon { font-size: 1.1rem; width: auto; }

  .sidebar-footer { display: none; }

  .page-wrap { margin-left: 0; padding-bottom: 60px; }

  .hero-section {
    flex-direction: column;
    min-height: auto;
    padding: 24px 20px;
    gap: 24px;
  }

  .hero-media { flex: none; width: 100%; max-width: 100%; }
  .hero-hud-box { aspect-ratio: 16/7; }

  .hero-copy { align-items: flex-start; text-align: left; }

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

  .content-section { padding: 16px 20px 32px; }
  .content-section h2 { font-size: 1.1rem; margin: 32px 0 8px; }
  .content-section p { font-size: 0.95rem; }

  section[id] { scroll-margin-top: 70px; }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-footer > section {
    border-right: none;
    border-top: 1px solid var(--muted);
    padding: 24px 20px;
  }

  .site-footer > section:first-child { border-top: none; }
}

@media (max-width: 480px) {
  .hero-h1 { font-size: 1.2rem; }
  .cta-btn { width: 100%; justify-content: center; }
  .nav-link { padding: 8px 8px; font-size: 0.63rem; }
  .nav-text { display: none; }
}

/* ── prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
}
