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

/* ===== CSS 变量 ===== */
:root {
  --c-primary: #ff0000;
  --c-accent: #ff006e;
  --c-dark: #1a1a2e;
  --c-darker: #0d0d1a;
  --c-cyan: #00ffff;
  --c-blue: #0080ff;
  --c-text: #e8e8f0;
  --c-text-dim: #9090b0;
  --c-glass: rgba(255, 0, 110, 0.08);
  --c-glass-border: rgba(255, 0, 110, 0.25);
  --nav-width: 220px;
  --font-title: 'Raleway', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Lora', 'PingFang SC', 'Microsoft YaHei', serif;
  --font-mono: 'Courier New', Courier, monospace;
  --radius-card: 10px;
  --transition: 0.25s ease;
  --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);
  --scroll-offset: 80px;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--scroll-offset);
  font-size: 16px;
  background: var(--c-darker);
  color: var(--c-text);
}
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  background: var(--c-darker);
  overflow-x: hidden;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, menu { list-style: none; }
address { font-style: normal; }

/* ===== CRT 扫描线覆盖层 ===== */
.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.18) 2px,
    rgba(0, 0, 0, 0.18) 4px
  );
  animation: crt-flicker 6s infinite;
}
@keyframes crt-flicker {
  0%, 98%, 100% { opacity: 1; }
  99% { opacity: 0.92; }
}

/* ===== 侧边导航 ===== */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(10,8,30,0.98) 0%, rgba(26,26,46,0.97) 100%);
  border-right: 1px solid var(--c-glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidenav[open] { width: var(--nav-width); }

.sidenav summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem 1rem;
  cursor: pointer;
  list-style: none;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255,0,110,0.15);
}
.sidenav summary::-webkit-details-marker { display: none; }

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 24px;
  cursor: pointer;
}
.hamburger-icon span {
  display: block;
  height: 2px;
  background: var(--c-accent);
  box-shadow: var(--glow-pink);
  transition: var(--transition);
}

.nav-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--c-glass-border);
  border-radius: 8px;
  background: var(--c-glass);
  transition: var(--transition);
}
.nav-brand:hover {
  border-color: var(--c-accent);
  box-shadow: var(--glow-pink);
}
.nav-logo-img { width: 36px; height: 36px; object-fit: contain; }
.nav-logo-text {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c-accent);
  text-shadow: var(--glow-pink);
}

.nav-menu {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--c-accent) transparent;
}
.nav-menu li { }
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.25rem;
  font-family: var(--font-title);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-dim);
  transition: var(--transition);
  border-left: 2px solid transparent;
  min-height: 44px;
}
.nav-link:hover {
  color: var(--c-cyan);
  border-left-color: var(--c-cyan);
  background: rgba(0,255,255,0.05);
  text-shadow: var(--glow-cyan);
  padding-left: 1.5rem;
}
.nav-link span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nav-cta {
  display: block;
  margin: 1rem;
  padding: 0.75rem 1rem;
  text-align: center;
  font-family: var(--font-title);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  border-radius: var(--radius-card);
  box-shadow: var(--glow-pink);
  transition: var(--transition);
  min-height: 44px;
  line-height: 1.5;
}
.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 15px var(--c-accent), 0 0 30px rgba(255,0,110,0.5);
}

/* ===== 页面包装 ===== */
.page-wrapper {
  margin-left: var(--nav-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== 英雄区 ===== */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c-darker) 0%, #0a0a1f 50%, #160820 100%);
}

.hero-media {
  position: relative;
  grid-column: 1;
  grid-row: 1 / 3;
}
.hero-frame {
  position: absolute;
  overflow: hidden;
  border: 1px solid var(--c-glass-border);
}
.hero-frame-1 {
  top: 8%;
  left: 5%;
  width: 58%;
  height: 52%;
  border-color: rgba(255,0,0,0.3);
  box-shadow: var(--glow-red);
  border-radius: 4px;
  z-index: 2;
}
.hero-frame-2 {
  top: 38%;
  left: 30%;
  width: 62%;
  height: 52%;
  border-color: rgba(255,0,110,0.35);
  box-shadow: var(--glow-pink);
  border-radius: 4px;
  z-index: 3;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-placeholder {
  background: linear-gradient(135deg, #0d0d2e, #1a0a2e);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-placeholder-2 {
  background: linear-gradient(135deg, #1a0020, #0d0d2e);
  display: flex;
  align-items: center;
  justify-content: center;
}
.placeholder-glyph {
  font-family: var(--font-title);
  font-size: 4rem;
  font-weight: 700;
  color: var(--c-primary);
  text-shadow: var(--glow-red);
  letter-spacing: 0.1em;
}
.placeholder-glyph-2 {
  font-family: var(--font-title);
  font-size: 5rem;
  font-weight: 300;
  color: var(--c-accent);
  text-shadow: var(--glow-pink);
  letter-spacing: 0.15em;
}
.hero-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,0,110,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,0,110,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding: 3rem 3rem 2rem 1.5rem;
  z-index: 5;
}
.hero-badge {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--c-cyan);
  border: 1px solid var(--c-cyan);
  border-radius: 2px;
  box-shadow: var(--glow-cyan);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}
.hero-title {
  font-family: var(--font-title);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 1.25rem;
  position: relative;
}
.hero-desc {
  font-size: 1rem;
  color: var(--c-text-dim);
  max-width: 360px;
  margin-bottom: 2rem;
  line-height: 1.7;
}
.hero-cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.btn-primary {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  border-radius: var(--radius-card);
  box-shadow: var(--glow-red);
  transition: var(--transition);
  min-height: 44px;
  line-height: 1.4;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px var(--c-primary), 0 0 40px rgba(255,0,0,0.4);
}
.btn-ghost {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-accent);
  border: 1px solid var(--c-accent);
  border-radius: var(--radius-card);
  box-shadow: var(--glow-pink);
  transition: var(--transition);
  min-height: 44px;
  line-height: 1.4;
}
.btn-ghost:hover {
  background: rgba(255,0,110,0.1);
  transform: translateY(-2px);
}
.hero-floating-tag {
  position: absolute;
  bottom: 2rem;
  right: 3rem;
  grid-column: 2;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: rgba(255,0,110,0.6);
  border-top: 1px solid rgba(255,0,110,0.3);
  padding-top: 0.4rem;
  z-index: 5;
  text-transform: uppercase;
}

/* ===== Glitch 动效 ===== */
.glitch-text {
  position: relative;
}
.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  clip-path: polygon(0 30%, 100% 30%, 100% 50%, 0 50%);
}
.glitch-text::before {
  color: var(--c-cyan);
  animation: glitch-before 3.5s infinite;
  opacity: 0.7;
}
.glitch-text::after {
  color: var(--c-accent);
  animation: glitch-after 3.5s infinite;
  opacity: 0.7;
}
@keyframes glitch-before {
  0%, 90%, 100% { transform: translate(0); opacity: 0; }
  91% { transform: translate(-3px, 1px); opacity: 0.7; clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%); }
  93% { transform: translate(3px, -1px); opacity: 0.7; clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%); }
  95% { transform: translate(0); opacity: 0; }
}
@keyframes glitch-after {
  0%, 92%, 100% { transform: translate(0); opacity: 0; }
  93% { transform: translate(3px, 2px); opacity: 0.7; clip-path: polygon(0 40%, 100% 40%, 100% 60%, 0 60%); }
  95% { transform: translate(-3px, -2px); opacity: 0.7; clip-path: polygon(0 10%, 100% 10%, 100% 30%, 0 30%); }
  97% { transform: translate(0); opacity: 0; }
}
.glitch-badge {
  animation: badge-pulse 2s ease-in-out infinite alternate;
}
@keyframes badge-pulse {
  from { box-shadow: var(--glow-cyan); }
  to { box-shadow: 0 0 15px var(--c-cyan), 0 0 35px rgba(0,255,255,0.5); }
}

/* ===== 主内容布局 ===== */
.main-content {
  flex: 1;
  display: flex;
  padding: 0;
}
.wrap {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ===== 侧边栏 ===== */
.sidebar-left {
  width: 200px;
  flex-shrink: 0;
  padding: 3rem 0 3rem 2rem;
  position: sticky;
  top: 0;
  height: fit-content;
  align-self: flex-start;
}
.sidebar-inner {
  background: var(--c-glass);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  backdrop-filter: blur(8px);
}
.sidebar-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--c-accent);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255,0,110,0.2);
}
.sidebar-toc ul { }
.sidebar-toc li { margin-bottom: 0.3rem; }
.sidebar-toc a {
  font-family: var(--font-title);
  font-size: 0.8rem;
  color: var(--c-text-dim);
  transition: var(--transition);
  display: block;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  min-height: 32px;
  line-height: 1.5;
}
.sidebar-toc a:hover {
  color: var(--c-cyan);
  background: rgba(0,255,255,0.06);
  text-shadow: var(--glow-cyan);
}
.sidebar-divider {
  height: 1px;
  background: rgba(255,0,110,0.15);
  margin: 1rem 0;
}
.sidebar-about {
  font-size: 0.78rem;
  color: var(--c-text-dim);
  line-height: 1.6;
}

/* ===== 正文 section / div ===== */
.content-section {
  background: transparent;
}
.content-article {
  color: var(--c-text);
}

/* 正文内部 section 样式（page.content 里的 section） */
.content-article section {
  margin-bottom: 4rem;
  scroll-margin-top: var(--scroll-offset);
  padding: 2rem;
  background: rgba(26,26,46,0.6);
  border: 1px solid rgba(255,0,110,0.12);
  border-radius: var(--radius-card);
  backdrop-filter: blur(4px);
  position: relative;
}
.content-article section::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--c-primary), var(--c-accent));
  border-radius: var(--radius-card) 0 0 var(--radius-card);
}
.content-article h1,
.content-article h2,
.content-article h3,
.content-article h4 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}
.content-article h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: #fff;
  text-shadow: 0 0 6px rgba(255,0,110,0.3);
}
.content-article h3 {
  font-size: 1.15rem;
  color: var(--c-accent);
}
.content-article h4 {
  font-size: 1rem;
  color: var(--c-cyan);
  font-weight: 600;
}
.content-article p {
  margin-bottom: 1rem;
  color: var(--c-text);
  font-size: 1rem;
  line-height: 1.75;
}
.content-article ul,
.content-article ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.content-article li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}
.content-article a {
  color: var(--c-accent);
  border-bottom: 1px solid rgba(255,0,110,0.3);
  transition: var(--transition);
}
.content-article a:hover {
  color: var(--c-cyan);
  border-bottom-color: var(--c-cyan);
  text-shadow: var(--glow-cyan);
}
.content-article strong { color: #fff; font-weight: 600; }
.content-article em { color: var(--c-accent); font-style: italic; }
.content-article blockquote {
  border-left: 3px solid var(--c-accent);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  background: rgba(255,0,110,0.06);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  color: var(--c-text-dim);
  font-style: italic;
}
.content-article time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--c-text-dim);
  display: inline-block;
  margin-bottom: 0.5rem;
}

/* small 眉题（契约要求） */
small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--c-accent);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
small + h2,
small + h3 {
  margin-top: 0;
}

/* ===== 页脚 ===== */
.site-footer {
  background: linear-gradient(180deg, var(--c-dark) 0%, var(--c-darker) 100%);
  border-top: 1px solid rgba(255,0,110,0.2);
  padding: 0;
}
.footer-top {
  padding: 3rem 3rem 0;
  overflow: hidden;
}
.footer-brand-giant {
  font-family: var(--font-title);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,0,110,0.25);
  letter-spacing: 0.05em;
  line-height: 1;
  user-select: none;
}
.footer-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem 3rem;
  border-top: 1px solid rgba(255,0,110,0.1);
  margin-top: 1rem;
}
.footer-site-name {
  display: block;
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}
.footer-tagline {
  font-size: 0.9rem;
  color: var(--c-text-dim);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
.footer-domain {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--c-accent);
}
.footer-nav-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.footer-nav-list li { }
.footer-nav-list a {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--c-text-dim);
  display: block;
  padding: 0.35rem 0;
  min-height: 40px;
  line-height: 1.5;
  transition: var(--transition);
  border-bottom: 1px solid transparent;
}
.footer-nav-list a:hover {
  color: var(--c-cyan);
  border-bottom-color: rgba(0,255,255,0.3);
}
.footer-bottom {
  padding: 1.25rem 3rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}
.footer-copy {
  font-size: 0.8rem;
  color: var(--c-text-dim);
  font-family: var(--font-mono);
}

/* ===== 动效 · prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  .crt-overlay,
  .glitch-text::before,
  .glitch-text::after,
  .glitch-badge,
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== 悬浮 micro-interaction ===== */
.nav-link:hover .hamburger-icon span { }
.content-article section:hover {
  border-color: rgba(255,0,110,0.25);
  box-shadow: 0 0 20px rgba(255,0,110,0.05);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ===== 交错列表 stagger ===== */
.nav-menu li:nth-child(1) { animation: fadein-up 0.4s ease 0.05s both; }
.nav-menu li:nth-child(2) { animation: fadein-up 0.4s ease 0.10s both; }
.nav-menu li:nth-child(3) { animation: fadein-up 0.4s ease 0.15s both; }
.nav-menu li:nth-child(4) { animation: fadein-up 0.4s ease 0.20s both; }
.nav-menu li:nth-child(5) { animation: fadein-up 0.4s ease 0.25s both; }
.nav-menu li:nth-child(6) { animation: fadein-up 0.4s ease 0.30s both; }
.nav-menu li:nth-child(7) { animation: fadein-up 0.4s ease 0.35s both; }
@keyframes fadein-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
  .sidebar-left {
    display: none;
  }
  .main-content {
    padding: 0;
  }
}

@media (max-width: 900px) {
  :root { --nav-width: 0px; }
  .sidenav {
    width: 100%;
    height: auto;
    min-height: unset;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--c-glass-border);
    background: rgba(10,8,30,0.97);
    backdrop-filter: blur(12px);
    z-index: 1000;
    overflow: visible;
  }
  .sidenav[open] { width: 100%; }
  .sidenav summary {
    flex-direction: row;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: none;
    width: 100%;
  }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10,8,30,0.98);
    border-bottom: 1px solid var(--c-glass-border);
    padding: 0.5rem 0;
    max-height: 70vh;
    overflow-y: auto;
  }
  .sidenav[open] .nav-menu {
    display: block;
  }
  .nav-menu li { }
  .nav-link {
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }
  .nav-cta {
    position: absolute;
    top: 0.6rem;
    right: 1rem;
    margin: 0;
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
    min-height: 40px;
  }
  .page-wrapper {
    margin-left: 0;
    padding-top: 60px;
  }
  .hero-section {
    grid-template-columns: 1fr;
    grid-template-rows: 50vh auto;
    min-height: unset;
  }
  .hero-media {
    grid-column: 1;
    grid-row: 1;
    min-height: 50vw;
  }
  .hero-content {
    grid-column: 1;
    grid-row: 2;
    text-align: left;
    align-items: flex-start;
    padding: 2rem 1.5rem;
  }
  .hero-cta-row { justify-content: flex-start; }
  .hero-floating-tag { right: 1.5rem; bottom: 1rem; }
  .footer-body {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
  .footer-top { padding: 2rem 1.5rem 0; }
  .footer-bottom { padding: 1rem 1.5rem; }
  .footer-nav-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .wrap { padding: 2rem 1rem; }
  .content-article section { padding: 1.25rem; }
  .hero-frame-1 { width: 65%; height: 46%; }
  .hero-frame-2 { width: 65%; height: 46%; left: 25%; top: 42%; }
  .footer-nav-list { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.5rem; }
  .footer-brand-giant { font-size: 2.5rem; }
}

/* ===== 无横向溢出保护 ===== */
html, body { max-width: 100%; overflow-x: hidden; }

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