:root {
  --primary: #ff6b35;
  --primary-dark: #e8551f;
  --primary-light: #ff8f66;
  --accent: #2d9cdb;
  --accent-2: #27ae60;
  --bg: #f7f8fa;
  --bg-elevated: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-border: rgba(255, 255, 255, 0.5);
  --text: #1f2430;
  --text-soft: #4a5262;
  --text-muted: #7a8494;
  --border: #e6e9ef;
  --shadow-sm: 0 2px 8px rgba(31, 36, 48, 0.06);
  --shadow-md: 0 8px 28px rgba(31, 36, 48, 0.1);
  --shadow-lg: 0 18px 48px rgba(31, 36, 48, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --header-h: 68px;
  --maxw: 1200px;
  --grad-hero: linear-gradient(135deg, #ff6b35 0%, #ff9457 45%, #ffb347 100%);
  --grad-accent: linear-gradient(135deg, #2d9cdb 0%, #27ae60 100%);
  --grad-card: linear-gradient(160deg, rgba(255, 107, 53, 0.08), rgba(45, 156, 219, 0.06));
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html[data-theme="dark"],
html.dark {
  --primary: #ff7d4d;
  --primary-dark: #ff6b35;
  --primary-light: #ffa37a;
  --accent: #4db3f0;
  --accent-2: #3fce7c;
  --bg: #12151c;
  --bg-elevated: #1a1f29;
  --bg-glass: rgba(26, 31, 41, 0.68);
  --bg-glass-border: rgba(255, 255, 255, 0.08);
  --text: #eef1f6;
  --text-soft: #c3cad6;
  --text-muted: #8b94a5;
  --border: #2a3140;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  --grad-hero: linear-gradient(135deg, #b8431a 0%, #d9662f 45%, #b8741f 100%);
  --grad-card: linear-gradient(160deg, rgba(255, 125, 77, 0.1), rgba(77, 179, 240, 0.08));
}

*,
*::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: -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: var(--bg);
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
  overflow-x: hidden;
}

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

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

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

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

h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); }
h3 { font-size: clamp(1.1rem, 1.9vw, 1.35rem); }
h4 { font-size: 1.05rem; }

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

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

ul li, ol li {
  margin-bottom: 0.45em;
}

strong {
  color: var(--text);
}

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

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

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

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

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

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

.logo-text {
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

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

.main-nav a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  color: var(--text-soft);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.main-nav a:hover {
  background: rgba(255, 107, 53, 0.12);
  color: var(--primary);
  transform: translateY(-2px);
}

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

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

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

.site-search input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  padding: 8px 14px;
  font-size: 0.9rem;
  width: 180px;
  font-family: inherit;
}

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

.site-search button {
  border: none;
  cursor: pointer;
  background: var(--grad-hero);
  color: #fff;
  font-size: 0.88rem;
  padding: 8px 16px;
  font-family: inherit;
  transition: filter 0.25s var(--ease);
}

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

#theme-toggle,
#menu-toggle {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--ease), background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}

#theme-toggle:hover,
#menu-toggle:hover {
  transform: rotate(12deg) scale(1.08);
  border-color: var(--primary);
}

#menu-toggle {
  display: none;
}

/* ============ Breadcrumb ============ */
.breadcrumb {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px 0;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--text-muted);
  opacity: 0.6;
}

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

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

.breadcrumb [aria-current="page"] {
  color: var(--text-soft);
  font-weight: 600;
}

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

.section {
  margin: 48px 0;
  padding: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease), background-color 0.35s var(--ease);
}

.section:hover {
  box-shadow: var(--shadow-md);
}

.section > h2 {
  position: relative;
  padding-left: 18px;
}

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

.section article > h3 {
  margin-top: 1.4em;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}

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

/* ============ Hero ============ */
.hero {
  position: relative;
  margin: 24px 0 48px;
  padding: 48px 36px 32px;
  border-radius: var(--radius-lg);
  background: var(--grad-hero);
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

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

.hero::before {
  width: 320px;
  height: 320px;
  background: rgba(255, 255, 255, 0.35);
  top: -120px;
  right: -80px;
}

.hero::after {
  width: 260px;
  height: 260px;
  background: rgba(45, 156, 219, 0.4);
  bottom: -120px;
  left: -60px;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero h1 {
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}

.hero-lead {
  color: rgba(255, 255, 255, 0.94);
  font-size: 1.02rem;
  max-width: 640px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.25s var(--ease), color 0.25s var(--ease);
  will-change: transform;
}

.btn:hover {
  transform: translateY(-3px);
}

.btn-primary {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.btn-primary:hover {
  color: var(--primary-dark);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.hero-banner {
  position: relative;
  margin-top: 32px;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 2 / 1;
  background: rgba(0, 0, 0, 0.12);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
}

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

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

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

.hero-stats {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.hero-stats li {
  margin: 0;
  padding: 16px 12px;
  text-align: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.35s var(--ease), background-color 0.3s var(--ease);
}

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

.hero-stats strong {
  display: block;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  color: #fff;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.hero-stats span {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.88);
}

/* ============ Article cards ============ */
.article-card {
  padding: 20px 22px;
  margin: 16px 0;
  border-radius: var(--radius-md);
  background: var(--grad-card);
  border: 1px solid var(--border);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.3s var(--ease);
}

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

.article-card h3 {
  margin-top: 0;
  border: none;
  padding: 0;
}

.article-card a {
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.article-card a::after {
  content: "→";
  transition: transform 0.3s var(--ease);
}

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

/* ============ FAQ ============ */
.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.3s var(--ease);
}

.faq-list details[open] {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
  background: var(--bg-elevated);
}

.faq-list summary {
  cursor: pointer;
  padding: 16px 48px 16px 20px;
  font-weight: 600;
  color: var(--text);
  position: relative;
  list-style: none;
  transition: color 0.25s var(--ease);
}

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

.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--primary);
  transition: transform 0.35s var(--ease);
  line-height: 1;
}

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

.faq-list summary:hover {
  color: var(--primary);
}

.faq-list details p {
  margin: 0;
  padding: 0 20px 18px;
  animation: fadeSlide 0.4s var(--ease);
}

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

/* ============ Blockquote ============ */
blockquote {
  margin: 20px 0;
  padding: 18px 22px;
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--grad-card);
}

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

blockquote p:last-child {
  margin-bottom: 0;
}

/* ============ Sitemap links ============ */
#sitemap ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sitemap ul li {
  margin: 0;
}

#sitemap ul a {
  display: inline-block;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-soft);
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

#sitemap ul a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

/* ============ Footer ============ */
#site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 44px 20px 28px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: 32px;
}

.footer-inner h3 {
  font-size: 1rem;
  margin-bottom: 0.8em;
}

.footer-inner p {
  font-size: 0.9rem;
  margin: 0 0 0.5em;
  color: var(--text-muted);
}

.footer-brand strong {
  color: var(--primary);
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  display: inline-block;
  padding: 3px 0;
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateX(4px);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 18px 20px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-bottom p {
  margin: 4px 0;
  color: var(--text-muted);
}

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

.footer-bottom a:hover {
  color: var(--primary);
}

/* ============ Back to top ============ */
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--grad-hero);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
  z-index: 90;
}

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

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

/* ============ Scroll reveal ============ */
.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: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .main-nav ul {
    gap: 0;
  }
  .main-nav a {
    padding: 6px 9px;
    font-size: 0.86rem;
  }
  .site-search input {
    width: 140px;
  }
}

@media (max-width: 860px) {
  :root {
    --header-h: 60px;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
  }

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

  .main-nav {
    order: 4;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease);
  }

  .main-nav.open {
    max-height: 640px;
  }

  .main-nav ul {
    flex-direction: column;
    padding: 10px 0 4px;
    gap: 2px;
  }

  .main-nav a {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
  }

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

  .hero {
    padding: 32px 22px 26px;
  }

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

  .section {
    padding: 24px 20px;
    margin: 32px 0;
    border-radius: var(--radius-md);
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

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

  .header-inner {
    padding: 8px 12px;
  }

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

  .site-search {
    display: none;
  }

  .breadcrumb {
    padding: 10px 14px 0;
  }

  main {
    padding: 0 14px 32px;
  }

  .hero {
    margin: 16px 0 32px;
    padding: 28px 18px 22px;
  }

  .hero-actions {
    gap: 10px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    flex: 1 1 auto;
  }

  .hero-banner {
    aspect-ratio: 16 / 10;
  }

  .hero-stats {
    gap: 10px;
    margin-top: 24px;
  }

  .hero-stats li {
    padding: 12px 8px;
  }

  .section {
    padding: 20px 16px;
    margin: 24px 0;
  }

  .article-card {
    padding: 16px;
  }

  .faq-list summary {
    padding: 14px 44px 14px 16px;
    font-size: 0.95rem;
  }

  .faq-list details p {
    padding: 0 16px 16px;
  }

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

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

/* ============ Dark mode adjustments ============ */
html[data-theme="dark"] .hero,
html.dark .hero {
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .section,
html.dark .section {
  background: var(--bg-elevated);
}

html[data-theme="dark"] .btn-primary,
html.dark .btn-primary {
  background: #fff;
  color: #b8431a;
}

html[data-theme="dark"] .faq-list details,
html.dark .faq-list details {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .faq-list details[open],
html.dark .faq-list details[open] {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .site-search,
html.dark .site-search {
  background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] #theme-toggle,
html[data-theme="dark"] #menu-toggle,
html.dark #theme-toggle,
html.dark #menu-toggle {
  background: rgba(255, 255, 255, 0.06);
}

/* ============ Print ============ */
@media print {
  #site-header,
  #back-to-top,
  .hero-banner,
  .hero-actions,
  .site-search,
  #theme-toggle,
  #menu-toggle {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .section {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
  a {
    color: #000;
    text-decoration: underline;
  }
}