:root {
  --brand: #ff5a8a;
  --brand-dark: #e63f70;
  --brand-light: #ffd6e4;
  --accent: #6b5cff;
  --accent-2: #4dc3ff;
  --bg: #fff7fa;
  --bg-soft: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --text: #2a2233;
  --text-soft: #6a6076;
  --text-faint: #9a90a6;
  --border: rgba(255, 90, 138, 0.16);
  --shadow-sm: 0 2px 8px rgba(255, 90, 138, 0.08);
  --shadow-md: 0 10px 30px rgba(255, 90, 138, 0.12);
  --shadow-lg: 0 20px 50px rgba(107, 92, 255, 0.16);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.7);
  --grad-banner: linear-gradient(135deg, #ff5a8a 0%, #6b5cff 55%, #4dc3ff 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 90, 138, 0.14), rgba(107, 92, 255, 0.12));
  --header-h: 68px;
  --max-w: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  color-scheme: light;
}

html[data-theme="dark"],
body.dark-mode {
  --bg: #12101a;
  --bg-soft: #1a1726;
  --bg-elevated: rgba(34, 30, 48, 0.72);
  --text: #f2eef8;
  --text-soft: #b8aecb;
  --text-faint: #7d7492;
  --border: rgba(255, 138, 176, 0.18);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
  --glass-bg: rgba(30, 26, 44, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --grad-soft: linear-gradient(135deg, rgba(255, 90, 138, 0.18), rgba(107, 92, 255, 0.16));
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  -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.75;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255, 90, 138, 0.12), transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(107, 92, 255, 0.1), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(77, 195, 255, 0.08), transparent 45%);
  background-attachment: fixed;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

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

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

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

ul,
ol {
  padding-left: 1.3em;
  margin: 0 0 1em;
}

li {
  margin-bottom: 0.4em;
}

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

h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); }
h3 { font-size: clamp(1.1rem, 2.2vw, 1.35rem); }

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

blockquote {
  margin: 1.2em 0;
  padding: 1em 1.3em;
  border-left: 4px solid var(--brand);
  background: var(--grad-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-soft);
}

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

time {
  font-size: 0.85em;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 800;
}

.brand svg {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(255, 90, 138, 0.35);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.brand a:hover svg {
  transform: rotate(-6deg) scale(1.06);
  box-shadow: 0 10px 24px rgba(255, 90, 138, 0.5);
}

.brand-name {
  font-size: 1.2rem;
  background: linear-gradient(120deg, #ff5a8a, #6b5cff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.04em;
}

#main-nav {
  flex: 1 1 auto;
}

#main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

#main-nav li { margin: 0; }

#main-nav a {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: 999px;
  position: relative;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

#main-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 0.3s var(--ease);
}

#main-nav a:hover,
#main-nav a:focus-visible {
  color: var(--brand);
  background: rgba(255, 90, 138, 0.1);
  transform: translateY(-1px);
}

#main-nav a:hover::after { width: 40%; }

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#site-search {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.3rem 0.2rem 0.9rem;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#site-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(255, 90, 138, 0.14);
}

#search-input {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.4rem 0;
  width: 150px;
  outline: none;
  font-family: inherit;
}

#search-input::placeholder { color: var(--text-faint); }

#site-search button,
#theme-toggle,
#menu-toggle,
#back-to-top {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 6px 16px rgba(255, 90, 138, 0.3);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
}

#site-search button:hover,
#theme-toggle:hover,
#menu-toggle:hover,
#back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 90, 138, 0.45);
  filter: brightness(1.05);
}

#site-search button:active,
#theme-toggle:active,
#menu-toggle:active,
#back-to-top:active {
  transform: translateY(0) scale(0.97);
}

#theme-toggle {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

#theme-toggle:hover {
  color: var(--brand);
  box-shadow: var(--shadow-md);
}

#menu-toggle {
  display: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

#breadcrumb {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.9rem 1.25rem 0;
}

#breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-faint);
}

#breadcrumb li { margin: 0; }

#breadcrumb li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--text-faint);
}

#breadcrumb a { color: var(--text-soft); font-weight: 600; }
#breadcrumb a:hover { color: var(--brand); }

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

main > section {
  margin: 2.2rem 0;
  padding: clamp(1.2rem, 3vw, 2.2rem);
  background: var(--bg-elevated);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.4s var(--ease);
  animation: rise-in 0.7s var(--ease) both;
  animation-timeline: view();
  animation-range: entry 0% cover 22%;
}

@supports not (animation-timeline: view()) {
  main > section {
    animation: none;
  }
}

main > section:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 90, 138, 0.28);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

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

#hero {
  padding: clamp(1.4rem, 3.5vw, 2.6rem);
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 90, 138, 0.22), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(107, 92, 255, 0.18), transparent 55%),
    var(--bg-elevated);
  border: 1px solid var(--glass-border);
}

#hero-title {
  background: linear-gradient(120deg, #ff5a8a 0%, #6b5cff 50%, #4dc3ff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s linear infinite;
}

.hero-lead {
  font-size: 1.02rem;
  color: var(--text-soft);
  max-width: 78ch;
}

.banner-carousel {
  position: relative;
  margin: 1.6rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--grad-banner);
  isolation: isolate;
}

.banner-slide {
  display: none;
  animation: float-in 0.6s var(--ease) both;
}

.banner-slide.is-active,
.banner-slide:first-child {
  display: block;
}

.banner-slide svg {
  width: 100%;
  height: auto;
  display: block;
}

.banner-controls {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 2;
}

.banner-controls button {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.banner-controls button:hover {
  background: rgba(255, 255, 255, 0.34);
  transform: translateY(-2px);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.8rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 1.1rem 0.6rem;
  text-align: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

.stat-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 90, 138, 0.4);
}

.stat-num {
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  font-weight: 900;
  background: linear-gradient(120deg, #ff5a8a, #6b5cff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-soft);
}

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

#products ul li,
#howto ul li,
#howto ol li,
#sitemap li,
#links li {
  position: relative;
  padding: 0.6rem 0.9rem 0.6rem 2.1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  margin: 0;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), color 0.28s var(--ease);
}

#products ul li::before,
#howto ul li::before,
#howto ol li::before,
#sitemap li::before,
#links li::before {
  content: "✦";
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand);
  font-size: 0.85rem;
}

#products ul li:hover,
#howto ul li:hover,
#howto ol li:hover,
#sitemap li:hover,
#links li:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

#news article,
#articles article {
  position: relative;
  padding: 1.1rem 1.2rem;
  margin-bottom: 0.9rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  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;
}

#news article::before,
#articles article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

#news article:hover,
#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 90, 138, 0.35);
}

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

#news article h3,
#articles article h3 {
  margin-bottom: 0.35rem;
}

#articles article a {
  display: inline-block;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
}

#articles article a:hover {
  transform: translateX(3px);
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}

#faq details {
  margin-bottom: 0.75rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#faq details:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 90, 138, 0.35);
}

#faq summary {
  cursor: pointer;
  padding: 1rem 1.2rem 1rem 2.6rem;
  font-weight: 700;
  color: var(--text);
  position: relative;
  list-style: none;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

#faq summary::-webkit-details-marker { display: none; }

#faq summary::before {
  content: "+";
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.3rem;
  height: 1.3rem;
  line-height: 1.25rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border-radius: 50%;
  transition: transform 0.3s var(--ease);
}

#faq details[open] summary {
  color: var(--brand);
  background: var(--grad-soft);
}

#faq details[open] summary::before {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
}

#faq details p {
  padding: 0 1.2rem 1rem 2.6rem;
  margin: 0;
  animation: float-in 0.35s var(--ease) both;
}

#cases blockquote p {
  margin-bottom: 0.6rem;
}

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

#contact p {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  line-height: 2;
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
}

#contact p a { font-weight: 700; }

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

#sitemap a,
#links a {
  display: block;
  font-weight: 600;
  color: var(--text-soft);
}

#sitemap li:hover a,
#links li:hover a {
  color: var(--brand);
}

#site-footer {
  position: relative;
  margin-top: 3rem;
  background: linear-gradient(160deg, rgba(255, 90, 138, 0.1), rgba(107, 92, 255, 0.1)), var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 2.6rem 1.25rem 5rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.6rem;
}

#site-footer section {
  background: var(--bg-elevated);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

#site-footer section:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

#site-footer h2 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
  color: var(--text);
}

#site-footer p {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 0.6rem;
}

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

#site-footer #copyright {
  font-size: 0.82rem;
  color: var(--text-faint);
}

#site-footer #privacy,
#site-footer #disclaimer {
  font-size: 0.8rem;
  color: var(--text-faint);
  line-height: 1.7;
}

#back-to-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.4rem;
  z-index: 90;
  padding: 0.7rem 1.1rem;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), box-shadow 0.3s var(--ease);
}

#back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 980px) {
  #main-nav {
    order: 3;
    flex-basis: 100%;
    display: none;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
    animation: float-in 0.35s var(--ease) both;
  }

  #main-nav.is-open { display: block; }

  #main-nav ul {
    flex-direction: column;
    gap: 0.2rem;
  }

  #main-nav a {
    display: block;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
  }

  #main-nav a::after { display: none; }

  #menu-toggle { display: inline-block; }

  .header-tools { margin-left: auto; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  :root { --header-h: 60px; }

  body { font-size: 15px; }

  .header-inner {
    padding: 0.5rem 0.9rem;
    gap: 0.6rem;
  }

  .brand-name { font-size: 1.05rem; }

  #site-search { padding-left: 0.7rem; }

  #search-input { width: 92px; font-size: 0.82rem; }

  #site-search button,
  #theme-toggle,
  #menu-toggle {
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
  }

  #breadcrumb { padding: 0.7rem 0.9rem 0; }

  main { padding: 0 0.9rem 2.4rem; }

  main > section {
    margin: 1.4rem 0;
    border-radius: var(--radius-md);
  }

  .banner-controls {
    right: 0.6rem;
    bottom: 0.6rem;
  }

  .banner-controls button {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }

  .stats {
    gap: 0.7rem;
    margin-top: 1.2rem;
  }

  .stat-item { padding: 0.85rem 0.4rem; }

  #faq summary { padding: 0.85rem 1rem 0.85rem 2.3rem; }

  #faq details p { padding: 0 1rem 0.9rem 2.3rem; }

  #contact p { padding: 0.85rem 1rem; line-height: 1.9; }

  #site-footer { padding: 1.8rem 0.9rem 4.6rem; }

  #back-to-top {
    right: 0.8rem;
    bottom: 0.9rem;
    padding: 0.6rem 0.9rem;
    font-size: 0.8rem;
  }
}

@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;
  }
}

@media print {
  #site-header,
  #breadcrumb,
  #back-to-top,
  .banner-controls,
  .header-tools {
    display: none !important;
  }

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

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