@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300&display=swap');

/* ── 基础变量 ── */
:root {
  --red: #ff0000;
  --pink: #ff006e;
  --navy: #1a1a2e;
  --navy-light: #16213e;
  --cyan: #00ffff;
  --white: #f0f0f0;
  --dim: rgba(240,240,240,0.65);
  --glass-bg: rgba(255,255,255,0.04);
  --glass-border: rgba(255,0,110,0.25);
  --card-radius: 28px;
  --header-h: 64px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* ── 重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--navy);
  color: var(--white);
}
body.body-dark {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
  position: relative;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--pink); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--cyan); }
ul, menu { list-style: none; }

/* ── CRT 效果层 ── */
.crt-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 2px,
      rgba(0,0,0,0.12) 2px,
      rgba(0,0,0,0.12) 4px
    );
  mix-blend-mode: multiply;
}
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: linear-gradient(
    to bottom,
    rgba(255,0,110,0.015) 0%,
    transparent 50%,
    rgba(255,0,0,0.015) 100%
  );
  animation: scanline-drift 8s linear infinite;
}
@keyframes scanline-drift {
  0% { background-position: 0 0; }
  100% { background-position: 0 100vh; }
}

/* ── 顶部导航 ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: var(--header-h);
  background: rgba(26,26,46,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 2px 24px rgba(255,0,0,0.12);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* 品牌 */
.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.brand-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  font-style: italic;
  color: var(--white);
  text-shadow: 0 0 12px var(--red), 0 0 24px var(--pink);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.logo-img { height: 36px; width: auto; }

/* 导航药丸组 */
.main-nav { display: flex; align-items: center; }

/* details/summary 移动端折叠导航 */
.nav-details { position: relative; }
.nav-details[open] .nav-menu:not(.nav-menu--desktop) {
  display: flex;
}
summary.nav-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 22px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  user-select: none;
}
summary.nav-summary::-webkit-details-marker { display: none; }
summary.nav-summary::marker { display: none; }
.nav-toggle-label { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; }
.nav-hamburger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}
.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--pink);
  border-radius: 1px;
  box-shadow: 0 0 4px var(--pink);
  transition: transform 0.2s;
}

/* 移动端展开菜单 */
.nav-details .nav-menu:not(.nav-menu--desktop) {
  display: none;
  flex-direction: column;
  gap: 4px;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(26,26,46,0.98);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 12px;
  min-width: 180px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(255,0,110,0.2);
  z-index: 200;
}
.nav-details .nav-menu:not(.nav-menu--desktop) li { width: 100%; }
.nav-details .nav-menu:not(.nav-menu--desktop) .nav-pill {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 10px;
  padding: 10px 14px;
}

/* 桌面药丸组 */
.nav-menu--desktop {
  display: none;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  min-height: 40px;
  border-radius: 22px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
  white-space: nowrap;
}
.nav-pill:hover, .nav-pill:focus-visible {
  background: rgba(255,0,110,0.18);
  border-color: var(--pink);
  color: var(--cyan);
  box-shadow: 0 0 12px var(--pink), inset 0 0 8px rgba(255,0,110,0.1);
  outline: none;
}

/* ── Hero ── */
.hero-section {
  position: relative;
  width: 100%;
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  scroll-margin-top: var(--header-h);
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
/* 无图时背景 */
.hero-section:not(:has(.hero-bg-img)) .hero-media,
.hero-media:empty {
  background: linear-gradient(135deg, #0d0d1a 0%, #1a1a2e 40%, #2d0a2d 100%);
}
.hero-mask {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    105deg,
    rgba(26,26,46,0.55) 0%,
    rgba(26,26,46,0.75) 45%,
    rgba(26,26,46,0.92) 100%
  );
}
/* 斜切分割带 */
.hero-slash {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  z-index: 2;
  height: 48px;
  background: var(--navy);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}
.hero-slash::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--pink), var(--cyan));
  box-shadow: 0 0 16px var(--pink);
}
.hero-content {
  position: relative;
  z-index: 3;
  text-align: right;
  padding: 48px 40px 80px 24px;
  max-width: 680px;
}
.hero-eyebrow small {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--cyan);
  text-transform: uppercase;
  border: 1px solid var(--cyan);
  padding: 3px 12px;
  border-radius: 4px;
  margin-bottom: 14px;
  box-shadow: 0 0 8px var(--cyan);
}
.hero-h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.8rem);
  font-weight: 900;
  font-style: italic;
  line-height: 1.15;
  color: var(--white);
  text-shadow: 0 0 20px var(--red), 0 0 40px var(--pink), 2px 2px 0 rgba(0,0,0,0.5);
  margin-bottom: 16px;
  word-break: break-all;
}
.hero-tagline {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--dim);
  line-height: 1.65;
  max-width: 480px;
  margin-left: auto;
}

/* ── 故障动效 ── */
.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  overflow: hidden;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  font-style: inherit;
  line-height: inherit;
}
.glitch::before {
  color: var(--cyan);
  animation: glitch-before 3.5s infinite steps(1);
  clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%);
}
.glitch::after {
  color: var(--pink);
  animation: glitch-after 3.5s infinite steps(1);
  clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
}
@keyframes glitch-before {
  0%, 92%, 100% { transform: none; opacity: 0; }
  93% { transform: translateX(-4px) skewX(-2deg); opacity: 0.7; }
  95% { transform: translateX(3px) skewX(1deg); opacity: 0.5; }
  97% { transform: translateX(-2px); opacity: 0.6; }
}
@keyframes glitch-after {
  0%, 88%, 100% { transform: none; opacity: 0; }
  89% { transform: translateX(4px) skewX(2deg); opacity: 0.6; }
  91% { transform: translateX(-3px); opacity: 0.4; }
}

/* ── 页面主体布局 ── */
.page-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

/* ── 正文区 ── */
.main-content { min-width: 0; }
.content-article { /* div 直接包 article */ }
.content-section { /* article 为正文容器 */ }

/* ── 正文内部排版 ── */
.prose-section h2,
.prose-section h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  margin: 2em 0 0.6em;
}
.prose-section h2 { font-size: clamp(1.4rem, 3vw, 2rem); color: var(--white); }
.prose-section h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--white); }
.prose-section p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--dim);
  margin-bottom: 1.2em;
}
.prose-section a { color: var(--pink); border-bottom: 1px solid rgba(255,0,110,0.3); }
.prose-section a:hover { color: var(--cyan); border-color: var(--cyan); }
.prose-section ul, .prose-section ol {
  padding-left: 1.4em;
  margin-bottom: 1.2em;
  color: var(--dim);
  line-height: 1.75;
}
.prose-section li { margin-bottom: 0.4em; }
.prose-section strong { color: var(--white); font-weight: 600; }
.prose-section em { color: var(--pink); font-style: italic; }
.prose-section blockquote {
  border-left: 3px solid var(--red);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: var(--glass-bg);
  border-radius: 0 12px 12px 0;
  color: var(--dim);
  font-style: italic;
  box-shadow: inset 0 0 16px rgba(255,0,0,0.05);
}
.prose-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}
.prose-section th {
  background: rgba(255,0,110,0.15);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--pink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}
.prose-section td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--dim);
}
.prose-section tr:hover td { background: rgba(255,0,110,0.05); }

/* content 内的 article（由 page.content 生成）*/
.prose-section article {
  scroll-margin-top: calc(var(--header-h) + 16px);
  padding: 40px 0 32px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
}
.prose-section article:last-child { border-bottom: none; }

/* 几何切割分割带 */
.prose-section article::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--pink), transparent);
  margin-bottom: 28px;
  border-radius: 2px;
  box-shadow: 0 0 10px var(--pink);
}

/* ── 侧边栏 ── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.aside-block {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 24px 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: box-shadow 0.3s;
}
.aside-block:hover {
  box-shadow: 0 0 24px rgba(255,0,110,0.18);
}
.aside-block--neon {
  border-color: rgba(255,0,0,0.35);
  background: rgba(255,0,0,0.06);
}
.aside-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.aside-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 14px;
  text-shadow: 0 0 8px var(--pink);
}
.aside-links { display: flex; flex-direction: column; gap: 6px; }
.aside-link {
  display: block;
  padding: 8px 12px;
  min-height: 40px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--dim);
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.aside-link:hover {
  background: rgba(255,0,110,0.12);
  border-color: var(--pink);
  color: var(--white);
}
.aside-desc {
  font-size: 0.88rem;
  color: var(--dim);
  line-height: 1.65;
  margin-bottom: 16px;
}

/* ── 按钮 ── */
.btn-neon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  min-height: 44px;
  border-radius: 22px;
  background: linear-gradient(90deg, var(--red), var(--pink));
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-decoration: none;
  box-shadow: 0 0 16px var(--pink), 0 0 32px rgba(255,0,110,0.3);
  transition: box-shadow 0.25s, transform 0.15s;
  border: none;
  cursor: pointer;
}
.btn-neon:hover {
  box-shadow: 0 0 24px var(--red), 0 0 48px rgba(255,0,0,0.4);
  transform: translateY(-1px);
  color: var(--white);
}

/* ── 页脚 ── */
.site-footer {
  background: var(--navy-light);
  border-top: 1px solid var(--glass-border);
  padding: 40px 24px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--red), var(--pink), var(--cyan), var(--navy));
  background-size: 200% 100%;
  animation: footer-line 4s linear infinite;
}
@keyframes footer-line {
  0% { background-position: 0 0; }
  100% { background-position: 200% 0; }
}
.footer-brand-section {
  margin-bottom: 16px;
}
.footer-brand-super {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  font-style: italic;
  color: transparent;
  background: linear-gradient(90deg, var(--red), var(--pink), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  letter-spacing: 0.04em;
  display: block;
  line-height: 1;
  filter: drop-shadow(0 0 12px var(--pink));
}
.footer-copy-section { }
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--dim);
  margin-bottom: 8px;
  line-height: 1.6;
}
.contact-item { margin: 0 4px; }
.footer-disclaimer {
  font-size: 0.72rem;
  color: rgba(240,240,240,0.4);
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto;
}

/* ── 滚动显现动效 ── */
@media (prefers-reduced-motion: no-preference) {
  .aside-block {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s;
  }
  .aside-block.in-view {
    opacity: 1;
    transform: none;
  }
  .aside-block:nth-child(2) { transition-delay: 0.12s; }

  .prose-section article {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .prose-section article.in-view {
    opacity: 1;
    transform: none;
  }
}

/* ── 断点 ── */
@media (min-width: 860px) {
  .nav-details { display: none; }
  .nav-menu--desktop { display: flex; }
}
@media (max-width: 859px) {
  .nav-menu--desktop { display: none !important; }
  .page-wrap {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .hero-content {
    padding: 36px 20px 72px;
    text-align: right;
    max-width: 100%;
  }
}
@media (max-width: 480px) {
  :root { --header-h: 56px; }
  .header-inner { padding: 0 16px; }
  .page-wrap { padding: 32px 16px 48px; }
  .prose-section article { padding: 28px 0 20px; }
  .footer-brand-super { font-size: 2.2rem; }
}

/* ── 焦点可访问性 ── */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ── 无动效偏好 ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
