:root {
  --primary: #ff6b9d;
  --primary-dark: #e84d84;
  --primary-light: #ffa8c5;
  --secondary: #7c5cff;
  --accent: #ffb84d;
  --bg: #fff5f9;
  --bg-alt: #ffeef5;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --text: #2d2430;
  --text-soft: #5f5563;
  --text-muted: #8a7f8e;
  --border: rgba(255, 107, 157, 0.18);
  --shadow-sm: 0 4px 14px rgba(255, 107, 157, 0.1);
  --shadow-md: 0 12px 32px rgba(255, 107, 157, 0.16);
  --shadow-lg: 0 24px 60px rgba(124, 92, 255, 0.18);
  --gradient-banner: linear-gradient(135deg, #ff9ec4 0%, #ff6b9d 40%, #a77bff 100%);
  --gradient-soft: linear-gradient(135deg, rgba(255, 158, 196, 0.22), rgba(167, 123, 255, 0.16));
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --max-width: 1180px;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #ff7fae;
    --primary-dark: #ff5c97;
    --primary-light: #ffa8c5;
    --secondary: #9d86ff;
    --accent: #ffc76b;
    --bg: #17121c;
    --bg-alt: #1e1725;
    --surface: rgba(40, 32, 48, 0.66);
    --surface-solid: #241c2c;
    --text: #f4eef7;
    --text-soft: #cbbfd3;
    --text-muted: #9b8fa4;
    --border: rgba(255, 127, 174, 0.22);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.32);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.42);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
    --gradient-banner: linear-gradient(135deg, #6b2d4f 0%, #4a2a6b 55%, #2f2350 100%);
    --gradient-soft: linear-gradient(135deg, rgba(255, 127, 174, 0.14), rgba(157, 134, 255, 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: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255, 107, 157, 0.14), transparent 42%),
    radial-gradient(circle at 88% 22%, rgba(124, 92, 255, 0.12), transparent 46%),
    radial-gradient(circle at 50% 100%, rgba(255, 184, 77, 0.08), transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

a:hover,
a:focus-visible {
  color: var(--secondary);
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
  border-radius: 6px;
}

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

h1 {
  font-size: clamp(1.65rem, 4.2vw, 2.6rem);
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.95rem);
  position: relative;
  padding-left: 18px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.22em;
  bottom: 0.22em;
  width: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}

h3 {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--primary-dark);
}

h4 {
  font-size: 1rem;
  color: var(--text-soft);
}

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

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}

li {
  margin-bottom: 0.35em;
  color: var(--text-soft);
}

li::marker {
  color: var(--primary);
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(255, 107, 157, 0.08);
}

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

header > div > a {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: var(--gradient-banner);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
  padding: 6px 0;
}

header > div > a:hover {
  filter: brightness(1.08);
}

header nav {
  flex: 1 1 auto;
  min-width: 0;
}

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

header nav li {
  margin: 0;
}

header nav a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: var(--radius-pill);
  transition: background 0.28s var(--ease), color 0.28s var(--ease), transform 0.28s var(--ease);
}

header nav a:hover,
header nav a:focus-visible {
  color: var(--primary-dark);
  background: var(--gradient-soft);
  transform: translateY(-1px);
}

/* ---------- Main / layout ---------- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

section {
  position: relative;
  background: var(--surface);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 40px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.4s var(--ease);
  animation: fadeUp 0.7s var(--ease) both;
}

section:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 107, 157, 0.34);
}

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

/* ---------- Breadcrumb ---------- */
main > nav[aria-label="面包屑导航"] {
  padding: 0 4px;
}

main > nav[aria-label="面包屑导航"] ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

main > nav[aria-label="面包屑导航"] li {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

main > nav[aria-label="面包屑导航"] li + li::before {
  content: "›";
  color: var(--primary-light);
  font-weight: 700;
}

/* ---------- Hero ---------- */
#hero {
  background: var(--gradient-banner);
  border: none;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

#hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.32), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.18), transparent 50%);
  z-index: -1;
  pointer-events: none;
}

#hero h1 {
  color: #fff;
  text-shadow: 0 2px 18px rgba(120, 40, 80, 0.28);
  max-width: 22em;
}

#hero p {
  color: rgba(255, 255, 255, 0.94);
  max-width: 62ch;
  font-size: 1.02rem;
}

#hero > div {
  margin-top: 24px;
  display: flex;
  justify-content: flex-start;
}

#hero figure {
  margin: 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

#hero figure:hover {
  transform: translateY(-6px) rotate(-1.5deg);
  box-shadow: var(--shadow-lg);
}

#hero figcaption {
  margin-top: 10px;
  font-size: 0.82rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.04em;
}

#hero svg {
  border-radius: var(--radius-sm);
}

/* ---------- Sections general polish ---------- */
section > h2 + p {
  margin-top: 0.2em;
}

section p:last-child,
section ul:last-child,
section ol:last-child {
  margin-bottom: 0;
}

#brand,
#about,
#history,
#culture,
#products,
#advantages,
#solutions,
#applications,
#cases,
#reviews,
#news,
#articles,
#knowledge,
#faq,
#howto,
#contact,
#sitemap,
#links,
#legal {
  scroll-margin-top: calc(var(--header-h) + 18px);
}

/* ---------- News / Articles cards ---------- */
#news,
#articles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

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

#news article,
#articles article {
  position: relative;
  margin-top: 18px;
  padding: 20px 22px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.38s var(--ease), box-shadow 0.38s var(--ease), border-color 0.38s var(--ease);
  overflow: hidden;
}

#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));
  opacity: 0.85;
  transition: width 0.38s var(--ease);
}

#news article:hover,
#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 107, 157, 0.4);
}

#news article:hover::before,
#articles article:hover::before {
  width: 8px;
}

#news article h3,
#articles article h3 {
  margin-bottom: 0.4em;
  transition: color 0.28s var(--ease);
}

#news article:hover h3,
#articles article:hover h3 {
  color: var(--primary-dark);
}

#news article p,
#articles article p {
  font-size: 0.94rem;
  margin-bottom: 0.5em;
}

#news article p:first-of-type,
#articles article p:first-of-type {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

#news article a,
#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: var(--gradient-soft);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease), color 0.3s var(--ease);
}

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

#news article a:hover,
#articles article a:hover {
  background: var(--gradient-banner);
  color: #fff;
  transform: translateX(2px);
}

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

@media (min-width: 760px) {
  #news,
  #articles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  #news article,
  #articles article {
    margin-top: 0;
  }
}

/* ---------- FAQ ---------- */
#faq details {
  margin-top: 12px;
  padding: 0;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.35s var(--ease);
}

#faq details:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 107, 157, 0.36);
}

#faq details[open] {
  border-color: rgba(255, 107, 157, 0.5);
  box-shadow: var(--shadow-md);
}

#faq summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding: 16px 52px 16px 20px;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  transition: color 0.28s var(--ease), background 0.28s var(--ease);
  user-select: none;
}

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}

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

#faq summary:hover {
  color: var(--primary-dark);
  background: var(--gradient-soft);
}

#faq details[open] summary {
  color: var(--primary-dark);
  border-bottom: 1px dashed var(--border);
}

#faq details p {
  padding: 14px 20px 18px;
  margin: 0;
  font-size: 0.94rem;
  animation: fadeUp 0.4s var(--ease) both;
}

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

#sitemap li,
#links li {
  margin: 0;
}

#sitemap a,
#links a {
  display: inline-block;
  padding: 7px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: var(--gradient-banner);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* ---------- Contact / Legal ---------- */
#contact p {
  font-size: 0.95rem;
}

#contact h3,
#legal h3,
#howto h3 {
  margin-top: 1.4em;
}

#contact h3:first-of-type,
#legal h3:first-of-type,
#howto h3:first-of-type {
  margin-top: 0;
}

#legal {
  border-left: 4px solid var(--primary-light);
}

/* ---------- Footer ---------- */
footer {
  position: relative;
  margin-top: 12px;
  padding: 40px 20px 48px;
  text-align: center;
  background: var(--gradient-banner);
  color: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -12px 40px rgba(255, 107, 157, 0.18);
}

footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.24), transparent 55%);
  border-radius: inherit;
  pointer-events: none;
}

footer p {
  position: relative;
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
}

footer p:first-child {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
}

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

/* ---------- Scroll reveal (progressive enhancement) ---------- */
@media (prefers-reduced-motion: no-preference) {
  section {
    animation-timing-function: var(--ease);
  }

  @supports (animation-timeline: view()) {
    section {
      animation: revealIn linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 42%;
    }

    @keyframes revealIn {
      from {
        opacity: 0;
        transform: translateY(34px) scale(0.985);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  header > div {
    padding: 10px 16px;
    gap: 6px 16px;
  }

  header nav ul {
    gap: 2px 4px;
  }

  header nav a {
    padding: 5px 10px;
    font-size: 0.82rem;
  }

  main {
    padding: 18px 14px 48px;
    gap: 20px;
  }

  section {
    border-radius: var(--radius-md);
  }
}

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

  header > div {
    flex-direction: column;
    align-items: flex-start;
  }

  header nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  header nav::-webkit-scrollbar {
    display: none;
  }

  header nav ul {
    flex-wrap: nowrap;
    padding-bottom: 8px;
  }

  header nav a {
    white-space: nowrap;
  }

  main {
    padding: 14px 12px 40px;
    gap: 16px;
  }

  section {
    padding: 20px 16px;
    border-radius: var(--radius-sm);
  }

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 5px;
  }

  #hero > div {
    justify-content: center;
  }

  #hero figure {
    padding: 10px;
  }

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

  #faq summary {
    padding: 14px 46px 14px 16px;
    font-size: 0.92rem;
  }

  footer {
    padding: 32px 16px 40px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }
}

@media (min-width: 1024px) {
  #hero {
    padding: clamp(36px, 5vw, 64px);
  }

  #hero h1 {
    font-size: 2.7rem;
  }
}

/* ---------- Print ---------- */
@media print {
  header,
  footer,
  #sitemap,
  #links {
    display: none;
  }

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

  section {
    box-shadow: none;
    border: 1px solid #ddd;
    animation: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: #fff;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}