:root {
  --primary: #e94560;
  --primary-dark: #c73650;
  --secondary: #f2a900;
  --accent: #0f3460;
  --bg: #f5f6fa;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-border: rgba(255, 255, 255, 0.35);
  --text: #1a1a2e;
  --text-secondary: #4a4a68;
  --text-muted: #7a7a95;
  --border: #e2e4ed;
  --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.14);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --header-h: 68px;
  --max-w: 1200px;
}

[data-theme="dark"] {
  --bg: #0d0d1a;
  --bg-card: #16162a;
  --bg-glass: rgba(22, 22, 42, 0.78);
  --bg-glass-border: rgba(255, 255, 255, 0.08);
  --text: #eaeaf2;
  --text-secondary: #b8b8d0;
  --text-muted: #7a7a95;
  --border: #2a2a44;
  --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.5);
}

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

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

body {
  font-family: var(--font-sans);
  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 {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

ul,
ol {
  list-style: none;
}

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

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

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

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

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

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

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

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

.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.main-nav ul {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.main-nav a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  position: relative;
  transition: color var(--transition), background var(--transition);
}

.main-nav a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width var(--transition);
}

.main-nav a:hover {
  color: var(--text);
  background: rgba(233, 69, 96, 0.08);
}

.main-nav a:hover::after {
  width: 60%;
}

#menu-toggle,
#theme-toggle {
  display: none;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

#theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

#theme-toggle:hover,
#menu-toggle:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

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

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

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

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

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

/* ========== MAIN ========== */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px 60px;
}

section {
  margin-top: 48px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

h1 {
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--text) 30%, var(--primary) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  font-weight: 700;
  line-height: 1.4;
  margin: 36px 0 18px;
  padding-left: 16px;
  position: relative;
  color: var(--text);
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 70%;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}

h3 {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  font-weight: 700;
  margin: 24px 0 12px;
  color: var(--text);
}

p {
  margin-bottom: 14px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.85;
}

/* ========== BANNER ========== */
#banner {
  position: relative;
  margin-top: 24px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--accent);
  isolation: isolate;
}

#banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(233, 69, 96, 0.18), rgba(15, 52, 96, 0.35));
  z-index: 1;
  pointer-events: none;
}

.banner-slide {
  display: none;
  animation: bannerFade 0.7s ease;
}

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

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

@keyframes bannerFade {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.banner-controls {
  position: absolute;
  bottom: 18px;
  right: 18px;
  display: flex;
  gap: 10px;
  z-index: 3;
}

.banner-controls button {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  transition: all var(--transition);
}

.banner-controls button:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 69, 96, 0.45);
}

/* ========== INTRO / CONTENT CARDS ========== */
#intro,
#products,
#solution,
#cases,
#news,
#articles,
#faq,
#howto,
#contact,
#sitemap,
#links,
#legal,
#about-team {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

#intro:hover,
#products:hover,
#solution:hover,
#cases:hover,
#contact:hover {
  box-shadow: var(--shadow-md);
}

/* ========== NEWS / ARTICLE CARDS ========== */
#news article,
#articles article {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

#news article::before,
#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition);
}

#news article:hover,
#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(233, 69, 96, 0.3);
}

#news article:hover::before,
#articles article:hover::before {
  transform: scaleY(1);
}

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

#news article time,
#articles article time {
  display: inline-block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 2px 10px;
  background: rgba(233, 69, 96, 0.08);
  border-radius: 999px;
}

#news article a,
#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
  transition: gap var(--transition), color var(--transition);
}

#news article a::after,
#articles article a::after {
  content: "→";
  transition: transform var(--transition);
}

#news article a:hover::after,
#articles article a:hover::after {
  transform: translateX(4px);
}

/* ========== BLOCKQUOTE ========== */
blockquote {
  position: relative;
  margin: 18px 0;
  padding: 20px 24px 20px 56px;
  background: linear-gradient(135deg, rgba(233, 69, 96, 0.06), rgba(15, 52, 96, 0.06));
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

blockquote::before {
  content: "\201C";
  position: absolute;
  left: 18px;
  top: 8px;
  font-size: 48px;
  line-height: 1;
  color: var(--primary);
  opacity: 0.35;
  font-family: Georgia, serif;
}

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

blockquote cite {
  font-size: 13px;
  color: var(--text-muted);
  font-style: normal;
}

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

#faq details[open] {
  border-color: rgba(233, 69, 96, 0.35);
  box-shadow: var(--shadow-sm);
}

#faq summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background var(--transition), color var(--transition);
}

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

#faq summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 400;
  color: var(--primary);
  transition: transform var(--transition);
  flex-shrink: 0;
}

#faq details[open] summary::after {
  transform: rotate(45deg);
}

#faq summary:hover {
  background: rgba(233, 69, 96, 0.06);
  color: var(--primary);
}

#faq details p {
  padding: 0 20px 18px;
  margin: 0;
  animation: faqSlide 0.35s ease;
}

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

/* ========== HOWTO LIST ========== */
#howto ol {
  counter-reset: step;
  margin: 16px 0;
}

#howto ol li {
  position: relative;
  padding: 14px 18px 14px 56px;
  margin-bottom: 10px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 15px;
  counter-increment: step;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
}

#howto ol li:hover {
  transform: translateX(6px);
  border-color: rgba(233, 69, 96, 0.3);
  box-shadow: var(--shadow-sm);
}

/* ========== CONTACT & SITEMAP LISTS ========== */
#contact ul,
#sitemap ul,
#links ul,
#about-team ul {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

#contact ul li {
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  font-size: 14px;
  color: var(--text-secondary);
  transition: transform var(--transition), background var(--transition);
}

#contact ul li:hover {
  transform: translateX(5px);
  background: rgba(233, 69, 96, 0.06);
}

#sitemap ul,
#links ul {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

#sitemap ul li a,
#links ul li a {
  display: block;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  transition: all var(--transition);
}

#sitemap ul li a:hover,
#links ul li a:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(233, 69, 96, 0.3);
}

#about-team ul {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

#about-team ul li {
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  transition: border-color var(--transition), color var(--transition);
}

#about-team ul li:hover {
  border-color: var(--primary);
  color: var(--text);
}

/* ========== FOOTER ========== */
footer {
  position: relative;
  background: linear-gradient(160deg, #1a1a2e 0%, #0f3460 100%);
  color: rgba(255, 255, 255, 0.82);
  padding: 48px 20px 32px;
  margin-top: 60px;
  text-align: center;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
  background-size: 200% 100%;
  animation: footerGlow 4s linear infinite;
}

@keyframes footerGlow {
  0% {
    background-position: 0% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

footer p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin-bottom: 8px;
}

footer p:first-child {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

footer nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin-top: 20px;
}

footer nav a {
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  position: relative;
  transition: color var(--transition);
}

footer nav a::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--secondary);
  transition: width var(--transition);
}

footer nav a:hover {
  color: var(--secondary);
}

footer nav a:hover::after {
  width: 100%;
}

/* ========== BACK TO TOP ========== */
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 28px;
  z-index: 900;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(233, 69, 96, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--transition);
}

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

#back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(233, 69, 96, 0.55);
}

/* ========== SCROLL ANIMATIONS ========== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

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

  .main-nav.open {
    display: block;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--bg-glass-border);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    animation: navSlide 0.3s ease;
  }

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

  .main-nav.open a {
    display: block;
    padding: 12px 16px;
    font-size: 15px;
    border-radius: var(--radius-sm);
  }

  .main-nav.open a:hover {
    background: rgba(233, 69, 96, 0.1);
  }

  #menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

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

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

  .brand-sub {
    display: none;
  }
}

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

  main {
    padding: 0 14px 40px;
  }

  section {
    margin-top: 32px;
  }

  #intro,
  #products,
  #solution,
  #cases,
  #news,
  #articles,
  #faq,
  #howto,
  #contact,
  #sitemap,
  #links,
  #legal,
  #about-team {
    padding: 22px 18px;
    border-radius: var(--radius-md);
  }

  h1 {
    font-size: 1.35rem;
    margin-bottom: 18px;
  }

  h2 {
    font-size: 1.15rem;
    padding-left: 13px;
    margin: 28px 0 14px;
  }

  h3 {
    font-size: 1.02rem;
  }

  p {
    font-size: 14.5px;
    line-height: 1.8;
  }

  #banner {
    border-radius: var(--radius-lg);
  }

  .banner-controls {
    bottom: 10px;
    right: 10px;
    gap: 6px;
  }

  .banner-controls button {
    padding: 6px 12px;
    font-size: 12px;
  }

  blockquote {
    padding: 16px 16px 16px 46px;
  }

  blockquote::before {
    left: 12px;
    font-size: 38px;
  }

  #news article,
  #articles article {
    padding: 16px 16px;
  }

  #howto ol li {
    padding: 12px 14px 12px 50px;
    font-size: 14px;
  }

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

  #sitemap ul,
  #links ul,
  #about-team ul {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

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

  footer {
    padding: 36px 16px 28px;
  }

  footer nav ul {
    gap: 6px 16px;
  }
}

@media (max-width: 380px) {
  .brand-name {
    font-size: 15px;
  }

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

  #theme-toggle {
    padding: 6px 10px;
    font-size: 12px;
  }

  #menu-toggle {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* ========== ACCESSIBILITY ========== */
@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;
  }
}

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

::selection {
  background: rgba(233, 69, 96, 0.25);
  color: var(--text);
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 999px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}