:root {
  --primary: #6c5ce7;
  --primary-light: #a29bfe;
  --primary-dark: #4834d4;
  --accent: #fd79a8;
  --accent-light: #ffeaa7;
  --bg: #f8f9fe;
  --bg-alt: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-glass: rgba(255, 255, 255, 0.55);
  --text: #2d3436;
  --text-secondary: #636e72;
  --text-light: #b2bec3;
  --border: rgba(108, 92, 231, 0.12);
  --shadow-sm: 0 2px 8px rgba(108, 92, 231, 0.08);
  --shadow-md: 0 8px 24px rgba(108, 92, 231, 0.12);
  --shadow-lg: 0 16px 48px rgba(108, 92, 231, 0.18);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #a29bfe;
    --primary-light: #6c5ce7;
    --primary-dark: #b8b0ff;
    --accent: #fd79a8;
    --accent-light: #ffd3e0;
    --bg: #0f0e17;
    --bg-alt: #1a1928;
    --bg-card: rgba(30, 28, 50, 0.78);
    --bg-glass: rgba(30, 28, 50, 0.6);
    --text: #e8e6f0;
    --text-secondary: #a8a4c0;
    --text-light: #6b6888;
    --border: rgba(162, 155, 254, 0.15);
    --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;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 10% 5%, rgba(108, 92, 231, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 15%, rgba(253, 121, 168, 0.06), transparent 50%),
    radial-gradient(ellipse 70% 60% at 50% 90%, rgba(162, 155, 254, 0.07), transparent 60%);
  pointer-events: none;
  transition: opacity var(--transition);
}

@media (prefers-color-scheme: dark) {
  body::before {
    background:
      radial-gradient(ellipse 80% 60% at 10% 5%, rgba(162, 155, 254, 0.1), transparent 60%),
      radial-gradient(ellipse 60% 50% at 90% 15%, rgba(253, 121, 168, 0.08), transparent 50%),
      radial-gradient(ellipse 70% 60% at 50% 90%, rgba(108, 92, 231, 0.1), transparent 60%);
  }
}

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

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

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

ul {
  list-style: none;
}

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

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

header nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

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

header nav > a:first-child:hover {
  opacity: 0.85;
  transform: scale(1.03);
}

header nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

header nav ul li a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition), transform var(--transition);
  position: relative;
}

header nav ul li a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  transition: width var(--transition), left var(--transition);
}

header nav ul li a:hover {
  color: var(--primary);
  background: rgba(108, 92, 231, 0.06);
}

header nav ul li a:hover::after {
  width: 60%;
  left: 20%;
}

/* ========== MAIN ========== */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ========== H1 BANNER ========== */
main > h1 {
  position: relative;
  margin: 0 -24px 48px;
  padding: 80px 48px 72px;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #fff;
  text-align: center;
  background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 35%, #fd79a8 70%, #ffeaa7 100%);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  overflow: hidden;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

main > h1::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.12), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1), transparent 50%);
  pointer-events: none;
}

main > h1::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ========== SECTIONS ========== */
section {
  margin-bottom: 56px;
  animation: fadeInUp 0.6s ease both;
}

section:nth-child(odd) {
  animation-delay: 0.05s;
}

section:nth-child(even) {
  animation-delay: 0.1s;
}

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

section h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 12px;
  position: relative;
  letter-spacing: -0.01em;
}

section h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

section:hover h2::after {
  width: 80px;
}

section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 28px 0 10px;
  letter-spacing: -0.005em;
}

section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 20px 0 8px;
}

section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 12px;
  line-height: 1.85;
}

section > p:last-child {
  margin-bottom: 0;
}

/* ========== CARD STYLES ========== */
section#brand,
section#team,
section#products,
section#advantages,
section#solutions,
section#applications,
section#cases,
section#reviews,
section#news,
section#articles,
section#knowledge,
section#faq,
section#howto,
section#contact,
section#sitemap,
section#links,
section#legal,
section#update {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition), background var(--transition);
}

section#brand:hover,
section#team:hover,
section#products:hover,
section#advantages:hover,
section#solutions:hover,
section#applications:hover,
section#cases:hover,
section#reviews:hover,
section#news:hover,
section#articles:hover,
section#knowledge:hover,
section#faq:hover,
section#howto:hover,
section#contact:hover,
section#sitemap:hover,
section#links:hover,
section#legal:hover,
section#update:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(108, 92, 231, 0.2);
}

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

section#news article::before,
section#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity var(--transition);
}

section#news article:hover,
section#articles article:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
  border-color: rgba(108, 92, 231, 0.2);
}

section#news article:hover::before,
section#articles article:hover::before {
  opacity: 1;
}

section#news article h3,
section#articles article h3 {
  margin-top: 0;
  font-size: 1.05rem;
  color: var(--text);
  transition: color var(--transition);
}

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

section#news article time,
section#articles article time {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

section#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 8px;
  transition: gap var(--transition), color var(--transition);
}

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

section#articles article a:hover {
  gap: 8px;
  color: var(--accent);
}

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

/* ========== BLOCKQUOTE (REVIEWS) ========== */
section#reviews blockquote {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.04), rgba(253, 121, 168, 0.04));
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px 24px;
  margin-bottom: 16px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
}

section#reviews blockquote::before {
  content: "\201C";
  position: absolute;
  top: 8px;
  right: 20px;
  font-size: 3rem;
  color: var(--primary);
  opacity: 0.12;
  font-family: Georgia, serif;
  line-height: 1;
}

section#reviews blockquote:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
  border-left-color: var(--accent);
}

section#reviews blockquote p {
  font-style: italic;
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.925rem;
}

/* ========== FAQ ========== */
section#faq h3 {
  padding: 16px 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  margin: 0;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  position: relative;
  font-size: 1rem;
}

section#faq h3::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--primary);
  transition: transform var(--transition);
}

section#faq h3:hover {
  background: rgba(108, 92, 231, 0.06);
  color: var(--primary);
}

section#faq h3 + p {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  margin: 0 0 12px;
  font-size: 0.925rem;
  transition: background var(--transition), border-color var(--transition);
}

section#faq h3 + p:hover {
  background: rgba(108, 92, 231, 0.03);
}

/* ========== HOWTO ========== */
section#howto h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-size: 1rem;
  color: var(--text);
}

section#howto h4::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.12);
}

section#howto h3 {
  color: var(--primary);
  font-size: 1.05rem;
  margin-top: 32px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}

/* ========== CONTACT ========== */
section#contact p {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

section#contact p strong {
  color: var(--text);
  font-weight: 600;
  min-width: 80px;
}

/* ========== SITEMAP & LINKS ========== */
section#sitemap ul,
section#links ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

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

section#sitemap ul li a:hover,
section#links ul li a:hover {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.25);
}

/* ========== LEGAL ========== */
section#legal h2 {
  font-size: 1.15rem;
  margin-top: 32px;
}

section#legal h2:first-child {
  margin-top: 0;
}

section#legal h2::after {
  width: 32px;
  height: 2px;
}

section#legal p {
  font-size: 0.9rem;
  line-height: 1.9;
}

/* ========== UPDATE ========== */
section#update p {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

/* ========== FOOTER ========== */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  transition: background var(--transition), border-color var(--transition);
}

footer p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 6px;
  line-height: 1.7;
}

footer p:first-child {
  font-weight: 600;
  color: var(--text-secondary);
}

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

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

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

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

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  main > h1 {
    padding: 64px 32px 56px;
  }

  section#brand,
  section#team,
  section#products,
  section#advantages,
  section#solutions,
  section#applications,
  section#cases,
  section#reviews,
  section#news,
  section#articles,
  section#knowledge,
  section#faq,
  section#howto,
  section#contact,
  section#sitemap,
  section#links,
  section#legal,
  section#update {
    padding: 28px 24px;
  }
}

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

  header nav {
    height: auto;
    flex-direction: column;
    padding: 12px 16px;
    gap: 10px;
  }

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

  header nav ul {
    justify-content: center;
    gap: 2px;
  }

  header nav ul li a {
    padding: 5px 8px;
    font-size: 0.8rem;
  }

  main {
    padding: 0 16px 60px;
  }

  main > h1 {
    margin: 0 -16px 32px;
    padding: 48px 20px 44px;
    font-size: 1.4rem;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  section {
    margin-bottom: 36px;
  }

  section#brand,
  section#team,
  section#products,
  section#advantages,
  section#solutions,
  section#applications,
  section#cases,
  section#reviews,
  section#news,
  section#articles,
  section#knowledge,
  section#faq,
  section#howto,
  section#contact,
  section#sitemap,
  section#links,
  section#legal,
  section#update {
    padding: 22px 16px;
    border-radius: var(--radius-md);
  }

  section h2 {
    font-size: 1.2rem;
    margin-bottom: 18px;
  }

  section h3 {
    font-size: 1rem;
    margin-top: 22px;
  }

  section p {
    font-size: 0.9rem;
    line-height: 1.8;
  }

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

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

  section#sitemap ul li a,
  section#links ul li a {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  section#reviews blockquote {
    padding: 16px 16px;
  }

  section#reviews blockquote::before {
    font-size: 2.2rem;
    right: 12px;
  }

  section#faq h3 {
    padding: 12px 16px;
    font-size: 0.925rem;
  }

  section#faq h3::after {
    right: 14px;
  }

  section#faq h3 + p {
    padding: 12px 16px;
    font-size: 0.875rem;
  }

  footer {
    padding: 28px 16px;
  }

  footer p {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  main > h1 {
    padding: 36px 16px 32px;
    font-size: 1.2rem;
    line-height: 1.45;
  }

  section#brand,
  section#team,
  section#products,
  section#advantages,
  section#solutions,
  section#applications,
  section#cases,
  section#reviews,
  section#news,
  section#articles,
  section#knowledge,
  section#faq,
  section#howto,
  section#contact,
  section#sitemap,
  section#links,
  section#legal,
  section#update {
    padding: 18px 14px;
  }

  section#sitemap ul,
  section#links ul {
    grid-template-columns: 1fr 1fr;
  }

  section#contact p {
    flex-direction: column;
    gap: 2px;
  }
}

/* ========== 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,
  body::before {
    display: none;
  }

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

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

  main > h1 {
    background: none;
    color: #000;
    text-shadow: none;
  }
}