:root {
  --primary: #1a3a8f;
  --primary-light: #2e5bbf;
  --primary-lighter: #3d6fd6;
  --accent: #ff7a3d;
  --accent-light: #ff9a66;
  --gradient-hero: linear-gradient(135deg, #1a3a8f 0%, #2e5bbf 45%, #3d6fd6 100%);
  --gradient-accent: linear-gradient(135deg, #ff7a3d 0%, #ff9a66 100%);
  --bg: #f4f6fb;
  --bg-alt: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-glass: rgba(255, 255, 255, 0.55);
  --text: #1c2333;
  --text-soft: #4a5468;
  --text-muted: #6b7488;
  --border: rgba(26, 58, 143, 0.12);
  --border-strong: rgba(26, 58, 143, 0.22);
  --shadow-sm: 0 2px 8px rgba(26, 58, 143, 0.06);
  --shadow-md: 0 8px 28px rgba(26, 58, 143, 0.10);
  --shadow-lg: 0 18px 50px rgba(26, 58, 143, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --header-h: 72px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html[data-theme="dark"],
html.dark {
  --primary: #6f9bff;
  --primary-light: #89b0ff;
  --primary-lighter: #a6c4ff;
  --accent: #ff8f5c;
  --accent-light: #ffab85;
  --gradient-hero: linear-gradient(135deg, #0b1530 0%, #142a5c 50%, #1d3a7a 100%);
  --gradient-accent: linear-gradient(135deg, #ff7a3d 0%, #ff9a66 100%);
  --bg: #0b1020;
  --bg-alt: #111830;
  --bg-card: rgba(22, 32, 60, 0.72);
  --bg-glass: rgba(18, 27, 52, 0.55);
  --text: #e8edf9;
  --text-soft: #b9c3da;
  --text-muted: #8b96b0;
  --border: rgba(140, 170, 255, 0.16);
  --border-strong: rgba(140, 170, 255, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(61, 111, 214, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(255, 122, 61, 0.08), transparent 55%);
  background-attachment: fixed;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

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

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

a:hover {
  color: var(--accent);
}

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

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

h1 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h3 { font-size: clamp(1.15rem, 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; }

blockquote {
  margin: 1.2em 0;
  padding: 1em 1.2em;
  border-left: 4px solid var(--accent);
  background: var(--bg-glass);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

time {
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

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

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

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  min-height: var(--header-h);
  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:hover { color: var(--primary); }

.brand svg {
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease);
}

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

.brand-name {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

nav[aria-label="主导航"] { flex: 1 1 auto; }

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

.nav-list a {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--text-soft);
  font-weight: 500;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.nav-list a:hover {
  color: var(--primary);
  background: rgba(61, 111, 214, 0.1);
  transform: translateY(-1px);
}

.site-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 4px 4px 14px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.site-search:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(61, 111, 214, 0.14);
}

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

.site-search input::placeholder { color: var(--text-muted); }
.site-search input:focus { width: 210px; }

.site-search button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-hero);
  padding: 7px 16px;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.site-search button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

#theme-toggle,
#menu-toggle {
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}

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

#menu-toggle { display: none; }

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

main > section {
  margin-bottom: 28px;
  padding: clamp(20px, 3.4vw, 40px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease), border-color 0.35s var(--ease);
}

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

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

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

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

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.breadcrumb li { color: var(--text-muted); }

.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--border-strong);
}

.breadcrumb a { color: var(--text-soft); }
.breadcrumb a:hover { color: var(--primary); }

/* ============ Hero ============ */
#hero {
  position: relative;
  overflow: hidden;
  background: var(--gradient-hero);
  color: #fff;
  border: 0;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

#hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 65%);
  pointer-events: none;
}

#hero::after {
  content: "";
  position: absolute;
  inset: auto auto -30% -10%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 122, 61, 0.28), transparent 65%);
  pointer-events: none;
}

#hero h1 {
  color: #fff;
  position: relative;
  z-index: 1;
  margin-bottom: 0.5em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

#hero p,
#hero .hero-lead {
  color: rgba(255, 255, 255, 0.88);
  position: relative;
  z-index: 1;
  max-width: 900px;
}

#hero .hero-carousel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 6px 2px 18px;
  margin: 10px 0 22px;
  scrollbar-width: thin;
}

#hero .hero-carousel::-webkit-scrollbar { height: 6px; }
#hero .hero-carousel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

#hero .slide {
  scroll-snap-align: start;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-md);
  padding: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}

#hero .slide:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.18);
}

#hero .slide svg {
  border-radius: var(--radius-sm);
  width: 100%;
  height: auto;
}

#hero .slide p {
  margin: 10px 4px 2px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

#hero .stats {
  position: relative;
  z-index: 1;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 0;
  padding: 0;
}

#hero .stats li {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}

#hero .stats li:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.16);
}

#hero .stats .count {
  display: block;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

#hero .stats span {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
}

/* ============ Anchor nav ============ */
.anchor-nav {
  margin-bottom: 28px;
}

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

.anchor-nav a {
  display: inline-block;
  padding: 7px 15px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s var(--ease);
}

.anchor-nav a:hover {
  color: #fff;
  background: var(--gradient-hero);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ============ Section headings ============ */
main > section > h2 {
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 1.1em;
}

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

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

main > section > h3:first-of-type { margin-top: 0.4em; }

/* ============ Lists in content ============ */
main > section > ul,
main > section > ol {
  color: var(--text-soft);
}

main > section > ul li,
main > section > ol li {
  margin-bottom: 0.5em;
}

/* ============ News & Articles ============ */
#news article,
#articles article {
  position: relative;
  margin-bottom: 16px;
  padding: 20px 22px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#news article:hover,
#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

#news article h3,
#articles article h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

#news article h3 a,
#articles article h3 a {
  color: var(--text);
  transition: color 0.25s var(--ease);
}

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

#news article p,
#articles article p {
  font-size: 0.94rem;
  margin-bottom: 0.6em;
}

#articles article > p:last-child a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(61, 111, 214, 0.1);
  color: var(--primary);
  transition: all 0.25s var(--ease);
}

#articles article > p:last-child a:hover {
  background: var(--gradient-hero);
  color: #fff;
  transform: translateX(3px);
}

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

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 14px 18px 14px 58px;
  margin-bottom: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

#howto ol li:hover {
  transform: translateX(4px);
  border-color: var(--border-strong);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gradient-hero);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}

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

#faq details[open] {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

#faq summary {
  cursor: pointer;
  list-style: none;
  position: relative;
  padding: 16px 52px 16px 20px;
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  transition: color 0.25s var(--ease), background 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: rgba(61, 111, 214, 0.12);
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 700;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}

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

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

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

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

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

#contact ul li {
  position: relative;
  padding: 14px 18px 14px 44px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.94rem;
  color: var(--text-soft);
  margin: 0;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

#contact ul li:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

#contact ul li::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gradient-accent);
}

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

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

#sitemap-links a,
#friend-links a {
  display: inline-block;
  padding: 7px 16px;
  font-size: 0.88rem;
  color: var(--text-soft);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 0.25s var(--ease);
}

#sitemap-links a:hover,
#friend-links a:hover {
  color: #fff;
  background: var(--gradient-hero);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ============ Footer ============ */
footer {
  background: var(--gradient-hero);
  color: rgba(255, 255, 255, 0.85);
  padding: 48px 20px 24px;
  margin-top: 20px;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto auto;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 65%);
  pointer-events: none;
}

footer > section {
  max-width: var(--maxw);
  margin: 0 auto 26px;
  position: relative;
  z-index: 1;
}

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

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

footer p,
footer address {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
  font-style: normal;
  line-height: 1.9;
}

footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer a:hover { color: #fff; }

footer .copyright {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.65);
}

/* ============ Back to top ============ */
#back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 90;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-hero);
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
}

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

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

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .site-search input { width: 140px; }
  .site-search input:focus { width: 170px; }
  #hero .stats { grid-template-columns: repeat(2, 1fr); }
}

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

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

  nav[aria-label="主导航"] {
    order: 5;
    flex: 1 1 100%;
    display: none;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }

  nav[aria-label="主导航"].open { display: block; }

  .nav-list {
    flex-direction: column;
    gap: 2px;
  }

  .nav-list a {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
  }

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

  .site-search {
    order: 6;
    flex: 1 1 100%;
    margin-top: 8px;
  }

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

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

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

  #hero { border-radius: var(--radius-lg); }

  #hero .hero-carousel {
    grid-auto-columns: minmax(240px, 82%);
  }

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

  #back-to-top {
    right: 14px;
    bottom: 16px;
    padding: 10px 15px;
  }
}

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

  #hero .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  #hero .stats li { padding: 12px 8px; }

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

  #theme-toggle,
  #menu-toggle {
    padding: 7px 11px;
    font-size: 0.8rem;
  }

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

  #howto ol li { padding-left: 50px; }
  #howto ol li::before { left: 12px; width: 26px; height: 26px; font-size: 0.82rem; }

  #faq summary { padding: 14px 46px 14px 16px; font-size: 0.95rem; }
  #faq details p { padding: 0 16px 16px; }
}

@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 print {
  #site-header,
  #back-to-top,
  .anchor-nav,
  .site-search,
  #theme-toggle,
  #menu-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  main > section { box-shadow: none; border: 1px solid #ccc; }
}