:root {
  --primary: #ff6b9d;
  --primary-dark: #e8558a;
  --primary-light: #ffb3d1;
  --secondary: #4a7bd1;
  --accent: #d18a4a;
  --bg: #fdf7fa;
  --bg-alt: #ffffff;
  --bg-soft: #f6eef3;
  --text: #2d2430;
  --text-soft: #6b5f6e;
  --text-mute: #9a8f9d;
  --border: rgba(255, 107, 157, 0.16);
  --shadow-sm: 0 2px 8px rgba(255, 107, 157, 0.08);
  --shadow-md: 0 8px 24px rgba(255, 107, 157, 0.12);
  --shadow-lg: 0 16px 48px rgba(255, 107, 157, 0.18);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.6);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --grad-hero: linear-gradient(135deg, #ffe3ef 0%, #f3e8ff 45%, #e3f0ff 100%);
  --grad-primary: linear-gradient(135deg, #ff6b9d 0%, #ff9ec4 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 107, 157, 0.08), rgba(74, 123, 209, 0.08));
  --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
  --primary: #ff85ae;
  --primary-dark: #ff6b9d;
  --primary-light: #6b2f47;
  --secondary: #7ba3e8;
  --accent: #e0a86a;
  --bg: #15101a;
  --bg-alt: #1d1622;
  --bg-soft: #241a2b;
  --text: #f2eaf5;
  --text-soft: #c4b8c9;
  --text-mute: #8f8295;
  --border: rgba(255, 133, 174, 0.18);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
  --glass-bg: rgba(29, 22, 34, 0.72);
  --glass-border: rgba(255, 133, 174, 0.16);
  --grad-hero: linear-gradient(135deg, #2a1a24 0%, #221a2e 45%, #1a2230 100%);
  --grad-primary: linear-gradient(135deg, #ff6b9d 0%, #ff9ec4 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 133, 174, 0.12), rgba(123, 163, 232, 0.12));
}

*,
*::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: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

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

h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); }
h3 { font-size: clamp(1.1rem, 2.2vw, 1.35rem); }
h4 { font-size: 1.05rem; }

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

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

li {
  margin-bottom: 0.4em;
}

blockquote {
  margin: 1em 0;
  padding: 0.9em 1.2em;
  border-left: 4px solid var(--primary);
  background: var(--grad-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  font-style: normal;
}

time {
  color: var(--text-mute);
  font-size: 0.85em;
}

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

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

.top-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.6rem 1.2rem;
  min-height: var(--header-h);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.brand-logo svg {
  transition: transform var(--transition);
}

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

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

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

#main-nav ul {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

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

#main-nav a {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

#main-nav a:hover {
  color: var(--primary);
  background: var(--grad-soft);
  transform: translateY(-1px);
}

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

.header-tools form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.25rem 0.2rem 0.85rem;
  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(255, 107, 157, 0.15);
}

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

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

.header-tools button {
  border: none;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--radius-pill);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.header-tools form button {
  padding: 0.35rem 0.85rem;
  background: var(--grad-primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
}

.header-tools form button:hover {
  box-shadow: 0 4px 14px rgba(255, 107, 157, 0.4);
  transform: translateY(-1px);
}

#theme-toggle,
#menu-toggle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 1rem;
  line-height: 1;
}

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

#menu-toggle {
  display: none;
}

.breadcrumb {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.35rem 1.2rem 0.55rem;
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
  color: var(--text-mute);
  flex-wrap: wrap;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--text-mute);
}

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

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

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

/* ============ MAIN ============ */
main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.5rem 1.2rem 3rem;
}

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

/* ============ HERO ============ */
#hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--grad-hero);
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--glass-border);
}

.banner-carousel {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.6rem;
  aspect-ratio: 1200 / 320;
  background: var(--bg-soft);
  box-shadow: var(--shadow-sm);
}

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

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

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

#hero-title {
  text-align: center;
  margin-bottom: 0.8rem;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-lead {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  font-size: 1rem;
  color: var(--text-soft);
}

/* ============ CARDS / SECTIONS ============ */
#brand-intro,
#products,
#solutions,
#cases,
#news,
#articles,
#faq,
#howto,
#contact,
#sitemap {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

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

#brand-intro h2,
#products h2,
#solutions h2,
#cases h2,
#news h2,
#articles h2,
#faq h2,
#howto h2,
#contact h2,
#sitemap h2 {
  position: relative;
  padding-bottom: 0.5rem;
}

#brand-intro h2::after,
#products h2::after,
#solutions h2::after,
#cases h2::after,
#news h2::after,
#articles h2::after,
#faq h2::after,
#howto h2::after,
#contact h2::after,
#sitemap h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--grad-primary);
}

#products ul,
#solutions ul {
  list-style: none;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}

#products ul li,
#solutions ul li {
  position: relative;
  padding: 0.85rem 1rem 0.85rem 2.6rem;
  background: var(--grad-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin: 0;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

#products ul li::before,
#solutions ul li::before {
  content: "♥";
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 1rem;
}

#products ul li:hover,
#solutions ul li:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

/* ============ NEWS ============ */
#news ul {
  list-style: none;
  padding-left: 0;
}

#news li {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary);
  background: var(--grad-soft);
  margin-bottom: 0.6rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

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

#news time {
  display: inline-block;
  font-weight: 600;
  color: var(--primary);
  margin-right: 0.5rem;
}

/* ============ ARTICLES ============ */
#articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

#articles > h2 {
  grid-column: 1 / -1;
}

#articles article {
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

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

#articles article h3 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

#articles article h3 a {
  color: var(--text);
}

#articles article h3 a:hover {
  color: var(--primary);
}

#articles article p {
  font-size: 0.9rem;
  flex: 1;
}

#articles article a {
  align-self: flex-start;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--grad-primary);
  color: #fff;
  transition: transform var(--transition), box-shadow var(--transition);
}

#articles article a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 107, 157, 0.4);
  color: #fff;
}

/* ============ FAQ ============ */
#faq details {
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.7rem;
  border: 1px solid var(--border);
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

#faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  position: relative;
  padding-right: 1.8rem;
  transition: color var(--transition);
}

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--primary);
  transition: transform var(--transition);
}

#faq details[open] summary::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
}

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

#faq details p {
  margin: 0.7rem 0 0;
  animation: fadeSlide 0.35s ease;
}

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

/* ============ HOWTO ============ */
#howto ol {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 0.7rem 1rem 0.7rem 3rem;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* ============ CONTACT ============ */
#contact p {
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--grad-soft);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

#contact p:first-of-type {
  font-weight: 600;
  color: var(--primary);
}

/* ============ SITEMAP ============ */
#sitemap ul {
  list-style: none;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
}

#sitemap li {
  margin: 0;
}

#sitemap a {
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

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

/* ============ FOOTER ============ */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 2rem 1.2rem 2.5rem;
  margin-top: 2rem;
}

footer > p {
  max-width: 1240px;
  margin: 0 auto 0.4rem;
  font-size: 0.85rem;
  color: var(--text-mute);
  text-align: center;
}

footer > p a {
  color: var(--text-soft);
}

footer > p a:hover {
  color: var(--primary);
}

footer > section {
  max-width: 1240px;
  margin: 1.6rem auto 0;
  padding: 1.2rem 1.4rem;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

footer > section h2 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: var(--primary);
}

footer > section p {
  font-size: 0.88rem;
  margin: 0;
}

#back-to-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 90;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--grad-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition), box-shadow var(--transition);
  font-family: inherit;
  line-height: 1.1;
  text-align: center;
  padding: 0.2rem;
}

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

#back-to-top:hover {
  box-shadow: 0 10px 28px rgba(255, 107, 157, 0.5);
  transform: translateY(-3px);
}

/* ============ SCROLL ANIMATION ============ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  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) {
  .header-tools input[type="search"] {
    width: 120px;
  }
  #main-nav a {
    padding: 0.4rem 0.55rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 860px) {
  .top-bar {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

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

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

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

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

  #main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    padding: 0.5rem 0;
    overflow: visible;
  }

  #main-nav a {
    display: block;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-md);
  }

  .breadcrumb {
    padding-top: 0;
  }

  #articles {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  main {
    padding: 1rem 0.8rem 2rem;
  }

  section {
    margin-bottom: 2rem;
  }

  .top-bar {
    padding: 0.5rem 0.8rem;
  }

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

  .header-tools form {
    display: none;
  }

  #hero {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .banner-carousel {
    border-radius: var(--radius-sm);
    margin-bottom: 1.2rem;
  }

  #brand-intro,
  #products,
  #solutions,
  #cases,
  #news,
  #articles,
  #faq,
  #howto,
  #contact,
  #sitemap {
    padding: 1.2rem 1rem;
    border-radius: var(--radius-md);
  }

  #products ul,
  #solutions ul {
    grid-template-columns: 1fr;
  }

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

  footer > section {
    padding: 1rem;
  }

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

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

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

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-soft);
}

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

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

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