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

/* ===== CSS 变量 ===== */
:root {
  --c-primary: #6514ff;
  --c-accent: #bf00ff;
  --c-dark: #1c1726;
  --c-dark2: #241d31;
  --c-dark3: #2e2440;
  --c-glass: rgba(101, 20, 255, 0.12);
  --c-glass2: rgba(191, 0, 255, 0.10);
  --c-text: #f0eaff;
  --c-text-muted: #a890d4;
  --c-border: rgba(101, 20, 255, 0.35);
  --c-border-hot: rgba(191, 0, 255, 0.5);
  --nav-h: 64px;
  --gap-xl: 64px;
  --gap-lg: 48px;
  --gap-md: 32px;
  --gap-sm: 16px;
  --gap-xs: 8px;
  --radius: 0px;
  --font-head: 'Caveat', cursive;
  --font-body: 'Quicksand', sans-serif;
  --transition: 220ms cubic-bezier(.4,0,.2,1);
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 8px);
  font-size: 16px;
  background: var(--c-dark);
  color: var(--c-text);
}
body, .hlw-body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  background: var(--c-dark);
  color: var(--c-text);
  min-height: 100vh;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--c-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }
ul { list-style: none; }
h1,h2,h3,h4 { font-family: var(--font-head); line-height: 1.2; }

/* ===== 页面骨架 ===== */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== 侧边 aside 导航（顶部横向，DOM 结构 aside>nav>ul>li>a） ===== */
.site-aside {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(28, 23, 38, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--c-border-hot);
  height: var(--nav-h);
}

.site-aside nav {
  width: 100%;
  height: 100%;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--gap-md);
}

.nav-brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  clip-path: polygon(0 0, 85% 0, 100% 15%, 100% 100%, 15% 100%, 0 85%);
  text-decoration: none;
}

.site-logo-text {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}
.site-logo-img { width: 32px; height: 32px; object-fit: contain; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-list::-webkit-scrollbar { display: none; }

.nav-list li { flex-shrink: 0; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  min-height: 40px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.nav-link:hover {
  color: #fff;
  border-bottom-color: var(--c-accent);
  background: var(--c-glass2);
}

/* 搜索框 */
.nav-search { flex-shrink: 0; }
.search-form {
  display: flex;
  align-items: center;
  background: var(--c-glass);
  border: 1px solid var(--c-border);
  overflow: hidden;
}
.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 8px 12px;
  width: 140px;
  min-height: 40px;
}
.search-input::placeholder { color: var(--c-text-muted); }
.search-btn {
  background: var(--c-primary);
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  padding: 8px 12px;
  min-height: 40px;
  min-width: 40px;
  transition: background var(--transition);
}
.search-btn:hover { background: var(--c-accent); }

/* ===== Hero ===== */
.site-hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--nav-h);
  background: var(--c-dark);
}

/* 动态背景纹理 */
.hero-bg-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.bp-dot {
  position: absolute;
  border-radius: 50%;
  opacity: 0.18;
  animation: pulse-float 6s ease-in-out infinite;
}
.bp-dot-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--c-primary), transparent 70%);
  top: -100px; left: -80px;
  animation-delay: 0s;
}
.bp-dot-2 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, var(--c-accent), transparent 70%);
  bottom: -80px; right: -60px;
  animation-delay: -3s;
}
.bp-dot-3 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, #bf00ff, transparent 70%);
  top: 40%; left: 50%;
  opacity: 0.10;
  animation-delay: -1.5s;
}
.bp-stripe {
  position: absolute;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  opacity: 0.06;
  animation: stripe-drift 12s linear infinite;
}
.bp-stripe-1 {
  width: 200%; height: 60px;
  top: 20%;
  transform: rotate(-8deg);
}
.bp-stripe-2 {
  width: 200%; height: 30px;
  bottom: 30%;
  transform: rotate(-8deg);
  animation-delay: -6s;
}

@keyframes pulse-float {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}
@keyframes stripe-drift {
  0% { transform: rotate(-8deg) translateX(-50%); }
  100% { transform: rotate(-8deg) translateX(0%); }
}

/* 斜切色带 */
.hero-slash {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 100%);
  clip-path: polygon(0 100%, 100% 40%, 100% 100%);
  z-index: 1;
  opacity: 0.85;
}

/* 双图错位拼贴 */
.hero-collage {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-img {
  position: absolute;
  object-fit: cover;
  opacity: 0.22;
}
.hero-img-a {
  width: 55%;
  height: 100%;
  left: 0;
  top: 0;
  clip-path: polygon(0 0, 90% 0, 75% 100%, 0 100%);
}
.hero-img-b {
  width: 55%;
  height: 100%;
  right: 0;
  top: 0;
  clip-path: polygon(25% 0, 100% 0, 100% 100%, 10% 100%);
}

/* Hero 文案 */
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--gap-xl) var(--gap-md);
  max-width: 800px;
}
.hero-h1 {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 40px rgba(191,0,255,0.6), 0 2px 8px rgba(0,0,0,0.8);
  letter-spacing: -0.01em;
  animation: hero-in 0.7s cubic-bezier(.4,0,.2,1) both;
}
.hero-lead {
  margin-top: var(--gap-sm);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--c-text-muted);
  max-width: 560px;
  margin-inline: auto;
  animation: hero-in 0.9s 0.15s cubic-bezier(.4,0,.2,1) both;
}
@keyframes hero-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 主内容区 ===== */
.site-main {
  flex: 1;
  padding-top: var(--gap-xl);
  padding-bottom: var(--gap-xl);
}

/* content-section: main > div > figure/aside */
.content-section {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto auto;
  gap: var(--gap-lg);
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 var(--gap-md);
  align-items: start;
}

/* aside 在内容左侧 */
.content-aside {
  grid-column: 1;
  grid-row: 1 / 3;
  position: sticky;
  top: calc(var(--nav-h) + 16px);
}

.aside-card {
  background: var(--c-glass);
  border: 1px solid var(--c-border);
  backdrop-filter: blur(8px);
  padding: var(--gap-md);
  border-left: 4px solid var(--c-primary);
}

.aside-h2 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: var(--gap-xs);
}
.aside-h2 + .subtitle {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  margin-bottom: var(--gap-md);
  display: block;
}

.aside-links { display: flex; flex-direction: column; gap: var(--gap-xs); }
.aside-link {
  display: block;
  padding: 8px 12px;
  min-height: 40px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text-muted);
  border-left: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.aside-link:hover {
  color: #fff;
  border-left-color: var(--c-accent);
  background: var(--c-glass2);
}

/* figure 装饰块 */
.content-figure {
  grid-column: 2;
  grid-row: 1;
}
.deco-block-main {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  padding: var(--gap-sm) var(--gap-md);
  clip-path: polygon(0 0, 95% 0, 100% 100%, 5% 100%);
  margin-bottom: var(--gap-md);
}
.deco-num {
  font-family: var(--font-head);
  font-size: 2.5rem;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  line-height: 1;
}
.deco-label {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

/* 正文容器 */
.content-body {
  grid-column: 2;
  grid-row: 2;
}

/* ===== page.content 内部样式（div、h2、p 等） ===== */
.content-body div,
.content-body > div {
  padding: var(--gap-lg) 0;
  border-bottom: 1px solid var(--c-border);
  scroll-margin-top: calc(var(--nav-h) + 8px);
}
.content-body div:last-child { border-bottom: none; }

.content-body h2 {
  font-family: var(--font-head);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: var(--gap-sm);
  position: relative;
  display: inline-block;
}
.content-body h2::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 70%;
  background: linear-gradient(to bottom, var(--c-primary), var(--c-accent));
}
.content-body h2 + p,
.content-body h2 + .subtitle {
  color: var(--c-text-muted);
  font-size: 1rem;
  margin-bottom: var(--gap-md);
}
.content-body h3 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--c-text);
  margin: var(--gap-md) 0 var(--gap-sm);
}
.content-body p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-text);
  margin-bottom: var(--gap-sm);
  max-width: 72ch;
}
.content-body ul, .content-body ol {
  padding-left: 1.5rem;
  margin-bottom: var(--gap-sm);
}
.content-body li {
  list-style: disc;
  line-height: 1.65;
  margin-bottom: 4px;
  color: var(--c-text);
}
.content-body a {
  color: var(--c-accent);
  border-bottom: 1px dashed rgba(191,0,255,0.4);
  transition: color var(--transition), border-color var(--transition);
}
.content-body a:hover { color: #fff; border-bottom-color: #fff; }

/* 玻璃拟态卡片（page.content 里的卡片） */
.content-body .card,
.content-body section,
.content-body .site-card {
  background: var(--c-glass);
  border: 1px solid var(--c-border);
  backdrop-filter: blur(8px);
  padding: var(--gap-md);
  margin-bottom: var(--gap-md);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.content-body .card:hover,
.content-body section:hover,
.content-body .site-card:hover {
  border-color: var(--c-border-hot);
  background: var(--c-glass2);
  transform: translateY(-2px);
}

/* stagger 列表动效 */
.content-body div { animation: section-in 0.6s ease both; }
.content-body div:nth-child(2) { animation-delay: 0.08s; }
.content-body div:nth-child(3) { animation-delay: 0.16s; }
.content-body div:nth-child(4) { animation-delay: 0.24s; }
.content-body div:nth-child(5) { animation-delay: 0.32s; }
.content-body div:nth-child(6) { animation-delay: 0.40s; }
.content-body div:nth-child(7) { animation-delay: 0.48s; }
@keyframes section-in {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 标题装饰 h2 + p.subtitle */
h2 + .subtitle,
h2 + p.subtitle,
h2 + p.subhead,
h2 + p.desc,
h2 + p.lead {
  color: var(--c-text-muted);
  font-size: 1rem;
  margin-bottom: var(--gap-md);
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--c-dark2);
  border-top: 2px solid var(--c-border);
  padding: var(--gap-md) var(--gap-md);
}
.footer-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--gap-md);
  text-align: center;
}
.footer-address {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
  font-style: normal;
  font-size: 0.875rem;
  color: var(--c-text-muted);
  align-items: center;
  justify-content: center;
}
.footer-address a { color: var(--c-accent); }
.footer-address a:hover { color: #fff; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-xs) var(--gap-sm);
  justify-content: center;
}
.footer-links li a {
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  padding: 8px 6px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.footer-links li a:hover { color: #fff; border-bottom-color: var(--c-accent); }
.footer-copy {
  width: 100%;
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  line-height: 1.5;
}

/* ===== 滚动视差（Parallax） ===== */
@supports (animation-timeline: scroll()) {
  .hero-content {
    animation: parallax-hero linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 40vh;
  }
  @keyframes parallax-hero {
    to { transform: translateY(-40px); opacity: 0.7; }
  }
}

/* ===== reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .content-section {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: var(--gap-md);
  }
  .content-aside {
    grid-column: 1;
    grid-row: auto;
    position: static;
  }
  .content-figure {
    grid-column: 1;
    grid-row: auto;
  }
  .content-body {
    grid-column: 1;
    grid-row: auto;
  }
  .aside-card { border-left: 2px solid var(--c-primary); }
}

@media (max-width: 640px) {
  :root { --nav-h: 56px; }
  .nav-inner { padding: 0 var(--gap-sm); gap: var(--gap-xs); }
  .search-input { width: 100px; }
  .hero-h1 { font-size: 2.25rem; }
  .hero-content { padding: var(--gap-md) var(--gap-sm); }
  .content-section { padding: 0 var(--gap-sm); }
  .site-hero { min-height: 60vh; }
  .hero-slash { height: 70px; }
  .bp-dot-1 { width: 200px; height: 200px; }
  .bp-dot-2 { width: 180px; height: 180px; }
  .footer-inner { flex-direction: column; gap: var(--gap-sm); }
  .nav-list { gap: 0; }
  .nav-link { padding: 10px 8px; font-size: 0.8125rem; }
}

@media (max-width: 400px) {
  .search-form { display: none; }
  .nav-link { padding: 10px 6px; font-size: 0.75rem; }
}
