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

/* ===== 基础变量 ===== */
:root {
  --c-primary: #ff0080;
  --c-secondary: #ff00ff;
  --c-bg: #26171f;
  --c-bg2: #1e1019;
  --c-bg3: #321a27;
  --c-text: #f0e6ec;
  --c-text-muted: #c9a8bb;
  --c-border: rgba(255,0,128,0.25);
  --c-glass-bg: rgba(50,20,40,0.55);
  --c-glass-border: rgba(255,0,255,0.2);
  --font-head: 'EB Garamond', Georgia, serif;
  --font-body: 'Lato', system-ui, sans-serif;
  --radius: 4px;
  --max-w: 1200px;
  --transition: 0.3s ease;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--c-secondary); }
ul, ol, menu { list-style: none; }

/* ===== Aurora Background ===== */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora-mesh {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(255,0,128,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(255,0,255,0.15) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 50% 80%, rgba(255,0,128,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 10% 70%, rgba(200,0,200,0.12) 0%, transparent 50%);
  animation: auroraFlow 12s ease-in-out infinite alternate;
}
@keyframes auroraFlow {
  0%   { filter: hue-rotate(0deg) brightness(1); background-position: 0% 0%; }
  33%  { filter: hue-rotate(20deg) brightness(1.08); }
  66%  { filter: hue-rotate(-15deg) brightness(0.95); }
  100% { filter: hue-rotate(10deg) brightness(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .aurora-mesh { animation: none; }
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(38,23,31,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-border);
}
.header-brand {
  border-bottom: 1px solid rgba(255,0,128,0.12);
}
.brand-row {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.logo-img { height: 36px; width: auto; }
.brand-name {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--c-primary), var(--c-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
}
.contact-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.1rem;
  min-height: 40px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-secondary));
  color: #fff;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: opacity var(--transition), transform var(--transition);
}
.contact-btn:hover { opacity: 0.85; transform: translateY(-1px); color: #fff; }

/* Nav details/menu */
.header-nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.nav-details { position: relative; }
.nav-toggle {
  display: none;
  align-items: center;
  padding: 0.6rem 0;
  min-height: 40px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--c-text-muted);
  list-style: none;
  user-select: none;
}
.nav-toggle::-webkit-details-marker { display: none; }
.nav-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.55rem 0;
}
.nav-menu li a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  min-height: 40px;
  background: rgba(255,0,128,0.08);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  color: var(--c-text);
  font-size: 0.855rem;
  font-weight: 400;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-menu li a:hover {
  background: rgba(255,0,128,0.22);
  border-color: var(--c-primary);
  color: #fff;
}

/* ===== Wrap & Layout ===== */
main {
  position: relative;
  z-index: 1;
}
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Hero ===== */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 6rem 2rem 4rem;
  overflow: hidden;
}
.hero-bg-text {
  position: absolute;
  left: -0.05em;
  top: 50%;
  transform: translateY(-55%);
  font-family: var(--font-head);
  font-size: clamp(6rem, 18vw, 18rem);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,0,128,0.1);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.hero-content {
  max-width: 52%;
  text-align: right;
  position: relative;
  z-index: 2;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--c-primary);
  margin-bottom: 1rem;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
}
.hero-section h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, #fff 30%, var(--c-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-lead {
  font-size: 1.1rem;
  color: var(--c-text-muted);
  margin-bottom: 2rem;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.8rem;
  min-height: 48px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-secondary));
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 0 24px rgba(255,0,128,0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(255,0,255,0.5);
  color: #fff;
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.8rem;
  min-height: 48px;
  background: transparent;
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-weight: 400;
  font-size: 1rem;
  transition: border-color var(--transition), color var(--transition);
}
.btn-ghost:hover { border-color: var(--c-secondary); color: var(--c-secondary); }

/* ===== Glass card ===== */
.glass {
  background: var(--c-glass-bg);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,0,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}

/* ===== Content section (inner layout) ===== */
.content-section,
.inner-section {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 3rem 0;
  align-items: start;
}

/* main div */
.main-article,
.inner-article {
  min-width: 0;
}
.inner-article {
  padding: 2.5rem;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--c-text-muted); }
.breadcrumb a:hover { color: var(--c-primary); }

/* ===== Article header ===== */
.article-header { margin-bottom: 2rem; }
.article-header h1 {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.6rem;
  background: linear-gradient(135deg, #fff 20%, var(--c-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle {
  color: var(--c-text-muted);
  font-size: 1rem;
  margin-top: 0.4rem;
  margin-bottom: 0.8rem;
}
.article-meta {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}
.article-date {
  font-size: 0.82rem;
  color: var(--c-text-muted);
  font-family: var(--font-body);
}

/* ===== Article body ===== */
.article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-text);
}
.article-body h2 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin: 2rem 0 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--c-border);
}
.article-body h3 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--c-text);
  margin: 1.5rem 0 0.4rem;
}
.article-body p { margin-bottom: 1rem; }
.article-body ul, .article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 0.4rem; }
.article-body a { color: var(--c-primary); text-decoration: underline; text-underline-offset: 2px; }
.article-body a:hover { color: var(--c-secondary); }
.article-body blockquote {
  border-left: 3px solid var(--c-primary);
  padding: 0.6rem 1.2rem;
  margin: 1.2rem 0;
  background: rgba(255,0,128,0.07);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--c-text-muted);
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.95rem;
}
.article-body th, .article-body td {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--c-border);
  text-align: left;
}
.article-body th { background: rgba(255,0,128,0.12); color: #fff; font-weight: 700; }
.article-body code {
  background: rgba(255,0,255,0.12);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: monospace;
  color: var(--c-secondary);
}
.article-body pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}
.article-body pre code { background: none; padding: 0; color: var(--c-text); }

/* ===== Sidebar ===== */
.sidebar { min-width: 0; }
.sidebar-inner {
  padding: 1.5rem;
}
.sidebar-inner h2 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.2rem;
}
.sidebar-inner .subtitle {
  font-size: 0.82rem;
  margin-bottom: 0.9rem;
}

/* DL patterns */
.quick-nav, .related-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.quick-nav dt, .related-list dt {
  margin-top: 0.7rem;
}
.quick-nav dt a, .related-list dt a {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-text);
  display: block;
  padding: 0.3rem 0;
  transition: color var(--transition);
}
.quick-nav dt a:hover, .related-list dt a:hover { color: var(--c-primary); }
.quick-nav dd, .related-list dd {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  padding-left: 0.5rem;
  line-height: 1.4;
}

/* ===== Cards Section ===== */
.cards-section {
  padding: 3rem 0;
}
.cards-section > h2 {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: #fff;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-top: 1.8rem;
}
.card {
  padding: 1.8rem 1.5rem;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(255,0,128,0.2);
}
.card-index {
  display: block;
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-primary);
  opacity: 0.6;
  margin-bottom: 0.6rem;
  line-height: 1;
}
.card h3 {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #fff;
}
.card h3 a { color: #fff; text-decoration: none; }
.card h3 a:hover { color: var(--c-secondary); }
.card-desc {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  line-height: 1.6;
  margin-bottom: 0.8rem;
}
.card time {
  font-size: 0.78rem;
  color: var(--c-text-muted);
  font-family: var(--font-body);
}

/* ===== Links Section ===== */
.links-section {
  padding: 2rem 0 3rem;
}
.links-section > h2 {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
}
.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.2rem;
}
.link-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.2rem;
  min-height: 40px;
  background: rgba(255,0,128,0.1);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  color: var(--c-text);
  font-size: 0.875rem;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.link-pill:hover {
  background: rgba(255,0,128,0.25);
  border-color: var(--c-primary);
  color: #fff;
}

/* ===== Footer ===== */
.site-footer {
  position: relative;
  z-index: 1;
  background: var(--c-bg2);
  border-top: 1px solid var(--c-border);
  margin-top: 2rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 1.5rem;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col .footer-heading {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-primary);
  display: block;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--c-border);
}
.footer-col dt a {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  display: block;
  padding: 0.25rem 0;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.footer-col dt a:hover { color: var(--c-primary); }
.footer-col dd {
  font-size: 0.78rem;
  color: rgba(200,168,187,0.6);
  padding-left: 0.3rem;
  margin-bottom: 0.3rem;
}
.footer-bottom {
  border-top: 1px solid rgba(255,0,128,0.1);
  padding-top: 1rem;
  font-size: 0.8rem;
  color: var(--c-text-muted);
  text-align: center;
}

/* ===== Reveal animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.stagger-0.is-visible { transition-delay: 0s; }
.stagger-1.is-visible { transition-delay: 0.1s; }
.stagger-2.is-visible { transition-delay: 0.2s; }
.stagger-3.is-visible { transition-delay: 0.3s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== FAQ specifics ===== */
.faq-body h2 { margin-top: 2.2rem; }
.faq-body h2::before {
  content: attr(data-n);
  display: inline-block;
  margin-right: 0.5em;
  color: var(--c-primary);
  font-variant-numeric: tabular-nums;
}

/* ===== Changelog specifics ===== */
.changelog-body h2 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.changelog-body h2 time {
  font-size: 0.85rem;
  color: var(--c-primary);
  font-family: var(--font-body);
  font-weight: 400;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .content-section,
  .inner-section {
    grid-template-columns: 1fr;
  }
  .sidebar { order: -1; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .hero-content { max-width: 80%; }
}

@media (max-width: 640px) {
  .brand-row { padding: 0.6rem 1rem; }
  .header-nav { padding: 0 1rem; }
  .wrap { padding: 0 1rem; }
  .nav-toggle { display: flex; }
  .nav-details:not([open]) .nav-menu { display: none; }
  .nav-menu {
    flex-direction: column;
    padding: 0.5rem 0 0.8rem;
    gap: 0.3rem;
  }
  .nav-menu li a {
    min-height: 44px;
    justify-content: center;
  }
  .hero-section {
    min-height: 100svh;
    justify-content: center;
    padding: 5rem 1rem 3rem;
  }
  .hero-content {
    max-width: 100%;
    text-align: center;
  }
  .hero-actions { justify-content: center; }
  .hero-bg-text { font-size: clamp(4rem, 22vw, 8rem); opacity: 0.6; }
  .cards-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; gap: 1.5rem; }
  .inner-article { padding: 1.5rem 1rem; }
  .content-section, .inner-section { padding: 2rem 0; }
}
