:root {
  --brand: #e63946;
  --brand-dark: #c1121f;
  --brand-light: #ff6b76;
  --accent: #1d3557;
  --accent-2: #457b9d;
  --ink: #1a1a2e;
  --ink-soft: #4a4a5e;
  --ink-mute: #6b6b80;
  --bg: #f7f8fc;
  --bg-elev: #ffffff;
  --bg-soft: #eef1f8;
  --border: rgba(26, 26, 46, 0.08);
  --glass: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.45);
  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 26, 46, 0.09);
  --shadow-lg: 0 18px 48px rgba(26, 26, 46, 0.14);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --grad-hero: linear-gradient(135deg, #e63946 0%, #ff6b76 42%, #457b9d 100%);
  --grad-brand: linear-gradient(135deg, #e63946 0%, #c1121f 100%);
  --grad-accent: linear-gradient(135deg, #1d3557 0%, #457b9d 100%);
  --grad-soft: linear-gradient(135deg, rgba(230, 57, 70, 0.08), rgba(69, 123, 157, 0.08));
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 72px;
  --maxw: 1180px;
}

[data-theme="dark"] {
  --ink: #eef1f8;
  --ink-soft: #c3c8d6;
  --ink-mute: #9aa0b4;
  --bg: #0e1220;
  --bg-elev: #161c2e;
  --bg-soft: #1c2338;
  --border: rgba(255, 255, 255, 0.09);
  --glass: rgba(22, 28, 46, 0.62);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  --grad-soft: linear-gradient(135deg, rgba(230, 57, 70, 0.16), rgba(69, 123, 157, 0.16));
}

*,
*::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: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 8% -8%, rgba(230, 57, 70, 0.1), transparent 60%),
    radial-gradient(55vw 55vw at 100% 0%, rgba(69, 123, 157, 0.12), transparent 55%),
    radial-gradient(50vw 50vw at 50% 120%, rgba(29, 53, 87, 0.08), transparent 60%);
}

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 {
  color: var(--brand-dark);
}

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

h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: clamp(1.1rem, 2.2vw, 1.3rem); }

p { margin: 0 0 1em; }

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

li { margin-bottom: 0.4em; }

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

::selection {
  background: var(--brand);
  color: #fff;
}

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

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 1000;
  padding: 12px 20px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  transition: top 0.3s var(--ease);
}

.skip-link:focus {
  top: 16px;
  color: #fff;
}

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

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

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

.brand a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
}

.brand svg {
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(230, 57, 70, 0.35);
  transition: transform 0.4s var(--ease);
}

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

.brand-name {
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

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

.nav-list li { margin: 0; }

.nav-list a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}

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

.nav-list a:hover {
  color: var(--brand);
  background: var(--grad-soft);
}

.nav-list a:hover::after {
  width: 40%;
}

.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: var(--radius-pill);
  padding: 3px 3px 3px 14px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.site-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.14);
}

.site-search input {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.9rem;
  font-family: inherit;
  padding: 7px 6px;
  width: 170px;
  outline: none;
}

.site-search input::placeholder {
  color: var(--ink-mute);
}

.site-search button,
#theme-toggle,
#menu-toggle {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  background: var(--grad-brand);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  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 {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(230, 57, 70, 0.35);
  filter: brightness(1.05);
}

#theme-toggle {
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--border);
}

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

#menu-toggle {
  display: none;
}

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

main > section {
  margin: 0 0 28px;
  padding: clamp(20px, 4vw, 40px);
  background: var(--bg-elev);
  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.35s var(--ease);
  will-change: opacity, transform;
}

main > section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* ===== Breadcrumb ===== */
.breadcrumb {
  margin: 20px 0 18px;
  font-size: 0.88rem;
}

.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--ink-mute);
}

.breadcrumb li {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--ink-mute);
  opacity: 0.6;
}

.breadcrumb a {
  color: var(--ink-soft);
}

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

/* ===== Hero ===== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.hero.is-visible {
  opacity: 1;
  transform: none;
}

.hero-slider {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--grad-hero);
}

.hero-slider .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
  pointer-events: none;
}

.hero-slider .slide.active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

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

.hero-slider::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.28));
}

.hero-text {
  position: relative;
  margin: -60px auto 0;
  width: min(100%, 900px);
  padding: clamp(22px, 4vw, 40px);
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 2;
}

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

.hero-lead {
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  color: var(--ink-mute);
  font-size: 0.92rem;
  margin: 18px 0;
}

.hero-stats .stat {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.cta,
.cta-secondary {
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  margin: 4px 8px 4px 0;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease),
    filter 0.28s var(--ease);
}

.cta {
  color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 10px 24px rgba(230, 57, 70, 0.35);
}

.cta:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(230, 57, 70, 0.45);
}

.cta-secondary {
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--border);
}

.cta-secondary:hover {
  color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* ===== Anchor nav ===== */
.anchor-nav {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 40;
  margin: 0 0 28px;
  padding: 10px 14px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: none;
}

.anchor-nav::-webkit-scrollbar {
  display: none;
}

.anchor-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.anchor-nav li { margin: 0; }

.anchor-nav a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.anchor-nav a:hover {
  color: #fff;
  background: var(--grad-brand);
  transform: translateY(-2px);
}

/* ===== Section content ===== */
main > section > h2 {
  position: relative;
  padding-left: 18px;
}

main > section > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 5px;
  border-radius: 5px;
  background: var(--grad-brand);
}

main > section > h3 {
  color: var(--accent-2);
  margin-top: 1.4em;
}

[data-theme="dark"] main > section > h3 {
  color: var(--brand-light);
}

main > section > p,
main > section > ul,
main > section > ol {
  color: var(--ink-soft);
}

/* ===== Cards: articles, news, cases, reviews ===== */
.article-card {
  position: relative;
  padding: 22px 24px;
  margin: 0 0 18px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.32s var(--ease), box-shadow 0.32s var(--ease),
    border-color 0.32s var(--ease), background-color 0.32s var(--ease);
}

.article-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 4px;
  border-radius: 4px;
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity 0.32s var(--ease);
}

.article-card:hover {
  transform: translateY(-4px);
  background: var(--bg-elev);
  border-color: rgba(230, 57, 70, 0.28);
  box-shadow: var(--shadow-md);
}

.article-card:hover::before {
  opacity: 1;
}

.article-card h3 {
  margin-bottom: 0.35em;
}

.article-card .meta {
  font-size: 0.82rem;
  color: var(--ink-mute);
  margin-bottom: 0.7em;
}

.article-card > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.article-card > a::after {
  content: "→";
  transition: transform 0.28s var(--ease);
}

.article-card > a:hover::after {
  transform: translateX(5px);
}

#news article {
  padding: 20px 22px;
  margin: 0 0 16px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#news article:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

#news h3 {
  margin-bottom: 0.2em;
}

#news time {
  font-size: 0.82rem;
  color: var(--brand);
  font-weight: 600;
}

#news article p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
}

#cases h3 {
  position: relative;
  padding-left: 16px;
}

#cases h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad-brand);
}

blockquote {
  margin: 0 0 16px;
  padding: 20px 24px 20px 28px;
  background: var(--bg-soft);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  position: relative;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    background-color 0.3s var(--ease);
}

blockquote::before {
  content: "\201C";
  position: absolute;
  top: 2px;
  right: 18px;
  font-size: 3.4rem;
  line-height: 1;
  color: var(--brand);
  opacity: 0.14;
  font-family: Georgia, serif;
}

blockquote:hover {
  transform: translateY(-3px);
  background: var(--bg-elev);
  box-shadow: var(--shadow-md);
}

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

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

#faq details[open] {
  background: var(--bg-elev);
  border-color: rgba(230, 57, 70, 0.3);
  box-shadow: var(--shadow-sm);
}

#faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 52px 16px 20px;
  font-weight: 600;
  color: var(--ink);
  position: relative;
  transition: color 0.25s var(--ease);
  user-select: none;
}

#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: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 400;
  transition: transform 0.35s var(--ease);
}

#faq details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

#faq summary:hover {
  color: var(--brand);
}

#faq details > p {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--ink-soft);
  animation: fadeIn 0.4s var(--ease);
}

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

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

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 12px 16px 12px 56px;
  margin-bottom: 10px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

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

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

#howto ul li::marker,
#knowledge ul li::marker,
main > section > ul li::marker {
  color: var(--brand);
}

/* ===== Contact ===== */
address {
  font-style: normal;
  padding: 20px 24px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
}

address p {
  margin: 0 0 8px;
  color: var(--ink-soft);
}

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

address strong {
  color: var(--ink);
}

/* ===== 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: 7px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  color: var(--ink-soft);
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: var(--grad-brand);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(230, 57, 70, 0.3);
}

/* ===== Footer ===== */
#site-footer {
  margin-top: 40px;
  padding: 48px 20px 28px;
  background: var(--grad-accent);
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  overflow: hidden;
}

#site-footer::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -120px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(230, 57, 70, 0.22);
  filter: blur(40px);
  pointer-events: none;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  position: relative;
  z-index: 1;
}

#site-footer h2 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.8em;
  position: relative;
  padding-bottom: 8px;
}

#site-footer h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 3px;
  border-radius: 3px;
  background: var(--brand);
}

#site-footer p {
  font-size: 0.9rem;
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.78);
}

#site-footer a {
  color: rgba(255, 255, 255, 0.9);
}

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

#site-footer > section:not(.footer-inner) {
  max-width: var(--maxw);
  margin: 18px auto 0;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 1;
}

#site-footer > section:not(.footer-inner) h2 {
  font-size: 0.98rem;
  margin-bottom: 0.5em;
}

#site-footer > section:not(.footer-inner) h2::after {
  display: none;
}

#site-footer > section:not(.footer-inner) p {
  margin-bottom: 0;
}

.footer-copy,
.footer-update {
  max-width: var(--maxw);
  margin: 24px auto 0 !important;
  text-align: center;
  font-size: 0.84rem !important;
  color: rgba(255, 255, 255, 0.62) !important;
  position: relative;
  z-index: 1;
}

.footer-update {
  margin-top: 6px !important;
}

/* ===== Back to top ===== */
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 90;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0;
  color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 12px 28px rgba(230, 57, 70, 0.42);
  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.35s var(--ease);
}

#back-to-top::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 54%;
  width: 12px;
  height: 12px;
  border-left: 3px solid #fff;
  border-top: 3px solid #fff;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 2px;
}

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

#back-to-top:hover {
  box-shadow: 0 16px 36px rgba(230, 57, 70, 0.55);
  transform: translateY(-3px) scale(1.05);
}

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

  .site-search input {
    width: 130px;
  }
}

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

  .header-inner {
    padding: 10px 16px;
    justify-content: space-between;
  }

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

  #main-nav {
    order: 3;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s var(--ease), opacity 0.3s var(--ease);
    opacity: 0;
  }

  #main-nav.is-open {
    max-height: 480px;
    opacity: 1;
  }

  .nav-list {
    flex-direction: column;
    gap: 2px;
    padding: 8px 0 4px;
  }

  .nav-list a {
    display: block;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
  }

  .nav-list a::after {
    display: none;
  }

  .header-tools {
    gap: 8px;
  }

  .site-search {
    order: 1;
    flex: 1 1 100%;
    padding: 3px 3px 3px 12px;
  }

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

  main {
    padding: 0 14px 44px;
  }

  .hero-text {
    margin-top: -32px;
    border-radius: var(--radius);
  }

  .anchor-nav {
    top: calc(var(--header-h) + 6px);
    border-radius: var(--radius);
  }

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

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

  main > section {
    border-radius: var(--radius);
    padding: 18px 16px;
  }

  .hero-text {
    padding: 20px 16px;
  }

  .hero-stats {
    font-size: 0.86rem;
  }

  .cta,
  .cta-secondary {
    display: block;
    text-align: center;
    margin: 8px 0;
  }

  .article-card,
  blockquote,
  #news article {
    padding: 16px 16px;
  }

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

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

  #howto ol li {
    padding: 12px 12px 12px 50px;
  }

  .footer-inner {
    gap: 20px;
  }

  #site-footer {
    padding: 36px 14px 22px;
  }
}

/* ===== 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 {
    opacity: 1;
    transform: none;
  }
}

/* ===== Print ===== */
@media print {
  #site-header,
  .anchor-nav,
  #back-to-top,
  .skip-link {
    display: none !important;
  }

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

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

  #site-footer {
    background: #fff;
    color: #000;
  }
}