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

/* =============================================
   CSS 自定义属性
   ============================================= */
:root {
  --c-primary: #6514ff;
  --c-accent: #bf00ff;
  --c-dark: #1c1726;
  --c-dark-80: rgba(28, 23, 38, 0.8);
  --c-primary-light: #8b4aff;
  --c-accent-light: #d966ff;
  --c-white: #ffffff;
  --c-off-white: #f5f0ff;
  --c-gray: #b0a8c0;
  --c-gray-light: #e8e0f5;

  --sidebar-w: 240px;
  --gap-xl: 64px;
  --gap-lg: 48px;
  --gap-md: 32px;
  --gap-sm: 16px;

  --radius-card: 28px;
  --radius-sm: 12px;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   Reset & Base
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--c-dark);
  color: var(--c-white);
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  background: var(--c-dark);
  color: var(--c-white);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  padding-left: 1.5em;
}

/* =============================================
   Shell Layout
   ============================================= */
.site-shell {
  display: flex;
  min-height: 100vh;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

/* =============================================
   Left Sidebar
   ============================================= */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--c-dark);
  border-right: 2px solid var(--c-primary);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--gap-md) var(--gap-sm);
  gap: var(--gap-md);
}

.sidebar-brand {
  padding-bottom: var(--gap-sm);
  border-bottom: 1px solid rgba(101, 20, 255, 0.3);
}

.brand-logo {
  display: block;
}

.logo-img {
  max-height: 48px;
  width: auto;
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-white);
  letter-spacing: -0.02em;
  line-height: 1.3;
  display: block;
  padding: 8px 0;
}

/* Sidebar Nav: dl > dt > a */
.sidebar-nav {
  flex: 1;
}

.sidebar-nav dl {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
}

.sidebar-nav dt {
  display: block;
}

.sidebar-nav dd {
  display: block;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-gray);
  transition: color var(--transition), background var(--transition);
  min-height: 44px;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--c-white);
  background: rgba(101, 20, 255, 0.25);
  outline: none;
}

.nav-link:focus-visible {
  outline: 2px solid var(--c-accent);
}

/* Sidebar CTA */
.sidebar-cta {
  padding-top: var(--gap-sm);
  border-top: 1px solid rgba(101, 20, 255, 0.3);
}

/* =============================================
   Buttons
   ============================================= */
.btn-cta,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: var(--c-primary);
  color: var(--c-white);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), transform var(--transition);
  min-height: 44px;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
}

.btn-cta:hover,
.btn-primary:hover {
  background: var(--c-accent);
  transform: translateY(-2px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: transparent;
  color: var(--c-white);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255,255,255,0.4);
  transition: border-color var(--transition), background var(--transition);
  min-height: 44px;
  cursor: pointer;
}

.btn-ghost:hover {
  border-color: var(--c-accent);
  background: rgba(191, 0, 255, 0.1);
}

.btn-large {
  padding: 18px 40px;
  font-size: 1.1rem;
  border-radius: var(--radius-card);
  min-height: 56px;
}

/* =============================================
   Hero Block
   ============================================= */
.hero-block {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--c-dark);
  overflow: hidden;
  padding: var(--gap-xl) var(--gap-xl);
}

/* Animated background pattern */
.hero-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 50%, rgba(101, 20, 255, 0.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 85% 20%, rgba(191, 0, 255, 0.12) 0%, transparent 60%);
  animation: heroBgPulse 6s ease-in-out infinite alternate;
}

@keyframes heroBgPulse {
  0% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* 超大背景文字 */
.hero-bg-text {
  position: absolute;
  right: -0.1em;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(160px, 25vw, 320px);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 2px rgba(101, 20, 255, 0.2);
  letter-spacing: -0.05em;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  animation: bgTextDrift 10s ease-in-out infinite alternate;
}

@keyframes bgTextDrift {
  0% { transform: translateY(-50%) translateX(0); }
  100% { transform: translateY(-52%) translateX(-20px); }
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
}

.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--c-white) 0%, var(--c-accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--c-gray);
  max-width: 500px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}

/* Decorative shapes */
.hero-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.deco-circle {
  position: absolute;
  border-radius: 50%;
  animation: decoFloat 8s ease-in-out infinite alternate;
}

.deco-c1 {
  width: 120px;
  height: 120px;
  background: var(--c-primary);
  opacity: 0.15;
  bottom: 15%;
  right: 20%;
  animation-duration: 7s;
}

.deco-c2 {
  width: 60px;
  height: 60px;
  background: var(--c-accent);
  opacity: 0.25;
  top: 20%;
  right: 35%;
  animation-duration: 5s;
  animation-delay: 1s;
}

.deco-rect {
  position: absolute;
  width: 80px;
  height: 80px;
  background: transparent;
  border: 3px solid rgba(191, 0, 255, 0.3);
  border-radius: 16px;
  bottom: 30%;
  right: 10%;
  animation: decoRotate 12s linear infinite;
}

@keyframes decoFloat {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-30px) scale(1.1); }
}

@keyframes decoRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* =============================================
   Main Content Area
   ============================================= */
main {
  background: var(--c-dark);
}

section.wrap {
  width: 100%;
}

article.content-section {
  width: 100%;
}

div.content-article {
  display: flex;
  gap: var(--gap-lg);
  padding: var(--gap-xl) var(--gap-xl);
  align-items: flex-start;
}

/* =============================================
   Aside (左侧)
   ============================================= */
.content-aside {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 32px;
}

.aside-inner {
  background: rgba(101, 20, 255, 0.12);
  border: 1px solid rgba(101, 20, 255, 0.3);
  border-radius: var(--radius-card);
  padding: var(--gap-md);
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.aside-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.aside-title span {
  display: block;
}

.aside-text {
  font-size: 0.85rem;
  color: var(--c-gray);
  line-height: 1.6;
}

.aside-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-primary-light);
  transition: color var(--transition);
}

.aside-link:hover {
  color: var(--c-accent);
}

/* =============================================
   Content Body (page.content)
   ============================================= */
.content-body {
  flex: 1;
  min-width: 0;
}

/* Sections inside page.content */
.content-body article {
  margin-bottom: var(--gap-xl);
  padding: var(--gap-lg);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(101, 20, 255, 0.15);
  scroll-margin-top: 80px;
  opacity: 0;
  transform: translateY(24px);
  animation: revealUp var(--transition-slow) ease forwards;
}

.content-body article:nth-child(1) { animation-delay: 0.05s; }
.content-body article:nth-child(2) { animation-delay: 0.1s; }
.content-body article:nth-child(3) { animation-delay: 0.15s; }
.content-body article:nth-child(4) { animation-delay: 0.2s; }
.content-body article:nth-child(5) { animation-delay: 0.25s; }
.content-body article:nth-child(6) { animation-delay: 0.3s; }
.content-body article:nth-child(7) { animation-delay: 0.35s; }

@keyframes revealUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-body h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: var(--gap-md);
  color: var(--c-white);
}

.content-body h2 span {
  display: inline;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.content-body h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--c-primary-light);
  margin-top: var(--gap-md);
  margin-bottom: var(--gap-sm);
}

.content-body h3 span {
  display: inline;
}

.content-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1em;
}

.content-body ul,
.content-body ol {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1em;
  line-height: 1.8;
}

.content-body li {
  margin-bottom: 0.4em;
}

.content-body strong {
  color: var(--c-white);
  font-weight: 700;
}

.content-body em {
  color: var(--c-accent-light);
  font-style: normal;
  font-weight: 600;
}

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

.content-body a:hover {
  color: var(--c-accent);
}

.content-body blockquote {
  border-left: 4px solid var(--c-primary);
  padding-left: var(--gap-md);
  margin: var(--gap-md) 0;
  color: var(--c-gray);
  font-style: italic;
}

.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--gap-md) 0;
  font-size: 0.9rem;
}

.content-body th {
  background: var(--c-primary);
  color: var(--c-white);
  padding: 10px 16px;
  text-align: left;
  font-weight: 700;
}

.content-body td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(101, 20, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
}

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

/* =============================================
   Footer
   ============================================= */
.site-footer {
  background: var(--c-dark);
  border-top: 2px solid var(--c-primary);
}

/* 大 CTA 块 */
.footer-cta-block {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 100%);
  padding: var(--gap-xl) var(--gap-xl);
}

.footer-cta-inner {
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
}

.footer-cta-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.footer-cta-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--c-white);
}

.footer-cta-title span {
  display: inline;
}

/* 三列 dl 页脚 */
.footer-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-lg);
  padding: var(--gap-xl) var(--gap-xl);
}

.footer-col {}

.footer-col-head {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--gap-sm);
  display: block;
}

.footer-col-desc {
  font-size: 0.9rem;
  color: var(--c-gray);
  line-height: 1.7;
}

/* footer nav dl */
.footer-col-nav nav dl {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-col-nav nav dl dt {
  display: block;
}

.footer-col-nav nav dl dt a {
  font-size: 0.9rem;
  color: var(--c-gray);
  padding: 6px 0;
  display: block;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.footer-col-nav nav dl dt a:hover {
  color: var(--c-white);
}

.footer-col-info dd {
  font-size: 0.9rem;
  color: var(--c-gray);
  margin-bottom: 4px;
}

.footer-link {
  color: var(--c-primary-light);
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--c-accent);
}

.footer-host {
  font-size: 0.8rem;
  color: rgba(176, 168, 192, 0.6);
}

/* 底栏 */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--gap-md) var(--gap-xl);
  border-top: 1px solid rgba(101, 20, 255, 0.2);
  flex-wrap: wrap;
  gap: var(--gap-sm);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--c-gray);
}

.footer-bottom-link {
  font-size: 0.8rem;
  color: var(--c-gray);
  transition: color var(--transition);
}

.footer-bottom-link:hover {
  color: var(--c-white);
}

/* =============================================
   Scroll Margin for sections (smooth nav)
   ============================================= */
article[id] {
  scroll-margin-top: 32px;
}

/* =============================================
   Scroll Reveal (Intersection Observer via JS)
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

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

/* =============================================
   Stagger children
   ============================================= */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.stagger.visible > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: none; }
.stagger.visible > *:nth-child(2) { transition-delay: 60ms; opacity: 1; transform: none; }
.stagger.visible > *:nth-child(3) { transition-delay: 120ms; opacity: 1; transform: none; }
.stagger.visible > *:nth-child(4) { transition-delay: 180ms; opacity: 1; transform: none; }
.stagger.visible > *:nth-child(5) { transition-delay: 240ms; opacity: 1; transform: none; }
.stagger.visible > *:nth-child(6) { transition-delay: 300ms; opacity: 1; transform: none; }
.stagger.visible > *:nth-child(7) { transition-delay: 360ms; opacity: 1; transform: none; }

/* =============================================
   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;
  }
  html {
    scroll-behavior: auto;
  }
  .content-body article {
    opacity: 1;
    transform: none;
  }
  .reveal, .stagger > * {
    opacity: 1;
    transform: none;
  }
}

/* =============================================
   Responsive: Tablet
   ============================================= */
@media (max-width: 1024px) {
  :root {
    --sidebar-w: 200px;
  }

  .hero-block {
    padding: var(--gap-lg) var(--gap-md);
  }

  div.content-article {
    padding: var(--gap-lg) var(--gap-md);
    gap: var(--gap-md);
  }

  .content-aside {
    width: 180px;
  }

  .footer-cta-block,
  .footer-body,
  .footer-bottom {
    padding-left: var(--gap-md);
    padding-right: var(--gap-md);
  }
}

/* =============================================
   Responsive: Mobile
   ============================================= */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
    --gap-xl: 40px;
    --gap-lg: 28px;
    --gap-md: 20px;
  }

  .site-shell {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    border-right: none;
    border-top: 2px solid var(--c-primary);
    z-index: 200;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar-inner {
    flex-direction: row;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    width: 100%;
    height: auto;
    overflow-x: auto;
  }

  .sidebar-brand {
    padding-bottom: 0;
    border-bottom: none;
    border-right: 1px solid rgba(101, 20, 255, 0.3);
    padding-right: 12px;
    flex-shrink: 0;
  }

  .brand-text {
    font-size: 1rem;
    white-space: nowrap;
    padding: 4px 0;
  }

  .sidebar-nav {
    flex: 1;
    overflow-x: auto;
  }

  .sidebar-nav dl {
    flex-direction: row;
    gap: 0;
    white-space: nowrap;
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 8px 10px;
    min-height: 44px;
    white-space: nowrap;
  }

  .sidebar-cta {
    padding-top: 0;
    border-top: none;
    flex-shrink: 0;
  }

  .btn-cta {
    padding: 10px 16px;
    font-size: 0.8rem;
    white-space: nowrap;
    min-height: 44px;
  }

  .main-content {
    margin-left: 0;
    padding-bottom: 80px; /* space for bottom nav */
  }

  article[id] {
    scroll-margin-top: 80px;
  }

  .hero-block {
    min-height: 100vh;
    padding: var(--gap-lg) var(--gap-md);
    padding-top: var(--gap-xl);
    align-items: flex-start;
    padding-top: 80px;
  }

  .hero-bg-text {
    font-size: clamp(80px, 25vw, 140px);
    right: -0.2em;
  }

  .hero-h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero-sub {
    font-size: 1rem;
  }

  /* div layout: stack vertically, aside on top */
  div.content-article {
    flex-direction: column;
    padding: var(--gap-lg) var(--gap-md);
    gap: var(--gap-md);
  }

  .content-aside {
    width: 100%;
    position: static;
  }

  .footer-body {
    grid-template-columns: 1fr;
    gap: var(--gap-md);
    padding: var(--gap-lg) var(--gap-md);
  }

  .footer-cta-block {
    padding: var(--gap-lg) var(--gap-md);
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--gap-md);
  }

  .content-body article {
    padding: var(--gap-md);
    margin-bottom: var(--gap-md);
  }

  .content-body h2 {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }
}
