:root {
  --c-primary: #5b3fd6;
  --c-primary-dark: #4529b8;
  --c-secondary: #06d6a0;
  --c-accent: #ffd166;
  --c-bg: #f5f4fb;
  --c-surface: #ffffff;
  --c-surface-glass: rgba(255, 255, 255, 0.72);
  --c-text: #1d1b2e;
  --c-text-soft: #55526b;
  --c-border: rgba(91, 63, 214, 0.14);
  --shadow-sm: 0 2px 8px rgba(29, 27, 46, 0.06);
  --shadow-md: 0 8px 24px rgba(29, 27, 46, 0.09);
  --shadow-lg: 0 18px 48px rgba(91, 63, 214, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --grad-hero: linear-gradient(135deg, #5b3fd6 0%, #7a5cf0 45%, #06d6a0 100%);
  --grad-btn: linear-gradient(135deg, #5b3fd6 0%, #7a5cf0 100%);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-primary: #8b73ff;
    --c-primary-dark: #6f55f0;
    --c-secondary: #2ee6b0;
    --c-accent: #ffd166;
    --c-bg: #0f0e17;
    --c-surface: #1a1826;
    --c-surface-glass: rgba(26, 24, 38, 0.72);
    --c-text: #eceaf6;
    --c-text-soft: #a9a5c0;
    --c-border: rgba(139, 115, 255, 0.22);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6);
    --grad-hero: linear-gradient(135deg, #2a1d6b 0%, #4a2fa8 45%, #0e6b56 100%);
    --grad-btn: linear-gradient(135deg, #7a5cf0 0%, #5b3fd6 100%);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-text);
  background: var(--c-bg);
  background-image: radial-gradient(
      circle at 12% 0%,
      rgba(91, 63, 214, 0.08),
      transparent 45%
    ),
    radial-gradient(circle at 88% 12%, rgba(6, 214, 160, 0.07), transparent 40%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

h1,
h2,
h3,
h4 {
  line-height: 1.3;
  margin: 0 0 0.6em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
}

h2 {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  position: relative;
  padding-bottom: 0.5em;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--grad-btn);
}

h3 {
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  color: var(--c-text);
}

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

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.35em;
  color: var(--c-text-soft);
}

li {
  margin-bottom: 0.45em;
}

blockquote {
  margin: 0 0 1em;
  padding: 1em 1.25em;
  border-left: 4px solid var(--c-secondary);
  border-radius: var(--radius-sm);
  background: var(--c-surface-glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

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

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-surface-glass);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

header > div {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

header > div > a {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--grad-btn);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
  transition: transform 0.3s var(--ease);
}

header > div > a:hover {
  transform: scale(1.04);
}

header nav {
  flex: 1 1 auto;
}

header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

header nav li {
  margin: 0;
}

header nav a {
  display: inline-block;
  padding: 0.3rem 0.2rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--c-text-soft);
  position: relative;
}

header nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--grad-btn);
  transition: width 0.3s var(--ease);
}

header nav a:hover {
  color: var(--c-primary);
}

header nav a:hover::after {
  width: 100%;
}

header form[role="search"] {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 1 300px;
}

header form[role="search"] label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

header form[role="search"] input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-pill);
  outline: none;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

header form[role="search"] input::placeholder {
  color: var(--c-text-soft);
  opacity: 0.7;
}

header form[role="search"] input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(91, 63, 214, 0.18);
}

header form[role="search"] button {
  flex: 0 0 auto;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--grad-btn);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    filter 0.25s var(--ease);
}

header form[role="search"] button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  filter: brightness(1.06);
}

header form[role="search"] button:active {
  transform: translateY(0);
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

main > section {
  margin-bottom: 2rem;
  padding: 1.75rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.7s var(--ease) both;
}

main > section:nth-of-type(even) {
  background: var(--c-surface-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

#hero {
  position: relative;
  overflow: hidden;
  padding: 2.5rem 1.75rem;
  color: #fff;
  background: var(--grad-hero);
  background-size: 180% 180%;
  animation: fadeUp 0.7s var(--ease) both,
    gradShift 14s ease infinite alternate;
  border: none;
  box-shadow: var(--shadow-lg);
}

#hero::before,
#hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

#hero::before {
  width: 320px;
  height: 320px;
  top: -120px;
  right: -80px;
  background: rgba(255, 255, 255, 0.14);
  filter: blur(6px);
}

#hero::after {
  width: 220px;
  height: 220px;
  bottom: -100px;
  left: -60px;
  background: rgba(255, 209, 102, 0.22);
  filter: blur(10px);
}

@keyframes gradShift {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 100% 50%;
  }
}

#hero h1 {
  position: relative;
  z-index: 1;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
}

#hero p {
  position: relative;
  z-index: 1;
  max-width: 62ch;
  color: rgba(255, 255, 255, 0.92);
}

#hero figure {
  position: relative;
  z-index: 1;
  margin: 1.5rem 0 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s var(--ease);
}

#hero figure:hover {
  transform: translateY(-4px) scale(1.01);
}

#hero figure svg {
  width: 100%;
  height: auto;
}

#hero figcaption {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.22);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

#products ul,
#howto ul,
#howto ol,
#contact ul,
#sitemap ul,
#links ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

#products ul {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

#products ul li {
  position: relative;
  margin: 0;
  padding: 1rem 1.1rem 1rem 2.6rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  color: var(--c-text);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

#products ul li::before {
  content: "✦";
  position: absolute;
  left: 1rem;
  top: 1rem;
  color: var(--c-primary);
  font-size: 1.05rem;
  line-height: 1.75;
}

#products ul li:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-primary);
}

#news ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

#news ul > li {
  margin: 0;
  padding: 1.25rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#news ul > li:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

#news h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

#news p {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
}

#news p:first-of-type {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-primary);
  background: rgba(91, 63, 214, 0.1);
  border-radius: var(--radius-pill);
}

#articles {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

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

#articles article {
  padding: 1.35rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

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

#articles article h3 {
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
}

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

#articles article p:first-of-type {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-secondary);
  background: rgba(6, 214, 160, 0.12);
  border-radius: var(--radius-pill);
}

#articles article a {
  display: inline-block;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--grad-btn);
  color: #fff;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

#articles article a:hover {
  transform: translateX(3px);
  box-shadow: var(--shadow-md);
  color: #fff;
}

#faq h3 {
  position: relative;
  margin-top: 1.5rem;
  padding: 0.85rem 1rem 0.85rem 2.4rem;
  font-size: 1.02rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}

#faq h3::before {
  content: "Q";
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  background: var(--grad-btn);
  border-radius: 50%;
}

#faq h3:hover {
  background: rgba(91, 63, 214, 0.07);
  border-color: var(--c-primary);
}

#faq h3 + p {
  margin: 0.6rem 0 1.25rem;
  padding: 0 0.25rem 0 2.4rem;
  font-size: 0.94rem;
}

#howto ol {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

#howto ol li {
  position: relative;
  margin: 0;
  padding: 0.75rem 1rem 0.75rem 3rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  counter-increment: step;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--grad-btn);
  border-radius: 50%;
}

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

#howto ul {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

#howto ul li {
  margin: 0;
  padding: 0.7rem 1rem 0.7rem 2.3rem;
  position: relative;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
}

#howto ul li::before {
  content: "✓";
  position: absolute;
  left: 0.9rem;
  color: var(--c-secondary);
  font-weight: 700;
}

#contact ul,
#sitemap ul,
#links ul {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

#contact ul li {
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  color: var(--c-text);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

#contact ul li:hover {
  border-color: var(--c-primary);
  transform: translateY(-2px);
}

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

#sitemap ul a,
#links ul a {
  display: block;
  padding: 0.65rem 1rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--c-text);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
    color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

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

#legal h3 {
  margin-top: 1.25rem;
  padding-left: 0.9rem;
  border-left: 4px solid var(--c-primary);
}

footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  text-align: center;
  border-top: 1px solid var(--c-border);
}

footer p {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--c-text-soft);
}

footer a {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.45rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--grad-btn);
  border-radius: var(--radius-pill);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

footer a:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--c-secondary);
  outline-offset: 2px;
}

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

@media (min-width: 1024px) {
  #articles {
    grid-template-columns: repeat(3, 1fr);
  }

  main > section {
    padding: 2.25rem 2.5rem;
  }

  #hero {
    padding: 3.25rem 2.5rem;
  }
}

@media (max-width: 860px) {
  header > div {
    gap: 0.6rem 1rem;
  }

  header nav {
    order: 3;
    flex-basis: 100%;
  }

  header nav ul {
    gap: 0.15rem 0.85rem;
  }

  header form[role="search"] {
    flex: 1 1 200px;
  }
}

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

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

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

  header > div {
    padding: 0.65rem 0.85rem;
  }

  header > div > a {
    font-size: 1.15rem;
  }

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

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

  header nav a {
    white-space: nowrap;
    font-size: 0.85rem;
  }

  header form[role="search"] {
    flex-basis: 100%;
  }

  #hero {
    padding: 1.75rem 1.1rem;
  }

  #hero figure {
    margin-top: 1rem;
  }

  #faq h3 + p {
    padding-left: 0.25rem;
  }

  #products ul,
  #news ul,
  #howto ul,
  #contact ul,
  #sitemap ul,
  #links ul {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) {
  #products ul li:hover,
  #news ul > li:hover,
  #articles article:hover,
  #sitemap ul a:hover,
  #links ul a:hover {
    transform: none;
  }
}