:root {
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --bg-glass: rgba(255, 255, 255, 0.55);
  --text: #1a1a2e;
  --text-soft: #4a4a63;
  --text-muted: #7a7a92;
  --primary: #6c5ce7;
  --primary-strong: #5a4bd4;
  --accent: #00cec9;
  --accent-warm: #fd79a8;
  --border: rgba(26, 26, 46, 0.1);
  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 8px 28px rgba(26, 26, 46, 0.1);
  --shadow-lg: 0 20px 50px rgba(26, 26, 46, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --header-h: 68px;
  --gradient-banner: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 40%, #00cec9 100%);
  --gradient-soft: linear-gradient(135deg, rgba(108, 92, 231, 0.12), rgba(0, 206, 201, 0.12));
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html[data-theme="dark"] {
  --bg: #10101c;
  --bg-soft: #181828;
  --bg-elevated: rgba(30, 30, 48, 0.72);
  --bg-glass: rgba(30, 30, 48, 0.55);
  --text: #f2f2f8;
  --text-soft: #c4c4d6;
  --text-muted: #8e8ea8;
  --primary: #a29bfe;
  --primary-strong: #8c82f7;
  --accent: #55efc4;
  --accent-warm: #fd79a8;
  --border: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
  --gradient-banner: linear-gradient(135deg, #2d2b55 0%, #4b3f8c 45%, #0f4c5c 100%);
  --gradient-soft: linear-gradient(135deg, rgba(162, 155, 254, 0.14), rgba(85, 239, 196, 0.12));
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #10101c;
    --bg-soft: #181828;
    --bg-elevated: rgba(30, 30, 48, 0.72);
    --bg-glass: rgba(30, 30, 48, 0.55);
    --text: #f2f2f8;
    --text-soft: #c4c4d6;
    --text-muted: #8e8ea8;
    --primary: #a29bfe;
    --primary-strong: #8c82f7;
    --accent: #55efc4;
    --border: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
    --gradient-banner: linear-gradient(135deg, #2d2b55 0%, #4b3f8c 45%, #0f4c5c 100%);
    --gradient-soft: linear-gradient(135deg, rgba(162, 155, 254, 0.14), rgba(85, 239, 196, 0.12));
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(108, 92, 231, 0.1), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(0, 206, 201, 0.1), transparent 40%);
  background-attachment: fixed;
  transition: background-color 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}

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

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

a:hover,
a:focus-visible {
  color: var(--primary-strong);
}

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

h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.8vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }

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

ul, ol { padding-left: 1.4em; color: var(--text-soft); }

li { margin-bottom: 0.5em; }

::selection {
  background: rgba(108, 92, 231, 0.28);
  color: var(--text);
}

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

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

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand svg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.35);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover svg {
  transform: rotate(-8deg) scale(1.08);
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--gradient-banner);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
}

#main-nav {
  flex: 1 1 auto;
  min-width: 0;
}

#main-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

#main-nav li {
  margin: 0;
}

#main-nav a {
  display: inline-block;
  padding: 7px 12px;
  font-size: 0.9rem;
  color: var(--text-soft);
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

#main-nav a:hover,
#main-nav a:focus-visible {
  color: var(--primary);
  background: rgba(108, 92, 231, 0.1);
  transform: translateY(-1px);
}

#site-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

#site-search input[type="search"] {
  width: 180px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, width 0.3s ease;
}

#site-search input[type="search"]::placeholder {
  color: var(--text-muted);
}

#site-search input[type="search"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.18);
  width: 220px;
}

#site-search button {
  padding: 8px 16px;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-banner);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

#site-search button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.4);
  filter: brightness(1.06);
}

#theme-toggle,
#menu-toggle {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.3s ease, background 0.25s ease, box-shadow 0.25s ease;
}

#theme-toggle:hover,
#menu-toggle:hover {
  transform: scale(1.1) rotate(6deg);
  box-shadow: var(--shadow-md);
}

#menu-toggle { display: none; }

/* ============ Main & Sections ============ */
main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

main > section {
  margin: 32px 0;
  padding: 32px clamp(18px, 3vw, 40px);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.35s ease, transform 0.35s ease, background 0.35s ease;
  opacity: 0;
  transform: translateY(28px);
}

main > section.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, background 0.35s ease;
}

main > section:hover {
  box-shadow: var(--shadow-md);
}

main > section > h2 {
  position: relative;
  padding-bottom: 14px;
  margin-top: 0;
}

main > section > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 4px;
  border-radius: 999px;
  background: var(--gradient-banner);
}

main > section h3 {
  margin-top: 1.6em;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
  border-radius: 2px;
}

/* ============ Banner ============ */
#banner {
  position: relative;
  margin-top: 28px;
  padding: clamp(32px, 5vw, 64px) clamp(20px, 4vw, 56px) clamp(72px, 8vw, 96px);
  border-radius: var(--radius-xl);
  background: var(--gradient-banner);
  background-size: 200% 200%;
  animation: bannerShift 14s ease infinite;
  color: #fff;
  overflow: hidden;
  opacity: 1;
  transform: none;
  border: none;
  box-shadow: var(--shadow-lg);
}

#banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.22), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.14), transparent 45%);
  pointer-events: none;
}

#banner::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  filter: blur(10px);
  pointer-events: none;
}

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

.banner-slide {
  display: none;
  position: relative;
  z-index: 1;
  animation: fadeSlide 0.7s ease both;
}

.banner-slide.active {
  display: block;
}

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

#banner h1,
#banner h2 {
  color: #fff;
  margin-top: 0;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
}

#banner h1 { font-size: clamp(1.55rem, 3.8vw, 2.5rem); }

#banner p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  margin-bottom: 0;
}

.banner-controls {
  position: absolute;
  right: clamp(20px, 4vw, 56px);
  bottom: clamp(20px, 3vw, 32px);
  display: flex;
  gap: 10px;
  z-index: 2;
}

.banner-controls button {
  padding: 8px 18px;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.banner-controls button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* ============ Breadcrumb ============ */
#breadcrumb {
  margin: 20px 0 0;
  padding: 0 4px;
  opacity: 0;
  transform: translateY(28px);
}

#breadcrumb.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

#breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  color: var(--text-muted);
}

#breadcrumb li {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#breadcrumb li + li::before {
  content: "›";
  color: var(--text-muted);
  font-size: 1rem;
}

#breadcrumb a {
  color: var(--text-muted);
}

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

#breadcrumb [aria-current="page"] {
  color: var(--primary);
  font-weight: 600;
}

/* ============ Products list ============ */
#products ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

#products ul li {
  position: relative;
  margin: 0;
  padding: 16px 18px 16px 46px;
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  font-size: 0.94rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

#products ul li::before {
  content: "🐼";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
}

#products ul li:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(108, 92, 231, 0.4);
}

/* ============ Cases blockquote ============ */
#cases blockquote {
  margin: 24px 0 0;
  padding: 20px 24px;
  background: var(--gradient-soft);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

#cases blockquote p {
  margin: 0 0 0.6em;
  font-style: italic;
  color: var(--text-soft);
}

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

/* ============ News / Articles cards ============ */
#news article,
#articles article {
  position: relative;
  margin: 18px 0;
  padding: 22px clamp(18px, 2.5vw, 28px);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  overflow: hidden;
}

#news article::before,
#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gradient-banner);
  opacity: 0;
  transition: opacity 0.35s ease;
}

#news article:hover,
#articles article:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(108, 92, 231, 0.35);
}

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

#news article h3,
#articles article h3 {
  margin: 0 0 8px;
  padding-left: 0;
  border-left: none;
  font-size: 1.15rem;
  transition: color 0.25s ease;
}

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

#news article time,
#articles article time {
  display: inline-block;
  margin-bottom: 10px;
  padding: 2px 12px;
  font-size: 0.78rem;
  color: var(--primary);
  background: rgba(108, 92, 231, 0.1);
  border-radius: 999px;
  letter-spacing: 0.03em;
}

#articles article p {
  font-size: 0.94rem;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 6px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-banner);
  border-radius: 999px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

#articles article a::after {
  content: "→";
  transition: transform 0.25s ease;
}

#articles article a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(108, 92, 231, 0.35);
  filter: brightness(1.05);
}

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

/* ============ FAQ ============ */
#faq details {
  margin: 12px 0;
  padding: 0;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

#faq details:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(108, 92, 231, 0.3);
}

#faq details[open] {
  border-color: rgba(108, 92, 231, 0.45);
  box-shadow: var(--shadow-md);
}

#faq summary {
  position: relative;
  padding: 16px 52px 16px 20px;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  transition: color 0.25s ease, background 0.25s ease;
}

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--primary);
  background: rgba(108, 92, 231, 0.12);
  border-radius: 50%;
  transition: transform 0.3s ease, background 0.25s ease;
}

#faq details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
  background: rgba(108, 92, 231, 0.22);
}

#faq summary:hover {
  color: var(--primary);
  background: rgba(108, 92, 231, 0.05);
}

#faq details p {
  margin: 0;
  padding: 0 20px 18px;
  font-size: 0.94rem;
  color: var(--text-soft);
  animation: faqIn 0.35s ease both;
}

@keyframes faqIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ HowTo lists ============ */
#howto ol,
#howto ul {
  padding: 0;
  list-style: none;
  counter-reset: howto-step;
}

#howto ol li {
  position: relative;
  margin: 12px 0;
  padding: 14px 18px 14px 56px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  counter-increment: howto-step;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

#howto ol li::before {
  content: counter(howto-step);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-banner);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.35);
}

#howto ul li {
  position: relative;
  margin: 10px 0;
  padding: 12px 18px 12px 44px;
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#howto ul li::before {
  content: "✓";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-weight: 700;
}

#howto ol li:hover,
#howto ul li:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(108, 92, 231, 0.3);
}

/* ============ Contact ============ */
#contact address {
  font-style: normal;
  margin: 20px 0;
}

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

#contact address li {
  position: relative;
  margin: 0;
  padding: 14px 18px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.94rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  word-break: break-word;
}

#contact address li:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(108, 92, 231, 0.35);
}

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

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

#sitemap a,
#links a {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.9rem;
  color: var(--text-soft);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: var(--gradient-banner);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(108, 92, 231, 0.35);
}

/* ============ Footer ============ */
#site-footer {
  position: relative;
  margin-top: 40px;
  padding: 48px clamp(20px, 4vw, 56px) 80px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  max-width: 100%;
}

#site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-banner);
}

#site-footer .footer-section h3 {
  margin: 0 0 12px;
  padding: 0;
  border: none;
  font-size: 1rem;
  color: var(--text);
}

#site-footer .footer-section p {
  margin: 0 0 0.8em;
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--text-muted);
}

#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 90;
  padding: 12px 18px;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-banner);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.25s ease;
}

#back-to-top:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: var(--shadow-lg);
  filter: brightness(1.08);
}

/* ============ Cookie notice ============ */
#cookie-notice {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 95;
  max-width: min(720px, calc(100% - 32px));
  padding: 14px 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  animation: cookieIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#cookie-notice p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-soft);
  text-align: center;
}

@keyframes cookieIn {
  from { opacity: 0; transform: translate(-50%, 24px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .header-inner {
    gap: 12px;
  }

  #main-nav ul {
    justify-content: flex-start;
  }

  #site-search input[type="search"] {
    width: 150px;
  }

  #site-search input[type="search"]:focus {
    width: 170px;
  }
}

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

  .header-inner {
    padding: 10px 16px;
    row-gap: 10px;
  }

  #menu-toggle {
    display: inline-flex;
    order: 3;
    margin-left: auto;
  }

  #theme-toggle {
    order: 4;
  }

  #site-search {
    order: 5;
    flex: 1 1 100%;
  }

  #site-search input[type="search"],
  #site-search input[type="search"]:focus {
    width: 100%;
    flex: 1;
  }

  #main-nav {
    order: 6;
    flex: 1 1 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }

  #main-nav.open {
    max-height: 640px;
  }

  #main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 6px 0 10px;
  }

  #main-nav a {
    display: block;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
  }

  main {
    padding: 0 14px 32px;
  }

  #banner {
    margin-top: 18px;
    border-radius: var(--radius-lg);
    padding-bottom: 88px;
  }

  .banner-controls {
    left: clamp(20px, 4vw, 56px);
    right: auto;
  }

  main > section {
    margin: 22px 0;
    padding: 24px 18px;
    border-radius: var(--radius-md);
  }

  #site-footer {
    padding: 36px 20px 100px;
    gap: 22px;
  }

  #back-to-top {
    right: 14px;
    bottom: 18px;
    padding: 10px 14px;
    font-size: 0.8rem;
  }

  #cookie-notice {
    bottom: 76px;
  }
}

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

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

  #site-search button {
    padding: 8px 14px;
  }

  #products ul,
  #contact address ul {
    grid-template-columns: 1fr;
  }

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

  #faq summary {
    padding: 14px 48px 14px 16px;
    font-size: 0.94rem;
  }

  #faq details p {
    padding: 0 16px 16px;
  }

  #howto ol li {
    padding-left: 50px;
  }

  #howto ul li {
    padding-left: 40px;
  }
}

/* ============ Motion preferences ============ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  main > section,
  #breadcrumb {
    opacity: 1;
    transform: none;
  }
}

/* ============ Print ============ */
@media print {
  #site-header,
  #banner,
  #breadcrumb,
  #back-to-top,
  #cookie-notice,
  #site-search,
  #menu-toggle,
  #theme-toggle,
  .banner-controls {
    display: none !important;
  }

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

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