@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

/* ===== 基础重置 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --red: #ff0000;
  --violet: #8b00ff;
  --dark: #261717;
  --dark-80: rgba(38,23,23,0.85);
  --dark-60: rgba(38,23,23,0.6);
  --glass-bg: rgba(255,255,255,0.10);
  --glass-border: rgba(255,255,255,0.18);
  --glass-blur: 15px;
  --text-main: #f5f0f0;
  --text-muted: rgba(245,240,240,0.65);
  --text-accent: #ff6666;
  --sidebar-w: 220px;
  --sidebar-w-collapsed: 60px;
  --radius: 0px;
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background-color: var(--dark);
  color: var(--text-main);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ===== 全局光晕背景 ===== */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,0,0,0.22) 0%, transparent 70%);
  top: -150px;
  right: 0;
  animation: glow-pulse 8s ease-in-out infinite alternate;
}
body::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139,0,255,0.20) 0%, transparent 70%);
  bottom: -100px;
  left: var(--sidebar-w);
  animation: glow-pulse 10s ease-in-out infinite alternate-reverse;
}

@keyframes glow-pulse {
  from { opacity: 0.7; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.12); }
}

/* ===== 布局包装 ===== */
.site-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ===== 左侧固定导航 ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-w);
  z-index: 100;
  transition: width var(--transition);
  overflow: hidden;
}

/* details[open] 展开宽度 */
.sidebar[open] {
  width: var(--sidebar-w);
}

/* 折叠时 */
.sidebar:not([open]) {
  width: var(--sidebar-w-collapsed);
}

.sidebar-inner {
  width: var(--sidebar-w);
  height: 100vh;
  background: rgba(38,23,23,0.75);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* details summary (切换按钮) */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: var(--sidebar-w-collapsed);
  min-height: 48px;
  padding: 12px 18px;
  cursor: pointer;
  list-style: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  background: transparent;
}
.sidebar-toggle::-webkit-details-marker { display: none; }
.sidebar-toggle::marker { display: none; }

.toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.toggle-icon span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: var(--transition);
}

/* 品牌标记 */
.brand-mark {
  padding: 64px 20px 20px;
  border-bottom: 1px solid var(--glass-border);
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-text-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--red), var(--violet));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-abbr {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.sidebar-slogan {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: 0.03em;
  line-height: 1.4;
}

/* 导航菜单 */
.nav-menu {
  list-style: none;
  padding: 16px 0;
  flex: 1;
}

.nav-menu li {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  min-height: 44px;
  border-left: 2px solid transparent;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(255,0,0,0.10);
  color: var(--text-main);
  border-left-color: var(--red);
}

.nav-icon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--violet));
  flex-shrink: 0;
  transition: transform var(--transition);
}

.nav-link:hover .nav-icon {
  transform: scale(1.5);
}

/* ===== 内容区域 ===== */
.content-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left var(--transition);
}

.sidebar:not([open]) ~ .content-area {
  margin-left: var(--sidebar-w-collapsed);
}

/* ===== Hero ===== */
.hero-section {
  min-height: 45vh;
  display: flex;
  align-items: center;
  padding: 60px 48px 40px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--glass-border);
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,0,0,0.08) 0%, rgba(139,0,255,0.08) 100%);
  pointer-events: none;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  max-width: 800px;
  position: relative;
  z-index: 1;
}

.hero-text {
  flex: 1;
}

.hero-h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 30%, #ff9999 70%, #cc88ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.hero-lead {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.7;
}

.hero-icon {
  flex-shrink: 0;
}

.hero-glyph {
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--red), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  animation: spin-slow 12s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ===== 主内容 ===== */
.main-content {
  flex: 1;
  padding: 48px;
}

.content-section {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* figure 容器 */
.content-figure {
  flex: 1;
  min-width: 0;
}

/* ===== 正文内容 (page.content) ===== */
.content-body {
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.8;
}

/* article 块样式（单页 7 个 article） */
.content-body article {
  margin-bottom: 56px;
  padding: 36px 40px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-top: 2px solid rgba(255,0,0,0.35);
  scroll-margin-top: 80px;
  position: relative;
  overflow: hidden;
}

.content-body article::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--red), var(--violet), transparent);
}

.content-body h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.content-body h2 span {
  background: linear-gradient(135deg, #fff, #ffaaaa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.content-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-accent);
  margin: 20px 0 10px;
}

.content-body h3 span {
  color: inherit;
}

.content-body p {
  margin-bottom: 14px;
  color: rgba(245,240,240,0.88);
}

.content-body ul,
.content-body ol {
  margin: 12px 0 16px 20px;
}

.content-body li {
  margin-bottom: 8px;
  color: rgba(245,240,240,0.85);
}

.content-body a {
  color: var(--text-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.content-body a:hover {
  color: #ff9999;
}

.content-body strong {
  color: #fff;
  font-weight: 700;
}

.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}

.content-body th {
  background: rgba(255,0,0,0.15);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  border-bottom: 1px solid var(--glass-border);
}

.content-body td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: rgba(245,240,240,0.82);
}

.content-body tr:hover td {
  background: rgba(255,255,255,0.04);
}

/* ===== 侧边栏 Aside ===== */
.content-aside {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 20px;
}

.aside-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  padding: 20px;
  border-left: 2px solid var(--violet);
}

.aside-card--highlight {
  border-left-color: var(--red);
  background: rgba(255,0,0,0.06);
}

.aside-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.aside-title span {
  color: inherit;
}

.aside-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aside-link {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 6px 10px;
  border-left: 1px solid transparent;
  transition: all var(--transition);
  min-height: 32px;
  line-height: 1.4;
}

.aside-link:hover,
.aside-link:focus-visible {
  color: var(--text-main);
  border-left-color: var(--violet);
  background: rgba(139,0,255,0.10);
}

.aside-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== 页脚 ===== */
.site-footer {
  border-top: 1px solid var(--glass-border);
  margin-top: 40px;
}

.footer-cta {
  background: linear-gradient(120deg, rgba(255,0,0,0.15), rgba(139,0,255,0.15));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 48px;
  text-align: center;
}

.footer-cta-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-cta-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 28px;
  background: linear-gradient(135deg, var(--red), var(--violet));
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  letter-spacing: 0.04em;
  border: none;
  transition: opacity var(--transition), transform var(--transition);
}

.footer-cta-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.footer-bottom {
  padding: 20px 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  background: rgba(0,0,0,0.2);
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-note {
  font-size: 0.76rem;
  color: rgba(245,240,240,0.4);
}

/* ===== Scroll Reveal 动效 ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-glyph {
    animation: none;
  }
  body::before,
  body::after {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ===== article scroll-margin ===== */
article[id] {
  scroll-margin-top: 20px;
}

/* ===== 断点 ===== */
@media (max-width: 1024px) {
  .content-aside {
    width: 200px;
  }
  .main-content {
    padding: 36px 32px;
  }
  .hero-section {
    padding: 50px 32px 36px;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 200px;
    --sidebar-w-collapsed: 0px;
  }

  .sidebar {
    width: var(--sidebar-w-collapsed);
  }
  .sidebar[open] {
    width: var(--sidebar-w);
  }
  .sidebar:not([open]) {
    width: 0;
    border: none;
  }

  /* 汉堡按钮在折叠时仍可见 */
  .sidebar-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    background: rgba(38,23,23,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 10px 12px;
    min-height: 44px;
    width: 44px;
  }

  .content-area {
    margin-left: 0 !important;
  }

  .hero-section {
    min-height: auto;
    padding: 80px 20px 32px;
  }

  .hero-inner {
    flex-direction: column;
    gap: 20px;
  }

  .hero-icon {
    display: none;
  }

  .main-content {
    padding: 24px 16px;
  }

  .content-section {
    flex-direction: column;
    gap: 24px;
  }

  .content-aside {
    width: 100%;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .aside-card {
    flex: 1;
    min-width: 200px;
  }

  .content-body article {
    padding: 24px 20px;
  }

  .footer-cta {
    padding: 36px 20px;
  }

  .footer-cta-inner {
    flex-direction: column;
    gap: 16px;
  }

  .footer-bottom {
    padding: 16px 20px;
  }

  .sidebar-inner {
    width: var(--sidebar-w);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
}

@media (max-width: 375px) {
  .hero-h1 {
    font-size: 1.5rem;
  }
  .content-body article {
    padding: 20px 16px;
  }
  .aside-card {
    min-width: 100%;
  }
}
