:root {
  --bg: #0d1b2a;
  --bg-soft: #13243a;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e8eef7;
  --text-soft: #a9b8cc;
  --text-dim: #7d8ea6;
  --accent: #4cc9f0;
  --accent-2: #7b61ff;
  --accent-3: #f72585;
  --grad: linear-gradient(135deg, #4cc9f0 0%, #7b61ff 50%, #f72585 100%);
  --grad-soft: linear-gradient(135deg, rgba(76, 201, 240, 0.18), rgba(123, 97, 255, 0.14), rgba(247, 37, 133, 0.12));
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.25);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --blur: blur(18px);
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f7fc;
    --bg-soft: #ffffff;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: rgba(255, 255, 255, 0.9);
    --border: rgba(13, 27, 42, 0.1);
    --text: #12213a;
    --text-soft: #43536b;
    --text-dim: #6b7c94;
    --shadow: 0 18px 50px rgba(18, 33, 58, 0.14);
    --shadow-sm: 0 8px 24px rgba(18, 33, 58, 0.1);
    --grad-soft: linear-gradient(135deg, rgba(76, 201, 240, 0.16), rgba(123, 97, 255, 0.12), rgba(247, 37, 133, 0.1));
  }
}

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

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

body {
  margin: 0;
  padding: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(76, 201, 240, 0.18), transparent 60%),
    radial-gradient(1000px 520px at 88% 0%, rgba(123, 97, 255, 0.16), transparent 62%),
    radial-gradient(900px 600px at 50% 110%, rgba(247, 37, 133, 0.12), transparent 65%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a:hover,
a:focus-visible {
  color: #8fe3ff;
}

@media (prefers-color-scheme: light) {
  a:hover,
  a:focus-visible {
    color: #2b7fd4;
  }
}

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

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

h1 {
  font-size: clamp(1.7rem, 4.2vw, 2.9rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  position: relative;
  padding-bottom: 0.5em;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 4px;
  border-radius: 4px;
  background: var(--grad);
}

h3 {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
}

h4 {
  font-size: 1.05rem;
}

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: 1.2em 0;
  padding: 1em 1.2em;
  border-left: 4px solid transparent;
  border-image: var(--grad) 1;
  background: var(--surface);
  border-radius: var(--radius-sm);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

blockquote p {
  margin: 0;
  color: var(--text);
  font-style: italic;
}

/* ====== Header ====== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 27, 42, 0.55);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

@media (prefers-color-scheme: light) {
  header {
    background: rgba(255, 255, 255, 0.65);
  }
}

header > div {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

header > div > a {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
  transition: transform 0.3s var(--ease), filter 0.3s var(--ease);
}

header > div > a:hover {
  transform: translateY(-1px);
  filter: drop-shadow(0 4px 14px rgba(76, 201, 240, 0.5));
}

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

header nav a {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  border-radius: 999px;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

header nav a:hover {
  color: var(--text);
  background: var(--surface-strong);
  transform: translateY(-1px);
}

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

main > nav[aria-label="面包屑导航"] {
  margin-bottom: 1.25rem;
}

main > nav[aria-label="面包屑导航"] ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

main > nav[aria-label="面包屑导航"] li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--text-dim);
  opacity: 0.6;
}

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

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

/* ====== Sections ====== */
section {
  margin-bottom: 2rem;
  padding: 1.75rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  animation: fadeUp 0.7s var(--ease) both;
}

section:hover {
  border-color: rgba(76, 201, 240, 0.35);
  box-shadow: var(--shadow);
}

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

@supports (animation-timeline: view()) {
  section {
    animation: fadeUp linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 28%;
  }
}

/* ====== Hero ====== */
#hero {
  position: relative;
  overflow: hidden;
  padding: 3rem 1.75rem;
  background:
    linear-gradient(135deg, rgba(76, 201, 240, 0.22), rgba(123, 97, 255, 0.2) 45%, rgba(247, 37, 133, 0.18)),
    var(--surface);
  border: 1px solid rgba(123, 97, 255, 0.3);
  border-radius: calc(var(--radius) + 6px);
}

#hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(76, 201, 240, 0.35), transparent 65%);
  filter: blur(40px);
  animation: floatBlob 14s ease-in-out infinite alternate;
  pointer-events: none;
}

#hero::after {
  content: "";
  position: absolute;
  inset: auto auto -45% -12%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(247, 37, 133, 0.3), transparent 65%);
  filter: blur(46px);
  animation: floatBlob 18s ease-in-out infinite alternate-reverse;
  pointer-events: none;
}

@keyframes floatBlob {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-40px, 30px, 0) scale(1.15); }
}

#hero h1 {
  position: relative;
  z-index: 1;
  background: linear-gradient(120deg, #ffffff 10%, #9be7ff 45%, #c3b3ff 75%, #ff9ad0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 4px 18px rgba(76, 201, 240, 0.25));
}

@media (prefers-color-scheme: light) {
  #hero h1 {
    background: linear-gradient(120deg, #0d1b2a 10%, #1b6fa8 45%, #5136c9 75%, #b81f6b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: none;
  }
}

#hero p {
  position: relative;
  z-index: 1;
  max-width: 78ch;
  color: var(--text-soft);
  font-size: 1.02rem;
}

/* ====== Article Cards ====== */
#articles article {
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.1rem;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
}

#articles article:hover {
  transform: translateY(-4px);
  border-color: rgba(76, 201, 240, 0.4);
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.09);
}

@media (prefers-color-scheme: light) {
  #articles article:hover {
    background: rgba(255, 255, 255, 0.95);
  }
}

#articles article h3 {
  margin-bottom: 0.35em;
  transition: color 0.3s var(--ease);
}

#articles article:hover h3 {
  color: var(--accent);
}

#articles article p:first-of-type {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.6em;
}

#articles article a {
  display: inline-block;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

#articles article a:hover {
  transform: translateX(4px);
  background: var(--grad);
  color: #0d1b2a;
  box-shadow: 0 6px 18px rgba(76, 201, 240, 0.35);
}

/* ====== FAQ ====== */
#faq h3 {
  margin-top: 1.4rem;
  padding-left: 0.9rem;
  border-left: 3px solid transparent;
  border-image: var(--grad) 1;
  color: var(--text);
}

#faq h3:first-of-type {
  margin-top: 0;
}

#faq p {
  margin-bottom: 0.4rem;
}

/* ====== HowTo ====== */
#howto h4 {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
}

#howto h4 + p {
  margin-top: 0.6rem;
}

/* ====== Contact ====== */
#contact p {
  margin-bottom: 0.35rem;
}

#contact h3 {
  margin-top: 1.3rem;
}

#contact h3:first-of-type {
  margin-top: 0;
}

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

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

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

#sitemap a:hover,
#links a:hover {
  transform: translateY(-3px);
  color: #0d1b2a;
  background: var(--grad);
  box-shadow: 0 8px 22px rgba(123, 97, 255, 0.35);
}

/* ====== Footer ====== */
footer {
  margin-top: 2rem;
  padding: 2.25rem 1.25rem 2.75rem;
  background: rgba(13, 27, 42, 0.6);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-top: 1px solid var(--border);
  text-align: center;
}

@media (prefers-color-scheme: light) {
  footer {
    background: rgba(255, 255, 255, 0.7);
  }
}

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

footer nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

footer nav a {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text-soft);
  border-radius: 999px;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

footer nav a:hover {
  color: var(--text);
  background: var(--surface-strong);
}

/* ====== Responsive ====== */
@media (max-width: 860px) {
  header > div {
    justify-content: center;
  }

  header nav {
    width: 100%;
  }

  header nav ul {
    justify-content: center;
  }

  header nav a {
    font-size: 0.84rem;
    padding: 0.35rem 0.6rem;
  }

  section {
    padding: 1.4rem 1.1rem;
    border-radius: var(--radius-sm);
  }

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

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

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

  header > div {
    padding: 0.6rem 0.85rem;
  }

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

  header nav ul {
    gap: 0.15rem;
  }

  header nav a {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }

  section {
    margin-bottom: 1.4rem;
    padding: 1.2rem 0.95rem;
  }

  h2::after {
    width: 48px;
    height: 3px;
  }

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

  #hero {
    padding: 1.9rem 1rem;
  }

  #sitemap a,
  #links a {
    font-size: 0.84rem;
    padding: 0.4rem 0.8rem;
  }
}

/* ====== 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;
  }
}

::selection {
  background: rgba(76, 201, 240, 0.35);
  color: #ffffff;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(13, 27, 42, 0.4);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4cc9f0, #7b61ff);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #7b61ff, #f72585);
  background-clip: padding-box;
}