:root {
  --primary: #7c3aed;
  --primary-light: #a78bfa;
  --primary-dark: #5b21b6;
  --accent: #ec4899;
  --accent-light: #f472b6;
  --bg: #f8f7fc;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-border: rgba(255, 255, 255, 0.5);
  --text: #1e1b2e;
  --text-secondary: #4a4560;
  --text-muted: #8b87a0;
  --border: #e8e5f0;
  --shadow-sm: 0 1px 3px rgba(30, 27, 46, 0.06);
  --shadow-md: 0 4px 16px rgba(30, 27, 46, 0.08);
  --shadow-lg: 0 12px 40px rgba(30, 27, 46, 0.12);
  --shadow-glow: 0 8px 32px rgba(124, 58, 237, 0.24);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #a78bfa;
    --primary-light: #c4b5fd;
    --primary-dark: #7c3aed;
    --accent: #f472b6;
    --accent-light: #f9a8d4;
    --bg: #0f0d17;
    --bg-card: #1a1725;
    --bg-glass: rgba(26, 23, 37, 0.78);
    --bg-glass-border: rgba(255, 255, 255, 0.08);
    --text: #ede9f5;
    --text-secondary: #b8b3c9;
    --text-muted: #7a7590;
    --border: #2a2640;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 8px 32px rgba(167, 139, 250, 0.3);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

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

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

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

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

ul,
ol {
  list-style: none;
}

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

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 4px;
}

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

/* ===== Header ===== */
header[role="banner"] {
  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(--bg-glass-border);
  transition: background var(--transition), box-shadow var(--transition);
}

header[role="banner"] nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

header[role="banner"] nav > a {
  font-size: 1.25rem;
  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);
}

header[role="banner"] nav > a:hover {
  opacity: 0.8;
  -webkit-text-fill-color: transparent;
}

header[role="banner"] nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

header[role="banner"] nav ul::-webkit-scrollbar {
  display: none;
}

header[role="banner"] nav ul li a {
  display: block;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

header[role="banner"] nav ul li a:hover {
  color: var(--primary);
  background: rgba(124, 58, 237, 0.08);
  transform: translateY(-1px);
}

/* ===== Main ===== */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 64px 0;
}

section + section {
  border-top: 1px solid var(--border);
}

section h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  position: relative;
  padding-left: 20px;
}

section h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

section h3 {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--text);
}

section p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.85;
}

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

/* ===== Hero ===== */
#hero {
  position: relative;
  padding: 80px 0 72px;
  text-align: center;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 30%, #ec4899 70%, #f472b6 100%);
  background-size: 300% 300%;
  animation: gradientShift 12s ease infinite;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
  overflow: hidden;
  border-top: none;
}

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

#hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.6;
}

#hero h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(1.5rem, 4.5vw, 2.5rem);
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 28px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

#hero p {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  line-height: 1.9;
  max-width: 780px;
  margin: 0 auto 18px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
}

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

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

/* ===== Cards ===== */
article {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 28px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
}

article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}

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

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

article:last-child {
  margin-bottom: 0;
}

/* ===== Lists in Products ===== */
#products article ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

#products article ul li {
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(236, 72, 153, 0.04));
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

#products article ul li:hover {
  transform: translateX(4px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

#products article ul li strong {
  color: var(--primary);
  font-weight: 700;
}

/* ===== Blockquote ===== */
blockquote {
  position: relative;
  margin: 16px 0;
  padding: 20px 24px 20px 56px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(236, 72, 153, 0.04));
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  transition: transform var(--transition), box-shadow var(--transition);
}

blockquote::before {
  content: "\201C";
  position: absolute;
  left: 16px;
  top: 8px;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--primary);
  opacity: 0.5;
  font-family: Georgia, serif;
}

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

blockquote p {
  color: var(--text-secondary);
  font-style: italic;
  margin: 0;
}

/* ===== News time ===== */
#news time {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(124, 58, 237, 0.08);
  padding: 3px 12px;
  border-radius: 100px;
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

/* ===== Articles links ===== */
#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  padding: 6px 0;
  position: relative;
  transition: gap var(--transition), color var(--transition);
}

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

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

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

/* ===== FAQ ===== */
#faq article {
  cursor: default;
}

#faq article h3 {
  position: relative;
  padding-left: 28px;
  color: var(--primary-dark);
}

@media (prefers-color-scheme: dark) {
  #faq article h3 {
    color: var(--primary-light);
  }
}

#faq article h3::before {
  content: "Q";
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  line-height: 1;
  margin-top: 3px;
}

/* ===== HowTo ===== */
#howto article ol {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

#howto article ol li {
  counter-increment: step;
  position: relative;
  padding: 12px 16px 12px 52px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

#howto article ol li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  line-height: 1;
}

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

#howto article ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

#howto article ul li {
  position: relative;
  padding: 10px 16px 10px 36px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  transition: transform var(--transition), border-color var(--transition);
}

#howto article ul li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

#howto article ul li:hover {
  transform: translateX(4px);
  border-color: var(--primary-light);
}

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

#contact article p:has(+ p) {
  margin-bottom: 6px;
}

/* ===== Sitemap & Links ===== */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sitemap ul li a,
#links ul li a {
  display: inline-block;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

#sitemap ul li a:hover,
#links ul li a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* ===== Legal ===== */
#legal article h3 {
  color: var(--primary-dark);
}

@media (prefers-color-scheme: dark) {
  #legal article h3 {
    color: var(--primary-light);
  }
}

/* ===== Footer ===== */
footer[role="contentinfo"] {
  margin-top: 48px;
  padding: 48px 24px 36px;
  background: linear-gradient(180deg, var(--bg), var(--bg-card));
  border-top: 1px solid var(--border);
  text-align: center;
}

footer[role="contentinfo"] p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.6;
}

footer[role="contentinfo"] p:first-child {
  font-weight: 600;
  color: var(--text-secondary);
}

footer[role="contentinfo"] nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

footer[role="contentinfo"] nav a {
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

footer[role="contentinfo"] nav a:hover {
  color: var(--primary);
}

/* ===== Scroll Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

section {
  animation: fadeInUp 0.7s ease both;
}

section:nth-child(1) { animation-delay: 0.05s; }
section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.15s; }
section:nth-child(4) { animation-delay: 0.2s; }
section:nth-child(5) { animation-delay: 0.25s; }
section:nth-child(6) { animation-delay: 0.3s; }
section:nth-child(7) { animation-delay: 0.35s; }
section:nth-child(8) { animation-delay: 0.4s; }
section:nth-child(9) { animation-delay: 0.45s; }
section:nth-child(10) { animation-delay: 0.5s; }
section:nth-child(11) { animation-delay: 0.55s; }
section:nth-child(12) { animation-delay: 0.6s; }

@supports (animation-timeline: view()) {
  section {
    animation: fadeInUp 0.7s ease both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  section {
    padding: 48px 0;
  }

  article {
    padding: 24px 20px 20px;
  }

  #hero {
    padding: 64px 20px 56px;
    margin: 0 -24px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

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

@media (max-width: 720px) {
  header[role="banner"] nav {
    padding: 0 16px;
    height: 60px;
    gap: 12px;
  }

  header[role="banner"] nav > a {
    font-size: 1.1rem;
  }

  header[role="banner"] nav ul li a {
    padding: 6px 10px;
    font-size: 0.8125rem;
  }

  main {
    padding: 0 16px;
  }

  section {
    padding: 40px 0;
  }

  section h2 {
    font-size: 1.375rem;
    margin-bottom: 24px;
    padding-left: 16px;
  }

  section h2::before {
    width: 4px;
  }

  section h3 {
    font-size: 1.0625rem;
  }

  article {
    padding: 20px 16px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
  }

  #hero {
    padding: 48px 16px 40px;
    margin: 0 -16px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }

  #hero h1 {
    font-size: 1.375rem;
    margin-bottom: 20px;
  }

  #hero p {
    font-size: 0.9375rem;
    line-height: 1.8;
  }

  blockquote {
    padding: 16px 16px 16px 44px;
  }

  blockquote::before {
    left: 12px;
    font-size: 2rem;
  }

  #sitemap ul li a,
  #links ul li a {
    padding: 8px 16px;
    font-size: 0.8125rem;
  }

  footer[role="contentinfo"] {
    padding: 36px 16px 28px;
  }

  footer[role="contentinfo"] nav {
    gap: 6px 14px;
  }
}

@media (max-width: 420px) {
  header[role="banner"] nav > a {
    font-size: 1rem;
  }

  header[role="banner"] nav ul li a {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

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

  #hero p {
    font-size: 0.875rem;
  }

  section h2 {
    font-size: 1.25rem;
  }

  #howto article ol li {
    padding: 10px 12px 10px 44px;
    font-size: 0.875rem;
  }

  #howto article ol li::before {
    width: 22px;
    height: 22px;
    font-size: 0.6875rem;
    left: 12px;
  }
}

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

  section {
    animation: none;
  }
}

/* ===== Print ===== */
@media print {
  header[role="banner"],
  footer[role="contentinfo"],
  #sitemap,
  #links {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

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

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