:root {
  --bg: #f4f6fb;
  --bg-elev: #ffffff;
  --bg-soft: #eef1f9;
  --text: #1a1a2e;
  --text-soft: #4a5568;
  --text-mute: #718096;
  --primary: #5a67d8;
  --primary-2: #7f9cf5;
  --accent: #f6e05e;
  --accent-2: #ed8936;
  --border: rgba(26, 26, 46, 0.1);
  --glass: rgba(255, 255, 255, 0.6);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --shadow: 0 10px 30px rgba(26, 26, 46, 0.08);
  --shadow-lg: 0 20px 50px rgba(26, 26, 46, 0.16);
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 68px;
  --grad-hero: linear-gradient(135deg, #eef1ff 0%, #f6f0ff 45%, #e6f7ff 100%);
  --grad-primary: linear-gradient(135deg, #5a67d8 0%, #7f9cf5 55%, #9f7aea 100%);
  --grad-accent: linear-gradient(135deg, #f6e05e 0%, #ed8936 100%);
  --focus: 0 0 0 3px rgba(127, 156, 245, 0.55);
}

[data-theme="dark"] {
  --bg: #0f1420;
  --bg-elev: #1a1a2e;
  --bg-soft: #161b2a;
  --text: #eef1f9;
  --text-soft: #c3c9d8;
  --text-mute: #8b93a7;
  --primary: #7f9cf5;
  --primary-2: #9f7aea;
  --accent: #f6e05e;
  --accent-2: #ed8936;
  --border: rgba(255, 255, 255, 0.12);
  --glass: rgba(26, 26, 46, 0.55);
  --glass-strong: rgba(26, 26, 46, 0.85);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
  --grad-hero: linear-gradient(135deg, #141a2b 0%, #1a1a2e 50%, #101726 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -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:
    radial-gradient(1200px 600px at 10% -10%, rgba(127, 156, 245, 0.18), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(159, 122, 234, 0.16), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

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

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

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 6px;
}

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

h1 { font-size: clamp(1.6rem, 3.6vw, 2.5rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); font-weight: 700; }
h3 { font-size: clamp(1.1rem, 1.9vw, 1.3rem); font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 600; }

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

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

li { margin-bottom: 0.35em; }

blockquote {
  margin: 0;
  padding: 1.2em 1.4em;
  border-left: 4px solid var(--primary-2);
  background: var(--glass);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

blockquote footer {
  margin-top: 0.6em;
  color: var(--text-mute);
  font-size: 0.9rem;
}

time {
  color: var(--text-mute);
  font-size: 0.86rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============ Header ============ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-strong);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(26, 26, 46, 0.05);
  transition: background 0.4s ease, border-color 0.4s ease;
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--text);
  font-weight: 800;
}

.brand-logo svg {
  border-radius: 10px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-logo:hover svg {
  transform: rotate(-6deg) scale(1.06);
}

.brand-text {
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#main-nav {
  flex: 1;
  min-width: 0;
}

#main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

#main-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  color: var(--text-soft);
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

#main-nav a:hover {
  background: var(--bg-soft);
  color: var(--primary);
  transform: translateY(-1px);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.site-search {
  display: flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 4px 3px 14px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-search:focus-within {
  border-color: var(--primary-2);
  box-shadow: var(--focus);
}

.site-search input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.88rem;
  width: 150px;
  padding: 6px 0;
  outline: none;
}

.site-search input::placeholder {
  color: var(--text-mute);
}

.site-search button {
  border: none;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--grad-primary);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.site-search button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(90, 103, 216, 0.4);
}

#theme-toggle,
#menu-toggle {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease, border-color 0.25s ease;
}

#theme-toggle:hover,
#menu-toggle:hover {
  background: var(--bg-soft);
  color: var(--primary);
  transform: translateY(-1px);
}

#menu-toggle {
  display: none;
}

/* ============ Layout ============ */
main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

main > section,
main > nav {
  margin: 40px 0;
  padding: 36px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: var(--shadow);
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

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

/* ============ Hero ============ */
#hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
  margin-top: 32px;
  padding: 48px;
  background: var(--grad-hero);
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(127, 156, 245, 0.35), transparent 65%);
  pointer-events: none;
  animation: floatBlob 14s ease-in-out infinite;
}

#hero::after {
  content: "";
  position: absolute;
  inset: auto auto -40% -15%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(246, 224, 94, 0.28), transparent 65%);
  pointer-events: none;
  animation: floatBlob 18s ease-in-out infinite reverse;
}

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

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5em;
}

.hero-lead {
  font-size: 1.02rem;
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.25s ease;
}

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(90, 103, 216, 0.35);
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 34px rgba(90, 103, 216, 0.5);
}

.btn-secondary {
  background: var(--glass-strong);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.hero-banner {
  position: relative;
  z-index: 1;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 16 / 10;
  background: var(--bg-elev);
}

.banner-slide {
  position: absolute;
  inset: 0;
  animation: fadeSlide 0.7s ease both;
}

.banner-slide svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: scale(1.04); }
  to { opacity: 1; transform: scale(1); }
}

.banner-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(26, 26, 46, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.banner-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  background: rgba(255, 255, 255, 0.45);
  transition: transform 0.25s ease, background 0.25s ease;
}

.banner-dots button:hover {
  transform: scale(1.2);
}

.banner-dots button[aria-current="true"] {
  background: var(--accent);
  transform: scale(1.25);
}

/* ============ Stats ============ */
#stats {
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 8px;
}

.stat-item {
  padding: 26px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-2);
}

.stat-num {
  display: block;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--text-mute);
}

/* ============ Breadcrumb & Anchor nav ============ */
#breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
}

#breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--text-mute);
}

#breadcrumb li[aria-current="page"] {
  color: var(--text-mute);
}

#anchor-nav h2 {
  font-size: 1.05rem;
  color: var(--text-mute);
  margin-bottom: 0.8em;
}

#anchor-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

#anchor-nav a {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-soft);
  transition: all 0.25s ease;
}

#anchor-nav a:hover {
  background: var(--grad-primary);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(90, 103, 216, 0.35);
}

/* ============ Content sections ============ */
main > section h2 {
  position: relative;
  padding-bottom: 0.5em;
  margin-bottom: 1em;
}

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

main > section h3 {
  margin-top: 1.4em;
  padding-left: 14px;
  border-left: 4px solid var(--primary-2);
}

/* ============ News & Articles ============ */
#news article,
#articles article {
  padding: 22px 24px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

#news article:hover,
#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-2);
}

#news article h3,
#articles article h3 {
  margin-top: 0;
  border-left: none;
  padding-left: 0;
}

#news article h3 a,
#articles article h3 a {
  color: var(--text);
  transition: color 0.25s ease;
}

#news article h3 a:hover,
#articles article h3 a:hover {
  color: var(--primary);
}

#articles article p:last-child a {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 0.86rem;
  font-weight: 600;
  transition: all 0.25s ease;
}

#articles article p:last-child a:hover {
  background: var(--grad-primary);
  color: #fff;
  transform: translateX(3px);
}

/* ============ FAQ ============ */
.faq-item {
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.faq-item:hover {
  border-color: var(--primary-2);
  box-shadow: var(--shadow);
}

.faq-item h3 {
  margin: 0;
  padding: 0;
  border-left: none;
}

.faq-question {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 18px 52px 18px 22px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
  position: relative;
  transition: background 0.25s ease, color 0.25s ease;
}

.faq-question:hover {
  background: var(--bg-soft);
  color: var(--primary);
}

.faq-question::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--primary-2);
  transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"]::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
}

.faq-answer {
  padding: 0 22px 20px;
  animation: fadeIn 0.35s ease both;
}

.faq-answer p {
  margin: 0;
}

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

/* ============ Contact / misc lists ============ */
#contact p {
  padding: 10px 16px;
  margin: 0 0 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

#contact p:hover {
  transform: translateX(4px);
  border-color: var(--primary-2);
}

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

#sitemap a,
#links a {
  display: block;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-soft);
  transition: all 0.25s ease;
}

#sitemap a:hover,
#links a:hover {
  background: var(--grad-primary);
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(90, 103, 216, 0.35);
}

#testimonials blockquote {
  margin-bottom: 18px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#testimonials blockquote:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ============ Footer ============ */
#site-footer {
  margin-top: 60px;
  padding: 48px 24px 32px;
  background: var(--glass-strong);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-top: 1px solid var(--border);
}

#site-footer > section {
  max-width: 1240px;
  margin: 0 auto 26px;
}

#site-footer h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5em;
}

#site-footer p {
  font-size: 0.9rem;
  color: var(--text-mute);
}

.footer-copy {
  max-width: 1240px;
  margin: 30px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-mute);
}

/* ============ Back to top ============ */
#back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease, color 0.25s ease;
}

#back-to-top:hover {
  background: var(--grad-primary);
  color: #fff;
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 14px 30px rgba(90, 103, 216, 0.45);
}

/* ============ Scroll reveal ============ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@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;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ============ Responsive ============ */
@media (max-width: 1080px) {
  #main-nav a { padding: 7px 9px; font-size: 0.86rem; }
  .site-search input { width: 110px; }
  #hero { padding: 36px; gap: 26px; }
}

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; padding: 12px 18px; }
  #menu-toggle { display: inline-block; }
  #main-nav {
    order: 3;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }
  #main-nav.is-open {
    max-height: 640px;
    overflow-y: auto;
  }
  #main-nav ul {
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
  }
  #main-nav a { display: block; }
  .header-tools { margin-left: auto; }
  .site-search { display: none; }
  #hero {
    grid-template-columns: 1fr;
    padding: 32px 24px;
  }
  .hero-banner { order: -1; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  main > section,
  main > nav { padding: 26px 22px; margin: 28px 0; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  main { padding: 0 14px; }
  .header-inner { padding: 10px 14px; gap: 10px; }
  .brand-text { font-size: 1.15rem; }
  #hero { padding: 24px 18px; }
  .hero-actions { flex-direction: column; }
  .btn-primary,
  .btn-secondary { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-item { padding: 18px 10px; }
  main > section,
  main > nav { padding: 22px 16px; margin: 22px 0; border-radius: 14px; }
  #sitemap ul,
  #links ul { grid-template-columns: 1fr 1fr; }
  #back-to-top {
    right: 14px;
    bottom: 14px;
    padding: 10px 14px;
    font-size: 0.8rem;
  }
  #site-footer { padding: 32px 16px 24px; }
}

@media (min-width: 1400px) {
  .header-inner,
  main,
  #site-footer > section,
  .footer-copy { max-width: 1320px; }
}