:root {
  --bg: #0f1020;
  --bg-soft: #15172b;
  --bg-card: rgba(255, 255, 255, 0.06);
  --bg-card-hover: rgba(255, 255, 255, 0.1);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.14);
  --text: #eef0ff;
  --text-soft: #b9bcd8;
  --text-dim: #8a8db0;
  --accent: #e94560;
  --accent-2: #ff7a5c;
  --accent-3: #6c5ce7;
  --accent-4: #00d2ff;
  --gradient-banner: linear-gradient(135deg, #1a1a2e 0%, #2b1d4e 40%, #4a1e52 70%, #7a1f3d 100%);
  --gradient-accent: linear-gradient(135deg, #e94560 0%, #ff7a5c 100%);
  --gradient-cool: linear-gradient(135deg, #6c5ce7 0%, #00d2ff 100%);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 20px 60px rgba(233, 69, 96, 0.25);
  --max-width: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: all 0.35s var(--ease);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5fb;
    --bg-soft: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --glass: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(26, 26, 46, 0.1);
    --text: #1a1a2e;
    --text-soft: #454a63;
    --text-dim: #6a6f8c;
    --gradient-banner: linear-gradient(135deg, #e8ecff 0%, #ffe3ea 45%, #f0e3ff 75%, #e3f6ff 100%);
    --shadow: 0 10px 40px rgba(26, 26, 46, 0.1);
    --shadow-hover: 0 20px 60px rgba(233, 69, 96, 0.2);
  }
}

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

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

body {
  margin: 0;
  padding: 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-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(233, 69, 96, 0.16), transparent 42%),
    radial-gradient(circle at 88% 18%, rgba(108, 92, 231, 0.18), transparent 45%),
    radial-gradient(circle at 50% 92%, rgba(0, 210, 255, 0.12), transparent 50%);
  background-attachment: fixed;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

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

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

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

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: linear-gradient(120deg, var(--text) 0%, var(--accent) 60%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text);
}

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

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: 6px;
  background: var(--gradient-accent);
  box-shadow: 0 0 18px rgba(233, 69, 96, 0.5);
}

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

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

/* ============ Header / Navigation ============ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition);
}

header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

header nav > a {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
  white-space: nowrap;
  position: relative;
}

header nav > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

header nav > a:hover::after {
  transform: scaleX(1);
}

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

header nav ul li a {
  display: inline-block;
  padding: 0.42rem 0.85rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  border-radius: 999px;
  transition: var(--transition);
  position: relative;
}

header nav ul li a:hover,
header nav ul li a:focus-visible {
  color: var(--text);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(233, 69, 96, 0.18);
}

/* ============ Main layout ============ */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

main > section {
  margin: 2.5rem 0;
  padding: 2rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(28px);
  animation: fadeUp 0.8s var(--ease) forwards;
}

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

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

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

/* ============ Hero ============ */
#hero {
  margin-top: 1.75rem;
  padding: 3rem 2rem;
  background: var(--gradient-banner);
  background-size: 200% 200%;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.8s var(--ease) forwards, bannerShift 14s ease-in-out infinite;
  box-shadow: var(--shadow);
}

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

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(233, 69, 96, 0.35), transparent 45%),
    radial-gradient(circle at 82% 80%, rgba(0, 210, 255, 0.28), transparent 50%);
  pointer-events: none;
}

#hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -120px;
  top: -120px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.03), 0 0 0 90px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

#hero h1,
#hero p,
#hero img {
  position: relative;
  z-index: 1;
}

#hero h1 {
  -webkit-text-fill-color: unset;
  background: none;
  color: var(--text);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

#hero p {
  max-width: 820px;
  color: var(--text-soft);
  font-size: 1.02rem;
}

#hero img {
  width: 100%;
  margin-top: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

#hero img:hover {
  transform: scale(1.012) translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* ============ Articles ============ */
#articles {
  display: block;
}

#articles > h2 {
  margin-bottom: 1.5rem;
}

#articles article {
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

#articles article:hover {
  transform: translateX(6px);
  background: var(--bg-card-hover);
  border-color: rgba(108, 92, 231, 0.45);
  box-shadow: var(--shadow-hover);
}

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

#articles article h3 {
  margin-bottom: 0.4rem;
}

#articles article p {
  font-size: 0.94rem;
  margin-bottom: 0.6rem;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: var(--gradient-accent);
  color: #fff;
  -webkit-text-fill-color: #fff;
  box-shadow: 0 6px 18px rgba(233, 69, 96, 0.3);
  transition: var(--transition);
}

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

#articles article a:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(233, 69, 96, 0.45);
}

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

/* ============ FAQ ============ */
#faq h3 {
  margin-top: 1.6rem;
  padding: 0.85rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 1.02rem;
  transition: var(--transition);
  cursor: default;
}

#faq h3:hover {
  background: var(--bg-card-hover);
  border-left-color: var(--accent-2);
  transform: translateX(4px);
}

#faq h3 + p {
  padding: 0.5rem 1.1rem 0.2rem;
  font-size: 0.95rem;
}

/* ============ HowTo ============ */
#howto h3 {
  display: inline-block;
  margin-top: 1.4rem;
  margin-bottom: 0.5rem;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  background: var(--gradient-cool);
  color: #fff;
  -webkit-text-fill-color: #fff;
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.3);
}

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

/* ============ Contact ============ */
#contact h3 {
  margin-top: 1.4rem;
}

#contact p {
  padding: 1.1rem 1.3rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 2;
}

#contact a {
  font-weight: 600;
}

/* ============ Sitemap / Links lists ============ */
#sitemap ul,
#links ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}

#sitemap ul li a,
#links ul li a {
  display: block;
  padding: 0.6rem 0.9rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-soft);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

#sitemap ul li a:hover,
#links ul li a:hover {
  color: #fff;
  -webkit-text-fill-color: #fff;
  background: var(--gradient-accent);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(233, 69, 96, 0.3);
}

/* ============ Footer ============ */
footer {
  margin-top: 2rem;
  padding: 2.5rem 1.25rem 2rem;
  text-align: center;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--glass-border);
}

footer p {
  margin: 0.35rem 0;
  font-size: 0.88rem;
  color: var(--text-dim);
}

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

/* ============ Scrollbar ============ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

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

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

::selection {
  background: rgba(233, 69, 96, 0.35);
  color: var(--text);
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  header nav {
    gap: 0.75rem;
  }

  header nav ul {
    margin-left: 0;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  header nav ul li a {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
  }

  main > section {
    padding: 1.5rem 1.2rem;
    margin: 1.75rem 0;
    border-radius: var(--radius);
  }

  #hero {
    padding: 2.2rem 1.3rem;
  }
}

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

  main {
    padding: 0 0.85rem 2rem;
  }

  main > section {
    padding: 1.25rem 1rem;
    margin: 1.35rem 0;
  }

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 4px;
  }

  #hero {
    padding: 1.8rem 1.1rem;
    margin-top: 1.1rem;
  }

  #hero::after {
    width: 200px;
    height: 200px;
    right: -80px;
    top: -80px;
  }

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

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

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

  footer {
    padding: 2rem 1rem 1.6rem;
  }
}

@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;
  }
}