:root {
  --bg: #0f0f1a;
  --bg-alt: #16162a;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e8e8f0;
  --text-soft: #b4b4c8;
  --text-muted: #8a8aa0;
  --accent: #e94560;
  --accent-2: #7b5cff;
  --accent-3: #00d2c6;
  --gradient: linear-gradient(135deg, #e94560 0%, #7b5cff 55%, #00d2c6 100%);
  --gradient-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.16), rgba(123, 92, 255, 0.16));
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.3);
  --radius: 18px;
  --radius-sm: 12px;
  --blur: saturate(160%) blur(16px);
  --maxw: 1160px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5fb;
    --bg-alt: #ffffff;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: rgba(255, 255, 255, 0.9);
    --border: rgba(20, 20, 45, 0.1);
    --text: #1a1a2e;
    --text-soft: #45455f;
    --text-muted: #6b6b85;
    --shadow: 0 18px 45px rgba(26, 26, 46, 0.12);
    --shadow-sm: 0 8px 22px rgba(26, 26, 46, 0.09);
    --gradient-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.1), rgba(123, 92, 255, 0.1));
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 12% -8%, rgba(233, 69, 96, 0.18), transparent 60%),
    radial-gradient(1000px 520px at 92% 4%, rgba(123, 92, 255, 0.2), transparent 62%),
    radial-gradient(900px 600px at 50% 110%, rgba(0, 210, 198, 0.12), transparent 65%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

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

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

a:hover,
a:focus-visible {
  color: var(--accent-2);
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent-3);
  outline-offset: 3px;
  border-radius: 6px;
}

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

h1 {
  font-size: clamp(1.7rem, 4.2vw, 2.9rem);
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: clamp(1.35rem, 2.8vw, 1.9rem);
  position: relative;
  padding-left: 16px;
}

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

h3 {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--text);
}

h4 {
  font-size: 1.05rem;
}

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

ul, ol {
  padding-left: 1.3em;
  color: var(--text-soft);
}

li {
  margin-bottom: 0.45em;
}

blockquote {
  margin: 0 0 1em;
  padding: 16px 20px;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--gradient-soft);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

blockquote p {
  margin: 0;
  color: var(--text);
  font-style: italic;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

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

nav > a {
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: 0.04em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

nav > a:hover {
  filter: brightness(1.15);
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  flex: 1;
  justify-content: flex-end;
}

nav ul li {
  margin: 0;
}

nav ul li a {
  display: inline-block;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-soft);
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

nav ul li a:hover,
nav ul li a:focus-visible {
  color: var(--text);
  background: var(--gradient-soft);
  transform: translateY(-2px);
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 60px;
}

main > section {
  position: relative;
  margin-bottom: 28px;
  padding: clamp(20px, 3.4vw, 38px);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: rise 0.7s cubic-bezier(0.22, 0.68, 0.36, 1) both;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

main > section::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), transparent 42%);
  opacity: 0.7;
}

main > section:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(233, 69, 96, 0.35);
}

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

main > section:nth-of-type(1) { animation-delay: 0.02s; }
main > section:nth-of-type(2) { animation-delay: 0.06s; }
main > section:nth-of-type(3) { animation-delay: 0.1s; }
main > section:nth-of-type(4) { animation-delay: 0.14s; }
main > section:nth-of-type(5) { animation-delay: 0.18s; }
main > section:nth-of-type(6) { animation-delay: 0.22s; }
main > section:nth-of-type(7) { animation-delay: 0.26s; }
main > section:nth-of-type(8) { animation-delay: 0.3s; }
main > section:nth-of-type(9) { animation-delay: 0.34s; }
main > section:nth-of-type(10) { animation-delay: 0.38s; }
main > section:nth-of-type(n+11) { animation-delay: 0.42s; }

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

#top {
  scroll-margin-top: 90px;
}

section > h1:first-child {
  margin-bottom: 0.5em;
}

section[aria-labelledby="hero-title"] {
  background:
    linear-gradient(135deg, rgba(233, 69, 96, 0.22), rgba(123, 92, 255, 0.24) 50%, rgba(0, 210, 198, 0.18)),
    var(--surface);
  border: 1px solid rgba(233, 69, 96, 0.28);
}

section[aria-labelledby="hero-title"] p {
  font-size: 1.02rem;
  color: var(--text-soft);
}

figure {
  margin: 26px 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: #1a1a2e;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

figure:hover {
  transform: scale(1.012);
  box-shadow: var(--shadow);
}

figure svg {
  display: block;
  width: 100%;
}

figcaption {
  padding: 12px 18px;
  font-size: 0.86rem;
  color: var(--text-muted);
  background: var(--surface-strong);
  border-top: 1px solid var(--border);
  text-align: center;
}

article {
  position: relative;
  padding: 20px 22px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

article:hover {
  transform: translateY(-3px);
  border-color: rgba(123, 92, 255, 0.4);
  box-shadow: var(--shadow-sm);
}

article h3 {
  margin-bottom: 0.35em;
}

article h4 {
  margin-bottom: 0.5em;
  color: var(--accent);
}

article > p:first-of-type {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5em;
}

article > a {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient);
  background-size: 160% 160%;
  transition: background-position 0.4s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

article > a:hover,
article > a:focus-visible {
  color: #fff;
  background-position: 100% 50%;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(233, 69, 96, 0.35);
}

#articles article[id] {
  background: linear-gradient(160deg, rgba(123, 92, 255, 0.1), transparent 60%), var(--surface-strong);
  border-color: rgba(123, 92, 255, 0.28);
}

details {
  margin-bottom: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

details:hover {
  border-color: rgba(0, 210, 198, 0.38);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

details[open] {
  border-color: rgba(233, 69, 96, 0.4);
  background: linear-gradient(150deg, rgba(233, 69, 96, 0.1), transparent 65%), var(--surface-strong);
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  position: relative;
  padding-right: 30px;
  transition: color 0.25s ease;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  line-height: 22px;
  text-align: center;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient);
  transition: transform 0.3s ease;
}

details[open] summary::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
}

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

details p {
  margin: 10px 0 0;
  font-size: 0.95rem;
  color: var(--text-soft);
}

#howto ol {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 10px 14px 10px 48px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient);
}

#howto ol li:hover {
  transform: translateX(4px);
  border-color: rgba(233, 69, 96, 0.35);
}

#contact ul,
#sitemap ul,
#links ul {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

#contact ul li {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  font-size: 0.94rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

#contact ul li:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 210, 198, 0.4);
}

#sitemap ul li,
#links ul li {
  margin: 0;
}

#sitemap ul a,
#links ul a {
  display: block;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text-soft);
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

#sitemap ul a:hover,
#links ul a:hover,
#sitemap ul a:focus-visible,
#links ul a:focus-visible {
  color: var(--text);
  border-color: rgba(233, 69, 96, 0.4);
  background: var(--gradient-soft);
  transform: translateY(-2px);
}

footer {
  position: relative;
  margin-top: 20px;
  padding: 40px 20px 30px;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-top: 1px solid var(--border);
}

footer section {
  max-width: var(--maxw);
  margin: 0 auto 20px;
  padding: 18px 22px;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

footer section:hover {
  border-color: rgba(123, 92, 255, 0.35);
  transform: translateY(-2px);
}

footer h2 {
  font-size: 1.05rem;
  padding-left: 14px;
  margin-bottom: 0.5em;
}

footer h2::before {
  width: 4px;
}

footer p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

footer > p {
  max-width: var(--maxw);
  margin: 0 auto;
  text-align: center;
}

footer > p a {
  display: inline-block;
  padding: 9px 26px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient);
  background-size: 160% 160%;
  transition: background-position 0.4s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

footer > p a:hover,
footer > p a:focus-visible {
  color: #fff;
  background-position: 100% 50%;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(123, 92, 255, 0.35);
}

::selection {
  background: rgba(233, 69, 96, 0.4);
  color: #fff;
}

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

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

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

@media (max-width: 900px) {
  nav {
    padding: 10px 16px;
    gap: 10px;
  }

  nav ul {
    justify-content: flex-start;
    width: 100%;
  }

  nav ul li a {
    padding: 6px 11px;
    font-size: 0.85rem;
  }
}

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

  main {
    padding: 18px 14px 44px;
  }

  main > section {
    padding: 20px 16px;
    border-radius: 14px;
    margin-bottom: 20px;
  }

  main > section:hover {
    transform: none;
  }

  h1 {
    font-size: 1.55rem;
  }

  h2 {
    padding-left: 13px;
  }

  nav > a {
    font-size: 1rem;
  }

  nav ul li a {
    padding: 5px 9px;
    font-size: 0.8rem;
  }

  article {
    padding: 16px;
  }

  details {
    padding: 12px 14px;
  }

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

  footer {
    padding: 28px 14px 24px;
  }

  footer section {
    padding: 16px;
  }
}

@media (hover: none) {
  main > section:hover,
  article:hover,
  figure:hover,
  details:hover {
    transform: none;
  }
}