@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

/* ===== 变量 ===== */
:root {
  --red: #ff0000;
  --pink: #ff006e;
  --dark: #1a1a2e;
  --darker: #0d0d1a;
  --mid: #16213e;
  --cyan: #00ffff;
  --white: #f0f0f0;
  --muted: #888aaa;
  --font-pixel: 'Press Start 2P', monospace;
  --font-vt: 'VT323', monospace;
  --font-sys: var(--font-vt), 'Courier New', monospace;
  --nav-h: 56px;
  --header-h: 60px;
  --max-w: 1100px;
  --radius: 0;
  --glow-red: 0 0 8px #ff0000, 0 0 16px #ff0000aa;
  --glow-pink: 0 0 8px #ff006e, 0 0 16px #ff006eaa;
  --glow-cyan: 0 0 8px #00ffff, 0 0 16px #00ffffaa;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--darker);
  color: var(--white);
  font-family: var(--font-sys);
  font-size: 18px;
  line-height: 1.7;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 8px);
  overflow-x: hidden;
  position: relative;
}
a { color: var(--pink); text-decoration: none; }
a:hover { color: var(--cyan); text-shadow: var(--glow-cyan); }
img { max-width: 100%; height: auto; display: block; }
ol, ul { list-style: none; }
button { cursor: pointer; font-family: var(--font-pixel); }

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

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

/* ===== 页头 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(13,13,26,0.96);
  border-bottom: 2px solid var(--red);
  box-shadow: 0 2px 0 var(--pink), var(--glow-red);
  height: var(--header-h);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-name {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--red);
  text-shadow: var(--glow-red);
  letter-spacing: 1px;
  line-height: 1.3;
  white-space: nowrap;
}
.logo-img { height: 32px; width: auto; }

.header-search {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 0 1 280px;
}
.search-input {
  background: var(--mid);
  border: 1px solid var(--pink);
  color: var(--white);
  font-family: var(--font-vt);
  font-size: 16px;
  padding: 6px 10px;
  flex: 1;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-input:focus {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}
.search-btn {
  background: var(--red);
  border: none;
  color: #fff;
  font-size: 12px;
  padding: 8px 14px;
  transition: background .2s, box-shadow .2s;
  min-height: 40px;
}
.search-btn:hover {
  background: var(--pink);
  box-shadow: var(--glow-pink);
}

/* ===== Hero（首页专用）===== */
.hero {
  min-height: 100vh;
  background: var(--darker);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 80px 32px 120px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 80% 50%, rgba(255,0,0,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(255,0,110,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  max-width: 720px;
  text-align: right;
  position: relative;
  z-index: 2;
}
.pixel-tag {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  letter-spacing: 2px;
  border: 1px solid var(--cyan);
  padding: 4px 10px;
  display: inline-block;
  margin-bottom: 24px;
}
.hero-title {
  font-family: var(--font-pixel);
  font-size: clamp(18px, 3.5vw, 40px);
  line-height: 1.6;
  color: var(--red);
  text-shadow: var(--glow-red);
  margin-bottom: 24px;
  word-break: break-all;
}
.hero-sub {
  font-family: var(--font-vt);
  font-size: 22px;
  color: var(--muted);
  margin-bottom: 36px;
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.hero-deco {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.deco-line {
  display: block;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--pink), transparent);
  box-shadow: var(--glow-pink);
  animation: deco-pulse 2s ease-in-out infinite alternate;
}
.deco-line:nth-child(2) { width: 120px; animation-delay: .4s; }
.deco-line:nth-child(3) { width: 60px; animation-delay: .8s; }

@keyframes deco-pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* ===== Glitch 效果 ===== */
.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  text-align: inherit;
  overflow: hidden;
}
.glitch::before {
  color: var(--cyan);
  text-shadow: none;
  animation: glitch-before 3s infinite step-start;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}
.glitch::after {
  color: var(--pink);
  text-shadow: none;
  animation: glitch-after 3s infinite step-start;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch-before {
  0%,90%,100% { transform: translate(0); opacity: 0; }
  91% { transform: translate(-3px, 1px); opacity: 1; }
  93% { transform: translate(3px, -1px); opacity: 1; }
  95% { transform: translate(0); opacity: 0; }
}
@keyframes glitch-after {
  0%,88%,100% { transform: translate(0); opacity: 0; }
  89% { transform: translate(4px, 2px); opacity: 1; }
  91% { transform: translate(-4px, -1px); opacity: 1; }
  93% { transform: translate(0); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .glitch::before, .glitch::after { display: none; }
  .deco-line { animation: none; }
}

/* ===== 按钮 ===== */
.btn-primary, .btn-secondary {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 12px 20px;
  min-height: 44px;
  line-height: 1.4;
  transition: transform .15s, box-shadow .2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--red);
  color: #fff;
  border: 2px solid var(--red);
  box-shadow: var(--glow-red);
}
.btn-primary:hover {
  background: var(--pink);
  border-color: var(--pink);
  box-shadow: var(--glow-pink);
  color: #fff;
  transform: translateY(-2px);
}
.btn-secondary {
  background: transparent;
  color: var(--cyan);
  border: 2px solid var(--cyan);
  box-shadow: var(--glow-cyan);
}
.btn-secondary:hover {
  background: var(--cyan);
  color: var(--darker);
  transform: translateY(-2px);
}

/* ===== 页面 Banner（非首页）===== */
.page-banner {
  background: var(--mid);
  border-bottom: 2px solid var(--pink);
  padding: 48px 16px 40px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.page-banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), var(--pink), var(--cyan), var(--red));
  background-size: 200%;
  animation: border-flow 4s linear infinite;
}
@keyframes border-flow {
  from { background-position: 0 0; }
  to { background-position: 200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .page-banner::after { animation: none; }
}
.banner-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}
.banner-title {
  font-family: var(--font-pixel);
  font-size: clamp(14px, 2.5vw, 24px);
  color: var(--red);
  text-shadow: var(--glow-red);
  margin-top: 16px;
  line-height: 1.6;
  word-break: break-all;
}
.post-meta {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.post-date, .post-mod {
  font-family: var(--font-vt);
  font-size: 16px;
  color: var(--muted);
}

/* ===== 面包屑 ===== */
.breadcrumb { margin-bottom: 24px; }
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-vt);
  font-size: 16px;
  color: var(--muted);
}
.breadcrumb ol li { display: flex; align-items: center; gap: 8px; }
.breadcrumb ol li:not(:last-child)::after {
  content: '›';
  color: var(--pink);
}
.breadcrumb a { color: var(--pink); }
.breadcrumb a:hover { color: var(--cyan); }

/* ===== main 与 layout ===== */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}

.content-section {
  padding: 48px 0;
  border-bottom: 1px solid rgba(255,0,110,0.15);
}
.content-section:last-child { border-bottom: none; }

/* aside 在左，正文在右 */
.layout-aside {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}
.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.aside-inner {
  background: var(--mid);
  border: 1px solid rgba(255,0,110,0.3);
  padding: 20px;
}
.aside-title {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--pink);
  text-shadow: var(--glow-pink);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,0,110,0.3);
  letter-spacing: 1px;
}
.aside-nav-wrap { margin-top: 24px; }
.aside-desc p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}
.sidebar nav ol {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar nav ol li a {
  display: block;
  font-family: var(--font-vt);
  font-size: 17px;
  color: var(--white);
  padding: 6px 8px;
  border-left: 2px solid transparent;
  transition: border-color .2s, color .2s, background .2s;
}
.sidebar nav ol li a:hover,
.sidebar nav ol li a[aria-current="page"] {
  border-left-color: var(--red);
  color: var(--cyan);
  background: rgba(255,0,0,0.08);
  text-shadow: var(--glow-cyan);
}

/* ===== 正文容器 ===== */
.main-content { min-width: 0; }
.page-content {
  font-family: var(--font-vt);
  font-size: 20px;
  line-height: 1.8;
  color: var(--white);
}
.page-content h2 {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--red);
  text-shadow: var(--glow-red);
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,0,0,0.3);
  line-height: 1.6;
}
.page-content h3 {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--pink);
  text-shadow: var(--glow-pink);
  margin: 28px 0 12px;
  line-height: 1.6;
}
.page-content p { margin-bottom: 16px; }
.page-content ul, .page-content ol {
  margin: 0 0 16px 20px;
  padding: 0;
  list-style: disc;
}
.page-content ol { list-style: decimal; }
.page-content li { margin-bottom: 8px; }
.page-content a { color: var(--pink); border-bottom: 1px solid var(--pink); }
.page-content a:hover { color: var(--cyan); border-color: var(--cyan); }
.page-content strong { color: var(--red); }
.page-content code {
  background: rgba(255,0,110,0.12);
  border: 1px solid rgba(255,0,110,0.3);
  padding: 1px 6px;
  font-family: 'Courier New', monospace;
  font-size: 17px;
}
.page-content pre {
  background: var(--mid);
  border: 1px solid var(--pink);
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 16px;
}
.page-content blockquote {
  border-left: 3px solid var(--red);
  padding-left: 16px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 16px;
}

/* ===== section 标题 ===== */
.section-title {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--red);
  text-shadow: var(--glow-red);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.6;
}
.section-title span {
  position: relative;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--red), transparent);
}

/* ===== 卡片列表 ===== */
.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.card {
  background: var(--mid);
  border: 1px solid rgba(255,0,110,0.3);
  padding: 20px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card:hover {
  border-color: var(--red);
  box-shadow: var(--glow-red);
  transform: translateY(-3px);
}
.card h3 {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--red);
  text-shadow: var(--glow-red);
  line-height: 1.6;
}
.card h3 span { display: block; }
.card p {
  font-family: var(--font-vt);
  font-size: 17px;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}
.card-link {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--pink);
  margin-top: 8px;
  transition: color .2s;
}
.card-link:hover { color: var(--cyan); text-shadow: var(--glow-cyan); }

/* ===== 兄弟页卡片列表 ===== */
.sibling-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sibling-card {
  background: var(--darker);
  border: 1px solid rgba(255,0,110,0.2);
  padding: 12px;
  transition: border-color .2s;
}
.sibling-card:hover, .sibling-card.current {
  border-color: var(--red);
}
.sibling-card h3 {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--white);
  margin-bottom: 6px;
  line-height: 1.6;
}
.sibling-card h3 span { display: block; }
.sibling-card p {
  font-family: var(--font-vt);
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.5;
}
.sibling-card a {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--pink);
}
.sibling-card a:hover { color: var(--cyan); }

/* ===== Feature strip ===== */
.strip-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--red);
}
.strip-item {
  padding: 24px 16px;
  border-right: 1px solid rgba(255,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
  transition: background .2s;
}
.strip-item:last-child { border-right: none; }
.strip-item:hover { background: rgba(255,0,0,0.08); }
.strip-num {
  font-family: var(--font-pixel);
  font-size: 20px;
  color: var(--red);
  text-shadow: var(--glow-red);
}
.strip-label {
  font-family: var(--font-vt);
  font-size: 20px;
  color: var(--white);
}

/* ===== 指南/功能页底部导航 ===== */
.guide-footer-nav {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
}

/* ===== FAQ 专属 ===== */
.faq-content .page-content { font-size: 19px; }
.faq-cta { margin-top: 40px; }

/* ===== 页脚 ===== */
.site-footer {
  background: var(--darker);
  border-top: 2px solid var(--red);
  padding: 16px 16px;
  position: relative;
  z-index: 10;
  margin-bottom: calc(var(--nav-h) + 4px);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-logo a {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--red);
  text-shadow: var(--glow-red);
  text-decoration: none;
  white-space: nowrap;
}
.site-footer nav ol {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer nav ol li a {
  font-family: var(--font-vt);
  font-size: 16px;
  color: var(--muted);
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 4px 4px;
  transition: color .2s;
}
.site-footer nav ol li a:hover { color: var(--pink); }
.footer-copy span {
  font-family: var(--font-vt);
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
}

/* ===== 底部固定导航 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: rgba(13,13,26,0.98);
  border-top: 2px solid var(--red);
  box-shadow: 0 -2px 0 var(--pink), var(--glow-red);
  height: var(--nav-h);
}
.bottom-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
}
.bottom-nav ol {
  display: flex;
  height: 100%;
  align-items: stretch;
}
.bottom-nav ol li {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bottom-nav ol li a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 40px;
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--muted);
  text-align: center;
  padding: 4px 2px;
  transition: color .2s, text-shadow .2s;
  line-height: 1.5;
}
.bottom-nav ol li a:hover {
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}
.brand-center {
  border-left: 1px solid rgba(255,0,110,0.3);
  border-right: 1px solid rgba(255,0,110,0.3);
}
.bottom-brand {
  color: var(--red) !important;
  text-shadow: var(--glow-red) !important;
  font-size: 7px !important;
}

/* ===== prose-section（首页正文）===== */
.prose-section .main-content { padding-top: 8px; }

/* ===== about / privacy 特调 ===== */
.about-links { margin-top: 40px; }

/* ===== 移动端 ===== */
@media (max-width: 767px) {
  body { font-size: 16px; }

  .header-inner { gap: 8px; padding: 0 10px; }
  .brand-name { font-size: 7px; }
  .header-search { flex: 0 1 180px; }
  .search-input { font-size: 14px; padding: 6px 8px; }
  .search-btn { font-size: 10px; padding: 8px 10px; }

  .hero {
    min-height: 100vh;
    padding: 80px 16px 100px;
    justify-content: center;
    align-items: flex-end;
  }
  .hero-inner { max-width: 100%; text-align: right; }
  .hero-title { font-size: clamp(14px, 5vw, 22px); }
  .hero-actions { justify-content: flex-end; }
  .hero-deco { display: none; }

  .layout-aside {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    order: 2;
  }
  .main-content { order: 1; }

  .strip-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .strip-item:nth-child(2) { border-right: none; }
  .strip-item:nth-child(3) { border-top: 1px solid rgba(255,0,0,0.3); }
  .strip-item:nth-child(4) { border-top: 1px solid rgba(255,0,0,0.3); }

  .card-list { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; text-align: center; gap: 12px; }
  .site-footer nav ol { justify-content: center; gap: 12px; }

  .page-banner { padding: 32px 16px 28px; }
  .banner-title { font-size: clamp(12px, 4vw, 18px); }

  .btn-primary, .btn-secondary { font-size: 9px; padding: 10px 14px; }

  .guide-footer-nav { flex-direction: column; gap: 10px; }
}

@media (max-width: 479px) {
  .bottom-nav ol li a { font-size: 6px; }
  .brand-name { display: none; }
  .section-title { font-size: 9px; }
  .aside-title { font-size: 8px; }
}

/* ===== parallax 微动效 ===== */
@media (prefers-reduced-motion: no-preference) {
  .card {
    transition: border-color .2s, box-shadow .2s, transform .25s cubic-bezier(.22,1,.36,1);
  }
  .strip-item {
    transition: background .2s, transform .2s;
  }
  .strip-item:hover { transform: scale(1.03); }
  .btn-primary:active, .btn-secondary:active { transform: translateY(1px) scale(0.98); }
}
