:root {
  --bg: #ffffff;
  --bg-soft: #f4f5fb;
  --fg: #1a1a2e;
  --fg-soft: #5a5a72;
  --accent: #e94560;
  --accent-2: #f5c518;
  --accent-3: #7b5cff;
  --card: rgba(255, 255, 255, 0.65);
  --card-solid: #f7f7fb;
  --border: rgba(26, 26, 46, 0.10);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.75);
  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 26, 46, 0.10);
  --shadow-lg: 0 18px 48px rgba(26, 26, 46, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --gradient-hero: linear-gradient(135deg, #e94560 0%, #7b5cff 55%, #f5c518 100%);
  --gradient-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.10), rgba(123, 92, 255, 0.10) 55%, rgba(245, 197, 24, 0.10));
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #10101c;
  --bg-soft: #17172a;
  --fg: #ececf5;
  --fg-soft: #a0a0b8;
  --accent: #ff5f7a;
  --accent-2: #f5c518;
  --accent-3: #9d86ff;
  --card: rgba(28, 28, 46, 0.62);
  --card-solid: #1c1c2e;
  --border: rgba(236, 236, 245, 0.12);
  --glass: rgba(28, 28, 46, 0.55);
  --glass-border: rgba(236, 236, 245, 0.14);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  --gradient-hero: linear-gradient(135deg, #ff5f7a 0%, #9d86ff 55%, #f5c518 100%);
  --gradient-soft: linear-gradient(135deg, rgba(255, 95, 122, 0.16), rgba(157, 134, 255, 0.16) 55%, rgba(245, 197, 24, 0.14));
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.8;
  font-size: 16px;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vw 60vw at 12% -10%, rgba(233, 69, 96, 0.14), transparent 60%),
    radial-gradient(50vw 50vw at 92% 8%, rgba(123, 92, 255, 0.14), transparent 60%),
    radial-gradient(50vw 50vw at 50% 110%, rgba(245, 197, 24, 0.10), transparent 60%);
  pointer-events: none;
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(60vw 60vw at 12% -10%, rgba(255, 95, 122, 0.18), transparent 60%),
    radial-gradient(50vw 50vw at 92% 8%, rgba(157, 134, 255, 0.20), transparent 60%),
    radial-gradient(50vw 50vw at 50% 110%, rgba(245, 197, 24, 0.10), transparent 60%);
}

img,
svg {
  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);
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--accent-3);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

::selection {
  background: var(--accent);
  color: #fff;
}

.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 ============ */
header#site-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);
  transition: box-shadow 0.35s var(--ease), background-color 0.35s var(--ease);
}

header#site-header.scrolled {
  box-shadow: var(--shadow-md);
  background: var(--glass);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo {
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease);
}

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

.brand-text strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.3;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.brand-text span {
  display: block;
  font-size: 12px;
  color: var(--fg-soft);
  line-height: 1.4;
}

#main-nav {
  flex: 1 1 auto;
}

#main-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

#main-nav a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--fg);
  border-radius: 999px;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

#main-nav a:hover {
  background: var(--gradient-soft);
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
}

.header-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.site-search {
  display: flex;
  gap: 6px;
}

.site-search input {
  padding: 7px 12px;
  width: 150px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--fg);
  font-size: 13px;
  font-family: inherit;
  transition: width 0.35s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.site-search input::placeholder {
  color: var(--fg-soft);
  opacity: 0.8;
}

.site-search input:focus {
  width: 200px;
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
}

.site-search button,
#theme-toggle,
#menu-toggle {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--fg);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.site-search button:hover,
#theme-toggle:hover,
#menu-toggle:hover {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

#menu-toggle {
  display: none;
}

/* ============ Hero ============ */
.hero {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 72px 24px 56px;
  text-align: center;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-soft);
  border-radius: inherit;
  z-index: -1;
}

.hero::after {
  content: "";
  position: absolute;
  top: -40%;
  left: 50%;
  width: 720px;
  height: 720px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(233, 69, 96, 0.22), transparent 62%);
  filter: blur(20px);
  z-index: -1;
  pointer-events: none;
  animation: heroPulse 9s ease-in-out infinite;
}

@keyframes heroPulse {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

.hero-slider {
  position: relative;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide {
  display: none;
  width: 100%;
  animation: fadeUp 0.7s var(--ease);
}

.slide.is-active {
  display: block;
}

.slide h2 {
  font-size: clamp(24px, 3.4vw, 40px);
  line-height: 1.35;
  margin-bottom: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.slide p {
  max-width: 780px;
  margin: 0 auto;
  color: var(--fg-soft);
  font-size: clamp(15px, 1.4vw, 18px);
}

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

.hero-actions {
  margin: 34px 0 26px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 13px 32px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.5px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.btn-primary {
  background: var(--gradient-hero);
  color: #fff;
  box-shadow: 0 10px 26px rgba(233, 69, 96, 0.35);
}

.btn-primary:hover {
  color: #fff;
  text-decoration: none;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 34px rgba(233, 69, 96, 0.45);
}

.btn-secondary {
  background: var(--glass);
  color: var(--fg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-md);
}

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

.stat {
  padding: 20px 12px;
  border-radius: var(--radius-md);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.stat:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.stat-num {
  display: block;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 800;
  line-height: 1.2;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--fg-soft);
}

/* ============ Breadcrumb ============ */
.breadcrumb {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-soft);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--fg-soft);
  opacity: 0.6;
}

.breadcrumb a {
  color: var(--fg-soft);
}

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

/* ============ Sections ============ */
.section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 24px;
  border-top: 1px solid var(--border);
}

.section h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.4;
  margin-bottom: 22px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.section h2 {
  position: relative;
  font-size: clamp(21px, 2.4vw, 28px);
  line-height: 1.4;
  margin-bottom: 20px;
  padding-left: 16px;
  font-weight: 700;
}

.section h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 5px;
  border-radius: 999px;
  background: var(--gradient-hero);
}

.section h3 {
  font-size: clamp(17px, 1.7vw, 20px);
  margin: 26px 0 10px;
  color: var(--fg);
  font-weight: 700;
}

.section h4 {
  font-size: 16px;
  margin: 18px 0 8px;
  color: var(--fg-soft);
  font-weight: 600;
}

.section p {
  margin-bottom: 14px;
  color: var(--fg);
  overflow-wrap: break-word;
}

.section .lead {
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--fg-soft);
  padding: 20px 24px;
  border-radius: var(--radius-md);
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.section ul,
.section ol {
  margin: 0 0 18px 24px;
}

.section li {
  margin-bottom: 8px;
  padding-left: 4px;
}

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

/* ============ Cards / Articles ============ */
.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 18px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(233, 69, 96, 0.35);
}

.article-card h3 {
  margin-top: 0;
  font-size: 19px;
}

.article-card:hover h3 {
  color: var(--accent);
}

.article-card .meta {
  font-size: 13px;
  color: var(--fg-soft);
  margin-bottom: 8px;
}

.article-card .summary {
  color: var(--fg-soft);
}

.article-card a {
  display: inline-block;
  margin-top: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.25s var(--ease);
}

.article-card a:hover {
  transform: translateX(4px);
  text-decoration: none;
}

/* ============ Details / FAQ ============ */
details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  margin-bottom: 12px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

details:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(123, 92, 255, 0.35);
}

details[open] {
  border-color: rgba(233, 69, 96, 0.35);
}

details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--fg);
  list-style: none;
  position: relative;
  padding-right: 28px;
  transition: color 0.25s var(--ease);
}

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

details summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.3s var(--ease);
}

details[open] summary::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
}

details summary:hover {
  color: var(--accent);
}

details p {
  margin-top: 12px;
  color: var(--fg-soft);
  animation: fadeUp 0.4s var(--ease);
}

/* ============ Blockquote ============ */
blockquote {
  position: relative;
  border-left: 4px solid transparent;
  border-image: var(--gradient-hero) 1;
  padding: 14px 20px;
  margin: 14px 0;
  background: var(--card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

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

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

/* ============ Contact ============ */
.contact-list {
  list-style: none;
  margin-left: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 24px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.contact-list li {
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
  transition: padding-left 0.25s var(--ease);
}

.contact-list li:last-child {
  border-bottom: none;
}

.contact-list li:hover {
  padding-left: 6px;
}

/* ============ Footer ============ */
footer#site-footer {
  position: relative;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 48px 24px 32px;
  overflow: hidden;
}

footer#site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-soft);
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.footer-inner h2 {
  font-size: 16px;
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--fg);
}

.footer-inner p {
  font-size: 13px;
  color: var(--fg-soft);
  margin-bottom: 6px;
}

.footer-inner a {
  color: var(--accent);
}

.copyright {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 13px;
  color: var(--fg-soft);
  padding-top: 24px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

/* ============ Back to top ============ */
#back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-hero);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.9);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  z-index: 200;
  box-shadow: var(--shadow-md);
}

#back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

#back-to-top:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: var(--shadow-lg);
}

/* ============ Reveal animations ============ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ============ Responsive ============ */
@media (max-width: 1080px) {
  #main-nav ul {
    gap: 2px;
  }

  #main-nav a {
    padding: 6px 9px;
    font-size: 13px;
  }

  .site-search input {
    width: 120px;
  }

  .site-search input:focus {
    width: 160px;
  }
}

@media (max-width: 900px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .header-inner {
    padding: 10px 16px;
    gap: 12px;
  }

  #main-nav {
    display: none;
    width: 100%;
    order: 3;
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 6px;
  }

  #main-nav.open {
    display: block;
    animation: fadeUp 0.35s var(--ease);
  }

  #main-nav ul {
    flex-direction: column;
    gap: 4px;
    padding: 6px 0;
    align-items: stretch;
  }

  #main-nav a {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
  }

  #menu-toggle {
    display: inline-block;
  }

  .header-tools {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .site-search {
    flex: 1 1 100%;
    order: 2;
  }

  .site-search input {
    width: 100%;
    flex: 1;
  }

  .site-search input:focus {
    width: 100%;
  }

  .hero {
    padding: 48px 16px 40px;
  }

  .hero-slider {
    min-height: 210px;
  }

  .section {
    padding: 40px 16px;
  }

  .breadcrumb {
    padding: 0 16px;
  }

  .article-card {
    padding: 20px;
  }

  details {
    padding: 16px 18px;
  }

  footer#site-footer {
    padding: 36px 16px 24px;
  }

  #back-to-top {
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
}

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

  .brand-text span {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
  }

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

  .stat {
    padding: 16px 8px;
  }

  .section ul,
  .section ol {
    margin-left: 18px;
  }

  .section .lead {
    padding: 16px 18px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  header#site-header,
  footer#site-footer,
  #back-to-top,
  .hero-actions,
  .hero-stats {
    display: none !important;
  }

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

  body::before {
    display: none;
  }

  .section {
    border-top: none;
    page-break-inside: avoid;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}