:root {
  --bg: #0f1220;
  --bg-soft: #171a2e;
  --bg-card: rgba(255, 255, 255, 0.06);
  --bg-card-hover: rgba(255, 255, 255, 0.1);
  --text: #eef0f8;
  --text-soft: #b7bcd0;
  --text-muted: #8a90a8;
  --brand: #e94560;
  --brand-2: #7b5cff;
  --brand-3: #22d3ee;
  --accent: #ffb86b;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.22);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.25);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --glass: rgba(23, 26, 46, 0.55);
  --glass-border: rgba(255, 255, 255, 0.14);
  --maxw: 1180px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6fc;
    --bg-soft: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-card-hover: rgba(255, 255, 255, 0.92);
    --text: #171a2e;
    --text-soft: #3f4560;
    --text-muted: #6b7290;
    --border: rgba(23, 26, 46, 0.1);
    --border-strong: rgba(23, 26, 46, 0.18);
    --shadow: 0 18px 40px rgba(35, 42, 80, 0.14);
    --shadow-soft: 0 8px 22px rgba(35, 42, 80, 0.1);
    --glass: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(23, 26, 46, 0.1);
  }
}

*,
*::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.8;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(123, 92, 255, 0.22), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(233, 69, 96, 0.16), transparent 55%),
    radial-gradient(700px 500px at 50% 120%, rgba(34, 211, 238, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

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

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

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

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

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

h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  letter-spacing: 0.02em;
}

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

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

h3 {
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  color: var(--text);
}

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

blockquote {
  margin: 0 0 1em;
  padding: 16px 20px;
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-soft);
  font-style: normal;
}

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

figure {
  margin: 1.6em 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--bg-soft);
}

figcaption {
  padding: 12px 18px;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}

address {
  font-style: normal;
}

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

header > div {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}

header > div > a {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
  background: linear-gradient(120deg, var(--brand), var(--brand-2) 55%, var(--brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  transition: transform 0.3s ease, filter 0.3s ease;
}

header > div > a:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

nav[aria-label="主导航"] ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

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

nav[aria-label="主导航"] a:hover,
nav[aria-label="主导航"] a:focus-visible {
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(123, 92, 255, 0.35);
}

form[role="search"] {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 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"] {
  width: 200px;
  padding: 9px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, width 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
}

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

form[role="search"] input[type="search"]:focus {
  outline: none;
  border-color: var(--brand-3);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
  width: 240px;
}

form[role="search"] button {
  padding: 9px 18px;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  white-space: nowrap;
}

form[role="search"] button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(233, 69, 96, 0.4);
  filter: brightness(1.08);
}

form[role="search"] button:active {
  transform: translateY(0);
}

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

main > section,
main > nav {
  margin: 34px 0;
  padding: 28px clamp(18px, 3vw, 36px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  box-shadow: var(--shadow-soft);
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease, background 0.4s ease;
  animation: fadeUp 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

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

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

/* Hero banner */
main > section[aria-labelledby="hero-title"] {
  position: relative;
  margin-top: 34px;
  padding: clamp(30px, 5vw, 56px) clamp(20px, 4vw, 48px);
  background:
    linear-gradient(135deg, rgba(233, 69, 96, 0.9), rgba(123, 92, 255, 0.88) 48%, rgba(34, 211, 238, 0.85)),
    var(--bg-soft);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: calc(var(--radius-lg) + 6px);
  box-shadow: 0 24px 60px rgba(233, 69, 96, 0.28);
  overflow: hidden;
  isolation: isolate;
}

main > section[aria-labelledby="hero-title"]::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 65%);
  border-radius: 50%;
  z-index: -1;
  animation: floatGlow 9s ease-in-out infinite alternate;
}

main > section[aria-labelledby="hero-title"]::after {
  content: "";
  position: absolute;
  inset: auto auto -30% -12%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 184, 107, 0.3), transparent 68%);
  border-radius: 50%;
  z-index: -1;
  animation: floatGlow 11s ease-in-out infinite alternate-reverse;
}

@keyframes floatGlow {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-30px, 24px, 0) scale(1.12);
  }
}

main > section[aria-labelledby="hero-title"] h1,
main > section[aria-labelledby="hero-title"] p {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}

main > section[aria-labelledby="hero-title"] h1 {
  font-size: clamp(1.8rem, 4.2vw, 3rem);
  max-width: 20ch;
}

main > section[aria-labelledby="hero-title"] p {
  max-width: 72ch;
  color: rgba(255, 255, 255, 0.92);
}

main > section[aria-labelledby="hero-title"] figure {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.35);
}

main > section[aria-labelledby="hero-title"] figcaption {
  color: rgba(255, 255, 255, 0.88);
  background: rgba(15, 18, 32, 0.4);
  border-top-color: rgba(255, 255, 255, 0.18);
}

/* Page directory nav */
main > nav[aria-label="页面目录"] {
  background: var(--glass);
  border-color: var(--glass-border);
}

main > nav[aria-label="页面目录"] h2 {
  font-size: 1.1rem;
}

main > nav[aria-label="页面目录"] ul,
section[aria-labelledby="sitemap-title"] ul,
section[aria-labelledby="links-title"] ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

main > nav[aria-label="页面目录"] li,
section[aria-labelledby="sitemap-title"] li,
section[aria-labelledby="links-title"] li {
  margin: 0;
}

main > nav[aria-label="页面目录"] a,
section[aria-labelledby="sitemap-title"] a,
section[aria-labelledby="links-title"] a {
  display: inline-block;
  padding: 7px 16px;
  font-size: 0.88rem;
  color: var(--text-soft);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

main > nav[aria-label="页面目录"] a:hover,
section[aria-labelledby="sitemap-title"] a:hover,
section[aria-labelledby="links-title"] a:hover {
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(123, 92, 255, 0.3);
}

/* ============ Articles ============ */
section[aria-labelledby="articles-title"] article {
  padding: 20px 22px;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

section[aria-labelledby="articles-title"] article:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

section[aria-labelledby="articles-title"] article h3 {
  margin-bottom: 0.35em;
  transition: color 0.25s ease;
}

section[aria-labelledby="articles-title"] article:hover h3 {
  color: var(--brand);
}

section[aria-labelledby="articles-title"] article p {
  margin-bottom: 0.5em;
  font-size: 0.94rem;
}

section[aria-labelledby="articles-title"] article p:first-of-type {
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

section[aria-labelledby="articles-title"] article a {
  display: inline-block;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 5px 14px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(233, 69, 96, 0.16), rgba(123, 92, 255, 0.16));
  border: 1px solid var(--border);
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

section[aria-labelledby="articles-title"] article a:hover {
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  transform: translateX(4px);
  box-shadow: 0 6px 16px rgba(233, 69, 96, 0.3);
}

/* ============ FAQ ============ */
section[aria-labelledby="faq-title"] h3 {
  position: relative;
  padding: 12px 16px 12px 40px;
  margin: 0 0 6px;
  font-size: 1.02rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: background 0.3s ease, border-color 0.3s ease;
}

section[aria-labelledby="faq-title"] h3::before {
  content: "Q";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

section[aria-labelledby="faq-title"] h3 + p {
  margin: 0 0 18px;
  padding: 14px 16px;
  font-size: 0.94rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

section[aria-labelledby="faq-title"] h3:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

/* ============ Contact ============ */
section[aria-labelledby="contact-title"] address {
  padding: 18px 22px;
  margin: 0 0 18px;
  background: linear-gradient(135deg, rgba(233, 69, 96, 0.14), rgba(123, 92, 255, 0.14));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

section[aria-labelledby="contact-title"] address p {
  margin-bottom: 0.4em;
  color: var(--text);
}

section[aria-labelledby="contact-title"] address p:last-child {
  margin-bottom: 0;
}

/* ============ Footer ============ */
footer {
  margin-top: 40px;
  padding: 48px 20px 32px;
  background:
    linear-gradient(180deg, rgba(15, 18, 32, 0.4), rgba(15, 18, 32, 0.85)),
    var(--bg-soft);
  border-top: 1px solid var(--border);
  color: var(--text-soft);
}

footer > section {
  max-width: var(--maxw);
  margin: 0 auto 22px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

footer > section:hover {
  border-color: var(--border-strong);
  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;
  margin-bottom: 0.6em;
}

footer > p {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  header > div {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "logo search"
      "nav nav";
    gap: 10px 16px;
  }

  header > div > a {
    grid-area: logo;
  }

  nav[aria-label="主导航"] {
    grid-area: nav;
    overflow-x: auto;
    scrollbar-width: none;
  }

  nav[aria-label="主导航"]::-webkit-scrollbar {
    display: none;
  }

  nav[aria-label="主导航"] ul {
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  form[role="search"] {
    grid-area: search;
    justify-self: end;
  }

  form[role="search"] input[type="search"] {
    width: 170px;
  }

  form[role="search"] input[type="search"]:focus {
    width: 200px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
    background-attachment: scroll;
  }

  header > div {
    padding: 10px 14px;
  }

  header > div > a {
    font-size: 1.1rem;
  }

  form[role="search"] input[type="search"] {
    width: 130px;
    padding: 8px 12px;
  }

  form[role="search"] input[type="search"]:focus {
    width: 150px;
  }

  form[role="search"] button {
    padding: 8px 14px;
  }

  main {
    padding: 0 12px 40px;
  }

  main > section,
  main > nav {
    margin: 20px 0;
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }

  main > section[aria-labelledby="hero-title"] {
    padding: 26px 18px;
    border-radius: var(--radius-lg);
  }

  main > section[aria-labelledby="hero-title"] h1 {
    max-width: none;
  }

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 5px;
  }

  section[aria-labelledby="articles-title"] article {
    padding: 16px;
  }

  footer {
    padding: 32px 12px 24px;
  }

  footer > section {
    padding: 16px 16px;
  }
}

@media (max-width: 420px) {
  header > div {
    grid-template-columns: 1fr;
    grid-template-areas:
      "logo"
      "search"
      "nav";
  }

  form[role="search"] {
    justify-self: stretch;
  }

  form[role="search"] input[type="search"],
  form[role="search"] input[type="search"]:focus {
    width: 100%;
    flex: 1;
  }

  form[role="search"] {
    width: 100%;
  }
}

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

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  header,
  main > section,
  main > nav,
  footer > section,
  blockquote,
  figcaption {
    background-color: var(--bg-soft);
  }
}

@media print {
  header,
  form[role="search"],
  footer > section {
    display: none;
  }

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

  main > section,
  main > nav {
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
  }
}