:root {
  --bg: #f5f7fb;
  --bg-alt: #eef2f9;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --text: #17202a;
  --text-body: #1f2937;
  --text-soft: #334155;
  --text-muted: #475569;
  --heading: #0f172a;
  --border: #dbe3ee;
  --border-strong: #c3cddd;
  --brand: #6d28d9;
  --brand-2: #2563eb;
  --brand-3: #db2777;
  --brand-soft: rgba(109, 40, 217, 0.12);
  --accent: #f59e0b;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.14);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-blur: saturate(180%) blur(16px);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --maxw: 1180px;
  --header-h: 68px;
  --transition: 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-alt: #0f172a;
  --surface: #131c2e;
  --surface-2: #182238;
  --text: #f1f5f9;
  --text-body: #e5e7eb;
  --text-soft: #e2e8f0;
  --text-muted: #cbd5e1;
  --heading: #ffffff;
  --border: #24324a;
  --border-strong: #33445f;
  --brand: #a78bfa;
  --brand-2: #60a5fa;
  --brand-3: #f472b6;
  --brand-soft: rgba(167, 139, 250, 0.16);
  --accent: #fbbf24;
  --link: #93c5fd;
  --link-hover: #bfdbfe;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6);
  --glass-bg: rgba(19, 28, 46, 0.72);
  --glass-border: rgba(148, 163, 184, 0.22);
}

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

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

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-body);
  background: var(--bg);
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

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

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

a:hover,
a:focus-visible {
  color: var(--link-hover);
  text-decoration: underline;
}

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

ul,
ol {
  list-style: none;
}

/* ---------- Header ---------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), box-shadow var(--transition);
}

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

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

.brand svg {
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}

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

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--heading);
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.6px;
}

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

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

#main-nav a {
  display: inline-block;
  padding: 8px 13px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: var(--radius-pill);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

#main-nav a:hover,
#main-nav a:focus-visible {
  color: var(--brand);
  background: var(--brand-soft);
  text-decoration: none;
  transform: translateY(-2px);
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.header-actions button {
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: all var(--transition);
  white-space: nowrap;
}

.header-actions button:hover,
.header-actions button:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

#menu-toggle {
  display: none;
}

#search-bar {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px 12px;
}

#search-bar label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

#search-bar input {
  flex: 1;
  min-width: 0;
  padding: 9px 16px;
  font-size: 0.92rem;
  color: var(--text-body);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#search-bar input::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

#search-bar input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

#search-btn {
  padding: 9px 22px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: var(--radius-pill);
  transition: transform var(--transition), box-shadow var(--transition);
}

#search-btn:hover,
#search-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

section {
  margin-bottom: 56px;
}

section > h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 18px;
  padding-left: 16px;
  border-left: 5px solid transparent;
  border-image: linear-gradient(180deg, var(--brand), var(--brand-3)) 1;
  line-height: 1.4;
}

section h3 {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--heading);
  margin: 26px 0 10px;
}

section h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 18px 0 8px;
}

section p {
  color: var(--text-body);
  margin-bottom: 12px;
}

/* ---------- Hero ---------- */
#hero {
  margin-top: 32px;
}

.hero-carousel {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 56px 48px 64px;
  background: linear-gradient(135deg, #6d28d9 0%, #2563eb 52%, #db2777 100%);
  box-shadow: var(--shadow-lg);
  color: #fff;
}

.hero-carousel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.28), transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(255, 255, 255, 0.2), transparent 46%);
  pointer-events: none;
}

.hero-slide {
  position: relative;
  display: none;
  animation: heroFade 0.6s ease both;
}

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

@keyframes heroFade {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-slide h1,
.hero-slide h2 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.4;
  color: #ffffff;
  margin-bottom: 16px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.28);
}

.hero-slide p {
  color: rgba(255, 255, 255, 0.94);
  max-width: 860px;
  margin-bottom: 12px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.22);
}

.hero-slide .btn-primary,
.hero-slide .btn-secondary {
  display: inline-block;
  margin-top: 18px;
  margin-right: 12px;
  padding: 12px 30px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.hero-slide .btn-primary {
  color: #4c1d95;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.hero-slide .btn-primary:hover,
.hero-slide .btn-primary:focus-visible {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  text-decoration: none;
  color: #4c1d95;
}

.hero-slide .btn-secondary {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.hero-slide .btn-secondary:hover,
.hero-slide .btn-secondary:focus-visible {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-3px) scale(1.03);
  text-decoration: none;
  color: #ffffff;
}

.carousel-dots {
  position: absolute;
  left: 48px;
  bottom: 22px;
  display: flex;
  gap: 10px;
  z-index: 2;
}

.carousel-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: all var(--transition);
}

.carousel-dots .dot:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.2);
}

.carousel-dots .dot.active {
  width: 34px;
  border-radius: var(--radius-pill);
  background: #ffffff;
}

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

.stat {
  text-align: center;
  padding: 22px 14px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.stat-number {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--brand), var(--brand-2), var(--brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* ---------- Breadcrumb ---------- */
#breadcrumb {
  margin: 26px 0 34px;
}

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

#breadcrumb li + li::before {
  content: "›";
  margin-right: 8px;
  color: var(--border-strong);
}

#breadcrumb a {
  color: var(--text-soft);
  font-weight: 600;
}

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

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

/* ---------- Cards / Content blocks ---------- */
#intro,
#products,
#solutions,
#cases,
#news,
#articles,
#faq,
#howto,
#contact,
#sitemap,
#links,
#legal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 34px 28px;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

#intro:hover,
#products:hover,
#solutions:hover,
#cases:hover,
#news:hover,
#articles:hover,
#faq:hover,
#howto:hover,
#contact:hover,
#sitemap:hover,
#links:hover,
#legal:hover {
  box-shadow: var(--shadow-md);
}

/* ---------- Articles ---------- */
#articles article {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--brand-3);
}

#articles article h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

#articles article p {
  margin-bottom: 8px;
}

#articles article p:nth-of-type(1) {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

#articles article a {
  display: inline-block;
  margin-top: 6px;
  font-weight: 700;
  color: var(--brand);
}

#articles article a::after {
  content: " →";
  transition: margin var(--transition);
  display: inline-block;
}

#articles article a:hover::after {
  margin-left: 4px;
}

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}

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

.faq-question {
  margin: 0;
  padding: 16px 22px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--heading);
  background: linear-gradient(90deg, var(--brand-soft), transparent 70%);
  cursor: pointer;
  position: relative;
  transition: color var(--transition), background var(--transition);
}

.faq-question::before {
  content: "Q";
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  margin-right: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: 8px;
  vertical-align: middle;
}

.faq-question:hover {
  color: var(--brand);
}

.faq-answer {
  padding: 4px 22px 18px;
  border-top: 1px dashed var(--border);
}

.faq-answer p {
  margin-bottom: 0;
  color: var(--text-body);
}

/* ---------- HowTo ---------- */
#howto ol {
  counter-reset: howto;
  margin: 12px 0 16px;
}

#howto ol li {
  position: relative;
  counter-increment: howto;
  padding: 12px 16px 12px 56px;
  margin-bottom: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

#howto ol li::before {
  content: counter(howto);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  border-radius: 50%;
}

#howto ol li:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
}

/* ---------- Contact ---------- */
#contact p {
  color: var(--text-body);
}

#contact h3 {
  padding-bottom: 6px;
  border-bottom: 2px solid var(--brand-soft);
}

/* ---------- Sitemap / Links ---------- */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sitemap li,
#links li {
  flex: 0 0 auto;
}

#sitemap a,
#links a {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: all var(--transition);
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

/* ---------- Legal ---------- */
#legal h3 {
  color: var(--heading);
}

/* ---------- Footer ---------- */
#site-footer {
  background: linear-gradient(160deg, #111827 0%, #1f2937 60%, #312e81 100%);
  color: #e5e7eb;
  padding: 48px 24px 0;
  margin-top: 20px;
}

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

.footer-col h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 14px;
  position: relative;
  padding-bottom: 10px;
}

.footer-col h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--brand), var(--brand-3));
}

.footer-col p {
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-bottom: 8px;
  line-height: 1.8;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col a {
  font-size: 0.9rem;
  color: #cbd5e1;
  transition: color var(--transition), padding-left var(--transition);
}

.footer-col a:hover {
  color: #ffffff;
  padding-left: 6px;
  text-decoration: none;
}

.footer-bottom {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 0 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  text-align: center;
}

.footer-bottom p {
  font-size: 0.84rem;
  color: #94a3b8;
}

/* ---------- Back to top ---------- */
#back-to-top {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 90;
  padding: 12px 18px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--transition);
}

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

#back-to-top:hover,
#back-to-top:focus-visible {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.42);
}

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

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

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

  #main-nav a {
    padding: 7px 10px;
    font-size: 0.86rem;
  }

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

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

  #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.open {
    max-height: 620px;
  }

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

  #main-nav a {
    display: block;
    padding: 11px 16px;
    font-size: 0.95rem;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
  }

  #search-bar {
    padding: 0 16px 12px;
    flex-wrap: wrap;
  }

  #search-bar label {
    flex-basis: 100%;
  }

  #search-bar input {
    flex: 1 1 60%;
  }

  main {
    padding: 0 16px 48px;
  }

  .hero-carousel {
    padding: 38px 24px 58px;
  }

  .hero-slide h1,
  .hero-slide h2 {
    font-size: 1.5rem;
  }

  .carousel-dots {
    left: 24px;
  }

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

  section > h2 {
    font-size: 1.42rem;
  }

  #intro,
  #products,
  #solutions,
  #cases,
  #news,
  #articles,
  #faq,
  #howto,
  #contact,
  #sitemap,
  #links,
  #legal {
    padding: 24px 20px 20px;
    border-radius: var(--radius);
  }

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

  #back-to-top {
    right: 16px;
    bottom: 18px;
    padding: 10px 14px;
    font-size: 0.8rem;
  }
}

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

  .brand-name {
    font-size: 1rem;
  }

  .brand-sub {
    font-size: 0.66rem;
  }

  .header-actions button {
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  .hero-carousel {
    padding: 30px 18px 54px;
  }

  .hero-slide h1,
  .hero-slide h2 {
    font-size: 1.28rem;
  }

  .hero-slide .btn-primary,
  .hero-slide .btn-secondary {
    display: block;
    width: 100%;
    margin-right: 0;
    text-align: center;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat {
    padding: 16px 10px;
  }

  section > h2 {
    font-size: 1.24rem;
    padding-left: 12px;
  }

  #articles article {
    padding: 16px;
  }

  .faq-question {
    padding: 14px 16px;
    font-size: 0.96rem;
  }

  .faq-answer {
    padding: 4px 16px 16px;
  }

  #howto ol li {
    padding-left: 48px;
  }
}

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

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

/* ---------- Print ---------- */
@media print {
  #site-header,
  #back-to-top,
  .hero-carousel,
  .carousel-dots,
  .header-actions,
  #search-bar {
    display: none !important;
  }

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

  section {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}