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

/* ── 根变量 ── */
:root {
  --c-bg: #0d0d0d;
  --c-surface: #111118;
  --c-surface2: #16161f;
  --c-primary: #8000ff;
  --c-accent: #ff00ff;
  --c-text: #d4c8ff;
  --c-text-dim: #7a6fa0;
  --c-border: #2a1a4a;
  --c-glow-p: 0 0 8px #8000ff, 0 0 20px #8000ff55;
  --c-glow-a: 0 0 8px #ff00ff, 0 0 20px #ff00ff55;
  --nav-w: 220px;
  --font-main: 'Lexend', 'Source Sans 3', system-ui, sans-serif;
  --font-mono: 'Courier New', 'Consolas', monospace;
}

/* ── 重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 16px;
  background: var(--c-bg);
  color: var(--c-text);
}
body, .dark-body {
  font-family: var(--font-main);
  font-size: 1rem;
  line-height: 1.7;
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--c-accent); text-decoration: none; transition: color .2s, text-shadow .2s; }
a:hover { color: var(--c-primary); text-shadow: var(--c-glow-p); }
ul, menu { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
input, button { font-family: inherit; font-size: 1rem; }

/* ── 扫描线叠加层 ── */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,.18) 3px,
    rgba(0,0,0,.18) 4px
  );
  animation: scanMove 8s linear infinite;
}
@keyframes scanMove {
  from { background-position: 0 0; }
  to   { background-position: 0 400px; }
}
@media (prefers-reduced-motion: reduce) {
  .scanlines { animation: none; }
}

/* ── 侧边导航 ── */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: #0a0010cc;
  border-right: 1px solid var(--c-primary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  padding: 1.5rem 0 1rem;
}
.sidenav-brand {
  padding: 0 1.2rem 1.5rem;
  border-bottom: 1px solid var(--c-border);
}
.brand-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  min-height: 44px;
  padding: .2rem 0;
}
.logo-img { width: 32px; height: 32px; object-fit: contain; }
.brand-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-accent);
  text-shadow: var(--c-glow-a);
  letter-spacing: .05em;
  line-height: 1.3;
}

/* details/summary 导航 */
.nav-details {
  flex: 1;
  padding: 1rem 0;
}
.nav-summary {
  padding: .5rem 1.2rem;
  font-size: .7rem;
  font-family: var(--font-mono);
  letter-spacing: .12em;
  color: var(--c-primary);
  text-shadow: var(--c-glow-p);
  text-transform: uppercase;
  cursor: default;
  list-style: none;
  user-select: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.nav-summary::-webkit-details-marker { display: none; }
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: .4rem 0 0;
}
.nav-menu li { width: 100%; }
.nav-link {
  display: flex;
  align-items: center;
  padding: .65rem 1.2rem;
  font-size: .92rem;
  font-weight: 400;
  color: var(--c-text);
  border-left: 3px solid transparent;
  transition: background .2s, border-color .2s, color .2s;
  min-height: 44px;
  line-height: 1.5;
}
.nav-link:hover {
  background: #8000ff18;
  border-left-color: var(--c-accent);
  color: var(--c-accent);
  text-shadow: var(--c-glow-a);
}
.sidenav-footer-note {
  padding: 1rem 1.2rem 0;
  border-top: 1px solid var(--c-border);
}
.sidenav-footer-note small {
  font-size: .7rem;
  font-family: var(--font-mono);
  color: var(--c-text-dim);
  letter-spacing: .08em;
}

/* ── 页面整体偏移 ── */
.page-wrapper {
  margin-left: var(--nav-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Hero ── */
.site-hero {
  min-height: 45vh;
  background: linear-gradient(135deg, #0d0010 60%, #1a0033 100%);
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 80%, 0 100%);
  margin-bottom: -4vh;
}
.site-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 50%, #8000ff22 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 30% 30%, #ff00ff11 0%, transparent 70%);
  pointer-events: none;
}
.site-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-primary), var(--c-accent), transparent);
  box-shadow: 0 0 16px var(--c-primary), 0 0 32px var(--c-accent);
}
.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 2.5rem 6rem;
  text-align: right;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .18em;
  color: var(--c-primary);
  text-shadow: var(--c-glow-p);
  margin-bottom: .8rem;
  text-transform: uppercase;
}
.hero-h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 0 10px #fff4, var(--c-glow-a);
  margin-bottom: 1rem;
  animation: glitchText 6s infinite;
}
@keyframes glitchText {
  0%, 90%, 100% { transform: none; clip-path: none; }
  92% { transform: skewX(-2deg) translateX(3px); }
  94% { transform: skewX(1deg) translateX(-2px); }
  96% { transform: skewX(0deg) translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-h1 { animation: none; }
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--c-text-dim);
  max-width: 520px;
  margin-left: auto;
  line-height: 1.7;
}
.hero-slash { display: none; }

/* ── 内容布局 ── */
.content-layout {
  display: flex;
  flex: 1;
  gap: 0;
  padding-top: 6vh;
}

/* ── 侧边栏 aside（内容左侧） ── */
.site-aside {
  width: 200px;
  flex-shrink: 0;
  padding: 2rem 0 2rem 1.5rem;
  position: sticky;
  top: 0;
  height: calc(100vh);
  overflow-y: auto;
}
.aside-inner {
  background: #0a001088;
  border: 1px solid var(--c-border);
  backdrop-filter: blur(8px);
  padding: 1.2rem 1rem;
}
.aside-inner small {
  display: block;
  font-size: .65rem;
  font-family: var(--font-mono);
  letter-spacing: .12em;
  color: var(--c-primary);
  text-shadow: var(--c-glow-p);
  text-transform: uppercase;
  margin-bottom: .4rem;
}
.aside-title {
  font-size: .85rem;
  font-weight: 600;
  color: var(--c-accent);
  margin-bottom: .8rem;
  text-shadow: var(--c-glow-a);
}
.aside-links { display: flex; flex-direction: column; gap: .3rem; }
.aside-link {
  display: flex;
  align-items: center;
  font-size: .82rem;
  color: var(--c-text-dim);
  padding: .3rem .4rem;
  border-left: 2px solid transparent;
  transition: border-color .2s, color .2s;
  min-height: 40px;
  line-height: 1.5;
}
.aside-link:hover {
  color: var(--c-accent);
  border-left-color: var(--c-accent);
  text-shadow: var(--c-glow-a);
}
.aside-badge {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .7rem;
  font-family: var(--font-mono);
  color: #00ff88;
}
.badge-dot {
  width: 8px;
  height: 8px;
  background: #00ff88;
  border-radius: 50%;
  box-shadow: 0 0 8px #00ff88;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}
@media (prefers-reduced-motion: reduce) {
  .badge-dot { animation: none; }
}

/* ── 主内容 ── */
.site-main {
  flex: 1;
  min-width: 0;
  padding: 0 2rem 3rem;
}
.wrap { max-width: 860px; margin: 0 auto; }
.main-section { width: 100%; }
.main-article { width: 100%; }

/* ── 正文内部元素样式 ── */
.main-article h2,
.main-article h3 {
  font-weight: 700;
  line-height: 1.3;
  margin: 2.5rem 0 1rem;
}
.main-article h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.7rem);
  color: var(--c-accent);
  text-shadow: var(--c-glow-a);
  border-left: 4px solid var(--c-primary);
  padding-left: .8rem;
}
.main-article h3 {
  font-size: 1.15rem;
  color: var(--c-primary);
  text-shadow: var(--c-glow-p);
}
.main-article p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-text);
  margin-bottom: 1rem;
}
.main-article ul,
.main-article ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.main-article li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--c-text);
  margin-bottom: .4rem;
}
.main-article strong { color: #fff; font-weight: 600; }
.main-article em { color: var(--c-accent); font-style: normal; }
.main-article a {
  color: var(--c-accent);
  border-bottom: 1px solid #ff00ff44;
  transition: border-color .2s;
}
.main-article a:hover { border-bottom-color: var(--c-accent); }
.main-article article {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--c-border);
  scroll-margin-top: 80px;
}
.main-article article:last-child { border-bottom: none; }

/* 玻璃拟态卡片（正文中若有 .card） */
.main-article .card,
.card {
  background: #ffffff0a;
  border: 1px solid var(--c-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 0;
  padding: 1.5rem;
  margin: 1.5rem 0;
  transition: border-color .25s, box-shadow .25s;
}
.main-article .card:hover,
.card:hover {
  border-color: var(--c-primary);
  box-shadow: 0 0 20px #8000ff33;
}

/* small + h2/h3 装饰眉题 */
small + h2,
small + h3 {
  margin-top: .25rem;
}
small {
  font-size: .72rem;
  font-family: var(--font-mono);
  color: var(--c-primary);
  letter-spacing: .1em;
  text-transform: uppercase;
  display: block;
}

/* ── 页脚 ── */
.site-footer {
  background: #08000f;
  border-top: 1px solid var(--c-primary);
  box-shadow: 0 -4px 30px #8000ff22;
  padding: 3rem 2rem 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 860px;
  margin: 0 auto 2rem;
}
.footer-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-accent);
  text-shadow: var(--c-glow-a);
  margin-bottom: .5rem;
}
.footer-desc {
  font-size: .9rem;
  color: var(--c-text-dim);
  line-height: 1.6;
  margin-bottom: .6rem;
}
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  font-size: .82rem;
  color: var(--c-text-dim);
}
.footer-subscribe-title {
  font-size: .85rem;
  font-family: var(--font-mono);
  color: var(--c-primary);
  letter-spacing: .1em;
  margin-bottom: .8rem;
  text-transform: uppercase;
}
.subscribe-form {
  display: flex;
  gap: .5rem;
  margin-bottom: .5rem;
}
.subscribe-input {
  flex: 1;
  background: #1a0033;
  border: 1px solid var(--c-primary);
  color: var(--c-text);
  padding: .55rem .8rem;
  font-size: .9rem;
  outline: none;
  border-radius: 0;
  min-height: 44px;
  transition: border-color .2s, box-shadow .2s;
}
.subscribe-input:focus {
  border-color: var(--c-accent);
  box-shadow: var(--c-glow-a);
}
.subscribe-input::placeholder { color: var(--c-text-dim); }
.subscribe-btn {
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff;
  border: none;
  padding: .55rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0;
  min-height: 44px;
  min-width: 60px;
  transition: opacity .2s, box-shadow .2s;
  letter-spacing: .05em;
}
.subscribe-btn:hover {
  opacity: .85;
  box-shadow: var(--c-glow-a);
}
.footer-note {
  font-size: .72rem;
  color: var(--c-text-dim);
  font-family: var(--font-mono);
}
.footer-copy {
  text-align: center;
  border-top: 1px solid var(--c-border);
  padding-top: 1.2rem;
  max-width: 860px;
  margin: 0 auto;
}
.footer-copy small {
  font-size: .75rem;
  color: var(--c-text-dim);
  letter-spacing: .06em;
  font-family: var(--font-mono);
  text-transform: none;
}

/* ── 响应式：平板 ── */
@media (max-width: 900px) {
  :root { --nav-w: 0px; }
  .sidenav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 60vh;
    flex-direction: column;
    border-right: none;
    border-top: 1px solid var(--c-primary);
    overflow-y: auto;
    padding: .5rem 0;
  }
  .sidenav-brand {
    padding: .5rem 1rem .5rem;
    border-bottom: none;
  }
  .brand-link {
    min-height: 44px;
    padding: .3rem 0;
  }
  .brand-text { font-size: .9rem; }
  .nav-details { flex: none; padding: .5rem 0; }
  .nav-menu { flex-direction: row; flex-wrap: wrap; gap: 0; }
  .nav-menu li { width: auto; }
  .nav-link {
    padding: .5rem .8rem;
    font-size: .82rem;
    border-left: none;
    border-bottom: 2px solid transparent;
    min-height: 44px;
  }
  .nav-link:hover { border-bottom-color: var(--c-accent); border-left: none; }
  .sidenav-footer-note { display: none; }
  .page-wrapper { margin-left: 0; padding-bottom: 60vh; }
  .site-hero { clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%); }
  .hero-inner { padding: 2.5rem 1.5rem 4rem; }
  .content-layout { padding-top: 3vh; }
  .site-aside { display: none; }
  .site-main { padding: 0 1.2rem 2rem; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ── 响应式：手机 ── */
@media (max-width: 480px) {
  html { scroll-padding-top: 60px; }
  .page-wrapper { padding-bottom: 55vh; }
  .hero-inner { padding: 2rem 1rem 3.5rem; text-align: right; }
  .hero-h1 { font-size: 1.7rem; }
  .hero-sub { font-size: .95rem; }
  .site-main { padding: 0 1rem 2rem; }
  .main-article h2 { font-size: 1.15rem; }
  .subscribe-form { flex-direction: column; }
  .subscribe-input, .subscribe-btn { width: 100%; }
  .sidenav { max-height: 50vh; }
  .nav-summary {
    font-size: .65rem;
    padding: .4rem .8rem;
    min-height: 44px;
  }
  .nav-link {
    font-size: .8rem;
    padding: .5rem .6rem;
    min-height: 44px;
  }
  .site-footer { padding: 2rem 1rem 1rem; }
  .footer-grid { gap: 1.2rem; }
  .brand-link { min-height: 44px; }
}

/* ── 打印 ── */
@media print {
  .scanlines, .sidenav, .site-aside { display: none !important; }
  .page-wrapper { margin: 0; }
}
