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

/* ===== 基础变量 ===== */
:root {
  --c-red: #ff0000;
  --c-pink: #ff006e;
  --c-dark: #1a1a2e;
  --c-dark2: #16213e;
  --c-dark3: #0f3460;
  --c-cyan: #00ffff;
  --c-text: #e8e8f0;
  --c-text-dim: #9999bb;
  --c-border: rgba(255, 0, 110, 0.4);
  --c-border-red: rgba(255, 0, 0, 0.5);
  --nav-h: 64px;
  --font-heading: 'Crimson Pro', Georgia, serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, -apple-system, sans-serif;
  --glow-red: 0 0 8px #ff0000, 0 0 20px rgba(255,0,0,0.4);
  --glow-pink: 0 0 8px #ff006e, 0 0 20px rgba(255,0,110,0.4);
  --glow-cyan: 0 0 8px #00ffff, 0 0 20px rgba(0,255,255,0.3);
  --radius: 4px;
  --transition: 0.2s ease;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-bottom: calc(var(--nav-h) + 16px);
  font-size: 16px;
  background: var(--c-dark);
  color: var(--c-text);
}
body.dark-body {
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  background: var(--c-dark);
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + 8px);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-pink); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--c-cyan); }
ul, ol { list-style: none; }

/* ===== CRT 扫描线 & 像素底纹 ===== */
.crt-overlay {
  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.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  mix-blend-mode: overlay;
}
.pixel-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle, rgba(255,0,110,0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ===== 站点头部 ===== */
.site-header {
  position: relative;
  z-index: 10;
  background: linear-gradient(180deg, var(--c-dark) 0%, var(--c-dark2) 100%);
  border-bottom: 1px solid var(--c-border);
  padding: 20px 0 16px;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.nav-brand-logo {
  display: flex;
  align-items: center;
}
.nav-logo-img {
  height: 48px;
  width: auto;
}
.nav-brand-text {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--c-red);
  text-shadow: var(--glow-red);
  letter-spacing: 0.06em;
}
.tagline-text {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--c-text-dim);
  letter-spacing: 0.04em;
}

/* ===== Hero ===== */
.hero-section {
  position: relative;
  z-index: 1;
  min-height: 45vh;
  display: flex;
  align-items: center;
  background:
    linear-gradient(135deg, var(--c-dark) 0%, #0d0d1f 50%, var(--c-dark2) 100%);
  border-bottom: 2px solid var(--c-border-red);
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,0,0,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
  display: flex;
  align-items: center;
  gap: 48px;
  width: 100%;
}
.hero-text {
  flex: 1 1 320px;
  text-align: center;
}
.hero-h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--c-red);
  text-shadow: var(--glow-red);
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}
.hero-desc {
  font-size: 1.05rem;
  color: var(--c-text-dim);
  margin-bottom: 28px;
  line-height: 1.7;
}
.hero-cta {
  display: inline-block;
  padding: 14px 36px;
  border: 2px solid var(--c-pink);
  color: var(--c-pink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 40px;
  text-shadow: var(--glow-pink);
  box-shadow: var(--glow-pink), inset 0 0 20px rgba(255,0,110,0.05);
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hero-cta:hover {
  background: var(--c-pink);
  color: #fff;
  box-shadow: 0 0 24px #ff006e, 0 0 48px rgba(255,0,110,0.5);
}
.hero-media {
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-img {
  max-height: 320px;
  width: auto;
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--glow-pink);
}
.hero-placeholder {
  width: 100%;
  max-width: 320px;
  height: 220px;
  border: 2px solid var(--c-border-red);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,0,0,0.04);
  box-shadow: var(--glow-red);
}
.hero-ascii {
  font-family: monospace;
  font-size: 1.5rem;
  color: var(--c-red);
  text-shadow: var(--glow-red);
  letter-spacing: 0.2em;
  animation: glitch-flicker 4s infinite;
}

/* ===== Glitch 文字 ===== */
.glitch-text {
  position: relative;
}
.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  pointer-events: none;
}
.glitch-text::before {
  color: var(--c-cyan);
  text-shadow: none;
  animation: glitch-before 3s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%);
}
.glitch-text::after {
  color: var(--c-pink);
  text-shadow: none;
  animation: glitch-after 3s infinite 0.15s;
  clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
}

@keyframes glitch-before {
  0%,90%,100% { transform: translate(0); opacity: 0; }
  92% { transform: translate(-3px, 1px); opacity: 0.7; }
  94% { transform: translate(3px, -1px); opacity: 0.7; }
  96% { transform: translate(-2px, 2px); opacity: 0.7; }
}
@keyframes glitch-after {
  0%,88%,100% { transform: translate(0); opacity: 0; }
  90% { transform: translate(3px, -2px); opacity: 0.7; }
  93% { transform: translate(-3px, 1px); opacity: 0.7; }
  95% { transform: translate(2px, 2px); opacity: 0.7; }
}
@keyframes glitch-flicker {
  0%,95%,100% { opacity: 1; }
  96% { opacity: 0.4; }
  97% { opacity: 1; }
  98% { opacity: 0.2; }
  99% { opacity: 1; }
}

/* ===== 页面布局（aside + main） ===== */
.page-layout {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* ===== 侧边栏（内容左侧） ===== */
.sidebar {
  flex: 0 0 220px;
  position: sticky;
  top: 20px;
  order: -1;
}
.sidebar-inner {
  background: var(--c-dark2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--glow-pink);
}
.sidebar-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-pink);
  text-shadow: var(--glow-pink);
  margin-bottom: 10px;
  letter-spacing: 0.06em;
}
.sidebar-inner > hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin-bottom: 14px;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}
.sidebar-link {
  display: block;
  padding: 8px 10px;
  font-size: 0.875rem;
  color: var(--c-text-dim);
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all var(--transition);
  min-height: 40px;
  display: flex;
  align-items: center;
}
.sidebar-link:hover {
  color: var(--c-cyan);
  border-color: rgba(0,255,255,0.3);
  background: rgba(0,255,255,0.04);
  text-shadow: var(--glow-cyan);
}
.sidebar-badge {
  font-size: 0.75rem;
  color: var(--c-text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--c-border);
  padding-top: 12px;
}
.badge-dot {
  color: var(--c-red);
  text-shadow: var(--glow-red);
  animation: glitch-flicker 3s infinite;
}

/* ===== 主内容区 ===== */
.main-content {
  flex: 1 1 0;
  min-width: 0;
}
.wrap {
  width: 100%;
}
.content-section {
  width: 100%;
}
.content-article {
  width: 100%;
}

/* ===== 正文内容样式 ===== */
.content-article h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--c-red);
  text-shadow: var(--glow-red);
  margin: 48px 0 0;
  letter-spacing: 0.04em;
  line-height: 1.3;
}
.content-article h2 + hr {
  border: none;
  border-top: 1px solid var(--c-border-red);
  margin: 12px 0 20px;
  box-shadow: 0 1px 8px rgba(255,0,0,0.3);
}
.content-article h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--c-pink);
  text-shadow: var(--glow-pink);
  margin: 32px 0 0;
  letter-spacing: 0.03em;
}
.content-article h3 + hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 10px 0 16px;
}
.content-article p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-text);
  margin-bottom: 16px;
}
.content-article ul,
.content-article ol {
  margin: 0 0 16px 0;
  padding-left: 20px;
}
.content-article ul { list-style: disc; }
.content-article ol { list-style: decimal; }
.content-article li {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-text);
  margin-bottom: 6px;
}
.content-article a {
  color: var(--c-pink);
  text-decoration: underline;
  text-decoration-color: rgba(255,0,110,0.4);
  transition: all var(--transition);
}
.content-article a:hover {
  color: var(--c-cyan);
  text-shadow: var(--glow-cyan);
}
.content-article strong {
  color: var(--c-red);
  font-weight: 700;
}
.content-article em {
  color: var(--c-text-dim);
  font-style: italic;
}
.content-article blockquote {
  border-left: 3px solid var(--c-pink);
  margin: 24px 0;
  padding: 12px 20px;
  background: rgba(255,0,110,0.05);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--glow-pink);
}
.content-article blockquote p { color: var(--c-text-dim); margin-bottom: 0; }
.content-article table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.content-article th {
  background: rgba(255,0,0,0.1);
  color: var(--c-red);
  padding: 10px 14px;
  border: 1px solid var(--c-border-red);
  font-family: var(--font-heading);
  font-weight: 600;
  text-align: left;
}
.content-article td {
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  color: var(--c-text);
}
.content-article tr:hover td {
  background: rgba(255,0,110,0.04);
}
.content-article section {
  scroll-margin-top: calc(var(--nav-h) + 24px);
  padding-top: 8px;
}

/* ===== section 内的 hr（区块分隔） ===== */
.content-article hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 24px 0;
}

/* ===== 页脚 ===== */
.site-footer {
  position: relative;
  z-index: 1;
  background: var(--c-dark2);
  border-top: 2px solid var(--c-border-red);
  margin-bottom: var(--nav-h);
}
.footer-contact {
  background: rgba(255,0,110,0.05);
  border-bottom: 1px solid var(--c-border);
  padding: 32px 24px;
}
.footer-contact-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.footer-brand-col {
  flex: 1 1 280px;
}
.footer-brand-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-red);
  text-shadow: var(--glow-red);
  margin-bottom: 10px;
}
.footer-brand-desc {
  font-size: 0.9rem;
  color: var(--c-text-dim);
  line-height: 1.7;
}
.footer-form-col {
  flex: 1 1 240px;
}
.footer-form-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-pink);
  margin-bottom: 12px;
}
.footer-contact-email,
.footer-contact-qq,
.footer-contact-wx,
.footer-contact-tg {
  font-size: 0.9rem;
  color: var(--c-text-dim);
  margin-bottom: 6px;
}
.label-tag {
  color: var(--c-text-dim);
  font-size: 0.85rem;
}
.contact-link {
  color: var(--c-pink);
}
.contact-link:hover { color: var(--c-cyan); }
.footer-cols {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px 24px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-dl {
  flex: 1 1 180px;
  min-width: 0;
}
.footer-dl dt {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-red);
  text-shadow: var(--glow-red);
  margin-bottom: 12px;
  letter-spacing: 0.04em;
}
.footer-dl dd {
  font-size: 0.875rem;
  color: var(--c-text-dim);
  line-height: 1.7;
  margin-bottom: 4px;
}
.footer-nav-link {
  color: var(--c-text-dim);
  font-size: 0.875rem;
  transition: color var(--transition);
  display: inline-block;
  padding: 2px 0;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.footer-nav-link:hover {
  color: var(--c-cyan);
  text-shadow: var(--glow-cyan);
}
.footer-bottom {
  background: rgba(0,0,0,0.3);
  border-top: 1px solid var(--c-border);
  text-align: center;
  padding: 20px 24px;
}
.footer-copyright {
  font-size: 0.8rem;
  color: var(--c-text-dim);
  margin-bottom: 6px;
}
.footer-beian {
  font-size: 0.8rem;
  color: var(--c-text-dim);
  margin-bottom: 4px;
}
.footer-disclaimer {
  font-size: 0.75rem;
  color: rgba(153,153,187,0.6);
}

/* ===== 底部固定导航 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(22, 33, 62, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--c-border-red);
  box-shadow: 0 -4px 24px rgba(255,0,0,0.2);
  z-index: 1000;
}
.bottom-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.bottom-nav-brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.bottom-logo-mark {
  height: 36px;
  width: auto;
}
.bottom-brand-text {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-red);
  text-shadow: var(--glow-red);
  white-space: nowrap;
}
.bottom-nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 0;
}
.bottom-nav-list::-webkit-scrollbar { display: none; }
.bottom-nav-list li {
  flex-shrink: 0;
}
.bottom-nav-list a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  min-height: 40px;
  border: 1px solid var(--c-border);
  border-radius: 40px;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--c-text-dim);
  white-space: nowrap;
  transition: all var(--transition);
  background: rgba(255,0,110,0.03);
}
.bottom-nav-list a:hover {
  color: var(--c-pink);
  border-color: var(--c-pink);
  box-shadow: var(--glow-pink);
  background: rgba(255,0,110,0.08);
  text-shadow: var(--glow-pink);
}
.bottom-nav-search {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.nav-search-input {
  width: 140px;
  height: 40px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--c-border);
  border-radius: 40px;
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.nav-search-input::placeholder { color: var(--c-text-dim); }
.nav-search-input:focus {
  border-color: var(--c-pink);
  box-shadow: var(--glow-pink);
}
.nav-search-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--c-border-red);
  background: rgba(255,0,0,0.1);
  color: var(--c-red);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-search-btn:hover {
  background: var(--c-red);
  color: #fff;
  box-shadow: var(--glow-red);
}

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

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .page-layout {
    flex-direction: column;
    padding: 24px 16px;
  }
  .sidebar {
    position: static;
    flex: none;
    width: 100%;
    order: -1;
  }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .sidebar-link {
    padding: 6px 10px;
    font-size: 0.8rem;
    min-height: 36px;
  }
  .hero-inner {
    flex-direction: column;
    padding: 32px 16px;
    gap: 28px;
    text-align: center;
  }
  .hero-media { width: 100%; justify-content: center; }
  .footer-cols { flex-direction: column; gap: 24px; }
  .footer-dl { flex: none; width: 100%; }
  .footer-contact-inner { flex-direction: column; gap: 24px; }
}

@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 16px;
    gap: 8px;
  }
  .bottom-nav-brand { display: none; }
  .nav-search-input { width: 100px; }
  .hero-h1 { font-size: 1.7rem; }
  .bottom-nav-list a {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}

@media (max-width: 375px) {
  .bottom-nav-search { display: none; }
  .bottom-nav-list { gap: 3px; }
  .bottom-nav-list a { padding: 6px 8px; }
}

/* ===== 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;
    scroll-behavior: auto !important;
  }
}
