:root {
  --bg-primary: #0d0d1a;
  --bg-secondary: #14142b;
  --bg-card: rgba(30, 30, 60, 0.55);
  --bg-card-hover: rgba(40, 40, 80, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --text-primary: #f0f0ff;
  --text-secondary: #b0b0d0;
  --text-muted: #7a7a9a;
  --accent: #6c5ce7;
  --accent-2: #a29bfe;
  --accent-3: #fd79a8;
  --gradient-start: #1a1a2e;
  --gradient-mid: #16213e;
  --gradient-end: #0f3460;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f5f6fa;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.65);
    --bg-card-hover: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #8a8aaa;
    --accent: #5b4cdb;
    --accent-2: #7c6ff0;
    --accent-3: #e84393;
    --gradient-start: #eef1ff;
    --gradient-mid: #f0e6ff;
    --gradient-end: #e6f0ff;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.75;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition), color var(--transition);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(108, 92, 231, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(253, 121, 168, 0.1), transparent),
    radial-gradient(ellipse 70% 60% at 50% 100%, rgba(15, 52, 96, 0.2), transparent);
  pointer-events: none;
}

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

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

a:hover {
  color: var(--accent-3);
}

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

ul,
ol {
  list-style: none;
}

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

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

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  margin-bottom: 0.75rem;
  color: var(--accent-2);
}

h4 {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

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

@media (prefers-color-scheme: light) {
  header {
    background: rgba(255, 255, 255, 0.72);
  }
}

header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

header nav > a:first-child {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: filter var(--transition), transform var(--transition);
}

header nav > a:first-child:hover {
  filter: brightness(1.2);
  transform: scale(1.03);
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

header nav ul li a {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition), transform var(--transition);
  white-space: nowrap;
}

header nav ul li a:hover {
  color: var(--text-primary);
  background: rgba(108, 92, 231, 0.18);
  transform: translateY(-1px);
}

/* ========== MAIN LAYOUT ========== */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}

section {
  margin-bottom: 2.5rem;
  padding: 2rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

section:hover {
  border-color: rgba(108, 92, 231, 0.35);
  box-shadow: 0 12px 48px rgba(108, 92, 231, 0.15);
}

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

section:nth-child(2) { animation-delay: 0.05s; }
section:nth-child(3) { animation-delay: 0.1s; }
section:nth-child(4) { animation-delay: 0.15s; }
section:nth-child(5) { animation-delay: 0.2s; }

/* ========== HOME / HERO BANNER ========== */
#home {
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-mid) 50%, var(--gradient-end) 100%);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(108, 92, 231, 0.25);
}

#home::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(162, 155, 254, 0.25), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: floatOrb 8s ease-in-out infinite;
}

#home::after {
  content: "";
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(253, 121, 168, 0.2), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: floatOrb 10s ease-in-out infinite reverse;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -20px) scale(1.08); }
}

#home h1 {
  position: relative;
  z-index: 1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-2) 60%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@media (prefers-color-scheme: light) {
  #home h1 {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 60%, var(--accent-3) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

#home > p {
  position: relative;
  z-index: 1;
  font-size: 1.05rem;
  max-width: 720px;
  color: var(--text-secondary);
}

/* Breadcrumb */
#home nav[aria-label="面包屑导航"] ol {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

#home nav[aria-label="面包屑导航"] ol li {
  display: flex;
  align-items: center;
}

#home nav[aria-label="面包屑导航"] ol li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: var(--text-muted);
  opacity: 0.6;
}

#home nav[aria-label="面包屑导航"] ol li a {
  color: var(--accent-2);
}

/* ========== ABOUT ========== */
#about h3 {
  margin-top: 1.5rem;
}

#about h4 {
  margin-top: 1rem;
}

#about p {
  max-width: 900px;
}

/* ========== PRODUCTS ========== */
#products h4 {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(108, 92, 231, 0.15);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  margin-top: 1.25rem;
  transition: background var(--transition), transform var(--transition);
}

#products h4:hover {
  background: rgba(108, 92, 231, 0.28);
  transform: translateX(4px);
}

/* ========== SOLUTIONS ========== */
#solutions h3 {
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent-3);
  margin-top: 1.25rem;
}

/* ========== SCENARIOS ========== */
#scenarios h3 {
  color: var(--accent-3);
}

/* ========== CASES ========== */
#cases h3 {
  margin-top: 1.25rem;
}

#cases p:last-of-type,
#cases p {
  position: relative;
}

#cases h3 + p {
  padding-left: 1rem;
  border-left: 2px solid rgba(108, 92, 231, 0.3);
}

#cases h3:last-of-type {
  margin-top: 1.75rem;
  color: var(--accent-3);
}

#cases h3:last-of-type ~ p {
  font-style: italic;
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  background: rgba(108, 92, 231, 0.08);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-2);
  margin-bottom: 0.75rem;
  transition: background var(--transition), transform var(--transition);
}

#cases h3:last-of-type ~ p:hover {
  background: rgba(108, 92, 231, 0.15);
  transform: translateX(4px);
}

/* ========== NEWS ========== */
#news h3 {
  margin-top: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
}

#news h3 + p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

#news h3 + p::first-line {
  color: var(--accent-2);
  font-weight: 600;
}

/* ========== ARTICLES ========== */
#articles > article {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  background: rgba(108, 92, 231, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

#articles > article:hover {
  transform: translateY(-4px);
  background: rgba(108, 92, 231, 0.12);
  border-color: rgba(108, 92, 231, 0.4);
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.15);
}

#articles > article h3 {
  margin-bottom: 0.35rem;
  color: var(--text-primary);
  transition: color var(--transition);
}

#articles > article:hover h3 {
  color: var(--accent-2);
}

#articles > article p:nth-of-type(1) {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

#articles > article p:nth-of-type(2) {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

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

#articles > article p:last-child a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-radius: 999px;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

#articles > article p:last-child a::after {
  content: "→";
  transition: transform var(--transition);
}

#articles > article p:last-child a:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.4);
  filter: brightness(1.1);
}

#articles > article p:last-child a:hover::after {
  transform: translateX(3px);
}

/* ========== FAQ ========== */
#faq h3 {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  background: rgba(108, 92, 231, 0.1);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  cursor: default;
  transition: background var(--transition), transform var(--transition);
  font-size: 1.05rem;
}

#faq h3:hover {
  background: rgba(108, 92, 231, 0.2);
  transform: translateX(4px);
}

#faq h3 + p {
  padding: 0 1rem;
  margin-bottom: 0.5rem;
}

/* ========== HOWTO ========== */
#howto h4 {
  position: relative;
  padding-left: 2rem;
  margin-top: 1.25rem;
  counter-increment: howto-step;
}

#howto h4::before {
  content: counter(howto-step);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.35);
}

#howto {
  counter-reset: howto-step;
}

#howto h3:not(:first-of-type) {
  margin-top: 1.5rem;
}

/* ========== KNOWLEDGE ========== */
#knowledge h3 {
  color: var(--accent-3);
}

/* ========== CONTACT ========== */
#contact h3 {
  margin-top: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
}

#contact p {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  padding-left: 0.25rem;
}

#contact p strong {
  color: var(--accent-2);
}

/* ========== SITEMAP ========== */
#sitemap ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

#sitemap ul li a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: rgba(108, 92, 231, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  text-align: center;
  transition: all var(--transition);
}

#sitemap ul li a:hover {
  color: var(--text-primary);
  background: rgba(108, 92, 231, 0.22);
  border-color: rgba(108, 92, 231, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.2);
}

/* ========== LINKS ========== */
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

#links ul li a {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: rgba(108, 92, 231, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  transition: all var(--transition);
}

#links ul li a:hover {
  color: var(--text-primary);
  background: rgba(108, 92, 231, 0.22);
  border-color: rgba(108, 92, 231, 0.45);
  transform: translateY(-2px);
}

/* ========== FOOTER ========== */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

footer section {
  margin-bottom: 0;
  padding: 1.5rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: border-color var(--transition), transform var(--transition);
}

footer section:hover {
  border-color: rgba(108, 92, 231, 0.3);
  transform: translateY(-3px);
}

footer h2 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  color: var(--accent-2);
}

footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ========== SCROLL ANIMATIONS ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#about,
#products,
#solutions,
#scenarios,
#cases,
#news,
#articles,
#faq,
#howto,
#knowledge,
#contact,
#sitemap,
#links {
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@supports (animation-timeline: view()) {
  #about,
  #products,
  #solutions,
  #scenarios,
  #cases,
  #news,
  #articles,
  #faq,
  #howto,
  #knowledge,
  #contact,
  #sitemap,
  #links {
    animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent-2), var(--accent-3));
}

/* ========== SELECTION ========== */
::selection {
  background: rgba(108, 92, 231, 0.4);
  color: var(--text-primary);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  main {
    padding: 1.25rem 1rem 2.5rem;
  }

  section {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.75rem;
  }

  header nav {
    padding: 0.65rem 1rem;
  }

  header nav ul {
    gap: 0.1rem;
  }

  header nav ul li a {
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
  }

  footer {
    padding: 0 1rem 2.5rem;
    gap: 1rem;
  }

  footer section {
    padding: 1.25rem;
  }
}

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

  header nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  header nav > a:first-child {
    font-size: 1.15rem;
  }

  header nav ul {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  header nav ul li a {
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
  }

  main {
    padding: 1rem 0.75rem 2rem;
  }

  section {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
  }

  #home::before,
  #home::after {
    width: 280px;
    height: 280px;
  }

  #articles > article {
    padding: 1rem;
  }

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

  #sitemap ul li a {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }

  #links ul li a {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
  }

  footer {
    grid-template-columns: 1fr;
    padding: 0 0.75rem 2rem;
    gap: 0.75rem;
  }

  footer section {
    padding: 1rem;
  }

  #howto h4 {
    padding-left: 1.85rem;
  }

  #howto h4::before {
    width: 1.35rem;
    height: 1.35rem;
    font-size: 0.72rem;
  }
}

@media (max-width: 380px) {
  header nav ul li a {
    padding: 0.3rem 0.45rem;
    font-size: 0.72rem;
  }

  section {
    padding: 1rem 0.85rem;
  }
}

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

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

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

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