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

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body.site-body {
  background: #0d0a14;
  color: #f0eaff;
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SCROLL MARGIN FOR SECTIONS ===== */
article[id] {
  scroll-margin-top: 72px;
}

/* ===== ANIMATED GRID PATTERN ===== */
@keyframes gridMove {
  0% { background-position: 0 0; }
  100% { background-position: 48px 48px; }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

@keyframes staggerIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to { opacity: 1; transform: translateX(0); }
}

@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; }
}

/* ===== PAGE WRAP ===== */
.page-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== ASIDE NAVIGATION ===== */
.site-aside {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
}

.aside-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 10, 20, 0.75);
  opacity: 0;
  transition: opacity 250ms ease;
  backdrop-filter: blur(4px);
}

.aside-drawer {
  position: absolute;
  top: 0;
  left: 0;
  width: min(340px, 90vw);
  height: 100%;
  background: linear-gradient(160deg, #1c1726 0%, #0d0a14 60%, #1a0a2e 100%);
  border-right: 2px solid #6514ff;
  transform: translateX(-100%);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 48px 32px 40px;
  overflow-y: auto;
}

.site-aside.is-open {
  pointer-events: auto;
}

.site-aside.is-open .aside-overlay {
  opacity: 1;
}

.site-aside.is-open .aside-drawer {
  transform: translateX(0);
}

.aside-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: flex-end;
  margin-bottom: 40px;
}

.close-bar {
  display: block;
  width: 28px;
  height: 2px;
  background: #bf00ff;
  transition: background 200ms;
}

.close-bar:first-child { transform: rotate(45deg) translate(5px, 5px); }
.close-bar:last-child { transform: rotate(-45deg) translate(5px, -5px); }

.aside-close:hover .close-bar { background: #f0eaff; }

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

.nav-link {
  display: block;
  padding: 14px 20px;
  color: #d4c8ff;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: color 220ms, background 220ms, border-color 220ms;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: #fff;
  background: rgba(101, 20, 255, 0.3);
  border-color: #6514ff;
  outline: none;
}

.aside-contact {
  margin-top: auto;
  padding-top: 32px;
  border-top: 1px solid rgba(101, 20, 255, 0.3);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-label {
  font-size: 0.8rem;
  color: #8b7baa;
  letter-spacing: 0.05em;
}

.contact-link {
  color: #bf00ff;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 200ms;
}

.contact-link:hover { color: #f0eaff; }

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 68px;
  background: rgba(13, 10, 20, 0.92);
  border-bottom: 1px solid rgba(101, 20, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
}

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

.brand-icon-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #6514ff, #bf00ff);
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hamburger {
  background: none;
  border: 1px solid rgba(101, 20, 255, 0.5);
  border-radius: 10px;
  cursor: pointer;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  align-items: center;
  transition: border-color 220ms, background 220ms;
}

.hamburger:hover,
.hamburger:focus-visible {
  border-color: #bf00ff;
  background: rgba(101, 20, 255, 0.15);
  outline: none;
}

.ham-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #bf00ff;
  border-radius: 2px;
  transition: background 220ms;
}

.hamburger:hover .ham-bar { background: #f0eaff; }

/* ===== HERO ===== */
.hero-section {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  padding: 80px 48px 80px 32px;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(101, 20, 255, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(101, 20, 255, 0.15) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridMove 8s linear infinite;
  z-index: 0;
}

.hero-grid-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 80% 50%, rgba(191, 0, 255, 0.18) 0%, transparent 70%),
              radial-gradient(ellipse 50% 80% at 20% 80%, rgba(101, 20, 255, 0.2) 0%, transparent 70%);
  animation: pulseGlow 4s ease-in-out infinite;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: right;
  max-width: 780px;
  animation: staggerIn 600ms ease both;
}

.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: #bf00ff;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 24px;
  text-shadow: 0 0 40px rgba(191, 0, 255, 0.4);
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: 1.1rem;
  color: #b8a8d8;
  margin-bottom: 40px;
  max-width: 560px;
  margin-left: auto;
  line-height: 1.75;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 40px;
  background: linear-gradient(135deg, #6514ff, #bf00ff);
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  min-height: 52px;
  transition: transform 200ms, box-shadow 200ms;
  box-shadow: 0 0 32px rgba(191, 0, 255, 0.4);
  letter-spacing: 0.02em;
}

.hero-cta:hover,
.hero-cta:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 48px rgba(191, 0, 255, 0.65);
  outline: none;
}

/* ===== MAIN CONTENT ===== */
main {
  flex: 1;
}

main > div {
  display: flex;
  flex-direction: column;
}

.content-body {
  padding: 64px 0;
  background: #0d0a14;
}

.content-prose {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ===== CONTENT SECTIONS (from page.content) ===== */
.content-prose article {
  margin-bottom: 80px;
  padding: 48px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(101, 20, 255, 0.25);
  border-radius: 28px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  transition: border-color 250ms, box-shadow 250ms;
}

.content-prose article::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #6514ff, #bf00ff, transparent);
}

.content-prose article:hover {
  border-color: rgba(191, 0, 255, 0.45);
  box-shadow: 0 8px 48px rgba(101, 20, 255, 0.15);
}

.content-prose h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.content-prose h2 + hr,
.content-prose h3 + hr {
  border: none;
  border-top: 2px solid rgba(101, 20, 255, 0.5);
  margin-bottom: 28px;
}

.content-prose h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #d4c8ff;
  margin: 28px 0 12px;
  line-height: 1.3;
}

.content-prose h4 {
  font-size: 1.05rem;
  font-weight: 500;
  color: #b8a8d8;
  margin: 20px 0 8px;
}

.content-prose p {
  font-size: 1rem;
  line-height: 1.8;
  color: #c8b8e8;
  margin-bottom: 16px;
}

.content-prose a {
  color: #bf00ff;
  text-decoration: underline;
  text-decoration-color: rgba(191, 0, 255, 0.4);
  transition: color 200ms, text-decoration-color 200ms;
}

.content-prose a:hover {
  color: #f0eaff;
  text-decoration-color: #f0eaff;
}

.content-prose ul,
.content-prose ol {
  padding-left: 24px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.content-prose li {
  color: #c8b8e8;
  line-height: 1.7;
  font-size: 1rem;
}

.content-prose ul li::marker {
  color: #bf00ff;
}

.content-prose ol li::marker {
  color: #6514ff;
  font-weight: 700;
}

.content-prose strong, .content-prose b {
  color: #f0eaff;
  font-weight: 700;
}

.content-prose em {
  color: #d4c8ff;
}

.content-prose blockquote {
  border-left: 3px solid #bf00ff;
  padding: 16px 24px;
  margin: 24px 0;
  background: rgba(191, 0, 255, 0.08);
  border-radius: 0 12px 12px 0;
  font-size: 1.05rem;
  color: #d4c8ff;
  font-style: italic;
}

.content-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}

.content-prose th {
  background: rgba(101, 20, 255, 0.3);
  color: #fff;
  font-weight: 700;
  padding: 12px 16px;
  text-align: left;
  border: 1px solid rgba(101, 20, 255, 0.4);
}

.content-prose td {
  padding: 10px 16px;
  border: 1px solid rgba(101, 20, 255, 0.2);
  color: #c8b8e8;
  vertical-align: top;
}

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

/* ===== FOOTER ===== */
.site-footer {
  background: #1c1726;
  border-top: 2px solid rgba(101, 20, 255, 0.5);
  padding: 0;
}

.footer-brand-section {
  padding: 64px 48px 56px;
  border-bottom: 1px solid rgba(101, 20, 255, 0.25);
  text-align: center;
  background: linear-gradient(180deg, rgba(101, 20, 255, 0.1) 0%, transparent 100%);
}

.footer-brand-big {
  font-size: clamp(2.8rem, 7vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(135deg, #6514ff, #bf00ff, #f0eaff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.footer-brand-desc {
  font-size: 1rem;
  color: #8b7baa;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.7;
}

.footer-nav-section,
.footer-info-section {
  padding: 48px 48px;
}

/* Three-column layout for footer sections */
.site-footer {
  display: flex;
  flex-direction: column;
}

.footer-mid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid rgba(101, 20, 255, 0.25);
}

/* We output as individual sections, style them in grid via container */
.footer-nav-section {
  border-right: 1px solid rgba(101, 20, 255, 0.2);
  border-bottom: 1px solid rgba(101, 20, 255, 0.25);
}

.footer-info-section {
  border-bottom: 1px solid rgba(101, 20, 255, 0.25);
}

.footer-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #d4c8ff;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.footer-nav-section hr,
.footer-info-section hr {
  border: none;
  border-top: 1px solid rgba(101, 20, 255, 0.4);
  margin-bottom: 24px;
}

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

.footer-link {
  color: #8b7baa;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 0;
  display: inline-block;
  min-height: 40px;
  line-height: 40px;
  transition: color 200ms;
}

.footer-link:hover { color: #bf00ff; }

.footer-info-text {
  font-size: 0.95rem;
  color: #8b7baa;
  line-height: 1.7;
  margin-bottom: 12px;
}

.footer-contact { margin-top: 8px; }

.footer-copy-section {
  padding: 28px 48px;
  text-align: center;
}

.footer-copy {
  font-size: 0.85rem;
  color: #5a4d6e;
  line-height: 1.6;
}

/* Grid layout for middle footer columns */
@supports (display: grid) {
  .site-footer > .footer-nav-section,
  .site-footer > .footer-info-section {
    /* handled by media queries below */
  }
}

/* ===== RESPONSIVE: tablet ===== */
@media (min-width: 768px) {
  .site-footer {
    display: grid;
    grid-template-areas:
      "brand brand"
      "nav   info"
      "copy  copy";
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
  }

  .footer-brand-section { grid-area: brand; }
  .footer-nav-section { grid-area: nav; }
  .footer-info-section { grid-area: info; }
  .footer-copy-section {
    grid-area: copy;
    grid-column: 1 / -1;
  }
}

/* ===== RESPONSIVE: mobile ===== */
@media (max-width: 767px) {
  .site-header {
    padding: 0 20px;
  }

  .hero-section {
    min-height: 70vh;
    padding: 60px 24px 60px 24px;
    justify-content: center;
  }

  .hero-inner {
    text-align: right;
    max-width: 100%;
  }

  .hero-title {
    font-size: 2.2rem;
  }

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

  .content-prose {
    padding: 0 20px;
  }

  .content-prose article {
    padding: 32px 24px;
    margin-bottom: 48px;
    border-radius: 20px;
  }

  .content-prose h2 {
    font-size: 1.5rem;
  }

  .footer-brand-section {
    padding: 48px 24px 40px;
  }

  .footer-brand-big {
    font-size: 2.6rem;
  }

  .footer-nav-section,
  .footer-info-section {
    padding: 36px 24px;
    border-right: none;
  }

  .footer-copy-section {
    padding: 24px 20px;
  }

  .hero-cta {
    padding: 14px 32px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.9rem;
  }

  .content-body {
    padding: 48px 0;
  }
}

/* ===== FOCUS VISIBLE ===== */
:focus-visible {
  outline: 2px solid #bf00ff;
  outline-offset: 3px;
}

/* ===== SELECTION ===== */
::selection {
  background: rgba(191, 0, 255, 0.35);
  color: #fff;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #0d0a14;
}
::-webkit-scrollbar-thumb {
  background: #6514ff;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #bf00ff;
}

/* ===== HR GLOBAL ===== */
hr {
  border: none;
  border-top: 1px solid rgba(101, 20, 255, 0.35);
  margin: 24px 0;
}
