@import url('https://fonts.googleapis.com/css2?family=Lexend+Mega:wght@100..900&family=Public+Sans:wght@100..900&display=swap');

/* ===== 基础变量 ===== */
:root {
  --c-primary: #6514ff;
  --c-accent: #bf00ff;
  --c-dark: #1c1726;
  --c-dark2: #251e35;
  --c-dark3: #2e2545;
  --c-light: #f0eaff;
  --c-light2: #d8c8ff;
  --c-neon: #e040fb;
  --c-text: #f0eaff;
  --c-text-dim: #a990d4;
  --c-border: rgba(191,0,255,0.25);
  --font-head: 'Lexend Mega', 'Public Sans', system-ui, sans-serif;
  --font-body: 'Public Sans', system-ui, sans-serif;
  --nav-w: 220px;
  --radius-card: 28px;
  --radius-pill: 100px;
  --gap-lg: 64px;
  --gap-md: 48px;
  --gap-sm: 24px;
  --transition: 200ms cubic-bezier(.4,0,.2,1);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 16px;
  background: var(--c-dark);
  color: var(--c-text);
}
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;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }

/* ===== 点阵底纹动画 ===== */
@keyframes dotDrift {
  0%   { background-position: 0 0; }
  100% { background-position: 40px 40px; }
}
@keyframes geoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-14px) rotate(4deg); }
}
@keyframes pulseBorder {
  0%, 100% { box-shadow: 0 0 0 0 rgba(191,0,255,0); }
  50%       { box-shadow: 0 0 0 6px rgba(191,0,255,0.25); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes stagger {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes patternMove {
  from { background-position: 0 0; }
  to   { background-position: 80px 80px; }
}

/* ===== 布局根 ===== */
.layout-root {
  display: flex;
  min-height: 100vh;
  flex-direction: row;
}

/* ===== 左侧固定竖排导航 ===== */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: var(--c-dark2);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px 16px 24px;
  gap: 20px;
  z-index: 100;
  overflow-y: auto;
}

.sidenav-brand {
  display: flex;
  align-items: center;
}
.brand-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-height: 48px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  border-radius: 14px;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.1rem;
  color: #fff;
  transition: transform var(--transition), box-shadow var(--transition);
}
.brand-icon-link:hover {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(191,0,255,0.5);
}
.logo-text-mark {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.1rem;
  color: #fff;
}
.site-logo-mark {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.sidenav-announce {
  background: linear-gradient(90deg, var(--c-primary) 0%, var(--c-accent) 100%);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-family: var(--font-head);
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidenav-nav {
  width: 100%;
  flex: 1;
}
.nav-pill-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.nav-pill {
  display: block;
  width: 100%;
  padding: 12px 16px;
  min-height: 44px;
  line-height: 1.3;
  background: var(--c-dark3);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-pill);
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c-light2);
  text-align: left;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  white-space: normal;
  word-break: break-all;
}
.nav-pill:hover, .nav-pill:focus-visible {
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  color: #fff;
  border-color: transparent;
  transform: translateX(4px);
  outline: none;
}

/* ===== 主内容区 ===== */
.main-content {
  margin-left: var(--nav-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ===== Hero Section ===== */
.hero-section {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto;
  min-height: 70vh;
  gap: var(--gap-md);
  padding: var(--gap-lg) var(--gap-md);
  background: var(--c-dark);
  overflow: hidden;
  align-items: center;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(101,20,255,0.18) 0%, transparent 55%),
    radial-gradient(circle at 80% 20%, rgba(191,0,255,0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.hero-aside {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  padding: 32px 20px;
  border-radius: var(--radius-card);
  background: var(--c-dark3);
  border: 1.5px solid var(--c-border);
  animation: slideIn 0.5s ease both;
}

.dot-grid-bg {
  background-image: radial-gradient(circle, rgba(191,0,255,0.3) 1px, transparent 1px);
  background-size: 20px 20px;
  animation: patternMove 8s linear infinite;
}

.aside-tag-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.geo-tag {
  display: block;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  color: #fff;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  text-align: center;
  letter-spacing: 0.06em;
  animation: stagger 0.5s ease both;
}
.geo-tag:nth-child(2) { animation-delay: 0.1s; background: linear-gradient(90deg, var(--c-accent), #ff3cac); }
.geo-tag:nth-child(3) { animation-delay: 0.2s; background: linear-gradient(90deg, #3c1fff, var(--c-primary)); }

.hero-body {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  align-items: flex-start;
  animation: slideIn 0.45s ease both;
}

.hero-h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  color: #fff;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 30%, var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--c-text-dim);
  line-height: 1.7;
  max-width: 40ch;
}
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}

/* ===== 按钮 ===== */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 32px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  color: #fff;
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 800;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  letter-spacing: 0.04em;
  animation: pulseBorder 3s ease infinite;
}
.btn-cta:hover, .btn-cta:focus-visible {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 32px rgba(191,0,255,0.45);
  outline: none;
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 32px;
  background: transparent;
  color: var(--c-light2);
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: 2px solid var(--c-border);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  letter-spacing: 0.04em;
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  background: var(--c-dark3);
  border-color: var(--c-accent);
  color: #fff;
  outline: none;
}
.btn-cta-sm {
  padding: 10px 24px;
  min-height: 44px;
  font-size: 0.82rem;
}

/* ===== Hero Figure ===== */
.hero-figure {
  grid-column: 3;
  grid-row: 1;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-img-stack {
  position: relative;
  width: 240px;
  height: 320px;
}
.hero-img {
  position: absolute;
  border-radius: var(--radius-card);
  object-fit: cover;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.hero-img-1 {
  width: 170px;
  height: 220px;
  top: 0;
  left: 0;
  z-index: 2;
  transform: rotate(-3deg);
  animation: geoFloat 6s ease-in-out infinite;
}
.hero-img-2 {
  width: 150px;
  height: 190px;
  bottom: 0;
  right: 0;
  z-index: 3;
  transform: rotate(3deg);
  animation: geoFloat 6s ease-in-out infinite reverse;
}
.hero-geo-block {
  position: absolute;
  border-radius: 12px;
}
.geo-1 {
  width: 60px;
  height: 60px;
  background: var(--c-primary);
  top: 10px;
  right: 10px;
  z-index: 1;
  transform: rotate(18deg);
  animation: geoFloat 5s ease-in-out infinite 1s;
}
.geo-2 {
  width: 40px;
  height: 40px;
  background: var(--c-accent);
  bottom: 20px;
  left: 10px;
  z-index: 1;
  transform: rotate(-12deg);
  animation: geoFloat 7s ease-in-out infinite 0.5s;
}

/* ===== 正文内容区 ===== */
.content-section {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: auto auto;
  gap: var(--gap-md);
  padding: var(--gap-lg) var(--gap-md);
  background: var(--c-dark2);
  border-top: 2px solid var(--c-border);
  position: relative;
}

.section-deco-figure {
  grid-column: 1 / -1;
  grid-row: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: -32px;
}
.deco-stripe {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent), #ff3cac, var(--c-primary));
  background-size: 200% 100%;
  animation: patternMove 3s linear infinite;
}

.content-aside {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  top: 24px;
  align-self: start;
  background: var(--c-dark3);
  border-radius: var(--radius-card);
  border: 1.5px solid var(--c-border);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.aside-eyebrow {
  display: block;
  font-family: var(--font-head);
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--c-accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.aside-nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.aside-link {
  display: block;
  padding: 9px 14px;
  min-height: 40px;
  line-height: 1.4;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-text-dim);
  transition: background var(--transition), color var(--transition);
  word-break: break-all;
}
.aside-link:hover, .aside-link:focus-visible {
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  color: #fff;
  outline: none;
}

.content-body {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.section-eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--c-accent);
  letter-spacing: 0.12em;
  background: rgba(191,0,255,0.12);
  border: 1px solid rgba(191,0,255,0.3);
  border-radius: var(--radius-pill);
  padding: 5px 16px;
}
.section-h2 {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.15;
}

/* ===== 正文排版 ===== */
.prose-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--c-text);
  max-width: 72ch;
}
.prose-content section {
  scroll-margin-top: 90px;
  margin-bottom: var(--gap-lg);
  padding-bottom: var(--gap-md);
  border-bottom: 1px solid var(--c-border);
}
.prose-content section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.prose-content h2 {
  font-family: var(--font-head);
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
  font-weight: 900;
  color: #fff;
  margin-bottom: 20px;
  margin-top: 40px;
  line-height: 1.2;
}
.prose-content h2:first-child { margin-top: 0; }
.prose-content h3 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--c-light2);
  margin: 28px 0 12px;
  line-height: 1.3;
}
.prose-content p {
  margin-bottom: 16px;
  color: var(--c-text);
}
.prose-content ul, .prose-content ol {
  margin: 12px 0 20px 0;
  padding-left: 24px;
}
.prose-content ul { list-style: disc; }
.prose-content ol { list-style: decimal; }
.prose-content li {
  margin-bottom: 8px;
  line-height: 1.7;
  color: var(--c-text);
}
.prose-content a {
  color: var(--c-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
.prose-content a:hover { color: #fff; }
.prose-content strong { color: #fff; font-weight: 700; }
.prose-content em { color: var(--c-light2); }
.prose-content blockquote {
  border-left: 4px solid var(--c-primary);
  margin: 24px 0;
  padding: 16px 24px;
  background: var(--c-dark3);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  color: var(--c-light2);
  font-size: 1.05rem;
}
.prose-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}
.prose-content th {
  background: var(--c-primary);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 800;
  padding: 12px 16px;
  text-align: left;
}
.prose-content td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
}
.prose-content tr:nth-child(even) td { background: rgba(255,255,255,0.03); }
.prose-content figure {
  margin: 28px 0;
  border-radius: var(--radius-card);
  overflow: hidden;
}
.prose-content img {
  border-radius: var(--radius-card);
  max-width: 100%;
  height: auto;
}
.prose-content figcaption {
  font-size: 0.85rem;
  color: var(--c-text-dim);
  text-align: center;
  margin-top: 10px;
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--c-dark2);
  border-top: 2px solid var(--c-border);
  margin-left: 0;
}
.footer-cta-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: var(--gap-md) var(--gap-md);
  background: linear-gradient(90deg, rgba(101,20,255,0.18), rgba(191,0,255,0.12));
  border-bottom: 1px solid var(--c-border);
}
.footer-cta-text {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}
.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px var(--gap-md);
}
.footer-brand {
  display: flex;
  align-items: center;
}
.footer-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 0;
  transition: opacity var(--transition);
}
.footer-logo-link:hover { opacity: 0.8; }
.footer-brand-name {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--c-light2);
  letter-spacing: 0.04em;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-text-dim);
  border-radius: var(--radius-pill);
  border: 1px solid var(--c-border);
  transition: background var(--transition), color var(--transition);
}
.footer-nav-link:hover, .footer-nav-link:focus-visible {
  background: var(--c-primary);
  color: #fff;
  border-color: transparent;
  outline: none;
}
.footer-copy {
  font-size: 0.82rem;
  color: var(--c-text-dim);
  white-space: nowrap;
}

/* ===== h2 前 small 眉题同级 ===== */
small.section-eyebrow + h2,
small.aside-eyebrow + h3 {
  margin-top: 8px;
}

/* ===== scroll-margin for sections ===== */
section[id] { scroll-margin-top: 80px; }

/* ===== prefers-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;
  }
}

/* ===== 响应式：平板 ===== */
@media (max-width: 1024px) {
  :root { --nav-w: 180px; }
  .hero-section {
    grid-template-columns: 1fr 1fr;
    padding: var(--gap-md) 28px;
  }
  .hero-aside { grid-column: 1; }
  .hero-body  { grid-column: 2; }
  .hero-figure { grid-column: 1 / -1; grid-row: 2; }
  .hero-img-stack { margin: 0 auto; }
  .content-section {
    grid-template-columns: 160px 1fr;
    padding: var(--gap-md) 28px;
  }
}

/* ===== 响应式：手机 ===== */
@media (max-width: 768px) {
  :root { --nav-w: 0px; }

  .layout-root { flex-direction: column; }

  .sidenav {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: column;
    padding: 16px;
    gap: 12px;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
  }
  .sidenav-brand { width: 100%; justify-content: flex-start; }
  .sidenav-announce { width: auto; }
  .sidenav-nav { width: 100%; }
  .nav-pill-group {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .nav-pill {
    width: auto;
    font-size: 0.7rem;
    padding: 10px 14px;
    min-height: 44px;
  }
  .nav-pill:hover { transform: none; }

  .main-content { margin-left: 0; }

  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 32px 20px;
    gap: 28px;
  }
  .hero-aside  { grid-column: 1; grid-row: 2; }
  .hero-body   { grid-column: 1; grid-row: 1; }
  .hero-figure { grid-column: 1; grid-row: 3; }
  .hero-h1 { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .hero-img-stack { width: 200px; height: 260px; margin: 0 auto; }

  .content-section {
    grid-template-columns: 1fr;
    padding: 32px 20px;
    gap: 28px;
  }
  .section-deco-figure { grid-column: 1; margin-bottom: -16px; }
  .content-aside {
    grid-column: 1;
    grid-row: 3;
    position: static;
  }
  .content-body { grid-column: 1; grid-row: 2; }

  .footer-cta-block {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 20px;
  }
  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    gap: 14px;
  }
  .footer-nav { gap: 6px; }
  .footer-copy { font-size: 0.78rem; }
}

@media (max-width: 480px) {
  .hero-h1 { font-size: 1.6rem; }
  .hero-cta-row { flex-direction: column; gap: 10px; }
  .btn-cta, .btn-ghost { width: 100%; justify-content: center; }
  .prose-content { font-size: 1rem; }
  .prose-content h2 { font-size: 1.3rem; }
}
