:root {
  --bg: #f6f4fb;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --border: rgba(43, 27, 61, 0.1);
  --text: #2b1b3d;
  --text-soft: #5c4a6e;
  --text-muted: #7d6b8f;
  --primary: #7c5cff;
  --primary-2: #f26b8a;
  --primary-3: #3ec6a8;
  --accent: #ffb347;
  --accent-2: #5bc8ff;
  --shadow-sm: 0 2px 8px rgba(43, 27, 61, 0.06);
  --shadow-md: 0 10px 30px rgba(43, 27, 61, 0.1);
  --shadow-lg: 0 24px 60px rgba(43, 27, 61, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --grad-hero: linear-gradient(135deg, #2b1b3d 0%, #4a2b6b 38%, #7c5cff 72%, #f26b8a 100%);
  --grad-brand: linear-gradient(120deg, #7c5cff 0%, #f26b8a 55%, #ffb347 100%);
  --grad-soft: linear-gradient(135deg, rgba(124, 92, 255, 0.12), rgba(242, 107, 138, 0.12));
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #120c1c;
    --bg-soft: #1a1228;
    --surface: rgba(38, 26, 56, 0.62);
    --surface-solid: #221733;
    --border: rgba(255, 255, 255, 0.1);
    --text: #f3eefb;
    --text-soft: #cbbfe0;
    --text-muted: #a494bd;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
    --grad-soft: linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(242, 107, 138, 0.18));
  }
}

*,
*::before,
*::after {
  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.75;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 90% -10%, rgba(124, 92, 255, 0.16), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(242, 107, 138, 0.14), transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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-2);
}

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

h1 { font-size: clamp(1.6rem, 4.2vw, 2.6rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); margin: 0 0 1rem; }
h3 { font-size: clamp(1.1rem, 2.2vw, 1.35rem); margin: 1.6rem 0 0.6rem; }
h4 { font-size: 1.05rem; margin: 1.2rem 0 0.4rem; color: var(--text-soft); }

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

ul, ol { margin: 0 0 1rem; padding-left: 1.4rem; color: var(--text-soft); }
li { margin: 0.35rem 0; }

blockquote {
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--primary-2);
  background: var(--grad-soft);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
}

blockquote p:last-child { margin-bottom: 0; }

figure {
  margin: 1.5rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #2b1b3d;
}

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

::selection {
  background: rgba(124, 92, 255, 0.3);
  color: var(--text);
}

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

/* ============ Header ============ */
#site-header {
  position: relative;
  z-index: 10;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: center;
  align-items: center;
  padding: 0.55rem 1.25rem;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(90deg, #2b1b3d, #4a2b6b, #7c5cff);
  text-align: center;
}

.topbar span + span {
  opacity: 0.85;
}

#site-header > nav[aria-label="主导航"] {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  background: var(--surface);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.logo {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--primary);
  white-space: nowrap;
  transition: transform 0.3s var(--ease), filter 0.3s var(--ease);
}

.logo:hover,
.logo:focus-visible {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.15);
}

#site-header > nav[aria-label="主导航"] > ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
}

#site-header > nav[aria-label="主导航"] > ul a {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  border-radius: 999px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

#site-header > nav[aria-label="主导航"] > ul a:hover,
#site-header > nav[aria-label="主导航"] > ul a:focus-visible {
  color: #fff;
  background: var(--grad-brand);
  transform: translateY(-2px);
}

form[role="search"] {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 1 320px;
  min-width: 0;
}

form[role="search"] label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

form[role="search"] input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.5rem 0.9rem;
  font: inherit;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

form[role="search"] input[type="search"]::placeholder {
  color: var(--text-muted);
}

form[role="search"] input[type="search"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.18);
}

form[role="search"] button {
  flex: 0 0 auto;
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  background: var(--grad-brand);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
}

form[role="search"] button:hover,
form[role="search"] button:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  filter: brightness(1.08);
}

nav[aria-label="面包屑"] {
  padding: 0.6rem clamp(1rem, 4vw, 2.5rem);
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

nav[aria-label="面包屑"] ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--maxw);
  margin-inline: auto;
}

nav[aria-label="面包屑"] li + li::before {
  content: "›";
  margin-right: 0.4rem;
  color: var(--text-muted);
}

nav[aria-label="面包屑"] a {
  color: var(--text-soft);
}

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

/* ============ Main Layout ============ */
main {
  display: block;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) 3rem;
}

main > section {
  position: relative;
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
  padding: clamp(1.25rem, 3.5vw, 2.5rem);
  background: var(--surface);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  animation: rise-in 0.7s var(--ease) both;
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.4s var(--ease);
  scroll-margin-top: 90px;
}

main > section:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(124, 92, 255, 0.25);
}

main > section:nth-child(even) {
  animation-delay: 0.06s;
}

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

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

/* ============ Hero ============ */
#hero {
  color: #fff;
  background: var(--grad-hero);
  background-size: 180% 180%;
  animation: rise-in 0.7s var(--ease) both, hero-shift 18s ease-in-out infinite;
  border: none;
  overflow: hidden;
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(400px 240px at 85% 15%, rgba(255, 179, 71, 0.35), transparent 70%),
    radial-gradient(360px 220px at 10% 90%, rgba(91, 200, 255, 0.28), transparent 70%);
  pointer-events: none;
}

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

#hero > * {
  position: relative;
  z-index: 1;
}

#hero h1 {
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}

#hero h1::after {
  content: "";
  display: block;
  width: 84px;
  height: 5px;
  margin-top: 1rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffb347, #f26b8a, #5bc8ff);
}

#hero p {
  color: rgba(255, 255, 255, 0.88);
  max-width: 78ch;
}

#hero figure {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  transition: transform 0.5s var(--ease);
}

#hero figure:hover {
  transform: translateY(-4px) scale(1.01);
}

#hero figcaption {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border-top-color: rgba(255, 255, 255, 0.15);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

#hero ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

#hero ul li {
  margin: 0;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}

#hero ul li:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.18);
}

/* ============ Section accents ============ */
main > section > h2 {
  position: relative;
  padding-left: 1rem;
}

main > section > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 5px;
  border-radius: 999px;
  background: var(--grad-brand);
}

/* ============ Articles ============ */
#articles article {
  position: relative;
  margin: 0 0 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface-solid);
  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::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}

#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(242, 107, 138, 0.35);
}

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

#articles article > * {
  position: relative;
  z-index: 1;
}

#articles article h3 {
  margin-top: 0;
  font-size: 1.08rem;
}

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

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  color: #fff;
  background: var(--grad-brand);
  border-radius: 999px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

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

#articles article a:hover,
#articles article a:focus-visible {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

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

#faq details[open] {
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: var(--shadow-md);
}

#faq summary {
  position: relative;
  padding: 0.9rem 2.6rem 0.9rem 1.1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: 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: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
  color: var(--primary);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}

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

#faq summary:hover {
  background: var(--grad-soft);
}

#faq details p {
  margin: 0;
  padding: 0 1.1rem 1rem;
  font-size: 0.94rem;
  animation: fade-in 0.4s var(--ease) both;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ Sitemap / Links / Lists ============ */
#sitemap ul,
#links ul,
#solutions ul,
#howto ul,
#howto ol {
  padding-left: 1.2rem;
}

#sitemap ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.4rem 1rem;
  list-style: none;
  padding: 0;
}

#sitemap ul li {
  margin: 0;
}

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

#sitemap ul a:hover,
#sitemap ul a:focus-visible {
  color: #fff;
  background: var(--grad-brand);
  border-color: transparent;
  transform: translateY(-2px);
}

#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  padding: 0;
}

#links ul li {
  margin: 0;
}

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

#links ul a:hover,
#links ul a:focus-visible {
  color: var(--primary-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ============ Contact ============ */
#contact p {
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--border);
}

#contact p:last-of-type {
  border-bottom: none;
}

/* ============ Footer ============ */
footer {
  position: relative;
  margin-top: 2rem;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.5rem) 2rem;
  color: rgba(255, 255, 255, 0.82);
  background: linear-gradient(160deg, #2b1b3d 0%, #3a2350 45%, #241531 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--grad-brand);
}

footer > section {
  max-width: var(--maxw);
  margin: 0 auto 1.5rem;
}

footer h2 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.6rem;
}

footer h3 {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.92);
  margin: 0.9rem 0 0.3rem;
}

footer p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

footer a {
  color: #ffb347;
}

footer a:hover {
  color: #ffd28a;
}

footer > p {
  max-width: var(--maxw);
  margin: 1.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

/* ============ Back to top ============ */
#back-to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 50;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--grad-brand);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0.9;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), opacity 0.3s var(--ease);
}

#back-to-top:hover,
#back-to-top:focus-visible {
  transform: translateY(-4px) scale(1.04);
  box-shadow: var(--shadow-lg);
  opacity: 1;
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  #site-header > nav[aria-label="主导航"] {
    gap: 0.6rem;
  }

  #site-header > nav[aria-label="主导航"] > ul {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #site-header > nav[aria-label="主导航"] > ul::-webkit-scrollbar {
    display: none;
  }

  #site-header > nav[aria-label="主导航"] > ul a {
    white-space: nowrap;
  }

  form[role="search"] {
    flex: 1 1 auto;
  }
}

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

  .topbar {
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.76rem;
    padding: 0.5rem 1rem;
  }

  #site-header > nav[aria-label="主导航"] {
    padding: 0.7rem 1rem;
  }

  .logo {
    font-size: 0.98rem;
  }

  form[role="search"] {
    flex-basis: 100%;
    order: 2;
  }

  main {
    padding: 1rem 0.75rem 2rem;
  }

  main > section {
    padding: 1.1rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.1rem;
  }

  #hero ul {
    grid-template-columns: 1fr;
  }

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

  #back-to-top {
    font-size: 0.78rem;
    padding: 0.55rem 0.9rem;
  }
}

@media (max-width: 380px) {
  #site-header > nav[aria-label="主导航"] > ul a {
    padding: 0.35rem 0.55rem;
    font-size: 0.84rem;
  }

  form[role="search"] button {
    padding-inline: 0.8rem;
  }
}

@media (hover: none) {
  main > section:hover,
  #articles article:hover,
  #hero ul li:hover,
  #hero figure:hover {
    transform: none;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  #site-header > nav[aria-label="主导航"],
  #back-to-top,
  footer::before {
    display: none;
  }

  main > section {
    box-shadow: none;
    border: 1px solid #ccc;
    animation: none;
  }
}