:root {
  --primary: #6c5ce7;
  --primary-light: #a29bfe;
  --primary-dark: #4834d4;
  --accent: #fd79a8;
  --accent-2: #00cec9;
  --accent-3: #fdcb6e;
  --bg: #f4f5fb;
  --bg-alt: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --text: #1e1f2b;
  --text-soft: #4b4d63;
  --text-muted: #7c7f99;
  --border: rgba(108, 92, 231, 0.14);
  --border-strong: rgba(108, 92, 231, 0.28);
  --shadow-sm: 0 2px 8px rgba(30, 31, 43, 0.06);
  --shadow-md: 0 8px 28px rgba(30, 31, 43, 0.09);
  --shadow-lg: 0 20px 48px rgba(30, 31, 43, 0.14);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --grad-hero: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 40%, #fd79a8 100%);
  --grad-accent: linear-gradient(135deg, #00cec9 0%, #6c5ce7 100%);
  --grad-warm: linear-gradient(135deg, #fdcb6e 0%, #fd79a8 100%);
  --header-h: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f1a;
    --bg-alt: #161826;
    --bg-elevated: rgba(28, 30, 46, 0.66);
    --text: #eceefb;
    --text-soft: #b9bcd6;
    --text-muted: #8b8ea8;
    --border: rgba(162, 155, 254, 0.16);
    --border-strong: rgba(162, 155, 254, 0.32);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 32px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.6);
    --grad-hero: linear-gradient(135deg, #4834d4 0%, #6c5ce7 45%, #c44569 100%);
  }
}

*,
*::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.8;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% -10%, rgba(108, 92, 231, 0.16), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(253, 121, 168, 0.14), transparent 40%),
    radial-gradient(circle at 50% 120%, rgba(0, 206, 201, 0.1), transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

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

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

h1 {
  font-size: clamp(1.75rem, 4.2vw, 2.9rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.4rem, 2.8vw, 2.05rem);
  position: relative;
  padding-left: 1.1rem;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 5px;
  border-radius: 99px;
  background: var(--grad-accent);
}

h3 {
  font-size: clamp(1.12rem, 1.9vw, 1.35rem);
  color: var(--text);
}

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

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

/* ---------- Skip link ---------- */
header > a[href="#main"] {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 999;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  transition: top 0.3s var(--ease);
}

header > a[href="#main"]:focus {
  top: 16px;
  color: #fff;
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-elevated);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

nav[aria-label="主导航"] {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

nav[aria-label="主导航"] > ul {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: var(--header-h);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

nav[aria-label="主导航"] > ul::-webkit-scrollbar {
  display: none;
}

nav[aria-label="主导航"] > ul > li {
  flex: 0 0 auto;
}

nav[aria-label="主导航"] a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-soft);
  white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

nav[aria-label="主导航"] a:hover,
nav[aria-label="主导航"] a:focus-visible {
  color: #fff;
  background: var(--grad-accent);
  transform: translateY(-1px);
}

/* ---------- Main layout ---------- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

main > section {
  margin-top: 64px;
  animation: fadeUp 0.7s var(--ease) both;
}

main > section:nth-of-type(1) { animation-delay: 0.05s; }
main > section:nth-of-type(2) { animation-delay: 0.1s; }
main > section:nth-of-type(3) { animation-delay: 0.15s; }
main > section:nth-of-type(4) { animation-delay: 0.2s; }
main > section:nth-of-type(5) { animation-delay: 0.25s; }

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

/* ---------- Breadcrumb ---------- */
nav[aria-label="面包屑导航"] {
  margin-top: 24px;
  animation: fadeUp 0.6s var(--ease) both;
}

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

nav[aria-label="面包屑导航"] li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--border-strong);
}

nav[aria-label="面包屑导航"] a {
  color: var(--text-muted);
}

nav[aria-label="面包屑导航"] a:hover {
  color: var(--primary);
}

nav[aria-label="面包屑导航"] [aria-current="page"] {
  color: var(--primary);
  font-weight: 600;
}

/* ---------- Hero ---------- */
#hero {
  position: relative;
  margin-top: 28px;
  padding: clamp(32px, 5vw, 64px) clamp(24px, 4vw, 56px);
  border-radius: var(--radius-xl);
  background: var(--grad-hero);
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.28), transparent 34%),
    radial-gradient(circle at 82% 78%, rgba(255, 255, 255, 0.18), transparent 38%);
  z-index: -1;
}

#hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -110px;
  top: -110px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.06), 0 0 0 80px rgba(255, 255, 255, 0.04);
  z-index: -1;
  animation: floatOrb 12s ease-in-out infinite;
}

@keyframes floatOrb {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(24px) scale(1.05); }
}

#hero h1 {
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.22);
  max-width: 22ch;
}

#hero p {
  color: rgba(255, 255, 255, 0.92);
  max-width: 68ch;
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
}

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

/* ---------- Content cards ---------- */
#brand,
#products,
#solutions,
#cases,
#news,
#articles,
#faq,
#howto,
#contact,
#sitemap,
#links,
#privacy,
#disclaimer,
#copyright {
  background: var(--bg-elevated);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3.6vw, 44px);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.4s var(--ease);
}

#brand:hover,
#products:hover,
#solutions:hover,
#cases:hover,
#news:hover,
#articles:hover,
#faq:hover,
#howto:hover,
#contact:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

#brand h3,
#products h3,
#solutions h3,
#cases h3,
#news h3,
#howto h3 {
  margin-top: 1.6em;
  padding-bottom: 0.4em;
  border-bottom: 1px dashed var(--border-strong);
}

#brand > h3:first-of-type,
#products > h3:first-of-type,
#solutions > h3:first-of-type,
#cases > h3:first-of-type,
#news > h3:first-of-type,
#howto > h3:first-of-type {
  margin-top: 0.4em;
}

/* ---------- Articles ---------- */
#articles {
  display: grid;
  gap: 20px;
}

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

#articles article {
  position: relative;
  padding: 22px 24px;
  border-radius: var(--radius-md);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  overflow: hidden;
}

#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--grad-accent);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

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

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

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

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

#articles article p:last-child {
  margin-bottom: 0;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(108, 92, 231, 0.1);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

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

#articles article a:hover {
  background: var(--grad-accent);
  color: #fff;
  transform: translateX(2px);
}

#articles article a:hover::after {
  transform: translateX(3px);
}

/* ---------- FAQ ---------- */
#faq h3 {
  position: relative;
  margin-top: 1.4em;
  padding: 14px 18px 14px 46px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 1.02rem;
  cursor: default;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#faq h3::before {
  content: "Q";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: var(--grad-accent);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.35);
}

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

#faq h3 + p {
  margin: 0 0 1.2em;
  padding: 0 4px 0 18px;
  font-size: 0.95rem;
  border-left: 2px solid var(--border-strong);
}

/* ---------- HowTo ---------- */
#howto h4 {
  margin-top: 1.2em;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  color: var(--primary);
}

#howto h4 + p {
  padding-left: 14px;
}

/* ---------- Contact ---------- */
#contact p {
  word-break: break-word;
}

/* ---------- Sitemap / Links ---------- */
#sitemap ul,
#links ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

#sitemap li a,
#links li a {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: transform 0.28s var(--ease), background 0.28s var(--ease), color 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

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

/* ---------- Legal sections ---------- */
#privacy,
#disclaimer,
#copyright {
  font-size: 0.94rem;
}

#privacy h2,
#disclaimer h2,
#copyright h2 {
  font-size: 1.25rem;
}

/* ---------- Footer ---------- */
footer {
  margin-top: 40px;
  padding: 40px 20px 56px;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

footer p {
  max-width: 1200px;
  margin: 0 auto 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-soft);
  font-weight: 500;
}

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

/* ---------- Responsive ---------- */
@media (min-width: 900px) {
  #articles {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 899px) {
  :root {
    --header-h: 56px;
  }

  main > section {
    margin-top: 44px;
  }

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

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

  main {
    padding: 0 14px 56px;
  }

  nav[aria-label="主导航"] {
    padding: 0 10px;
  }

  nav[aria-label="主导航"] > ul {
    gap: 0;
  }

  nav[aria-label="主导航"] a {
    padding: 8px 10px;
    font-size: 0.86rem;
  }

  #hero {
    padding: 28px 20px;
    border-radius: var(--radius-md);
  }

  #hero::after {
    width: 220px;
    height: 220px;
    right: -90px;
    top: -90px;
  }

  #brand,
  #products,
  #solutions,
  #cases,
  #news,
  #articles,
  #faq,
  #howto,
  #contact,
  #sitemap,
  #links,
  #privacy,
  #disclaimer,
  #copyright {
    padding: 22px 18px;
    border-radius: var(--radius-md);
  }

  #faq h3 {
    padding: 12px 14px 12px 42px;
    font-size: 0.96rem;
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  #sitemap li a,
  #links li a {
    padding: 10px 12px;
    font-size: 0.86rem;
  }
}

@media (max-width: 380px) {
  #sitemap ul,
  #links ul {
    grid-template-columns: 1fr;
  }
}

/* ---------- Reduced motion ---------- */
@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;
  }
}

/* ---------- Print ---------- */
@media print {
  header,
  footer,
  nav[aria-label="主导航"],
  nav[aria-label="面包屑导航"] {
    display: none;
  }

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

  main > section {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}