:root {
  --bg: #0f0f1a;
  --bg-soft: #161628;
  --bg-card: rgba(255, 255, 255, 0.045);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --glass: rgba(22, 22, 40, 0.55);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text: #e8e8f2;
  --text-soft: #b4b4c8;
  --text-mute: #8a8aa3;
  --accent: #7c5cff;
  --accent-2: #ff5c8a;
  --accent-3: #38d9c9;
  --grad: linear-gradient(135deg, #7c5cff 0%, #ff5c8a 55%, #ffa25c 100%);
  --grad-soft: linear-gradient(135deg, rgba(124, 92, 255, 0.16), rgba(255, 92, 138, 0.12));
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.3);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f4fb;
    --bg-soft: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --glass: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(20, 20, 50, 0.08);
    --text: #1a1a2e;
    --text-soft: #4a4a63;
    --text-mute: #6f6f88;
    --line: rgba(20, 20, 50, 0.09);
    --shadow: 0 18px 50px rgba(60, 60, 120, 0.14);
    --shadow-sm: 0 8px 24px rgba(60, 60, 120, 0.1);
    --grad-soft: linear-gradient(135deg, rgba(124, 92, 255, 0.12), rgba(255, 92, 138, 0.09));
  }
}

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

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

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 12% -8%, rgba(124, 92, 255, 0.22), transparent 62%),
    radial-gradient(760px 480px at 92% 4%, rgba(255, 92, 138, 0.16), transparent 60%),
    radial-gradient(680px 520px at 50% 108%, rgba(56, 217, 201, 0.1), transparent 62%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

a:hover {
  color: var(--accent-2);
}

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

h1,
h2,
h3,
h4 {
  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.7rem);
  letter-spacing: -0.01em;
}

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

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: var(--radius-pill);
  background: var(--grad);
}

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

h4 {
  font-size: 1.02rem;
  color: var(--accent-3);
}

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

li {
  margin: 0.35em 0;
}

li::marker {
  color: var(--accent);
}

::selection {
  background: rgba(124, 92, 255, 0.4);
  color: #fff;
}

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

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

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

header nav > a[aria-label] {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
  position: relative;
  padding-left: 26px;
}

header nav > a[aria-label]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: var(--grad);
  box-shadow: 0 0 16px rgba(124, 92, 255, 0.7);
}

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 li a {
  display: inline-block;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  color: var(--text-soft);
  border: 1px solid transparent;
  transition: all 0.28s var(--ease);
}

header nav ul li a:hover,
header nav ul li a:focus-visible {
  color: var(--text);
  background: var(--bg-card-hover);
  border-color: var(--glass-border);
  transform: translateY(-2px);
}

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

/* ============ Breadcrumb ============ */
main > nav[aria-label="面包屑导航"] ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 0 6px;
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-mute);
}

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

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

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

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

/* ============ Sections ============ */
section {
  margin: 26px 0;
  padding: 30px clamp(18px, 3.5vw, 38px);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
  animation: rise 0.7s var(--ease) both;
}

section:hover {
  border-color: rgba(124, 92, 255, 0.35);
  box-shadow: var(--shadow);
}

section > h2:first-child {
  margin-top: 0;
}

section > h3 {
  margin-top: 1.4em;
}

section > h3:first-of-type {
  margin-top: 0.6em;
}

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

/* ============ Hero ============ */
#hero {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 6vw, 64px) clamp(20px, 4vw, 46px);
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 0.28), rgba(255, 92, 138, 0.18) 55%, rgba(56, 217, 201, 0.14)),
    var(--bg-soft);
  border: 1px solid rgba(124, 92, 255, 0.28);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(60, 30, 140, 0.28);
  margin-top: 18px;
}

#hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 92, 138, 0.4), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
  animation: floaty 12s ease-in-out infinite alternate;
}

#hero::after {
  content: "";
  position: absolute;
  inset: auto auto -50% -15%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(56, 217, 201, 0.28), transparent 65%);
  filter: blur(24px);
  pointer-events: none;
  animation: floaty 15s ease-in-out infinite alternate-reverse;
}

@keyframes floaty {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-24px, 22px, 0) scale(1.08);
  }
}

#hero h1 {
  position: relative;
  z-index: 1;
  background: linear-gradient(120deg, #ffffff 10%, #ffe1ee 45%, #cfe9ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: 0 2px 30px rgba(124, 92, 255, 0.25);
  margin-bottom: 0.55em;
}

@media (prefers-color-scheme: light) {
  #hero h1 {
    background: linear-gradient(120deg, #2a1a5e 10%, #7c2a5a 55%, #0d5a6a 95%);
    -webkit-background-clip: text;
    background-clip: text;
  }
}

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

#hero p:last-child {
  margin-bottom: 0;
  font-size: 0.94rem;
  color: var(--text-mute);
}

/* ============ Articles ============ */
#news article,
#articles > article {
  position: relative;
  margin: 0 0 16px;
  padding: 20px 22px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  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);
}

#news article:last-child,
#articles > article:last-of-type {
  margin-bottom: 0;
}

#news article::before,
#articles > article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: var(--radius-pill);
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

#news article:hover,
#articles > article:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: var(--shadow-sm);
}

#news article:hover::before,
#articles > article:hover::before {
  opacity: 1;
}

#news article h3,
#articles > article h3 {
  margin-bottom: 0.35em;
}

#news article p,
#articles > article p {
  margin-bottom: 0.4em;
  font-size: 0.95rem;
}

#articles > article p:first-of-type {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--text-mute);
  background: var(--grad-soft);
  border: 1px solid var(--glass-border);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 0.7em;
}

#articles > article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-3);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 217, 201, 0.35);
  background: rgba(56, 217, 201, 0.06);
  transition: all 0.3s var(--ease);
}

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

#articles > article a:hover {
  background: rgba(56, 217, 201, 0.16);
  border-color: var(--accent-3);
  color: var(--text);
  transform: translateY(-2px);
}

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

/* Article detail blocks */
#articles section[id^="article-"] {
  margin: 18px 0 0;
  padding: 22px 24px;
  background: var(--grad-soft);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: none;
  animation: none;
}

#articles section[id^="article-"]:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: rgba(124, 92, 255, 0.4);
  border-left-color: var(--accent-2);
}

#articles section[id^="article-"] h4 {
  margin-top: 0;
  color: var(--text);
}

#articles section[id^="article-"] p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

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

#faq details:last-child {
  margin-bottom: 0;
}

#faq details[open] {
  border-color: rgba(124, 92, 255, 0.42);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-sm);
}

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

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

#faq summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--accent-3);
  border-bottom: 2px solid var(--accent-3);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.35s var(--ease);
}

#faq details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

#faq summary:hover {
  color: var(--accent-3);
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============ HowTo steps ============ */
#howto ol {
  list-style: none;
  counter-reset: step;
  padding: 0;
  display: grid;
  gap: 12px;
  margin-top: 0.6em;
}

#howto ol li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 16px 18px 16px 62px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  transition: transform 0.32s var(--ease), border-color 0.32s var(--ease), background 0.32s var(--ease);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.92rem;
  color: #fff;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.4);
}

#howto ol li:hover {
  transform: translateX(6px);
  background: var(--bg-card-hover);
  border-color: rgba(124, 92, 255, 0.4);
}

/* ============ Contact ============ */
#contact p {
  margin-bottom: 0.5em;
  padding-left: 16px;
  position: relative;
}

#contact p::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 10px var(--accent-3);
}

#contact p:last-child {
  margin-bottom: 0;
}

/* ============ 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 li a,
#links li a {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.9rem;
  color: var(--text-soft);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  transition: all 0.3s var(--ease);
}

#sitemap li a:hover,
#links li a:hover {
  color: var(--text);
  background: var(--grad-soft);
  border-color: rgba(124, 92, 255, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.22);
}

/* ============ Legal ============ */
#legal h3 {
  margin-top: 1.2em;
}

#legal h3:first-of-type {
  margin-top: 0.4em;
}

#legal p {
  font-size: 0.93rem;
}

/* ============ Footer ============ */
footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 20px 48px;
  border-top: 1px solid var(--line);
  text-align: center;
}

footer p {
  margin: 0.3em 0;
  font-size: 0.84rem;
  color: var(--text-mute);
}

footer p:last-child {
  margin-top: 0.8em;
  color: var(--text-soft);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ============ Scroll reveal (progressive enhancement) ============ */
@supports (animation-timeline: view()) {
  section {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
  #hero {
    animation: none;
  }
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  header nav {
    gap: 12px;
  }
  header nav ul {
    justify-content: flex-start;
    width: 100%;
  }
  header nav ul li a {
    padding: 6px 11px;
    font-size: 0.85rem;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
    background-attachment: scroll;
  }
  main {
    padding: 0 14px 56px;
  }
  section {
    padding: 22px 16px;
    border-radius: 16px;
    margin: 18px 0;
  }
  #hero {
    border-radius: 20px;
    padding: 28px 18px;
  }
  h2 {
    padding-left: 14px;
    font-size: 1.25rem;
  }
  h2::before {
    width: 4px;
  }
  header nav {
    padding: 10px 14px;
  }
  header nav > a[aria-label] {
    font-size: 1rem;
  }
  header nav ul {
    gap: 2px;
    max-height: 132px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  header nav ul li a {
    padding: 5px 9px;
    font-size: 0.8rem;
  }
  #news article,
  #articles > article {
    padding: 16px;
  }
  #articles section[id^="article-"] {
    padding: 18px 16px;
  }
  #faq summary {
    padding: 14px 44px 14px 16px;
    font-size: 0.94rem;
  }
  #faq details p {
    padding: 0 16px 16px;
  }
  #howto ol li {
    padding: 14px 14px 14px 56px;
  }
  #howto ol li::before {
    left: 12px;
    width: 30px;
    height: 30px;
  }
  #sitemap li a,
  #links li a {
    padding: 7px 13px;
    font-size: 0.84rem;
  }
}

@media (max-width: 380px) {
  header nav ul li a {
    font-size: 0.76rem;
    padding: 4px 8px;
  }
  h1 {
    font-size: 1.5rem;
  }
}

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

@media print {
  body {
    background: #fff;
    color: #000;
  }
  header,
  footer,
  #sitemap,
  #links {
    display: none;
  }
  section {
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
    break-inside: avoid;
  }
  a {
    color: #000;
  }
}