:root {
  --primary: #e94560;
  --primary-dark: #c73550;
  --primary-light: #ff6b81;
  --accent: #f0c040;
  --accent-2: #533483;
  --bg: #f7f8fc;
  --bg-elevated: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.65);
  --bg-glass-strong: rgba(255, 255, 255, 0.85);
  --text: #1a1a2e;
  --text-secondary: #4a4a68;
  --text-muted: #7a7a95;
  --border: rgba(26, 26, 46, 0.08);
  --border-strong: rgba(26, 26, 46, 0.14);
  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 26, 46, 0.1);
  --shadow-lg: 0 16px 48px rgba(26, 26, 46, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --header-h: 72px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #533483 100%);
  --gradient-primary: linear-gradient(135deg, #e94560 0%, #533483 100%);
  --gradient-accent: linear-gradient(135deg, #f0c040 0%, #e94560 100%);
  --gradient-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.08) 0%, rgba(83, 52, 131, 0.08) 100%);
}

[data-theme="dark"] {
  --bg: #0d0d1a;
  --bg-elevated: #16162a;
  --bg-glass: rgba(22, 22, 42, 0.65);
  --bg-glass-strong: rgba(22, 22, 42, 0.88);
  --text: #f0f0f8;
  --text-secondary: #b8b8d0;
  --text-muted: #8888a8;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
  --gradient-hero: linear-gradient(135deg, #0d0d1a 0%, #16213e 40%, #3a2260 100%);
  --gradient-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.12) 0%, rgba(83, 52, 131, 0.12) 100%);
}

*,
*::before,
*::after {
  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", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

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

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

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

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.35;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.6rem, 3.4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.35rem); }

p {
  color: var(--text-secondary);
  margin-bottom: 0.85em;
}

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

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

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

/* ============ HEADER ============ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition), background var(--transition);
}

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

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-logo svg {
  border-radius: 10px;
  transition: transform var(--transition);
}

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

.brand-logo:hover {
  color: var(--text);
}

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

#main-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

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

#main-nav a {
  display: block;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

#main-nav a:hover {
  background: var(--gradient-soft);
  color: var(--primary);
}

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

.header-tools form {
  display: flex;
  align-items: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.header-tools form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
}

.header-tools input[type="search"] {
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text);
  width: 170px;
  outline: none;
  font-family: inherit;
}

.header-tools input[type="search"]::placeholder {
  color: var(--text-muted);
}

.header-tools button {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition), color var(--transition);
}

.header-tools form button[type="submit"] {
  background: var(--gradient-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0;
}

.header-tools form button[type="submit"]:hover {
  filter: brightness(1.1);
}

#theme-toggle,
#menu-toggle {
  background: var(--bg-glass);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
}

#theme-toggle:hover,
#menu-toggle:hover {
  background: var(--gradient-soft);
  color: var(--primary);
  border-color: var(--primary);
}

#menu-toggle {
  display: none;
}

/* ============ MAIN LAYOUT ============ */
main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

main > section {
  padding: 64px 0;
}

main > section + section {
  border-top: 1px solid var(--border);
}

main > section > h2 {
  position: relative;
  margin-bottom: 32px;
  padding-left: 20px;
}

main > section > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 6px;
  border-radius: 3px;
  background: var(--gradient-primary);
}

/* ============ HERO ============ */
#hero {
  padding: 40px 0 56px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  border-top: none !important;
}

.hero-slider {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--gradient-hero);
  min-height: 260px;
}

.hero-slider .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

.hero-slider .slide.active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
}

.hero-slider .slide svg {
  width: 100%;
  height: auto;
  min-height: 260px;
  object-fit: cover;
}

.hero-content {
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 48px);
  box-shadow: var(--shadow-md);
}

.hero-content h1 {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin-bottom: 20px;
}

.hero-content > p {
  font-size: 1.02rem;
  max-width: 68ch;
  margin-bottom: 28px;
}

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

.stat {
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.stat:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

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

.stat span:last-child {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.cta-btn {
  display: inline-block;
  padding: 14px 36px;
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(233, 69, 96, 0.35);
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.cta-btn:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(233, 69, 96, 0.45);
  filter: brightness(1.08);
}

/* ============ BREADCRUMB ============ */
#breadcrumb {
  padding: 0 0 8px !important;
  border-top: none !important;
}

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

#breadcrumb li {
  display: flex;
  align-items: center;
  gap: 8px;
}

#breadcrumb li + li::before {
  content: "/";
  color: var(--text-muted);
  opacity: 0.5;
}

#breadcrumb a {
  color: var(--text-secondary);
}

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

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

/* ============ ARTICLES / CARDS ============ */
#about article,
#products article,
#solutions article,
#cases article,
#news article,
#articles article,
#faq article,
#howto article,
#contact article {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 36px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}

#about article:hover,
#products article:hover,
#solutions article:hover,
#cases article:hover,
#news article:hover,
#faq article:hover,
#howto article:hover,
#contact article:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

#about h3,
#products h3,
#solutions h3,
#cases h3,
#news h3,
#articles h3,
#faq h3,
#howto h3,
#contact h3 {
  margin-top: 28px;
  margin-bottom: 10px;
  padding-left: 14px;
  position: relative;
}

#about h3:first-child,
#products h3:first-child,
#solutions h3:first-child,
#cases h3:first-child,
#news h3:first-child,
#faq h3:first-child,
#howto h3:first-child,
#contact h3:first-child {
  margin-top: 0;
}

#about h3::before,
#products h3::before,
#solutions h3::before,
#cases h3::before,
#news h3::before,
#articles h3::before,
#faq h3::before,
#howto h3::before,
#contact h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  bottom: 0.28em;
  width: 4px;
  border-radius: 2px;
  background: var(--gradient-primary);
}

/* ============ ARTICLES GRID ============ */
#articles {
  display: block;
}

#articles > h2 {
  margin-bottom: 32px;
}

#articles article {
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

#articles article::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-soft);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

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

#articles article:hover::after {
  opacity: 1;
}

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

#articles article p:nth-of-type(1) {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

#articles article a {
  display: inline-block;
  margin-top: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--gradient-soft);
  border: 1px solid var(--border-strong);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

#articles article a:hover {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  transform: translateX(4px);
}

/* ============ NEWS ============ */
#news article {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#news h3 + p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ============ CASES / BLOCKQUOTE ============ */
blockquote {
  margin-top: 24px;
  padding: 20px 24px;
  background: var(--gradient-soft);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

blockquote p {
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

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

/* ============ FAQ ============ */
#faq article {
  display: grid;
  gap: 8px;
}

#faq h3 {
  margin-top: 20px;
  cursor: default;
  transition: color var(--transition);
}

#faq h3:hover {
  color: var(--primary);
}

#faq h3:first-child {
  margin-top: 0;
}

#faq p {
  padding-left: 14px;
  border-left: 2px solid var(--border);
  transition: border-color var(--transition);
}

#faq h3:hover + p {
  border-color: var(--primary);
}

/* ============ HOWTO ============ */
#howto ol {
  counter-reset: step;
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 14px 18px 14px 60px;
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: transform var(--transition), border-color var(--transition);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

#howto ol li:hover {
  transform: translateX(4px);
  border-color: var(--primary);
}

/* ============ CONTACT ============ */
#contact article p {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

#contact article p:last-child {
  border-bottom: none;
}

/* ============ SITEMAP & LINKS ============ */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sitemap li a,
#links li a {
  display: inline-block;
  padding: 8px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition), transform var(--transition), border-color var(--transition);
}

#sitemap li a:hover,
#links li a:hover {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
}

/* ============ FOOTER ============ */
#site-footer {
  margin-top: 40px;
  background: var(--gradient-hero);
  color: rgba(255, 255, 255, 0.85);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 56px 24px 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

#site-footer h2 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 14px;
  position: relative;
  padding-bottom: 10px;
}

#site-footer h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: var(--gradient-accent);
}

#site-footer h3 {
  font-size: 0.92rem;
  color: var(--accent);
  margin: 14px 0 4px;
}

#site-footer p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.copyright {
  grid-column: 1 / -1;
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem !important;
  color: rgba(255, 255, 255, 0.55) !important;
  margin-top: 8px;
}

/* ============ BACK TO TOP ============ */
#back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 0;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition), filter var(--transition);
}

#back-to-top::before {
  content: "↑";
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
}

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

#back-to-top:hover {
  filter: brightness(1.12);
  transform: translateY(-3px);
}

/* ============ SCROLL ANIMATION ============ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

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

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

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  #main-nav ul {
    gap: 0;
  }

  #main-nav a {
    padding: 8px 9px;
    font-size: 0.84rem;
  }

  .header-tools input[type="search"] {
    width: 130px;
  }
}

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

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

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

  #main-nav {
    order: 3;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

  #main-nav.open {
    max-height: 480px;
    padding-bottom: 12px;
  }

  #main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    overflow-x: visible;
  }

  #main-nav a {
    padding: 12px 16px;
    font-size: 0.95rem;
  }

  .header-tools {
    margin-left: auto;
  }

  .header-tools form {
    display: none;
  }

  main {
    padding: 0 16px;
  }

  main > section {
    padding: 44px 0;
  }

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

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

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

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

  .brand-logo span {
    font-size: 0.92rem;
  }

  .brand-logo svg {
    width: 34px;
    height: 34px;
  }

  #theme-toggle {
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  #menu-toggle {
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .hero-content {
    padding: 22px 18px;
  }

  .hero-stats {
    gap: 10px;
  }

  .stat {
    padding: 14px 8px;
  }

  .cta-btn {
    display: block;
    text-align: center;
    padding: 13px 24px;
  }

  #about article,
  #products article,
  #solutions article,
  #cases article,
  #news article,
  #faq article,
  #howto article,
  #contact article {
    padding: 20px 16px;
  }

  #howto ol li {
    padding: 14px 14px 14px 52px;
  }

  #howto ol li::before {
    left: 12px;
    width: 26px;
    height: 26px;
    font-size: 0.82rem;
  }

  #sitemap li a,
  #links li a {
    padding: 7px 14px;
    font-size: 0.82rem;
  }
}

/* ============ PRINT ============ */
@media print {
  #site-header,
  #back-to-top,
  .hero-slider,
  #links {
    display: none;
  }

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

  main > section {
    padding: 20px 0;
    page-break-inside: avoid;
  }
}