:root {
  --bg: #0b0b14;
  --bg-2: #12121f;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f2f3f8;
  --text-2: #b9bccc;
  --text-3: #8a8ea3;
  --primary: #7c5cff;
  --primary-2: #22d3ee;
  --accent: #ff4d8d;
  --gradient: linear-gradient(135deg, #7c5cff 0%, #22d3ee 60%, #ff4d8d 120%);
  --gradient-soft: linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(34, 211, 238, 0.16));
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.3);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-lg: 28px;
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6fb;
    --bg-2: #ffffff;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: rgba(255, 255, 255, 0.9);
    --border: rgba(20, 22, 40, 0.1);
    --text: #14162a;
    --text-2: #444a63;
    --text-3: #6b7188;
    --shadow: 0 18px 50px rgba(30, 34, 70, 0.14);
    --shadow-sm: 0 8px 24px rgba(30, 34, 70, 0.1);
    --gradient-soft: linear-gradient(135deg, rgba(124, 92, 255, 0.12), rgba(34, 211, 238, 0.1));
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 92, 255, 0.25), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(34, 211, 238, 0.18), transparent 55%),
    radial-gradient(800px 600px at 50% 110%, rgba(255, 77, 141, 0.14), transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

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

a {
  color: var(--primary-2);
  text-decoration: none;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}

a:hover {
  color: var(--accent);
}

h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(1.8rem, 4.4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

h2 {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  position: relative;
  padding-left: 18px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 5px;
  border-radius: 6px;
  background: var(--gradient);
  box-shadow: 0 0 18px rgba(124, 92, 255, 0.6);
}

h3 {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--text);
}

p {
  color: var(--text-2);
  margin: 0 0 1em;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ============ Header / Nav ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 10px 20px;
  background: rgba(11, 11, 20, 0.55);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}

@media (prefers-color-scheme: light) {
  header {
    background: rgba(255, 255, 255, 0.6);
  }
}

header nav {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

header nav > a:first-child {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 6px 16px;
  border-radius: 999px;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 6px 22px rgba(124, 92, 255, 0.45);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

header nav > a:first-child:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.65);
  color: #fff;
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

header nav ul a {
  display: inline-block;
  padding: 7px 13px;
  font-size: 0.9rem;
  color: var(--text-2);
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.28s var(--ease);
}

header nav ul a:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ============ Main / Sections ============ */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 20px 60px;
}

section {
  position: relative;
  margin: 28px 0;
  padding: 34px clamp(20px, 4vw, 44px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--shadow);
  animation: fadeUp 0.8s var(--ease) both;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease),
    border-color 0.4s var(--ease);
}

section:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(124, 92, 255, 0.15);
}

section::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: var(--gradient-soft);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
}

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

/* Hero */
main > section:first-of-type {
  padding: clamp(40px, 7vw, 80px) clamp(22px, 5vw, 60px);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 0.28), rgba(34, 211, 238, 0.18) 55%, rgba(255, 77, 141, 0.2)),
    var(--surface);
  background-size: 200% 200%;
  animation: fadeUp 0.8s var(--ease) both, gradientShift 12s ease infinite;
  overflow: hidden;
}

main > section:first-of-type::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  top: -160px;
  right: -120px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.45), transparent 65%);
  filter: blur(30px);
  pointer-events: none;
}

main > section:first-of-type p {
  max-width: 820px;
  margin: 0 auto;
  color: var(--text-2);
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
}

/* ============ Articles & Cards ============ */
article {
  position: relative;
  margin: 16px 0;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
    border-color 0.35s var(--ease), background 0.35s var(--ease);
}

article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 4px;
  background: var(--gradient);
  opacity: 0;
  transform: scaleY(0.4);
  transform-origin: center;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

article:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(34, 211, 238, 0.12);
}

article:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

article h3 {
  margin-bottom: 0.4em;
  transition: color 0.3s ease;
}

article:hover h3 {
  color: var(--primary-2);
}

article a {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: var(--primary-2);
  transition: all 0.28s var(--ease);
}

article a:hover {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4);
}

/* ============ Lists (footer info) ============ */
section ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 18px;
}

section ul li a {
  display: inline-block;
  padding: 7px 16px;
  font-size: 0.9rem;
  color: var(--text-2);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 0.28s var(--ease);
}

section ul li a:hover {
  color: #fff;
  background: var(--gradient);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.45);
}

/* ============ FAQ ============ */
#faq h3 {
  position: relative;
  margin: 22px 0 0.5em;
  padding: 14px 18px 14px 46px;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  font-size: 1rem;
  cursor: default;
  transition: all 0.3s var(--ease);
}

#faq h3::before {
  content: "?";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  border-radius: 50%;
  background: var(--gradient);
}

#faq h3:hover {
  border-color: rgba(124, 92, 255, 0.5);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

#faq p {
  padding-left: 18px;
}

/* ============ HowTo ============ */
#howto h3 {
  display: inline-block;
  margin-top: 18px;
  padding: 4px 14px;
  font-size: 0.95rem;
  border-radius: 999px;
  color: var(--primary-2);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
}

#howto p {
  padding-left: 4px;
}

/* ============ Contact ============ */
#contact p {
  word-break: break-word;
}

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

/* ============ Footer ============ */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 30px 20px 50px;
  text-align: center;
  border-top: 1px solid var(--border);
}

footer p {
  color: var(--text-3);
  font-size: 0.88rem;
  margin-bottom: 12px;
}

footer nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

footer nav a {
  padding: 7px 18px;
  font-size: 0.88rem;
  color: var(--text-2);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.28s var(--ease);
}

footer nav a:hover {
  color: #fff;
  background: var(--gradient);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.45);
}

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

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

@keyframes floatGlow {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.75;
  }
  50% {
    transform: translate(-20px, 18px) scale(1.08);
    opacity: 1;
  }
}

main > section:first-of-type::before {
  animation: floatGlow 9s ease-in-out infinite;
}

/* Staggered entrance for children */
section > h2,
section > p,
section > h3,
section > article,
section > ul {
  animation: fadeUp 0.9s var(--ease) both;
}

section > *:nth-child(2) { animation-delay: 0.06s; }
section > *:nth-child(3) { animation-delay: 0.12s; }
section > *:nth-child(4) { animation-delay: 0.18s; }
section > *:nth-child(5) { animation-delay: 0.24s; }
section > *:nth-child(6) { animation-delay: 0.3s; }

/* ============ Scroll reveal ============ */
@media (prefers-reduced-motion: no-preference) {
  section {
    animation-timeline: view();
    animation-range: entry 0% cover 28%;
  }
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  header nav {
    gap: 10px;
  }
  header nav ul {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  header nav ul::-webkit-scrollbar {
    display: none;
  }
  header nav ul a {
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }
  header {
    padding: 8px 14px;
  }
  header nav > a:first-child {
    font-size: 1rem;
    padding: 5px 14px;
  }
  main {
    padding: 16px 12px 40px;
  }
  section {
    margin: 18px 0;
    padding: 24px 18px;
    border-radius: var(--radius);
  }
  main > section:first-of-type {
    padding: 36px 18px;
  }
  h2 {
    padding-left: 14px;
  }
  h2::before {
    width: 4px;
  }
  article {
    padding: 18px 16px;
  }
  #faq h3 {
    padding-left: 42px;
  }
  footer {
    padding: 24px 14px 40px;
  }
}

@media (max-width: 380px) {
  header nav ul a {
    padding: 6px 10px;
    font-size: 0.84rem;
  }
  section {
    padding: 20px 14px;
  }
}

/* ============ Accessibility ============ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible {
  outline: 2px solid var(--primary-2);
  outline-offset: 3px;
  border-radius: 6px;
}