:root {
  --primary: #7C3AED;
  --primary-light: #A78BFA;
  --primary-dark: #5B21B6;
  --secondary: #EC4899;
  --secondary-light: #F9A8D4;
  --accent: #06B6D4;
  --accent-light: #67E8F9;
  --bg: #FDF2F8;
  --bg-alt: #F5F3FF;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-card-solid: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.45);
  --bg-glass-strong: rgba(255, 255, 255, 0.65);
  --text: #1E1B4B;
  --text-secondary: #4C1D95;
  --text-muted: #6B7280;
  --border: rgba(124, 58, 237, 0.12);
  --border-strong: rgba(124, 58, 237, 0.25);
  --shadow-sm: 0 1px 3px rgba(124, 58, 237, 0.08);
  --shadow: 0 4px 20px rgba(124, 58, 237, 0.10);
  --shadow-lg: 0 12px 40px rgba(124, 58, 237, 0.15);
  --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.18);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --header-height: 68px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #A78BFA;
    --primary-light: #C4B5FD;
    --primary-dark: #7C3AED;
    --secondary: #F472B6;
    --secondary-light: #F9A8D4;
    --accent: #22D3EE;
    --accent-light: #67E8F9;
    --bg: #0F0A1F;
    --bg-alt: #1A1033;
    --bg-card: rgba(30, 20, 60, 0.72);
    --bg-card-solid: #1E143C;
    --bg-glass: rgba(30, 20, 60, 0.55);
    --bg-glass-strong: rgba(30, 20, 60, 0.75);
    --text: #EDE9FE;
    --text-secondary: #C4B5FD;
    --text-muted: #9CA3AF;
    --border: rgba(167, 139, 250, 0.15);
    --border-strong: rgba(167, 139, 250, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(167, 139, 250, 0.2);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(124, 58, 237, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 20%, rgba(236, 72, 153, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(6, 182, 212, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-color-scheme: dark) {
  body {
    background-image:
      radial-gradient(ellipse 80% 60% at 10% 0%, rgba(124, 58, 237, 0.15) 0%, transparent 60%),
      radial-gradient(ellipse 60% 50% at 90% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 60%),
      radial-gradient(ellipse 50% 40% at 50% 100%, rgba(6, 182, 212, 0.08) 0%, transparent 60%);
  }
}

::selection {
  background: var(--primary);
  color: #fff;
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), box-shadow var(--transition);
}

header:hover {
  box-shadow: var(--shadow);
}

nav[aria-label="主导航"] {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

nav[aria-label="主导航"] > a:first-child {
  font-size: 1.35rem;
  font-weight: 800;
  text-decoration: none;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
  white-space: nowrap;
  transition: transform var(--transition-fast), filter var(--transition-fast);
  filter: drop-shadow(0 2px 8px rgba(124, 58, 237, 0.25));
}

nav[aria-label="主导航"] > a:first-child:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 16px rgba(124, 58, 237, 0.4));
}

nav[aria-label="主导航"] ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav[aria-label="主导航"] ul li a {
  display: block;
  padding: 7px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  white-space: nowrap;
}

nav[aria-label="主导航"] ul li a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  transition: transform var(--transition);
}

nav[aria-label="主导航"] ul li a:hover {
  background: rgba(124, 58, 237, 0.08);
  color: var(--primary);
  transform: translateY(-1px);
}

nav[aria-label="主导航"] ul li a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* ===== MAIN ===== */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

article {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ===== HERO / H1 ===== */
h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  padding: 60px 24px 48px;
  margin: 0 -24px;
  background: linear-gradient(135deg, #7C3AED 0%, #EC4899 40%, #06B6D4 80%, #7C3AED 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 8s ease infinite;
  position: relative;
  letter-spacing: -0.02em;
}

h1::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 80% at 20% 30%, rgba(124, 58, 237, 0.10) 0%, transparent 70%),
    radial-gradient(ellipse 60% 70% at 80% 70%, rgba(236, 72, 153, 0.10) 0%, transparent 70%);
  border-radius: var(--radius-xl);
  z-index: -1;
  pointer-events: none;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ===== ARTICLE > P (intro) ===== */
article > p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.9;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
}

article > p::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  margin: 28px auto 0;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
}

/* ===== SECTIONS ===== */
section {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.7s ease forwards;
}

section:nth-child(1) { animation-delay: 0.05s; }
section:nth-child(2) { animation-delay: 0.10s; }
section:nth-child(3) { animation-delay: 0.15s; }
section:nth-child(4) { animation-delay: 0.20s; }
section:nth-child(5) { animation-delay: 0.25s; }
section:nth-child(6) { animation-delay: 0.30s; }
section:nth-child(7) { animation-delay: 0.35s; }
section:nth-child(8) { animation-delay: 0.40s; }
section:nth-child(9) { animation-delay: 0.45s; }
section:nth-child(10) { animation-delay: 0.50s; }
section:nth-child(11) { animation-delay: 0.55s; }
section:nth-child(12) { animation-delay: 0.60s; }
section:nth-child(13) { animation-delay: 0.65s; }
section:nth-child(14) { animation-delay: 0.70s; }
section:nth-child(15) { animation-delay: 0.75s; }
section:nth-child(16) { animation-delay: 0.80s; }

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

section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}

section:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

section:hover::before {
  opacity: 1;
}

section::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.06) 0%, transparent 70%);
  pointer-events: none;
  transition: transform var(--transition);
}

section:hover::after {
  transform: scale(1.5);
}

section h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
  position: relative;
  letter-spacing: -0.01em;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 70px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 24px 0 10px;
  padding-left: 14px;
  position: relative;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

section h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transition: height var(--transition), background var(--transition);
}

section h3:hover {
  color: var(--secondary);
  transform: translateX(4px);
}

section h3:hover::before {
  height: 24px;
  background: linear-gradient(180deg, var(--secondary), var(--accent));
}

section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 18px 0 8px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}

section p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 10px;
}

section p a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed var(--primary-light);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

section p a:hover {
  color: var(--secondary);
  border-bottom-color: var(--secondary);
}

/* ===== ARTICLE CARDS (inside #articles) ===== */
#articles {
  display: flex;
  flex-direction: column;
  gap: 0;
}

#articles > article {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 16px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

#articles > article:nth-child(1) { animation-delay: 0.1s; }
#articles > article:nth-child(2) { animation-delay: 0.15s; }
#articles > article:nth-child(3) { animation-delay: 0.2s; }
#articles > article:nth-child(4) { animation-delay: 0.25s; }
#articles > article:nth-child(5) { animation-delay: 0.3s; }
#articles > article:nth-child(6) { animation-delay: 0.35s; }
#articles > article:nth-child(7) { animation-delay: 0.4s; }
#articles > article:nth-child(8) { animation-delay: 0.45s; }
#articles > article:nth-child(9) { animation-delay: 0.5s; }
#articles > article:nth-child(10) { animation-delay: 0.55s; }

#articles > article::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity var(--transition);
}

#articles > article:hover {
  transform: translateX(6px) translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
  background: var(--bg-glass-strong);
}

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

#articles > article h3 {
  margin-top: 0;
  font-size: 1.05rem;
}

#articles > article p:first-of-type {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

#articles > article p:last-of-type a {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(124, 58, 237, 0.08);
  border: none;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

#articles > article p:last-of-type a:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  transform: translateX(4px);
}

/* ===== FAQ ===== */
#faq h3 {
  cursor: default;
  padding: 14px 18px 14px 22px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  margin: 12px 0 0;
  border-left: none;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
}

#faq h3::before {
  content: 'Q';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  line-height: 1;
}

#faq h3:hover {
  background: rgba(124, 58, 237, 0.06);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

#faq p {
  padding: 8px 18px 14px 22px;
  margin: 0;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}

#faq p:hover {
  background: rgba(124, 58, 237, 0.03);
}

#faq p:last-child {
  border-bottom: none;
}

/* ===== HOWTO ===== */
#howto h4 {
  font-size: 0.95rem;
  color: var(--text);
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(236, 72, 153, 0.06));
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  margin: 20px 0 8px;
  transition: background var(--transition), transform var(--transition);
}

#howto h4:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(236, 72, 153, 0.12));
  transform: translateX(4px);
}

/* ===== CONTACT ===== */
#contact p {
  padding: 6px 0;
  font-size: 0.95rem;
  border-bottom: 1px dashed var(--border);
  transition: padding-left var(--transition-fast), color var(--transition-fast);
}

#contact p:hover {
  padding-left: 8px;
  color: var(--primary);
}

#contact p:last-child {
  border-bottom: none;
}

/* ===== SITEMAP & LINKS ===== */
#sitemap ul,
#links ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sitemap ul li a,
#links ul li a {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 50px;
  transition: all var(--transition-fast);
}

#sitemap ul li a:hover,
#links ul li a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}

/* ===== COPYRIGHT / PRIVACY / DISCLAIMER / AUTHOR ===== */
#copyright p,
#privacy p,
#disclaimer p,
#author p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.85;
}

/* ===== FOOTER ===== */
footer {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
  padding: 36px 24px;
  text-align: center;
  margin-top: 20px;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), var(--accent), transparent);
}

footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.7;
}

footer p:first-child {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

footer p a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

footer p a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width var(--transition);
}

footer p a:hover {
  color: var(--secondary);
}

footer p a:hover::after {
  width: 100%;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-light), var(--secondary-light));
  border-radius: 10px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}

/* ===== FOCUS ===== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  main {
    padding: 0 20px 50px;
  }

  section {
    padding: 30px 26px;
  }

  nav[aria-label="主导航"] ul li a {
    padding: 6px 10px;
    font-size: 0.82rem;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: auto;
  }

  header {
    position: relative;
    height: auto;
  }

  nav[aria-label="主导航"] {
    flex-direction: column;
    padding: 14px 16px;
    gap: 10px;
  }

  nav[aria-label="主导航"] > a:first-child {
    font-size: 1.2rem;
  }

  nav[aria-label="主导航"] ul {
    gap: 2px;
    justify-content: center;
    width: 100%;
  }

  nav[aria-label="主导航"] ul li a {
    padding: 5px 9px;
    font-size: 0.78rem;
  }

  main {
    padding: 0 14px 40px;
  }

  article {
    gap: 22px;
  }

  h1 {
    padding: 40px 16px 32px;
    font-size: clamp(1.35rem, 5.5vw, 1.9rem);
    margin: 0 -14px;
  }

  article > p {
    font-size: 0.95rem;
    padding: 0 8px;
  }

  section {
    padding: 24px 18px;
    border-radius: var(--radius);
  }

  section h2 {
    font-size: 1.2rem;
    margin-bottom: 18px;
    padding-bottom: 12px;
  }

  section h3 {
    font-size: 1rem;
    margin: 20px 0 8px;
  }

  section p {
    font-size: 0.9rem;
  }

  #articles > article {
    padding: 18px 16px;
  }

  #articles > article:hover {
    transform: translateX(3px) translateY(-1px);
  }

  #sitemap ul,
  #links ul {
    gap: 8px;
  }

  #sitemap ul li a,
  #links ul li a {
    padding: 6px 14px;
    font-size: 0.82rem;
  }

  footer {
    padding: 28px 16px;
  }
}

@media (max-width: 480px) {
  nav[aria-label="主导航"] ul li a {
    padding: 4px 7px;
    font-size: 0.72rem;
  }

  section {
    padding: 20px 14px;
  }

  section h2 {
    font-size: 1.1rem;
  }

  section h3 {
    font-size: 0.95rem;
    padding-left: 12px;
  }

  section h3::before {
    width: 3px;
    height: 15px;
  }

  #faq h3 {
    padding: 12px 14px 12px 20px;
    font-size: 0.92rem;
  }

  #faq p {
    padding: 6px 14px 12px 20px;
    font-size: 0.86rem;
  }

  #howto h4 {
    font-size: 0.88rem;
    padding: 8px 12px;
  }
}

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

  section {
    opacity: 1;
    transform: none;
  }

  #articles > article {
    opacity: 1;
    transform: none;
  }

  h1 {
    animation: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* ===== PRINT ===== */
@media print {
  header,
  footer,
  #sitemap,
  #links {
    display: none;
  }

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

  section {
    box-shadow: none;
    border: 1px solid #ccc;
    backdrop-filter: none;
    background: #fff;
    opacity: 1;
    transform: none;
    animation: none;
  }

  h1 {
    -webkit-text-fill-color: #000;
    color: #000;
    background: none;
    animation: none;
  }
}