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

/* ===== CSS 变量 ===== */
:root {
  --c-bg: #0d0d0d;
  --c-purple: #8000ff;
  --c-magenta: #ff00ff;
  --c-purple-dim: rgba(128, 0, 255, 0.15);
  --c-magenta-dim: rgba(255, 0, 255, 0.12);
  --c-text: #e0e0e0;
  --c-text-dim: #888;
  --c-border: rgba(128, 0, 255, 0.35);
  --c-border-bright: rgba(255, 0, 255, 0.6);
  --nav-h: 64px;
  --top-bar-h: 40px;
  --radius-card: 18px;
  --font-cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Barlow', system-ui, sans-serif;
  --glow-purple: 0 0 10px #8000ff, 0 0 24px rgba(128,0,255,0.5);
  --glow-magenta: 0 0 10px #ff00ff, 0 0 24px rgba(255,0,255,0.5);
  --shadow-card: 0 8px 32px rgba(128,0,255,0.18), 0 2px 8px rgba(255,0,255,0.1);
}

/* ===== 全局重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top-bar-h) + 16px);
  font-size: 16px;
}

body.cyberpunk-body {
  background-color: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + 24px);
  position: relative;
}

/* ===== 扫描线叠加 ===== */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.18) 2px,
    rgba(0,0,0,0.18) 4px
  );
  mix-blend-mode: multiply;
}

/* ===== HUD 网格底纹 ===== */
.hud-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(128,0,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128,0,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ===== 顶部品牌条 ===== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--top-bar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: rgba(13,13,13,0.92);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(8px);
}

.top-bar__brand {
  font-family: var(--font-cond);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--c-magenta);
  text-shadow: var(--glow-magenta);
  text-transform: uppercase;
}

.top-bar__tagline {
  font-size: 0.75rem;
  color: var(--c-text-dim);
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Glitch 动画 ===== */
@keyframes glitch-skew {
  0%   { transform: skewX(0deg); }
  10%  { transform: skewX(-2deg); }
  12%  { transform: skewX(0deg); }
  60%  { transform: skewX(0deg); }
  65%  { transform: skewX(1.5deg); }
  68%  { transform: skewX(0deg); }
  100% { transform: skewX(0deg); }
}

@keyframes glitch-offset-1 {
  0%   { clip-path: inset(0 0 95% 0); transform: translate(-2px, 0); }
  20%  { clip-path: inset(30% 0 50% 0); transform: translate(2px, 0); }
  40%  { clip-path: inset(60% 0 20% 0); transform: translate(-1px, 0); }
  60%  { clip-path: inset(80% 0 5% 0);  transform: translate(1px, 0); }
  80%  { clip-path: inset(10% 0 75% 0); transform: translate(-2px, 0); }
  100% { clip-path: inset(0 0 95% 0);   transform: translate(0, 0); }
}

@keyframes glitch-offset-2 {
  0%   { clip-path: inset(50% 0 30% 0); transform: translate(2px, 0); }
  25%  { clip-path: inset(10% 0 70% 0); transform: translate(-2px, 0); }
  50%  { clip-path: inset(70% 0 10% 0); transform: translate(1px, 0); }
  75%  { clip-path: inset(25% 0 55% 0); transform: translate(-1px, 0); }
  100% { clip-path: inset(50% 0 30% 0); transform: translate(0, 0); }
}

@keyframes neon-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}

@keyframes stagger-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.glitch-text {
  position: relative;
  display: inline-block;
  animation: glitch-skew 4s infinite linear;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.glitch-text::before {
  color: var(--c-magenta);
  animation: glitch-offset-1 3s infinite linear;
  text-shadow: none;
  opacity: 0.7;
}

.glitch-text::after {
  color: var(--c-purple);
  animation: glitch-offset-2 3.5s infinite linear;
  text-shadow: none;
  opacity: 0.6;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  overflow: hidden;
  scroll-margin-top: var(--top-bar-h);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 75% 50%, rgba(128,0,255,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 25% 50%, rgba(255,0,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero__copy {
  position: relative;
  z-index: 2;
  padding: 80px 48px 80px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
}

.hero__eyebrow {
  font-family: var(--font-cond);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--c-magenta);
  text-shadow: var(--glow-magenta);
  animation: neon-pulse 2s ease-in-out infinite;
}

.hero__h1 {
  font-family: var(--font-cond);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: var(--glow-purple);
  text-transform: uppercase;
}

.hero__desc {
  font-size: 1rem;
  color: var(--c-text-dim);
  max-width: 420px;
  line-height: 1.7;
}

.hero__cta {
  display: inline-block;
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--c-purple), var(--c-magenta));
  color: #fff;
  font-family: var(--font-cond);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  box-shadow: var(--glow-purple);
  transition: box-shadow 0.2s, transform 0.2s;
  min-height: 48px;
  line-height: 1;
}

.hero__cta:hover {
  box-shadow: var(--glow-magenta), 0 0 40px rgba(255,0,255,0.4);
  transform: translateY(-2px);
}

.hero__media {
  position: relative;
  z-index: 2;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0;
  padding: 40px 32px;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-card);
  filter: saturate(1.2) contrast(1.05);
}

.hero__placeholder {
  width: 100%;
  height: 70%;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--c-purple-dim), var(--c-magenta-dim));
  border: 1px solid var(--c-border);
}

.hero__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, rgba(128,0,255,0.2), transparent 70%);
  pointer-events: none;
}

/* ===== 主内容 ===== */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.content-section {
  display: grid;
  grid-template-columns: 220px 1fr 100px;
  grid-template-rows: auto 1fr;
  gap: 32px;
  padding: 48px 0;
  align-items: start;
}

/* aside 在右侧 via grid order */
.content-aside {
  grid-column: 1;
  grid-row: 1 / 3;
  position: sticky;
  top: calc(var(--top-bar-h) + 16px);
  background: rgba(128,0,255,0.07);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aside-label {
  font-family: var(--font-cond);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-magenta);
  text-shadow: var(--glow-magenta);
  margin-bottom: 4px;
}

.aside-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aside-nav-list li a {
  display: block;
  padding: 8px 10px;
  font-size: 0.85rem;
  color: var(--c-text-dim);
  text-decoration: none;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  min-height: 40px;
  line-height: 1.4;
  display: flex;
  align-items: center;
}

.aside-nav-list li a:hover {
  color: var(--c-magenta);
  border-left-color: var(--c-magenta);
  background: var(--c-magenta-dim);
}

.aside-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #00ff88;
  margin-top: 8px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 6px #00ff88;
  animation: neon-pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

/* figure 装饰块 */
.content-deco {
  grid-column: 3;
  grid-row: 1;
  margin: 0;
  align-self: start;
}

.deco-frame {
  position: relative;
  width: 80px;
  height: 80px;
  border: 1px solid var(--c-purple);
  box-shadow: var(--glow-purple);
  display: flex;
  align-items: center;
  justify-content: center;
}

.deco-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--c-magenta);
  border-style: solid;
}

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

.deco-inner-text {
  font-family: monospace;
  font-size: 0.5rem;
  letter-spacing: 0.05em;
  color: var(--c-purple);
  text-align: center;
  word-break: break-all;
  padding: 4px;
}

/* 正文区 */
.content-body {
  grid-column: 2;
  grid-row: 1 / 3;
  min-width: 0;
}

/* ===== 正文内的 div (来自 page.content) ===== */
.content-body div {
  padding: 48px 0;
  border-bottom: 1px solid var(--c-border);
  scroll-margin-top: calc(var(--top-bar-h) + var(--nav-h) + 24px);
}

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

.content-body h2 {
  font-family: var(--font-cond);
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: var(--glow-purple);
  margin-bottom: 8px;
  line-height: 1.2;
}

.content-body h2 + p,
.content-body .subtitle,
.content-body .subhead,
.content-body .desc,
.content-body .lead {
  font-size: 1rem;
  color: var(--c-magenta);
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}

.content-body h3 {
  font-family: var(--font-cond);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--c-magenta);
  margin: 28px 0 10px;
  letter-spacing: 0.05em;
}

.content-body p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-text);
  margin-bottom: 16px;
  max-width: 72ch;
}

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

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

.content-body a {
  color: var(--c-purple);
  text-decoration: underline;
  text-decoration-color: rgba(128,0,255,0.4);
  transition: color 0.2s, text-shadow 0.2s;
}

.content-body a:hover {
  color: var(--c-magenta);
  text-shadow: var(--glow-magenta);
}

.content-body strong {
  color: #fff;
  font-weight: 600;
}

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

.content-body th {
  background: var(--c-purple-dim);
  color: var(--c-magenta);
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--c-border);
  font-family: var(--font-cond);
  letter-spacing: 0.08em;
}

.content-body td {
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  color: var(--c-text);
}

.content-body blockquote {
  border-left: 3px solid var(--c-purple);
  padding: 12px 20px;
  margin: 20px 0;
  background: var(--c-purple-dim);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--c-text-dim);
}

/* ===== 卡片 (正文内如有) ===== */
.content-body .card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s, transform 0.25s;
  margin-bottom: 20px;
}

.content-body .card:hover {
  box-shadow: 0 12px 40px rgba(128,0,255,0.28), 0 2px 12px rgba(255,0,255,0.15);
  transform: translateY(-3px);
}

/* ===== 底部固定导航条（footer） ===== */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: rgba(13,13,13,0.97);
  border-top: 1px solid var(--c-border);
  backdrop-filter: blur(12px);
}

/* footer 顶部四栏区（hover 展开） */
.footer-top {
  display: none; /* 固定底部条时隐藏，通过 scroll/hover 控制 */
}

/* 导航条主体 */
.footer-nav-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: var(--nav-h);
}

.footer-nav-brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.footer-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px var(--c-purple));
}

.footer-logo-text {
  font-family: var(--font-cond);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-purple);
  text-shadow: var(--glow-purple);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.footer-nav-dl {
  flex: 1;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.footer-nav-dl::-webkit-scrollbar { display: none; }

.nav-item {
  flex-shrink: 0;
}

.nav-pill {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  background: rgba(128,0,255,0.1);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  color: var(--c-text-dim);
  font-family: var(--font-cond);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.nav-pill:hover {
  background: rgba(255,0,255,0.15);
  border-color: var(--c-magenta);
  color: var(--c-magenta);
  box-shadow: var(--glow-magenta);
}

/* 搜索框 */
.footer-search {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  overflow: hidden;
  height: 40px;
}

.footer-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0 14px;
  width: 140px;
  min-height: 40px;
}

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

.footer-search-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--c-text-dim);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  transition: color 0.2s;
}

.footer-search-btn:hover { color: var(--c-magenta); }

/* footer 版权行 */
.footer-copy {
  padding: 4px 16px 6px;
  font-size: 0.7rem;
  color: var(--c-text-dim);
  text-align: center;
  border-top: 1px solid rgba(128,0,255,0.12);
  letter-spacing: 0.04em;
}

/* ===== footer 展开面板（非固定部分）需要独立滚动区呈现 ===== */
/* 页脚信息区改为页面流式区块，在 footer 固定条之前渲染 */
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding: 48px 40px 32px;
  background: rgba(13,13,13,0.98);
  border-top: 1px solid var(--c-border);
  position: relative;
  z-index: 1;
}

/* 需要脱离 fixed footer，放在 footer 之前 */
.footer-info-panel {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding: 48px 40px 32px;
  background: rgba(13,13,13,0.98);
  border-top: 2px solid var(--c-purple);
  position: relative;
  z-index: 1;
  margin-bottom: 0;
}

.footer-brand-col { display: flex; flex-direction: column; gap: 12px; }

.footer-brand-big {
  font-family: var(--font-cond);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: transparent;
  background: linear-gradient(135deg, var(--c-purple), var(--c-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  line-height: 1;
}

.footer-address {
  font-style: normal;
  font-size: 0.8rem;
  color: var(--c-text-dim);
  font-family: monospace;
}

.footer-links-col { display: flex; flex-direction: column; gap: 12px; }

.footer-col-title {
  font-family: var(--font-cond);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-purple);
  text-shadow: var(--glow-purple);
}

.footer-link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-link-list li a {
  font-size: 0.9rem;
  color: var(--c-text-dim);
  text-decoration: none;
  transition: color 0.2s;
  display: block;
  min-height: 28px;
  line-height: 1.6;
}

.footer-link-list li a:hover { color: var(--c-magenta); }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .content-section {
    grid-template-columns: 180px 1fr;
    grid-template-rows: auto auto 1fr;
  }
  .content-deco { display: none; }
  .content-aside { grid-column: 1; }
  .content-body { grid-column: 2; }

  .footer-info-panel,
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 32px 24px;
  }
  .footer-brand-col { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  :root { --nav-h: 60px; }

  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: 100vh;
  }

  .hero__copy {
    padding: 80px 24px 32px;
    order: 1;
  }

  .hero__media {
    height: 40vh;
    padding: 16px 24px;
    order: 2;
  }

  .content-section {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 0;
  }

  .content-aside {
    position: static;
    grid-column: 1;
    grid-row: auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
  }

  .aside-label { width: 100%; }

  .aside-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .aside-nav-list li a {
    padding: 8px 12px;
    border-left: none;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    font-size: 0.8rem;
    min-height: 40px;
  }

  .content-body { grid-column: 1; }

  .footer-nav-bar { padding: 0 10px; gap: 8px; }

  .footer-search { display: none; }

  .nav-pill {
    font-size: 0.75rem;
    padding: 0 10px;
    height: 40px;
  }

  .footer-info-panel,
  .footer-top {
    grid-template-columns: 1fr 1fr;
    padding: 24px 16px;
    gap: 20px;
  }

  .footer-brand-col { grid-column: 1 / -1; }

  .footer-brand-big { font-size: 2.5rem; }

  .hero__h1 { font-size: 2.2rem; }

  .top-bar__tagline { display: none; }
}

@media (max-width: 480px) {
  .footer-info-panel,
  .footer-top {
    grid-template-columns: 1fr;
  }

  .footer-nav-dl { gap: 4px; }

  .nav-pill { font-size: 0.7rem; padding: 0 8px; }

  .hero__copy { padding: 72px 16px 24px; }

  .main-content { padding: 0 16px; }
}

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

/* ===== 硬性 div scroll margin ===== */
div[id] {
  scroll-margin-top: calc(var(--top-bar-h) + var(--nav-h) + 16px);
}

/* ===== 列表交错动画 ===== */
.aside-nav-list li {
  animation: stagger-in 0.4s ease both;
}
.aside-nav-list li:nth-child(1) { animation-delay: 0.05s; }
.aside-nav-list li:nth-child(2) { animation-delay: 0.10s; }
.aside-nav-list li:nth-child(3) { animation-delay: 0.15s; }
.aside-nav-list li:nth-child(4) { animation-delay: 0.20s; }
.aside-nav-list li:nth-child(5) { animation-delay: 0.25s; }
.aside-nav-list li:nth-child(6) { animation-delay: 0.30s; }
.aside-nav-list li:nth-child(7) { animation-delay: 0.35s; }

/* ===== 焦点样式 ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--c-magenta);
  outline-offset: 2px;
  box-shadow: var(--glow-magenta);
}
