:root {
  --bg: #f6f7fb;
  --bg-soft: #ffffff;
  --bg-elev: rgba(255, 255, 255, 0.72);
  --text: #1a1a2e;
  --text-soft: #4a4a66;
  --text-mute: #74748c;
  --brand: #e94560;
  --brand-2: #6a3ff0;
  --brand-3: #0f3460;
  --accent: #ff7a59;
  --line: rgba(26, 26, 46, 0.1);
  --line-strong: rgba(26, 26, 46, 0.18);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.65);
  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow: 0 10px 30px rgba(26, 26, 46, 0.1);
  --shadow-lg: 0 22px 60px rgba(26, 26, 46, 0.16);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 72px;
  --maxw: 1200px;
  --grad-hero: linear-gradient(135deg, #1a1a2e 0%, #0f3460 45%, #6a3ff0 100%);
  --grad-brand: linear-gradient(135deg, #e94560 0%, #ff7a59 100%);
  --grad-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.12), rgba(106, 63, 240, 0.12));
  color-scheme: light;
}

html[data-theme="dark"],
body.dark-mode {
  --bg: #0d0f1a;
  --bg-soft: #151829;
  --bg-elev: rgba(24, 27, 46, 0.72);
  --text: #eef0f8;
  --text-soft: #b8bdd4;
  --text-mute: #8b90ab;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --glass: rgba(21, 24, 41, 0.55);
  --glass-border: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.6);
  --grad-hero: linear-gradient(135deg, #0d0f1a 0%, #16213e 45%, #3a1f7a 100%);
  color-scheme: dark;
}

*,
*::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", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(233, 69, 96, 0.12), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(106, 63, 240, 0.14), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  transition: background-color 0.35s var(--ease), color 0.35s 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(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

h1 { font-size: clamp(1.6rem, 3.4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 2rem); }
h3 { font-size: clamp(1.1rem, 1.9vw, 1.4rem); }
h4 { font-size: 1.05rem; }

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

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

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

blockquote {
  margin: 1.2em 0;
  padding: 1em 1.4em;
  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 { margin: 0; }

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

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

::selection {
  background: rgba(233, 69, 96, 0.28);
  color: var(--text);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--brand), var(--brand-2));
  border-radius: 999px;
  border: 2px solid var(--bg);
}

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

#site-header.scrolled {
  box-shadow: var(--shadow);
}

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

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

.brand:hover { text-decoration: none; color: var(--brand); }

.brand svg {
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(233, 69, 96, 0.3);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.brand:hover svg {
  transform: rotate(-6deg) scale(1.06);
  box-shadow: 0 10px 26px rgba(233, 69, 96, 0.45);
}

.brand-text {
  font-size: 1rem;
  white-space: nowrap;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

#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: 7px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  color: var(--text-soft);
  text-decoration: none;
  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: #fff;
  background: var(--grad-brand);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(233, 69, 96, 0.32);
}

#menu-toggle,
#theme-toggle {
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
  flex-shrink: 0;
}

#menu-toggle:hover,
#theme-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow);
  background: var(--grad-soft);
}

#menu-toggle { display: none; }

#site-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 4px 4px 4px 16px;
  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(233, 69, 96, 0.16);
}

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

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

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

#site-search button:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 20px rgba(233, 69, 96, 0.4);
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 20px 60px;
}

section {
  margin-bottom: 44px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

#hero {
  position: relative;
  margin-top: 8px;
  padding: 0;
}

.carousel {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--grad-hero);
  aspect-ratio: 3 / 1;
  min-height: 220px;
  isolation: isolate;
}

.carousel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 15, 26, 0.05) 0%, rgba(13, 15, 26, 0.55) 100%);
  pointer-events: none;
  z-index: 2;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.8s var(--ease), transform 1.2s var(--ease);
  z-index: 1;
}

.slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.slide svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 10px;
  z-index: 3;
}

.carousel-controls button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}

.carousel-controls button:hover {
  background: var(--grad-brand);
  transform: scale(1.1);
  border-color: transparent;
}

#hero-title {
  margin-top: 26px;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-lead {
  font-size: 1.02rem;
  max-width: 900px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.stat {
  position: relative;
  padding: 22px 18px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  text-align: center;
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

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

.stat:hover::before { opacity: 1; }

.stat .num {
  display: block;
  position: relative;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 900;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: -0.02em;
}

.stat span:last-child {
  position: relative;
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-mute);
}

#breadcrumb {
  margin: 4px 0 24px;
}

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

#breadcrumb li + li::before {
  content: "›";
  margin-right: 8px;
  color: var(--text-mute);
}

#breadcrumb a {
  color: var(--text-soft);
  text-decoration: none;
}

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

#toc {
  margin-bottom: 40px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}

#toc h2 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

#toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  counter-reset: toc;
}

#toc li { counter-increment: toc; }

#toc a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--text-soft);
  text-decoration: none;
  transition: all 0.3s var(--ease);
}

#toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--brand);
}

#toc a:hover {
  color: #fff;
  background: var(--grad-brand);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(233, 69, 96, 0.32);
}

#toc a:hover::before { color: rgba(255, 255, 255, 0.85); }

section:not(#hero):not(#breadcrumb):not(#toc) {
  position: relative;
  padding: 28px 30px;
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}

section:not(#hero):not(#breadcrumb):not(#toc):hover {
  box-shadow: var(--shadow);
}

section:not(#hero):not(#breadcrumb):not(#toc) > h2 {
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 22px;
}

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

section h3 {
  margin-top: 1.4em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

section h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad-brand);
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.14);
}

section h4 {
  color: var(--brand);
  margin-top: 1.2em;
}

#products h4 {
  padding-left: 14px;
  border-left: 3px solid var(--brand);
}

article {
  position: relative;
  padding: 20px 22px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

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

article h3 {
  margin-top: 0;
  font-size: 1.12rem;
}

article h3::before { display: none; }

article time {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand);
  background: var(--grad-soft);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

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

article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--grad-soft);
  text-decoration: none;
  transition: all 0.3s var(--ease);
}

article a::after {
  content: "→";
  transition: transform 0.3s var(--ease);
}

article a:hover {
  background: var(--grad-brand);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(233, 69, 96, 0.32);
}

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

.faq-list {
  display: grid;
  gap: 12px;
}

details {
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

details[open] {
  border-color: rgba(233, 69, 96, 0.4);
  box-shadow: var(--shadow-sm);
}

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

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

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

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

details summary:hover {
  color: var(--brand);
  background: var(--grad-soft);
}

details p {
  padding: 0 20px 18px;
  margin: 0;
  animation: fadeSlide 0.4s var(--ease);
}

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

#howto ol {
  counter-reset: howto;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
}

#howto ol li {
  counter-increment: howto;
  position: relative;
  padding: 14px 18px 14px 60px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text-soft);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#howto ol li::before {
  content: counter(howto);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 6px 16px rgba(233, 69, 96, 0.32);
}

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

address {
  font-style: normal;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--grad-soft);
  border: 1px solid var(--line);
  display: grid;
  gap: 6px;
}

address p { margin: 0; }

address a { font-weight: 700; }

#sitemap ul,
#links ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sitemap a,
#links a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--text-soft);
  text-decoration: none;
  transition: all 0.3s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: var(--grad-brand);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(233, 69, 96, 0.3);
  text-decoration: none;
}

#site-footer {
  position: relative;
  background: var(--grad-hero);
  color: rgba(255, 255, 255, 0.78);
  padding: 50px 20px 30px;
  margin-top: 20px;
  overflow: hidden;
}

#site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 15% 0%, rgba(233, 69, 96, 0.35), transparent 60%),
    radial-gradient(600px 300px at 85% 100%, rgba(106, 63, 240, 0.35), transparent 60%);
  pointer-events: none;
}

#site-footer > section {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto 28px;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

#site-footer > section:hover { box-shadow: none; }

#site-footer h2 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

#site-footer h3 {
  font-size: 0.95rem;
  color: #fff;
  margin: 14px 0 6px;
}

#site-footer h3::before { display: none; }

#site-footer p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  margin-bottom: 0.6em;
}

#site-footer a { color: #ffb3c0; }

#site-footer a:hover { color: #fff; }

#site-footer > section:last-of-type {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
}

#site-footer > section:last-of-type p {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.6);
}

#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 90;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: var(--grad-brand);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(233, 69, 96, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s, box-shadow 0.35s var(--ease);
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#back-to-top:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 18px 40px rgba(233, 69, 96, 0.6);
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@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;
  }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 1024px) {
  .header-inner { gap: 10px; }
  #main-nav ul { gap: 2px; }
  #main-nav a { padding: 6px 9px; font-size: 0.84rem; }
  #search-input { width: 130px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

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

  #theme-toggle { order: 4; }

  #site-search {
    order: 5;
    flex: 1 1 100%;
    margin-top: 4px;
  }

  #search-input { width: 100%; flex: 1; }

  #main-nav {
    order: 6;
    flex: 1 1 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s var(--ease);
  }

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

  #main-nav ul {
    flex-direction: column;
    gap: 4px;
    padding: 8px 0 4px;
  }

  #main-nav a {
    display: block;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    background: var(--bg-soft);
    border: 1px solid var(--line);
  }

  .brand-text { font-size: 0.9rem; }

  .carousel { aspect-ratio: 16 / 9; }

  main { padding: 18px 14px 48px; }

  section:not(#hero):not(#breadcrumb):not(#toc) {
    padding: 22px 18px;
    border-radius: var(--radius);
  }

  #toc { padding: 18px; }

  #toc ol { flex-direction: column; align-items: stretch; }

  #toc a { justify-content: flex-start; }

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

  .stat { padding: 16px 12px; }

  article { padding: 16px 16px; }

  #back-to-top { right: 14px; bottom: 16px; width: 44px; height: 44px; }
}

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

  .brand-text { display: none; }

  #hero-title { margin-top: 20px; }

  .hero-lead { font-size: 0.95rem; }

  .hero-stats { grid-template-columns: 1fr 1fr; }

  .stat span:last-child { font-size: 0.76rem; }

  section:not(#hero):not(#breadcrumb):not(#toc) { padding: 18px 14px; }

  details summary { padding: 13px 46px 13px 14px; font-size: 0.92rem; }

  details p { padding: 0 14px 14px; font-size: 0.9rem; }

  #howto ol li { padding: 12px 12px 12px 52px; font-size: 0.9rem; }

  #howto ol li::before { left: 10px; width: 28px; height: 28px; font-size: 0.8rem; }

  .carousel-controls { bottom: 10px; right: 10px; }

  .carousel-controls button { width: 38px; height: 38px; font-size: 1.2rem; }

  #site-search button { padding: 8px 12px; font-size: 0.8rem; }
}

@media print {
  #site-header, #back-to-top, #toc, .carousel-controls, #site-search { display: none !important; }
  body { background: #fff; color: #000; }
  section, article, .stat { box-shadow: none; border: 1px solid #ccc; }
  a { color: #000; text-decoration: underline; }
}