:root {
  --bg: #0f0f1a;
  --bg-alt: #16162a;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text: #e8e8f0;
  --text-muted: #a0a0b8;
  --text-dim: #70708a;
  --primary: #e94560;
  --primary-soft: #ff6b81;
  --accent: #7b5ea7;
  --accent-2: #4a6cf7;
  --gradient: linear-gradient(135deg, #e94560 0%, #7b5ea7 50%, #4a6cf7 100%);
  --gradient-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.15) 0%, rgba(74, 108, 247, 0.15) 100%);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 16px 48px rgba(233, 69, 96, 0.18);
  --transition: 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(233, 69, 96, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(74, 108, 247, 0.10), transparent),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(123, 94, 167, 0.08), transparent);
  background-attachment: fixed;
}

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

a {
  color: var(--primary-soft);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

a:hover {
  color: #fff;
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4 {
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  margin-bottom: 1.1rem;
  position: relative;
  padding-left: 1rem;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 4px;
  border-radius: 4px;
  background: var(--gradient);
}

h3 {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: #fff;
  margin: 1.6rem 0 0.7rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

strong {
  color: var(--text);
}

/* ============ Header ============ */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(15, 15, 26, 0.72);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--transition);
}

header > div {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

header > div > a[aria-label] {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  flex-shrink: 0;
  transition: transform var(--transition), filter var(--transition);
}

header > div > a[aria-label]:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

header nav a {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}

header nav a:hover {
  color: #fff;
  background: var(--surface-strong);
  transform: translateY(-2px);
}

/* ============ Main ============ */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* ============ Breadcrumb ============ */
nav[aria-label="面包屑导航"] {
  margin: 1.5rem 0 2rem;
}

nav[aria-label="面包屑导航"] ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

nav[aria-label="面包屑导航"] li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

nav[aria-label="面包屑导航"] li:not(:last-child)::after {
  content: "›";
  color: var(--text-dim);
  opacity: 0.6;
}

nav[aria-label="面包屑导航"] a {
  color: var(--text-muted);
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  transition: all var(--transition);
}

nav[aria-label="面包屑导航"] a:hover {
  color: var(--primary-soft);
  background: var(--surface);
}

/* ============ Sections ============ */
section {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  margin-bottom: 2rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: fadeUp 0.7s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

section:hover {
  border-color: rgba(233, 69, 96, 0.25);
  box-shadow: var(--shadow-hover);
}

/* Hero / intro gradient banner */
#intro {
  background:
    linear-gradient(135deg, rgba(233, 69, 96, 0.18) 0%, rgba(123, 94, 167, 0.16) 50%, rgba(74, 108, 247, 0.18) 100%),
    var(--glass);
  border-color: rgba(233, 69, 96, 0.28);
  position: relative;
  overflow: hidden;
}

#intro::before {
  content: "";
  position: absolute;
  inset: -50% -20% auto auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(233, 69, 96, 0.28), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
  animation: pulseGlow 8s ease-in-out infinite;
}

#intro::after {
  content: "";
  position: absolute;
  inset: auto auto -40% -10%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(74, 108, 247, 0.22), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
  animation: pulseGlow 10s ease-in-out infinite reverse;
}

#intro h1 {
  position: relative;
  z-index: 1;
}

#intro p {
  position: relative;
  z-index: 1;
  font-size: 1.02rem;
  color: var(--text);
  opacity: 0.92;
}

/* ============ Articles ============ */
#articles article {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.1rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
}

#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity var(--transition);
}

#articles article:hover {
  transform: translateY(-4px);
  background: var(--surface-strong);
  border-color: rgba(233, 69, 96, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

#articles article:hover::before {
  opacity: 1;
}

#articles article h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  transition: color var(--transition);
}

#articles article:hover h3 {
  color: var(--primary-soft);
}

#articles article p:nth-of-type(1) {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}

#articles article p:nth-of-type(2) {
  font-size: 0.94rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: var(--gradient-soft);
  border: 1px solid rgba(233, 69, 96, 0.3);
  color: var(--primary-soft);
  transition: all var(--transition);
}

#articles article a::after {
  content: "→";
  transition: transform var(--transition);
}

#articles article a:hover {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  transform: translateX(2px);
}

#articles article a:hover::after {
  transform: translateX(4px);
}

/* ============ FAQ ============ */
#faq h3 {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  margin: 0.9rem 0 0;
  font-size: 1rem;
  color: var(--text);
  cursor: default;
  transition: all var(--transition);
  position: relative;
}

#faq h3::before {
  content: "Q";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.6rem;
  border-radius: 8px;
  background: var(--gradient);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  vertical-align: middle;
}

#faq h3:hover {
  background: var(--surface-strong);
  border-color: rgba(233, 69, 96, 0.3);
  transform: translateX(4px);
}

#faq h3 + p {
  padding: 0.9rem 1.1rem 0.9rem 3.2rem;
  margin: 0 0 0.6rem;
  font-size: 0.93rem;
  border-left: 2px solid rgba(233, 69, 96, 0.25);
  margin-left: 0.75rem;
  color: var(--text-muted);
}

/* ============ HowTo ============ */
#howto h3 {
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent-2);
  margin-left: 0;
}

#howto p {
  font-size: 0.95rem;
}

/* ============ Lists in sitemap / links ============ */
#sitemap ul,
#links ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
}

#sitemap li a,
#links li a {
  display: block;
  padding: 0.65rem 1rem;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all var(--transition);
}

#sitemap li a:hover,
#links li a:hover {
  background: var(--gradient-soft);
  border-color: rgba(233, 69, 96, 0.35);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* ============ Contact ============ */
#contact p {
  font-size: 0.95rem;
}

#contact h3 {
  color: var(--primary-soft);
}

/* ============ Footer ============ */
footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  border-top: 1px solid var(--glass-border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

footer p {
  margin-bottom: 0.5rem;
  color: var(--text-dim);
}

footer a {
  color: var(--text-muted);
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: all var(--transition);
}

footer a:hover {
  color: var(--primary-soft);
  background: var(--surface);
}

/* ============ Animations ============ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Stagger section entrance */
section:nth-of-type(1) { animation-delay: 0.02s; }
section:nth-of-type(2) { animation-delay: 0.06s; }
section:nth-of-type(3) { animation-delay: 0.10s; }
section:nth-of-type(4) { animation-delay: 0.14s; }
section:nth-of-type(5) { animation-delay: 0.18s; }
section:nth-of-type(6) { animation-delay: 0.22s; }
section:nth-of-type(7) { animation-delay: 0.26s; }
section:nth-of-type(8) { animation-delay: 0.30s; }

/* ============ Scroll reveal via CSS only (progressive) ============ */
@supports (animation-timeline: view()) {
  section {
    animation: fadeUp linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  header > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
  }

  header nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  header nav::-webkit-scrollbar {
    display: none;
  }

  header nav ul {
    flex-wrap: nowrap;
    gap: 0.15rem;
    padding-bottom: 0.25rem;
  }

  header nav a {
    font-size: 0.82rem;
    padding: 0.35rem 0.6rem;
  }

  main {
    padding: 0 1rem 2.5rem;
  }

  section {
    border-radius: var(--radius);
    padding: 1.35rem;
    margin-bottom: 1.5rem;
  }

  h2 {
    padding-left: 0.85rem;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 15px;
    line-height: 1.75;
  }

  h1 {
    font-size: 1.55rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1.02rem;
  }

  header > div > a[aria-label] {
    font-size: 1.35rem;
  }

  nav[aria-label="面包屑导航"] {
    margin: 1rem 0 1.25rem;
    font-size: 0.78rem;
  }

  #intro {
    padding: 1.5rem 1.15rem;
  }

  #intro p {
    font-size: 0.95rem;
  }

  #articles article {
    padding: 1.1rem 1.15rem;
  }

  #articles article h3 {
    font-size: 1rem;
  }

  #faq h3 {
    font-size: 0.93rem;
    padding: 0.7rem 0.9rem;
  }

  #faq h3 + p {
    padding: 0.75rem 0.9rem 0.75rem 1rem;
    font-size: 0.88rem;
    margin-left: 0.4rem;
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
  }

  #sitemap li a,
  #links li a {
    padding: 0.55rem 0.8rem;
    font-size: 0.85rem;
  }

  footer {
    padding: 2rem 1rem 2.5rem;
    font-size: 0.8rem;
  }
}

/* ============ Light mode support ============ */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5fa;
    --bg-alt: #ffffff;
    --surface: rgba(0, 0, 0, 0.03);
    --surface-strong: rgba(0, 0, 0, 0.05);
    --glass: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(0, 0, 0, 0.08);
    --text: #1a1a2e;
    --text-muted: #4a4a60;
    --text-dim: #8888a0;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 16px 48px rgba(233, 69, 96, 0.15);
  }

  body {
    background-image:
      radial-gradient(ellipse 80% 50% at 20% -10%, rgba(233, 69, 96, 0.08), transparent),
      radial-gradient(ellipse 60% 40% at 90% 10%, rgba(74, 108, 247, 0.07), transparent),
      radial-gradient(ellipse 70% 50% at 50% 100%, rgba(123, 94, 167, 0.05), transparent);
  }

  header {
    background: rgba(255, 255, 255, 0.75);
  }

  h3 {
    color: #1a1a2e;
  }

  #intro {
    background:
      linear-gradient(135deg, rgba(233, 69, 96, 0.10) 0%, rgba(123, 94, 167, 0.08) 50%, rgba(74, 108, 247, 0.10) 100%),
      var(--glass);
  }

  #intro p {
    color: var(--text);
  }

  #articles article a:hover,
  #faq h3:hover {
    color: #1a1a2e;
  }
}

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

/* ============ Print ============ */
@media print {
  header,
  footer,
  nav[aria-label="面包屑导航"],
  #sitemap,
  #links {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  section {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}