:root {
  --bg: #f4f6fb;
  --bg-alt: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --border: rgba(31, 41, 55, 0.1);
  --text: #1f2937;
  --text-soft: #4b5563;
  --text-mute: #6b7280;
  --brand: #1f2937;
  --accent: #f59e0b;
  --accent-2: #ec4899;
  --accent-3: #6366f1;
  --grad: linear-gradient(135deg, #1f2937 0%, #374151 45%, #4b5563 100%);
  --grad-accent: linear-gradient(120deg, #f59e0b 0%, #ec4899 55%, #6366f1 100%);
  --shadow-sm: 0 2px 8px rgba(17, 24, 39, 0.06);
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.1);
  --shadow-lg: 0 24px 60px rgba(17, 24, 39, 0.16);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --blur: saturate(160%) blur(14px);
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f16;
    --bg-alt: #111722;
    --surface: rgba(24, 32, 45, 0.66);
    --surface-solid: #161d29;
    --border: rgba(255, 255, 255, 0.1);
    --text: #e8eef7;
    --text-soft: #b7c2d0;
    --text-mute: #8b97a7;
    --brand: #e8eef7;
    --grad: linear-gradient(135deg, #0f1622 0%, #1a2333 50%, #223046 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
  }
}

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

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, 0.14), transparent 60%),
    radial-gradient(1000px 520px at 100% 0%, rgba(236, 72, 153, 0.12), transparent 55%),
    radial-gradient(900px 500px at 50% 100%, rgba(245, 158, 11, 0.1), transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}

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

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

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

h1, h2, h3 {
  line-height: 1.3;
  color: var(--text);
  letter-spacing: 0.2px;
}

h1 {
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  font-weight: 800;
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  font-weight: 750;
  margin: 0 0 1rem;
  position: relative;
  padding-left: 18px;
}

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

h3 {
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  font-weight: 700;
  margin: 1.6rem 0 0.7rem;
}

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

strong {
  color: var(--text);
  font-weight: 700;
}

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

li {
  margin: 0.35rem 0;
}

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

hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

::selection {
  background: rgba(236, 72, 153, 0.28);
  color: var(--text);
}

/* ===== Header ===== */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.6rem);
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  animation: slideDown 0.6s var(--ease) both;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

#site-header .brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  min-width: 0;
}

#site-header .brand svg {
  flex: 0 0 auto;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(31, 41, 55, 0.35);
  transition: transform 0.5s var(--ease);
}

#site-header .brand:hover svg {
  transform: rotate(-8deg) scale(1.06);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text);
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-slogan {
  font-size: 0.78rem;
  color: var(--text-mute);
  letter-spacing: 0.4px;
  padding-left: 0.6rem;
  border-left: 1px solid var(--border);
}

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

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

#site-header nav a:hover {
  color: #fff;
  background: var(--grad-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(236, 72, 153, 0.3);
}

/* ===== Main layout ===== */
main {
  display: block;
  width: 100%;
}

main > section,
main > nav {
  width: min(var(--maxw), calc(100% - 2rem));
  margin: 0 auto 2.4rem;
}

main > section {
  padding: clamp(1.4rem, 3vw, 2.4rem);
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fadeUp 0.8s var(--ease) both;
  animation-timeline: view();
  animation-range: entry 0% cover 22%;
}

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

@supports not (animation-timeline: view()) {
  main > section {
    animation: none;
  }
}

main > section:hover {
  border-color: rgba(236, 72, 153, 0.28);
  box-shadow: var(--shadow-lg);
  transition: box-shadow 0.5s var(--ease), border-color 0.5s var(--ease);
}

/* ===== Banner ===== */
#banner {
  position: relative;
  overflow: hidden;
  margin-top: 1.6rem;
  padding: clamp(1.8rem, 4vw, 3.2rem);
  border-radius: var(--radius-lg);
  color: #f9fafb;
  background: var(--grad);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg);
}

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

#banner::before {
  width: 420px;
  height: 420px;
  top: -180px;
  right: -120px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.75), transparent 70%);
  animation: floaty 12s ease-in-out infinite;
}

#banner::after {
  width: 380px;
  height: 380px;
  bottom: -200px;
  left: -100px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.75), transparent 70%);
  animation: floaty 15s ease-in-out infinite reverse;
}

@keyframes floaty {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-24px, 20px, 0) scale(1.08); }
}

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

#banner h1 {
  color: #ffffff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

#banner p {
  color: rgba(249, 250, 251, 0.86);
  max-width: 78ch;
}

#banner strong {
  color: var(--accent);
}

/* ===== Carousel ===== */
.carousel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.6rem 0;
}

.carousel figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.carousel figure:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.42);
}

.carousel figure svg {
  display: block;
  width: 100%;
  height: auto;
}

.carousel figcaption {
  padding: 0.7rem 1rem;
  font-size: 0.88rem;
  color: rgba(249, 250, 251, 0.82);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== Stats ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.9rem;
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
}

.stats li {
  margin: 0;
  padding: 1rem 0.9rem;
  text-align: center;
  font-size: 0.86rem;
  color: rgba(249, 250, 251, 0.8);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  transition: transform 0.4s var(--ease), background 0.4s var(--ease);
}

.stats li:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.16);
}

.stats .num {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Breadcrumb & anchor nav ===== */
main > nav {
  padding: 0.6rem 0.2rem;
}

main > nav ol,
main > nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.86rem;
}

main > nav ol li,
main > nav ul li {
  display: inline-flex;
  align-items: center;
  margin: 0;
  color: var(--text-mute);
}

main > nav ol li:not(:last-child)::after {
  content: "/";
  margin: 0 0.5rem;
  color: var(--text-mute);
  opacity: 0.6;
}

main > nav ul {
  gap: 0.5rem;
}

main > nav ul a {
  display: inline-block;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  font-size: 0.84rem;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  transition: all 0.3s var(--ease);
}

main > nav ul a:hover {
  color: #fff;
  background: var(--grad-accent);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(236, 72, 153, 0.28);
}

/* ===== Blockquote ===== */
blockquote {
  margin: 1rem 0;
  padding: 1rem 1.2rem;
  background: var(--surface-solid);
  border-left: 4px solid var(--accent-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

blockquote:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow);
}

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

/* ===== Articles / cards ===== */
#articles {
  display: grid;
  gap: 1rem;
}

#articles > article {
  position: relative;
  padding: 1.2rem 1.3rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease),
    border-color 0.45s var(--ease);
}

#articles > article::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--grad-accent);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
  mix-blend-mode: overlay;
}

#articles > article:hover {
  transform: translateY(-5px);
  border-color: rgba(236, 72, 153, 0.4);
  box-shadow: var(--shadow-lg);
}

#articles > article:hover::after {
  opacity: 0.07;
}

#articles > article h3 {
  margin-top: 0;
}

#articles > article p:first-of-type {
  font-size: 0.82rem;
  color: var(--text-mute);
  letter-spacing: 0.3px;
}

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

#articles > article a:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(236, 72, 153, 0.35);
  color: #fff;
}

/* ===== News ===== */
#news article {
  padding: 1rem 1.2rem;
  margin-bottom: 0.9rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

#news article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

#news article h3 {
  margin-top: 0;
}

#news article p:first-of-type {
  font-size: 0.82rem;
  color: var(--text-mute);
}

/* ===== FAQ ===== */
#faq details {
  margin-bottom: 0.7rem;
  padding: 0.2rem 1.1rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

#faq details:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: var(--shadow);
}

#faq details[open] {
  border-color: rgba(236, 72, 153, 0.4);
  box-shadow: var(--shadow);
}

#faq summary {
  position: relative;
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1.8rem 0.85rem 0;
  font-weight: 650;
  color: var(--text);
  transition: color 0.3s var(--ease);
}

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 0.2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  border-radius: 50%;
  background: var(--grad-accent);
  transition: transform 0.4s var(--ease);
}

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

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

#faq details p {
  margin: 0 0 0.9rem;
  padding-top: 0.2rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.8rem;
  animation: fadeIn 0.4s var(--ease) both;
}

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

/* ===== HowTo ===== */
#howto ol {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

#howto ol li {
  position: relative;
  margin: 0 0 0.7rem;
  padding: 0.85rem 1rem 0.85rem 3.2rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text-soft);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

#howto ol li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  border-radius: 50%;
  background: var(--grad-accent);
  box-shadow: 0 6px 14px rgba(236, 72, 153, 0.3);
}

#howto ol li:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow);
}

/* ===== Contact ===== */
#contact ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

#contact ul li {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-size: 0.92rem;
  color: var(--text-soft);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}

#contact ul li:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.35);
}

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

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

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

#sitemap ul a:hover,
#links ul a:hover {
  color: #fff;
  background: var(--grad-accent);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(236, 72, 153, 0.3);
}

/* ===== Legal & meta ===== */
#legal h2,
#meta-info h2 {
  margin-top: 1.4rem;
}

#meta-info ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

#meta-info ul li {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* ===== Footer ===== */
footer {
  margin-top: 2rem;
  padding: 2rem clamp(1rem, 4vw, 2.6rem) 3.5rem;
  text-align: center;
  color: var(--text-mute);
  font-size: 0.9rem;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-top: 1px solid var(--border);
}

footer p {
  margin: 0.4rem 0;
  color: var(--text-mute);
}

footer a {
  color: var(--text-soft);
  transition: color 0.3s var(--ease);
}

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

/* ===== Back to top ===== */
#back-to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 200;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  border-radius: 50%;
  background: var(--grad-accent);
  box-shadow: 0 12px 28px rgba(236, 72, 153, 0.4);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

#back-to-top:hover {
  color: #fff;
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 18px 38px rgba(236, 72, 153, 0.5);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  #site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  #site-header nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #site-header nav::-webkit-scrollbar {
    display: none;
  }

  #site-header nav ul {
    flex-wrap: nowrap;
    width: max-content;
    padding-bottom: 0.2rem;
  }

  .brand-slogan {
    border-left: 0;
    padding-left: 0;
    width: 100%;
  }
}

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

  main > section,
  main > nav {
    width: calc(100% - 1.2rem);
    margin-bottom: 1.6rem;
  }

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

  #banner {
    margin-top: 1rem;
    padding: 1.4rem 1.1rem;
    border-radius: var(--radius);
  }

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 5px;
  }

  .carousel {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  #articles > article {
    padding: 1rem;
  }

  #howto ol li {
    padding-left: 2.9rem;
  }

  #back-to-top {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 0.7rem;
  }
}

@media (hover: none) {
  #articles > article:hover,
  #news article:hover,
  .carousel figure:hover,
  #howto ol li:hover,
  blockquote:hover {
    transform: none;
  }
}

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

@media print {
  #site-header,
  #back-to-top,
  footer {
    display: none;
  }

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

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