:root {
  --brand: #6d28d9;
  --brand-2: #a855f7;
  --brand-3: #ec4899;
  --accent: #f59e0b;
  --bg: #f7f5ff;
  --bg-elev: #ffffff;
  --bg-soft: #f1ecff;
  --text: #1e1b2e;
  --text-soft: #4b4661;
  --text-mute: #6b6580;
  --border: rgba(109, 40, 217, 0.14);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --shadow-sm: 0 2px 8px rgba(76, 29, 149, 0.08);
  --shadow-md: 0 10px 30px rgba(76, 29, 149, 0.12);
  --shadow-lg: 0 22px 60px rgba(76, 29, 149, 0.18);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --maxw: 1180px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --grad-hero: linear-gradient(135deg, #6d28d9 0%, #a855f7 45%, #ec4899 100%);
  --grad-soft: linear-gradient(135deg, rgba(109, 40, 217, 0.1), rgba(236, 72, 153, 0.08));
}

html.dark {
  --bg: #0e0b1a;
  --bg-elev: #17122b;
  --bg-soft: #1d1638;
  --text: #f3efff;
  --text-soft: #cfc7e8;
  --text-mute: #a49cc2;
  --border: rgba(168, 85, 247, 0.22);
  --glass: rgba(30, 22, 56, 0.6);
  --glass-strong: rgba(30, 22, 56, 0.85);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  --grad-soft: linear-gradient(135deg, rgba(168, 85, 247, 0.16), rgba(236, 72, 153, 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: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(168, 85, 247, 0.18), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(236, 72, 153, 0.14), transparent 55%),
    radial-gradient(900px 600px at 50% 120%, rgba(109, 40, 217, 0.12), transparent 60%);
  background-attachment: fixed;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  height: auto;
  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-3);
}

html.dark a {
  color: #c4a5ff;
}

html.dark a:hover,
html.dark a:focus-visible {
  color: #f9a8d4;
}

:focus-visible {
  outline: 3px solid rgba(168, 85, 247, 0.55);
  outline-offset: 3px;
  border-radius: 6px;
}

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

h1 { font-size: clamp(1.65rem, 3.6vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.3rem); }

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

ul, ol {
  margin: 0 0 1.2em;
  padding-left: 1.3em;
  color: var(--text-soft);
}

li { margin-bottom: 0.45em; }

strong { color: var(--text); font-weight: 700; }

blockquote {
  margin: 0 0 1em;
  padding: 18px 22px;
  border-left: 4px solid var(--brand-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

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

time {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

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

#site-header.is-sticky {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-md);
  background: var(--glass-strong);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  flex-shrink: 0;
}

.brand svg {
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(109, 40, 217, 0.35);
  transition: transform 0.5s var(--ease);
}

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

.brand-name {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.02em;
}

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

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

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

#main-nav a:hover,
#main-nav a:focus-visible {
  color: var(--brand);
  background: rgba(109, 40, 217, 0.08);
  transform: translateY(-1px);
}

html.dark #main-nav a:hover,
html.dark #main-nav a:focus-visible {
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.16);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#site-search {
  display: flex;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 4px 4px 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#site-search:focus-within {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.16);
}

#site-search input {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  padding: 6px 4px;
  width: 150px;
  outline: none;
}

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

#site-search button,
#theme-toggle,
#menu-toggle {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 8px 16px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
}

#site-search button {
  background: var(--grad-hero);
  color: #fff;
  box-shadow: 0 6px 16px rgba(109, 40, 217, 0.32);
}

#site-search button:hover { transform: translateY(-1px) scale(1.03); }

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

#theme-toggle:hover,
#menu-toggle:hover {
  color: var(--brand);
  border-color: var(--brand-2);
  transform: translateY(-1px);
}

#menu-toggle { display: none; }

/* ============ Breadcrumb ============ */
#breadcrumb {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px 0;
}

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

#breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: var(--text-mute);
  opacity: 0.6;
}

#breadcrumb a { color: var(--text-mute); font-weight: 600; }
#breadcrumb a:hover { color: var(--brand); }
#breadcrumb [aria-current] { color: var(--brand); font-weight: 700; }

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

main > section {
  margin-top: 40px;
  padding: clamp(22px, 3.4vw, 40px);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

main > section.is-visible {
  opacity: 1;
  transform: none;
}

main > section:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(168, 85, 247, 0.3);
}

main > section > h2 {
  position: relative;
  padding-bottom: 12px;
  margin-bottom: 22px;
}

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

main > section > h3 {
  margin-top: 1.6em;
  color: var(--brand);
}

html.dark main > section > h3 { color: #c4a5ff; }

/* ============ Hero ============ */
#hero {
  margin-top: 24px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  display: grid;
  gap: 24px;
  opacity: 1;
  transform: none;
}

#hero:hover { box-shadow: none; border-color: transparent; }

.hero-slider {
  position: relative;
  min-height: 300px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--grad-hero);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

.hero-slider::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 85% 10%, rgba(255, 255, 255, 0.28), transparent 60%),
    radial-gradient(500px 260px at 10% 90%, rgba(255, 255, 255, 0.16), transparent 60%);
  z-index: 0;
  pointer-events: none;
}

.hero-slider .slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: clamp(24px, 4vw, 52px);
  padding-bottom: 88px;
  opacity: 0;
  transform: translateX(24px) scale(0.99);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  pointer-events: none;
  z-index: 1;
}

.hero-slider .slide.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.hero-slider .slide svg {
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  margin-bottom: 6px;
}

.hero-slider .slide h2 {
  color: #fff;
  font-size: clamp(1.3rem, 2.8vw, 2rem);
  margin: 0;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.24);
}

.hero-slider .slide p {
  color: rgba(255, 255, 255, 0.92);
  max-width: 640px;
  margin: 0;
  font-size: 0.98rem;
}

.slider-controls {
  position: absolute;
  left: clamp(24px, 4vw, 52px);
  bottom: 24px;
  display: flex;
  gap: 10px;
  z-index: 2;
}

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

.slider-controls button:hover {
  background: rgba(255, 255, 255, 0.32);
  border-color: #fff;
  transform: translateY(-2px);
}

.hero-intro {
  padding: clamp(22px, 3.4vw, 40px);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.hero-intro h1 {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 0;
}

.stat {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--grad-soft);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-mute);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.stat:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat strong {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}

/* ============ Articles ============ */
#articles {
  display: block;
}

#articles > article {
  padding: 20px 22px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#articles > article.is-visible {
  opacity: 1;
  transform: none;
}

#articles > article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(168, 85, 247, 0.4);
}

#articles > article h3 {
  margin: 0 0 6px;
  color: var(--text);
}

#articles > article h3::before {
  content: "#";
  color: var(--brand-2);
  margin-right: 6px;
  font-weight: 800;
}

#articles > article time {
  font-size: 0.8rem;
  color: var(--text-mute);
  margin-bottom: 8px;
}

#articles > article p { margin-bottom: 10px; font-size: 0.95rem; }

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

#articles > article a:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

/* ============ News ============ */
#news ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#news li {
  position: relative;
  padding: 14px 18px 14px 42px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 0.94rem;
  color: var(--text-soft);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#news li::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--grad-hero);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.16);
}

#news li:hover {
  transform: translateX(6px);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: var(--shadow-sm);
}

#news time {
  margin-right: 10px;
  font-weight: 700;
  color: var(--brand);
}

html.dark #news time { color: #c4a5ff; }

/* ============ FAQ ============ */
#faq details {
  margin-bottom: 12px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#faq details:hover {
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: var(--shadow-md);
}

#faq details[open] {
  border-color: var(--brand-2);
}

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

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-soft);
  color: var(--brand);
  font-weight: 800;
  font-size: 1.1rem;
  transition: transform 0.35s var(--ease), background 0.3s var(--ease);
}

#faq details[open] summary::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
  background: var(--grad-hero);
  color: #fff;
}

#faq summary:hover {
  background: rgba(168, 85, 247, 0.06);
  color: var(--brand);
}

html.dark #faq summary:hover { color: #d8b4fe; }

#faq details p {
  margin: 0;
  padding: 0 20px 18px;
  font-size: 0.95rem;
  animation: faqFade 0.4s var(--ease);
}

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

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

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

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-hero);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.32);
}

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

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

/* ============ Contact / Footer lists ============ */
#contact ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 8px;
}

#contact > ul:first-of-type li {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 0.94rem;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

#contact > ul:first-of-type li:hover {
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateX(4px);
}

#contact h3 + ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#contact h3 + ul li { margin: 0; }

#contact h3 + ul a {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.3s var(--ease), transform 0.25s var(--ease), box-shadow 0.3s var(--ease);
}

#contact h3 + ul a:hover {
  background: var(--grad-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ============ Footer ============ */
#site-footer {
  margin-top: 40px;
  padding: clamp(28px, 4vw, 48px) 20px 40px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-top: 1px solid var(--border);
  text-align: center;
}

#site-footer p {
  max-width: 900px;
  margin: 0 auto 10px;
  font-size: 0.84rem;
  color: var(--text-mute);
  line-height: 1.8;
}

#site-footer a {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 22px;
  border-radius: 999px;
  background: var(--grad-hero);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 8px 22px rgba(109, 40, 217, 0.3);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

#site-footer a:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(109, 40, 217, 0.42);
}

/* ============ Back to top ============ */
#back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 90;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--grad-hero);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s var(--ease), box-shadow 0.3s var(--ease);
}

#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

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

/* ============ Responsive ============ */
@media (min-width: 900px) {
  #hero {
    grid-template-columns: 1.05fr 1fr;
    align-items: stretch;
  }
  .hero-slider { min-height: 100%; }
}

@media (max-width: 1024px) {
  #site-search input { width: 120px; }
  #main-nav a { padding: 7px 10px; font-size: 0.88rem; }
}

@media (max-width: 860px) {
  .header-inner { gap: 12px; }
  #main-nav {
    order: 3;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s var(--ease), opacity 0.3s var(--ease);
  }
  #main-nav.is-open {
    max-height: 480px;
    opacity: 1;
  }
  #main-nav ul {
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
  }
  #main-nav a {
    display: block;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
  }
  #menu-toggle { display: inline-block; }
  .header-tools { margin-left: auto; }
  #site-search { order: 2; }
}

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  body { font-size: 15px; }
  .header-inner { padding: 8px 14px; }
  main { padding: 0 14px 48px; }
  #breadcrumb { padding: 12px 14px 0; }
  main > section { margin-top: 28px; padding: 20px 16px; border-radius: var(--radius); }
  #hero { padding: 0; }
  .hero-slider { border-radius: var(--radius); min-height: 340px; }
  .hero-slider .slide { padding: 22px; padding-bottom: 84px; }
  .hero-slider .slide svg { width: 84px; height: 84px; }
  .hero-intro { padding: 20px 16px; border-radius: var(--radius); }
  .hero-stats { gap: 8px; }
  .stat { flex: 1 1 100%; padding: 12px 14px; }
  .stat strong { font-size: 1.4rem; }
  .brand-name { font-size: 1.02rem; }
  #site-search { display: none; }
  #theme-toggle { padding: 7px 12px; font-size: 0.8rem; }
  #menu-toggle { padding: 7px 12px; font-size: 0.8rem; }
  #articles > article { padding: 16px; }
  #faq summary { padding: 14px 48px 14px 16px; }
  #faq details p { padding: 0 16px 16px; }
  #howto ol li { padding: 12px 14px 12px 50px; }
  #news li { padding: 12px 14px 12px 38px; }
  #news li::before { left: 15px; }
  #contact h3 + ul { gap: 8px; }
  #back-to-top { right: 14px; bottom: 16px; width: 44px; height: 44px; }
}

/* ============ Motion & print ============ */
@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;
  }
  main > section,
  #articles > article {
    opacity: 1 !important;
    transform: none !important;
  }
}

@media print {
  #site-header,
  #breadcrumb,
  #back-to-top,
  .slider-controls,
  #site-footer a {
    display: none !important;
  }
  body { background: #fff; color: #000; }
  main > section,
  #articles > article {
    opacity: 1 !important;
    transform: none !important;
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
  }
}

::selection {
  background: rgba(168, 85, 247, 0.28);
  color: inherit;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #a855f7, #ec4899);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6d28d9, #a855f7);
  background-clip: padding-box;
}