:root {
  --orange: #ff6b35;
  --orange-light: #ffb347;
  --orange-soft: #ffd1a4;
  --orange-pale: #fff3e6;
  --ink: #2b2d42;
  --ink-soft: #4a4d63;
  --text: #33364a;
  --text-muted: #6b6f85;
  --bg: #fdfaf7;
  --bg-alt: #fff7f0;
  --card: #ffffff;
  --card-glass: rgba(255, 255, 255, 0.72);
  --border: rgba(255, 107, 53, 0.16);
  --border-strong: rgba(255, 107, 53, 0.32);
  --shadow-sm: 0 2px 10px rgba(43, 45, 66, 0.06);
  --shadow-md: 0 10px 30px rgba(43, 45, 66, 0.1);
  --shadow-lg: 0 18px 50px rgba(255, 107, 53, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --maxw: 1200px;
}

[data-theme="dark"] {
  --ink: #f3f1ee;
  --ink-soft: #d6d3cf;
  --text: #e6e3df;
  --text-muted: #a8a5a1;
  --bg: #14151c;
  --bg-alt: #1b1d26;
  --card: #21232e;
  --card-glass: rgba(33, 35, 46, 0.72);
  --border: rgba(255, 107, 53, 0.22);
  --border-strong: rgba(255, 179, 71, 0.4);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 18px 50px rgba(255, 107, 53, 0.22);
}

*,
*::before,
*::after {
  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", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255, 179, 71, 0.1), transparent 42%),
    radial-gradient(circle at 88% 24%, rgba(255, 107, 53, 0.08), transparent 46%);
  background-attachment: fixed;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

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

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

a:hover,
a:focus-visible {
  color: var(--orange-light);
}

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

h1 {
  font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.6rem);
}

h2 {
  font-size: clamp(1.35rem, 1.05rem + 1.4vw, 2rem);
}

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

h4 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

.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;
  height: var(--header-h);
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s var(--ease), box-shadow 0.3s var(--ease);
}

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

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--ink);
}

.logo svg {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  transition: transform 0.4s var(--ease);
}

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

.logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(120deg, var(--orange), var(--orange-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

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

.main-nav ul {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav ul::-webkit-scrollbar {
  display: none;
}

.main-nav a {
  display: block;
  padding: 8px 11px;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--orange);
  background: rgba(255, 107, 53, 0.1);
}

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

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

.site-search:focus-within {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.12);
}

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

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

.site-search button {
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(120deg, var(--orange), var(--orange-light));
  transition: filter 0.25s var(--ease);
}

.site-search button:hover {
  filter: brightness(1.08);
}

#theme-toggle,
#menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}

#theme-toggle:hover,
#menu-toggle:hover {
  transform: translateY(-2px) rotate(8deg);
  border-color: var(--border-strong);
}

#menu-toggle {
  display: none;
}

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

main > section,
main > nav,
main > .breadcrumb,
main > .anchor-nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

main > section {
  padding-top: 56px;
  padding-bottom: 8px;
}

main > section > h2 {
  position: relative;
  padding-left: 18px;
  margin-bottom: 1.2em;
}

main > section > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--orange), var(--orange-light));
}

main > section > article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 40px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease), border-color 0.35s var(--ease);
}

main > section > article:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

main > section > article h3 {
  margin-top: 1.4em;
  color: var(--orange);
}

main > section > article h3:first-child {
  margin-top: 0;
}

main > section > article p {
  color: var(--text);
}

/* ============ Hero ============ */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 20px 0;
  display: grid;
  gap: 32px;
}

.hero-carousel {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 1200 / 420;
  background: var(--ink);
}

.hero-carousel .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.8s var(--ease), transform 1.2s var(--ease);
  pointer-events: none;
}

.hero-carousel .slide.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

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

.carousel-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 2;
}

.carousel-prev,
.carousel-next {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.carousel-prev:hover,
.carousel-next:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.08);
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.carousel-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  transition: width 0.35s var(--ease), background 0.35s var(--ease);
}

.carousel-dots .dot.is-active {
  width: 28px;
  background: #fff;
}

.hero-intro {
  max-width: 900px;
}

.hero-intro h1 {
  margin-bottom: 0.5em;
  background: linear-gradient(120deg, var(--orange) 10%, var(--orange-light) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 12px;
  border-radius: var(--radius-md);
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

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

.stat-num {
  font-size: clamp(1.4rem, 1rem + 1.4vw, 2rem);
  font-weight: 800;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

.hero-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 10px 16px;
  display: inline-block;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px dashed var(--border-strong);
}

/* ============ Breadcrumb ============ */
.breadcrumb {
  margin-top: 28px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 8px;
  color: var(--orange-light);
}

.breadcrumb a {
  color: var(--text-muted);
}

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

/* ============ Anchor nav ============ */
.anchor-nav {
  margin-top: 18px;
}

.anchor-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.anchor-nav a {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.anchor-nav a:hover {
  color: #fff;
  background: linear-gradient(120deg, var(--orange), var(--orange-light));
  border-color: transparent;
  transform: translateY(-2px);
}

/* ============ Article cards ============ */
.article-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 16px;
  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::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--orange), var(--orange-light));
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.article-card:hover::before {
  opacity: 1;
}

.article-card h3 {
  margin-top: 0;
  color: var(--ink);
  transition: color 0.25s var(--ease);
}

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

.article-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.8em;
}

.article-card a {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  color: var(--orange);
  background: rgba(255, 107, 53, 0.1);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.article-card a:hover {
  color: #fff;
  background: linear-gradient(120deg, var(--orange), var(--orange-light));
  transform: translateX(4px);
}

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

#faq details[open] {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

#faq summary {
  position: relative;
  padding: 16px 52px 16px 20px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--orange);
  background: rgba(255, 107, 53, 0.12);
  border-radius: 50%;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}

#faq details[open] summary::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
  color: #fff;
  background: linear-gradient(120deg, var(--orange), var(--orange-light));
}

#faq summary:hover {
  color: var(--orange);
  background: rgba(255, 107, 53, 0.05);
}

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

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

/* ============ Sitemap & Links ============ */
#sitemap nav ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

#sitemap nav a,
#links a {
  display: inline-block;
  padding: 7px 16px;
  font-size: 0.86rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

#sitemap nav a:hover,
#links a:hover {
  color: #fff;
  background: linear-gradient(120deg, var(--orange), var(--orange-light));
  border-color: transparent;
  transform: translateY(-2px);
}

/* ============ Footer ============ */
footer {
  margin-top: 64px;
  padding: 56px 20px 32px;
  background: linear-gradient(180deg, transparent, rgba(255, 107, 53, 0.06));
  border-top: 1px solid var(--border);
}

footer > section {
  max-width: var(--maxw);
  margin: 0 auto 24px;
  padding: 22px 24px;
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

footer > section:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

footer > section h2 {
  font-size: 1rem;
  margin-bottom: 0.5em;
  color: var(--orange);
}

footer > section p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

.footer-copy {
  max-width: var(--maxw);
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px dashed var(--border-strong);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============ Back to top ============ */
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s var(--ease);
  z-index: 90;
}

#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#back-to-top:hover {
  transform: translateY(-4px) scale(1.06);
  filter: brightness(1.06);
}

/* ============ Scroll reveal ============ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  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.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .main-nav {
    display: none;
  }

  #menu-toggle {
    display: grid;
  }

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

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

@media (max-width: 720px) {
  :root {
    --header-h: 64px;
  }

  .header-inner {
    padding: 0 14px;
    gap: 10px;
  }

  .logo-text {
    font-size: 1.05rem;
  }

  .site-search {
    display: none;
  }

  .main-nav.is-open {
    display: block;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--card-glass);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 12px;
    animation: fadeSlide 0.3s var(--ease);
  }

  .main-nav.is-open ul {
    flex-direction: column;
    gap: 2px;
  }

  .main-nav.is-open a {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
  }

  main > section {
    padding-top: 40px;
  }

  main > section > article {
    padding: 20px;
    border-radius: var(--radius-md);
  }

  .hero {
    padding: 20px 14px 0;
    gap: 24px;
  }

  .hero-carousel {
    border-radius: var(--radius-lg);
    aspect-ratio: 4 / 3;
  }

  .hero-carousel .slide svg text {
    font-size: 34px;
  }

  .hero-stats {
    gap: 10px;
  }

  .stat {
    padding: 14px 8px;
  }

  .stat-label {
    font-size: 0.76rem;
  }

  .hero-meta {
    display: block;
    text-align: center;
    line-height: 1.6;
  }

  .article-card {
    padding: 18px;
  }

  #faq summary {
    padding: 14px 48px 14px 16px;
    font-size: 0.95rem;
  }

  #faq details p {
    padding: 0 16px 16px;
    font-size: 0.9rem;
  }

  #sitemap nav ul,
  #links ul {
    padding: 16px;
    gap: 8px;
  }

  footer {
    padding: 40px 14px 28px;
  }

  footer > section {
    padding: 18px;
  }

  #back-to-top {
    right: 14px;
    bottom: 18px;
    width: 44px;
    height: 44px;
  }
}

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

  .logo-text {
    display: none;
  }

  .carousel-controls {
    gap: 10px;
    bottom: 10px;
  }

  .carousel-prev,
  .carousel-next {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
  }
}