:root {
  --primary: #5b3df5;
  --primary-dark: #4527d6;
  --primary-light: #7c63ff;
  --accent: #ffd166;
  --accent-2: #ff6b9d;
  --accent-3: #4ecdc4;
  --bg: #f7f6fd;
  --bg-soft: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.65);
  --bg-glass-strong: rgba(255, 255, 255, 0.85);
  --text: #1d1b2e;
  --text-soft: #4a4763;
  --text-muted: #7a7691;
  --border: rgba(91, 61, 245, 0.12);
  --border-strong: rgba(91, 61, 245, 0.22);
  --shadow-sm: 0 2px 8px rgba(45, 32, 110, 0.06);
  --shadow-md: 0 8px 28px rgba(45, 32, 110, 0.1);
  --shadow-lg: 0 18px 48px rgba(45, 32, 110, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #8b74ff;
    --primary-dark: #6c50f0;
    --primary-light: #a894ff;
    --accent: #ffd166;
    --accent-2: #ff7fae;
    --accent-3: #5fd8cf;
    --bg: #0e0c1a;
    --bg-soft: #17142a;
    --bg-glass: rgba(30, 26, 54, 0.6);
    --bg-glass-strong: rgba(30, 26, 54, 0.85);
    --text: #eceaf7;
    --text-soft: #c3bfd9;
    --text-muted: #908bb0;
    --border: rgba(139, 116, 255, 0.18);
    --border-strong: rgba(139, 116, 255, 0.32);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", 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(91, 61, 245, 0.12), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(255, 107, 157, 0.1), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(78, 205, 196, 0.08), transparent 46%);
  background-attachment: fixed;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

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(--primary-dark);
}

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

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

h1 {
  font-size: clamp(1.55rem, 3.6vw, 2.5rem);
}

h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.85rem);
}

h3 {
  font-size: clamp(1.08rem, 1.9vw, 1.3rem);
  font-weight: 700;
}

h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-soft);
}

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

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

li {
  margin-bottom: 0.4em;
}

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

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

header nav > a {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
  padding: 8px 4px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

header nav > a::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  box-shadow: 0 4px 12px rgba(91, 61, 245, 0.35);
  flex: none;
}

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

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

header nav ul li {
  margin: 0;
}

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

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

header nav ul a:hover,
header nav ul a:focus-visible {
  color: var(--primary);
  background: rgba(91, 61, 245, 0.08);
  transform: translateY(-1px);
}

header nav ul a:hover::after {
  width: 60%;
}

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

main > section {
  margin-top: 34px;
  padding: 28px clamp(18px, 3vw, 36px);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease),
    border-color 0.35s var(--ease);
  animation: fadeUp 0.7s var(--ease) both;
}

main > section:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

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

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ============ Breadcrumb ============ */
main > nav[aria-label="面包屑导航"] {
  margin-top: 22px;
}

main > nav[aria-label="面包屑导航"] ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

main > nav[aria-label="面包屑导航"] li {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

main > nav[aria-label="面包屑导航"] li + li::before {
  content: "›";
  color: var(--text-muted);
  opacity: 0.7;
}

main > nav[aria-label="面包屑导航"] a {
  color: var(--text-soft);
  font-weight: 600;
}

main > nav[aria-label="面包屑导航"] a:hover {
  color: var(--primary);
}

/* ============ Hero ============ */
#hero {
  position: relative;
  overflow: hidden;
  margin-top: 22px;
  padding: clamp(30px, 5vw, 60px) clamp(20px, 4vw, 52px);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, #5b3df5 0%, #7c63ff 42%, #ff6b9d 100%);
  background-size: 200% 200%;
  animation: fadeUp 0.7s var(--ease) both, gradientShift 14s ease infinite;
  box-shadow: var(--shadow-lg);
  color: #fff;
  border: none;
}

#hero::before,
#hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

#hero::before {
  width: 320px;
  height: 320px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.55), transparent 68%);
  animation: floaty 7s ease-in-out infinite;
}

#hero::after {
  width: 260px;
  height: 260px;
  bottom: -130px;
  left: -60px;
  background: radial-gradient(circle, rgba(78, 205, 196, 0.5), transparent 70%);
  animation: floaty 9s ease-in-out infinite reverse;
}

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

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

#hero h1 {
  color: #fff;
  text-shadow: 0 2px 20px rgba(20, 10, 60, 0.28);
  max-width: 22ch;
}

#hero p {
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.95rem, 1.6vw, 1.06rem);
  max-width: 68ch;
}

#hero figure {
  margin: 26px 0 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

#hero figure:hover {
  transform: translateY(-6px) scale(1.008);
  box-shadow: var(--shadow-lg);
}

#hero figure svg {
  width: 100%;
  height: auto;
  display: block;
}

#hero figcaption {
  padding: 12px 18px;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(20, 10, 60, 0.28);
  text-align: center;
}

/* ============ Section headings accent ============ */
main > section > h2 {
  position: relative;
  padding-left: 18px;
}

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

/* ============ Articles ============ */
#articles {
  display: grid;
  gap: 18px;
}

#articles > h2 {
  grid-column: 1 / -1;
}

#articles article {
  padding: 20px 22px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
    border-color 0.35s var(--ease);
}

#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

#articles article h3 {
  margin-bottom: 6px;
}

#articles article h3::before {
  content: "📖 ";
  font-size: 0.9em;
}

#articles article > p:first-of-type {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

#articles article > p:nth-of-type(2) {
  font-size: 0.94rem;
  color: var(--text-soft);
}

#articles article a {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(91, 61, 245, 0.1);
  color: var(--primary);
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

#articles article a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateX(3px);
}

/* ============ FAQ ============ */
#faq details {
  margin-bottom: 12px;
  padding: 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#faq details:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

#faq details[open] {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

#faq summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 50px 16px 20px;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  position: relative;
  user-select: none;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  line-height: 24px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  border-radius: 50%;
  background: rgba(91, 61, 245, 0.1);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease),
    color 0.3s var(--ease);
}

#faq details[open] summary::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
  background: var(--primary);
  color: #fff;
}

#faq summary:hover {
  background: rgba(91, 61, 245, 0.05);
  color: var(--primary);
}

#faq details > p {
  margin: 0;
  padding: 0 20px 18px;
  font-size: 0.94rem;
  color: var(--text-soft);
  animation: fadeUp 0.4s var(--ease) both;
}

/* ============ HowTo steps ============ */
#howto h4 {
  position: relative;
  padding-left: 34px;
  margin-top: 1.4em;
}

#howto h4::before {
  content: counter(step);
  counter-increment: step;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  box-shadow: 0 3px 10px rgba(91, 61, 245, 0.35);
}

#howto {
  counter-reset: step;
}

/* ============ Contact ============ */
#contact p {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 16px;
  margin: 0 0 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

#contact p:hover {
  transform: translateX(4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

#contact p:last-child {
  background: transparent;
  border: none;
  padding-left: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

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

#sitemap a,
#links a {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: transform 0.25s var(--ease), color 0.25s var(--ease),
    background 0.25s var(--ease), border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

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

/* ============ Legal ============ */
#legal h2 {
  font-size: 1.1rem;
  margin-top: 1.2em;
}

#legal h2:first-child {
  margin-top: 0;
}

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

/* ============ Footer ============ */
footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 20px 46px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
  border-top: 1px solid var(--border);
}

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

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

/* ============ Responsive ============ */
@media (min-width: 860px) {
  #articles {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1120px) {
  #articles {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 56px;
    --radius-lg: 20px;
    --radius-xl: 24px;
  }

  body {
    font-size: 15px;
  }

  header nav {
    padding: 8px 14px;
    gap: 10px;
  }

  header nav ul {
    flex: 1 0 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  header nav ul a {
    white-space: nowrap;
    font-size: 0.84rem;
    padding: 6px 11px;
  }

  main {
    padding: 0 14px 40px;
  }

  main > section {
    margin-top: 22px;
    padding: 22px 18px;
  }

  #hero {
    padding: 28px 20px;
  }

  #hero h1 {
    max-width: none;
  }

  #contact p {
    flex-direction: column;
    gap: 2px;
  }

  #faq summary {
    padding: 14px 46px 14px 16px;
    font-size: 0.92rem;
  }

  #faq summary::after {
    right: 14px;
  }
}

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

/* ============ Print ============ */
@media print {
  header,
  footer,
  #hero::before,
  #hero::after {
    display: none;
  }

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

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