:root {
  --bg-primary: #0b1020;
  --bg-secondary: #111633;
  --bg-card: rgba(18, 24, 48, 0.72);
  --bg-glass: rgba(20, 28, 58, 0.55);
  --bg-glass-hover: rgba(28, 38, 78, 0.7);
  --text-primary: #e8ecff;
  --text-secondary: #9aa6d4;
  --text-muted: #6b78a8;
  --accent-1: #ff2d6f;
  --accent-2: #7b5cff;
  --accent-3: #00d4ff;
  --accent-4: #ff8a3d;
  --gradient-hero: linear-gradient(135deg, #1a0b3d 0%, #2d1b69 25%, #0f2a5e 50%, #0b1020 100%);
  --gradient-accent: linear-gradient(135deg, #ff2d6f 0%, #7b5cff 50%, #00d4ff 100%);
  --gradient-card: linear-gradient(145deg, rgba(30, 40, 80, 0.6), rgba(12, 18, 40, 0.8));
  --gradient-btn: linear-gradient(135deg, #ff2d6f, #7b5cff);
  --border-glass: rgba(120, 140, 220, 0.18);
  --border-glass-hover: rgba(140, 160, 255, 0.35);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 30px rgba(123, 92, 255, 0.25);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-main: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f4f6fc;
    --bg-secondary: #eaeef8;
    --bg-card: rgba(255, 255, 255, 0.78);
    --bg-glass: rgba(255, 255, 255, 0.6);
    --bg-glass-hover: rgba(255, 255, 255, 0.82);
    --text-primary: #141a33;
    --text-secondary: #4a5578;
    --text-muted: #7a85a8;
    --gradient-hero: linear-gradient(135deg, #c9d6ff 0%, #e2d1ff 30%, #d1e8ff 60%, #f4f6fc 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.85), rgba(240, 244, 255, 0.7));
    --border-glass: rgba(100, 120, 200, 0.18);
    --border-glass-hover: rgba(100, 120, 220, 0.4);
    --shadow-card: 0 8px 32px rgba(80, 100, 180, 0.12);
    --shadow-glow: 0 0 30px rgba(123, 92, 255, 0.15);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.85;
  font-size: 16px;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(123, 92, 255, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 20%, rgba(255, 45, 111, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 50% 100%, rgba(0, 212, 255, 0.06) 0%, transparent 60%);
  background-attachment: fixed;
}

::selection {
  background: rgba(123, 92, 255, 0.45);
  color: #fff;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-2), var(--accent-3));
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent-1), var(--accent-2));
}

a {
  color: var(--accent-3);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover,
a:focus-visible {
  color: var(--accent-1);
  outline: none;
}

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

/* ========== HEADER ========== */
header#top {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-glass);
  transition: background var(--transition-smooth), box-shadow var(--transition-smooth);
  animation: slideDown 0.6s ease-out both;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

header#top::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-accent);
  opacity: 0.4;
}

header#top nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

header#top nav ul {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 4px;
  list-style: none;
  padding: 12px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

header#top nav ul::-webkit-scrollbar {
  display: none;
}

header#top nav ul li {
  flex-shrink: 0;
}

header#top nav ul li a {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  position: relative;
  transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

header#top nav ul li a::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  background: var(--gradient-btn);
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: -1;
}

header#top nav ul li a:hover,
header#top nav ul li a:focus-visible {
  color: #fff;
  transform: translateY(-2px);
}

header#top nav ul li a:hover::before,
header#top nav ul li a:focus-visible::before {
  opacity: 0.85;
}

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

/* ========== HERO / H1 ========== */
main > h1 {
  font-size: clamp(1.75rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin: 48px 0 24px;
  padding: 48px 40px;
  border-radius: var(--radius-xl);
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: heroFadeIn 0.9s ease-out both;
  background-size: 200% 200%;
  animation: heroFadeIn 0.9s ease-out both, gradientShift 12s ease infinite;
}

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

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

main > h1::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 45, 111, 0.15), transparent, rgba(0, 212, 255, 0.15), transparent);
  animation: rotateGlow 20s linear infinite;
  pointer-events: none;
}

@keyframes rotateGlow {
  to { transform: rotate(360deg); }
}

main > h1::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

main > h1 + p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 900px;
  margin: 0 auto 56px;
  padding: 0 8px;
  text-align: center;
  animation: fadeUp 0.8s ease-out 0.2s both;
}

main > h1 + p strong {
  color: var(--accent-1);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* ========== SECTIONS ========== */
section {
  margin-bottom: 56px;
  padding: 40px 36px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
  animation: sectionReveal 0.7s ease-out both;
  animation-timeline: view();
  animation-range: entry 0% entry 40%;
}

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

@supports not (animation-timeline: view()) {
  section {
    animation: sectionReveal 0.7s ease-out both;
  }
}

section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

section:hover {
  transform: translateY(-4px);
  border-color: var(--border-glass-hover);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

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

section h2 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 24px;
  padding-bottom: 16px;
  position: relative;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

section h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 64px;
  height: 3px;
  border-radius: 3px;
  background: var(--gradient-btn);
  transition: width var(--transition-smooth);
}

section:hover h2::after {
  width: 120px;
}

section h3 {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--text-primary);
  position: relative;
  padding-left: 18px;
  transition: color var(--transition-fast);
}

section h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  border-radius: 4px;
  background: var(--gradient-btn);
  transition: height var(--transition-smooth);
}

section h3:hover {
  color: var(--accent-3);
}

section h3:hover::before {
  height: 100%;
}

section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0 10px;
  color: var(--accent-3);
  letter-spacing: 0.01em;
}

section p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-size: 0.98rem;
}

section p strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ========== ARTICLES ========== */
section#articles article {
  background: var(--gradient-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-bounce), border-color var(--transition-fast), box-shadow var(--transition-smooth);
}

section#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-btn);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform var(--transition-smooth);
}

section#articles article:hover {
  transform: translateX(8px) scale(1.01);
  border-color: var(--border-glass-hover);
  box-shadow: 0 8px 40px rgba(123, 92, 255, 0.2);
}

section#articles article:hover::before {
  transform: scaleY(1);
}

section#articles article h3 {
  margin-top: 0;
  font-size: 1.15rem;
}

section#articles article p {
  font-size: 0.92rem;
  margin-bottom: 8px;
}

section#articles article p:first-of-type {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

section#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent-3);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  transition: all var(--transition-fast);
}

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

section#articles article a:hover {
  background: var(--gradient-btn);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(123, 92, 255, 0.4);
}

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

/* ========== FAQ ========== */
section#faq h3 {
  font-size: 1.05rem;
  margin: 24px 0 8px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  padding-left: 44px;
  position: relative;
  transition: all var(--transition-smooth);
  cursor: default;
}

section#faq h3::before {
  content: "Q";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gradient-btn);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

section#faq h3:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass-hover);
  transform: translateX(6px);
  color: var(--accent-3);
}

section#faq h3 + p {
  padding: 0 20px 0 44px;
  margin-top: -4px;
  margin-bottom: 16px;
  border-left: 2px solid rgba(123, 92, 255, 0.25);
  margin-left: 22px;
}

/* ========== HOWTO ========== */
section#howto h3 {
  color: var(--accent-4);
}

section#howto h3::before {
  background: linear-gradient(135deg, var(--accent-4), var(--accent-1));
}

section#howto p {
  padding-left: 18px;
}

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

section#contact p:nth-of-type(1),
section#contact p:nth-of-type(2),
section#contact p:nth-of-type(3),
section#contact p:nth-of-type(4),
section#contact p:nth-of-type(5) {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  margin-bottom: 8px;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 10px;
}

section#contact p:nth-of-type(1)::before { content: "🏢"; }
section#contact p:nth-of-type(2)::before { content: "📍"; }
section#contact p:nth-of-type(3)::before { content: "📞"; }
section#contact p:nth-of-type(4)::before { content: "✉️"; }
section#contact p:nth-of-type(5)::before { content: "🕐"; }

section#contact p:nth-of-type(1):hover,
section#contact p:nth-of-type(2):hover,
section#contact p:nth-of-type(3):hover,
section#contact p:nth-of-type(4):hover,
section#contact p:nth-of-type(5):hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass-hover);
  transform: translateX(6px);
}

/* ========== SITEMAP & LINKS ========== */
section#sitemap ul,
section#links ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

section#sitemap ul li a,
section#links ul li a {
  display: block;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

section#sitemap ul li a::before,
section#links ul li a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-btn);
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: -1;
}

section#sitemap ul li a:hover,
section#links ul li a:hover {
  color: #fff;
  transform: translateY(-3px);
  border-color: transparent;
  box-shadow: 0 6px 24px rgba(123, 92, 255, 0.35);
}

section#sitemap ul li a:hover::before,
section#links ul li a:hover::before {
  opacity: 1;
}

/* ========== LEGAL ========== */
section#legal h3 {
  color: var(--text-muted);
  font-size: 0.95rem;
}

section#legal h3::before {
  background: linear-gradient(135deg, var(--text-muted), var(--accent-2));
}

section#legal p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

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

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 6px;
  transition: color var(--transition-fast);
}

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

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

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  body {
    font-size: 15px;
    line-height: 1.8;
  }

  header#top nav {
    padding: 0 16px;
  }

  header#top nav ul {
    padding: 10px 0;
    gap: 2px;
  }

  header#top nav ul li a {
    padding: 7px 12px;
    font-size: 13px;
  }

  main {
    padding: 0 16px 60px;
  }

  main > h1 {
    font-size: 1.5rem;
    padding: 32px 24px;
    margin: 28px 0 18px;
    border-radius: var(--radius-lg);
  }

  main > h1 + p {
    font-size: 0.95rem;
    margin-bottom: 40px;
  }

  section {
    padding: 28px 20px;
    margin-bottom: 36px;
    border-radius: var(--radius-md);
  }

  section h2 {
    font-size: 1.25rem;
  }

  section h3 {
    font-size: 1.05rem;
    padding-left: 14px;
  }

  section#articles article {
    padding: 20px 18px;
  }

  section#articles article:hover {
    transform: translateX(4px) scale(1.005);
  }

  section#faq h3 {
    font-size: 0.95rem;
    padding: 14px 16px 14px 40px;
  }

  section#faq h3 + p {
    padding-left: 16px;
    margin-left: 20px;
  }

  section#sitemap ul,
  section#links ul {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  section#sitemap ul li a,
  section#links ul li a {
    padding: 9px 12px;
    font-size: 0.84rem;
  }

  footer {
    padding: 36px 16px;
  }
}

@media (max-width: 480px) {
  main > h1 {
    font-size: 1.3rem;
    padding: 26px 18px;
    border-radius: var(--radius-md);
  }

  section {
    padding: 22px 16px;
    border-radius: var(--radius-sm);
  }

  section h2 {
    font-size: 1.15rem;
    padding-bottom: 12px;
  }

  section h2::after {
    width: 48px;
    height: 2px;
  }

  section#sitemap ul,
  section#links ul {
    grid-template-columns: 1fr;
  }
}

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

  main > h1::before {
    animation: none;
  }

  section {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ========== PRINT ========== */
@media print {
  header#top {
    position: static;
    background: none;
    backdrop-filter: none;
  }

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

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

  main > h1 {
    background: none;
    color: #000;
    box-shadow: none;
  }

  main > h1::before,
  main > h1::after {
    display: none;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}