:root {
  --primary: #5b6ee1;
  --primary-deep: #4453c4;
  --primary-light: #7f8ff0;
  --accent: #ff7eb6;
  --accent-2: #4fd1c5;
  --bg: #f4f6ff;
  --bg-soft: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.65);
  --text: #1f2340;
  --text-soft: #545a7d;
  --text-mute: #7a80a3;
  --border: rgba(91, 110, 225, 0.16);
  --shadow-sm: 0 4px 14px rgba(64, 78, 155, 0.08);
  --shadow-md: 0 14px 40px rgba(64, 78, 155, 0.14);
  --shadow-lg: 0 24px 70px rgba(64, 78, 155, 0.22);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --container: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #7f8ff0;
    --primary-deep: #6a7ae8;
    --primary-light: #9aa7f5;
    --accent: #ff8fc0;
    --accent-2: #5fe0d3;
    --bg: #0d1024;
    --bg-soft: #151a36;
    --bg-glass: rgba(24, 29, 60, 0.62);
    --text: #eef1ff;
    --text-soft: #b9c0e6;
    --text-mute: #8b93bd;
    --border: rgba(127, 143, 240, 0.22);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.6);
  }
}

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

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

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 8% -10%, rgba(91, 110, 225, 0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 126, 182, 0.14), transparent 55%),
    radial-gradient(800px 600px at 50% 120%, rgba(79, 209, 197, 0.12), transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(127, 143, 240, 0.55);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3, h4 {
  line-height: 1.35;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  margin: 0 0 0.6em;
}

h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  margin: 0 0 0.7em;
  position: relative;
  padding-left: 18px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  margin: 1.6em 0 0.5em;
}

h4 {
  font-size: 1.05rem;
  margin: 1.2em 0 0.4em;
  color: var(--primary-deep);
}

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

ul {
  margin: 0 0 1.2em;
  padding-left: 1.25em;
}

li {
  margin-bottom: 0.45em;
  color: var(--text-soft);
}

strong {
  color: var(--text);
  font-weight: 700;
}

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

header > div {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

header > div > a {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  transition: transform 0.3s var(--ease);
}

header > div > a:hover {
  transform: translateY(-1px) scale(1.02);
}

header nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

header nav li {
  margin: 0;
}

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

header nav a:hover,
header nav a:focus-visible {
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--primary-light));
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(91, 110, 225, 0.32);
}

/* ========== Main layout ========== */
main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

main > section {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px clamp(20px, 4vw, 48px);
  margin-bottom: 36px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: fadeUp 0.7s var(--ease) both;
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.4s var(--ease);
}

main > section::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(600px 200px at 100% 0%, rgba(91, 110, 225, 0.06), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

main > section:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: rgba(91, 110, 225, 0.3);
}

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

/* ========== Hero / Banner ========== */
main > section:first-child {
  background:
    linear-gradient(135deg, rgba(91, 110, 225, 0.94), rgba(68, 83, 196, 0.92) 45%, rgba(255, 126, 182, 0.85)),
    var(--bg-soft);
  color: #fff;
  border: none;
  padding: clamp(40px, 6vw, 72px) clamp(22px, 5vw, 60px);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

main > section:first-child::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(500px 300px at 85% 15%, rgba(255, 255, 255, 0.28), transparent 60%),
    radial-gradient(420px 260px at 10% 90%, rgba(79, 209, 197, 0.3), transparent 65%);
  animation: floatGlow 12s ease-in-out infinite alternate;
}

main > section:first-child h1 {
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

main > section:first-child p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.02rem;
  max-width: 78ch;
}

main > section:first-child p:last-child {
  margin-bottom: 0;
}

/* ========== Article cards ========== */
article {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  position: relative;
  overflow: hidden;
}

article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--ease);
}

article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(91, 110, 225, 0.32);
}

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

article h3 {
  margin-top: 0;
  color: var(--text);
}

article p:first-of-type {
  font-size: 0.86rem;
  color: var(--text-mute);
  margin-bottom: 0.9em;
}

article a {
  display: inline-block;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 6px 16px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 6px 18px rgba(91, 110, 225, 0.28);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), filter 0.28s var(--ease);
}

article a:hover,
article a:focus-visible {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(91, 110, 225, 0.42);
  filter: brightness(1.06);
}

/* Article body blocks (glass panels) */
main > section > div[id^="article-"] {
  margin-top: 18px;
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(91, 110, 225, 0.08), rgba(255, 126, 182, 0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.35s var(--ease), transform 0.35s var(--ease);
}

main > section > div[id^="article-"]:hover {
  background: linear-gradient(135deg, rgba(91, 110, 225, 0.14), rgba(255, 126, 182, 0.1));
  transform: translateX(3px);
}

main > section > div[id^="article-"] h4 {
  margin-top: 0;
  color: var(--primary-deep);
}

main > section > div[id^="article-"] p {
  margin-bottom: 0;
}

/* ========== FAQ ========== */
#faq h3 {
  padding: 14px 18px;
  margin: 18px 0 0;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--primary-deep);
  font-size: 1.02rem;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

#faq h3:hover {
  background: linear-gradient(120deg, rgba(91, 110, 225, 0.14), rgba(255, 126, 182, 0.1));
}

#faq h3 + p {
  margin: 0 0 4px;
  padding: 16px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 0.95rem;
}

/* ========== HowTo ========== */
#howto h3 {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(91, 110, 225, 0.14), rgba(79, 209, 197, 0.14));
  color: var(--primary-deep);
  font-size: 1rem;
  margin: 20px 0 8px;
}

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

/* ========== Contact ========== */
#contact ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

#contact li {
  margin: 0;
  padding: 16px 18px;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#contact li:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

/* ========== Sitemap & Links ========== */
#sitemap ul,
#links ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

#sitemap a,
#links a {
  display: inline-block;
  padding: 7px 16px;
  font-size: 0.9rem;
  border-radius: 999px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-soft);
  transition: all 0.28s var(--ease);
}

#sitemap a:hover,
#links a:hover,
#sitemap a:focus-visible,
#links a:focus-visible {
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(91, 110, 225, 0.3);
}

/* ========== Footer ========== */
footer {
  background: linear-gradient(180deg, transparent, rgba(91, 110, 225, 0.1));
  border-top: 1px solid var(--border);
  padding: 44px 24px 52px;
  margin-top: 20px;
}

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

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

footer p:first-child {
  color: var(--text-soft);
  font-weight: 600;
}

footer nav ul {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
}

footer nav li {
  margin: 0;
}

footer nav a {
  font-size: 0.88rem;
  color: var(--text-soft);
  position: relative;
  padding-bottom: 2px;
}

footer nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

footer nav a:hover {
  color: var(--primary);
}

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

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

@keyframes floatGlow {
  0% {
    transform: scale(1) translate3d(0, 0, 0);
  }
  100% {
    transform: scale(1.08) translate3d(-2%, 2%, 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; }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  main {
    padding: 32px 20px 64px;
  }
  main > section {
    padding: 32px clamp(18px, 3.4vw, 36px);
    border-radius: var(--radius-md);
  }
  header > div {
    padding: 12px 20px;
  }
}

@media (max-width: 860px) {
  header > div {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  header > div > a {
    text-align: center;
    font-size: 1.18rem;
  }
  header nav ul {
    justify-content: center;
    gap: 4px;
  }
  header nav a {
    padding: 6px 11px;
    font-size: 0.86rem;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 130px;
  }
  body {
    font-size: 15px;
    line-height: 1.8;
  }
  main {
    padding: 24px 14px 52px;
  }
  main > section {
    padding: 26px 18px;
    margin-bottom: 22px;
    border-radius: var(--radius-sm);
  }
  main > section:first-child {
    padding: 34px 20px;
  }
  h2 {
    padding-left: 14px;
  }
  h2::before {
    width: 5px;
  }
  article {
    padding: 20px 18px;
  }
  #contact ul {
    grid-template-columns: 1fr;
  }
  #sitemap a,
  #links a {
    font-size: 0.84rem;
    padding: 6px 13px;
  }
  footer {
    padding: 34px 16px 44px;
  }
}

@media (max-width: 400px) {
  header nav a {
    padding: 5px 9px;
    font-size: 0.8rem;
  }
  main > section {
    padding: 22px 14px;
  }
}

/* ========== Motion & print preferences ========== */
@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;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  header,
  footer,
  main > section::after,
  main > section:first-child::before {
    display: none;
  }
  main > section {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}