:root {
  --brand: #c8102e;
  --brand-dark: #a00d24;
  --brand-light: #e63950;
  --accent: #f5b301;
  --accent-soft: #ffd75e;
  --ink: #1a1d24;
  --ink-soft: #3c4250;
  --muted: #6b7280;
  --bg: #f7f8fb;
  --bg-elev: #ffffff;
  --bg-soft: #eef1f7;
  --line: rgba(26, 29, 36, 0.08);
  --line-strong: rgba(26, 29, 36, 0.16);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.55);
  --shadow-sm: 0 2px 8px rgba(26, 29, 36, 0.06);
  --shadow-md: 0 10px 28px rgba(26, 29, 36, 0.10);
  --shadow-lg: 0 22px 50px rgba(26, 29, 36, 0.16);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;
  --grad-hero: linear-gradient(135deg, #c8102e 0%, #e63950 42%, #f5b301 100%);
  --grad-brand: linear-gradient(135deg, #c8102e 0%, #e63950 100%);
  --grad-accent: linear-gradient(135deg, #f5b301 0%, #ffd75e 100%);
  --grad-deep: linear-gradient(160deg, #1f3a5f 0%, #2e7d32 100%);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 132px;
  color-scheme: light dark;
}

html[data-theme="dark"] {
  --brand: #ff4d63;
  --brand-dark: #e63950;
  --brand-light: #ff7285;
  --accent: #ffc93c;
  --accent-soft: #ffe08a;
  --ink: #f2f4f8;
  --ink-soft: #d4d9e3;
  --muted: #9aa3b2;
  --bg: #0e1116;
  --bg-elev: #171b22;
  --bg-soft: #1e232c;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --glass: rgba(23, 27, 34, 0.6);
  --glass-border: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 22px 50px rgba(0, 0, 0, 0.6);
  --grad-hero: linear-gradient(135deg, #7a0a1c 0%, #b3122a 45%, #a87a00 100%);
  --grad-brand: linear-gradient(135deg, #ff4d63 0%, #b3122a 100%);
  --grad-accent: linear-gradient(135deg, #d99a00 0%, #ffc93c 100%);
  --grad-deep: linear-gradient(160deg, #16283f 0%, #1d4d24 100%);
}

*,
*::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.75;
  color: var(--ink-soft);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 100% -10%, rgba(200, 16, 46, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(245, 179, 1, 0.10), transparent 55%);
  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-light);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.2vw, 1.35rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin-bottom: 0.35em; }

blockquote {
  margin: 0 0 1em;
  padding: 16px 20px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--ink-soft);
  font-style: italic;
}

blockquote p { margin: 0; }

time {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

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

small { color: var(--muted); }

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

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

.top-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 24px;
  padding: 7px 20px;
  font-size: 0.78rem;
  color: #fff;
  background: var(--grad-brand);
  letter-spacing: 0.02em;
}

.top-bar span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.top-bar span::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-soft);
  flex: none;
}

#main-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 24px;
}

#main-nav .logo {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  white-space: nowrap;
  transition: transform 0.3s var(--ease);
}

#main-nav .logo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--brand);
  opacity: 0.28;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

#main-nav .logo:hover { transform: translateY(-1px); }
#main-nav .logo:hover::after { opacity: 0.6; }

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

#main-nav > ul > li { margin: 0; }

#main-nav > ul a {
  display: inline-block;
  padding: 7px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
  position: relative;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

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

#main-nav > ul a:hover,
#main-nav > ul a:focus-visible {
  color: var(--brand);
  background: rgba(200, 16, 46, 0.08);
  transform: translateY(-1px);
}

#main-nav > ul a:hover::after { width: 60%; }

#site-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 280px;
  position: relative;
}

#site-search label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#site-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 14px;
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}

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

#site-search input[type="search"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.14);
  outline: none;
}

#site-search button[type="submit"] {
  flex: none;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  background: var(--grad-brand);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
}

#site-search button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(200, 16, 46, 0.32);
  filter: brightness(1.06);
}

#theme-toggle,
#menu-toggle {
  flex: none;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

#theme-toggle:hover,
#menu-toggle:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: rgba(200, 16, 46, 0.08);
  transform: translateY(-1px);
}

#menu-toggle { display: none; }

/* ---------- Main layout ---------- */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

main > nav[aria-label="面包屑导航"] ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

main > nav[aria-label="面包屑导航"] li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

main > nav[aria-label="面包屑导航"] li + li::before {
  content: "›";
  color: var(--line-strong);
  font-size: 1rem;
  line-height: 1;
}

main > nav[aria-label="面包屑导航"] a {
  color: var(--muted);
  padding: 2px 4px;
  border-radius: 6px;
}

main > nav[aria-label="面包屑导航"] a:hover {
  color: var(--brand);
  background: rgba(200, 16, 46, 0.08);
}

/* ---------- Section base ---------- */
main > section {
  position: relative;
  margin: 0 0 28px;
  padding: clamp(22px, 3.4vw, 40px);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.4s var(--ease), background 0.35s var(--ease);
  animation: rise 0.7s var(--ease) both;
}

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

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

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

main > section > h3 {
  margin-top: 26px;
  padding-left: 14px;
  border-left: 4px solid var(--accent);
  line-height: 1.35;
}

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

main > section > h4 {
  margin-top: 20px;
  color: var(--brand);
}

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

main > section:nth-of-type(1) { animation-delay: 0.02s; }
main > section:nth-of-type(2) { animation-delay: 0.06s; }
main > section:nth-of-type(3) { animation-delay: 0.10s; }
main > section:nth-of-type(4) { animation-delay: 0.14s; }
main > section:nth-of-type(5) { animation-delay: 0.18s; }
main > section:nth-of-type(6) { animation-delay: 0.22s; }
main > section:nth-of-type(7) { animation-delay: 0.26s; }
main > section:nth-of-type(8) { animation-delay: 0.30s; }
main > section:nth-of-type(9) { animation-delay: 0.34s; }
main > section:nth-of-type(10) { animation-delay: 0.38s; }
main > section:nth-of-type(n+11) { animation-delay: 0.42s; }

/* ---------- Hero ---------- */
#hero {
  overflow: hidden;
  color: #fff;
  background: var(--grad-hero);
  border: none;
  box-shadow: var(--shadow-lg);
  padding: clamp(28px, 4.4vw, 56px);
}

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

#hero::after {
  content: "";
  position: absolute;
  inset: auto auto -50% -20%;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(245, 179, 1, 0.35), transparent 68%);
  pointer-events: none;
}

#hero > * { position: relative; z-index: 1; }

#hero h1 {
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.22);
  max-width: 22em;
}

#hero > p {
  max-width: 62em;
  color: rgba(255, 255, 255, 0.94);
  font-size: 1.02rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.18);
}

#banner-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 18px;
  overflow-x: auto;
  padding: 6px 4px 18px;
  margin: 8px -4px 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}

#banner-carousel::-webkit-scrollbar { height: 8px; }
#banner-carousel::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.14); border-radius: 8px; }
#banner-carousel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.5); border-radius: 8px; }

#banner-carousel figure {
  margin: 0;
  scroll-snap-align: start;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

#banner-carousel figure:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-lg);
}

#banner-carousel figure svg {
  width: 100%;
  height: auto;
  aspect-ratio: 800 / 320;
  object-fit: cover;
}

#banner-carousel figcaption {
  padding: 12px 16px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

#stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}

#stats li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 0;
  padding: 16px 18px;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}

#stats li:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.22);
}

#stats strong {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

#stats strong::after {
  content: "";
}

/* ---------- News / Articles cards ---------- */
#news {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  align-items: start;
}

#news > h2 {
  grid-column: 1 / -1;
}

#news article {
  padding: 20px 20px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

#news article:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
}

#news article h3 {
  margin: 0 0 8px;
  padding: 0;
  border: none;
  font-size: 1.05rem;
}

#news article p { margin: 0 0 8px; font-size: 0.94rem; }
#news article p:last-child { margin-bottom: 0; }

#articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  align-items: stretch;
}

#articles > h2 {
  grid-column: 1 / -1;
}

#articles article {
  display: flex;
  flex-direction: column;
  padding: 22px 20px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

#articles article::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

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

#articles article:hover::before { transform: scaleX(1); }

#articles article h3 {
  margin: 0 0 8px;
  border: none;
  padding: 0;
  font-size: 1.04rem;
  line-height: 1.4;
}

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

#articles article a {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #fff;
  background: var(--grad-brand);
  border-radius: var(--radius-pill);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), filter 0.3s var(--ease);
}

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

#articles article a:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(200, 16, 46, 0.3);
  filter: brightness(1.06);
}

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

/* ---------- Cases ---------- */
#cases blockquote {
  margin: 12px 0;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

#cases blockquote:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
}

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

#faq details:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

#faq details[open] {
  border-color: var(--brand);
  background: var(--bg-elev);
  box-shadow: var(--shadow-md);
}

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

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand);
  background: rgba(200, 16, 46, 0.1);
  border-radius: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}

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

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

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

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

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

#howto ol li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 14px 18px 14px 60px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: transform 0.3s var(--ease), border-color 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: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  background: var(--grad-brand);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(200, 16, 46, 0.3);
}

#howto ol li:hover {
  transform: translateX(6px);
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

/* ---------- Contact ---------- */
#contact address {
  font-style: normal;
  padding: 22px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

#contact address p {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0 0 8px;
  font-size: 0.95rem;
}

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

#contact address a {
  font-weight: 600;
  word-break: break-all;
}

#contact h3 { margin-top: 24px; }

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

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

#sitemap a,
#links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  transition: color 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

#sitemap a::before,
#links a::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: var(--grad-brand);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(200, 16, 46, 0.28);
}

#sitemap a:hover::before,
#links a:hover::before { background: #fff; }

/* ---------- Footer ---------- */
#site-footer {
  position: relative;
  color: rgba(255, 255, 255, 0.82);
  background: var(--grad-deep);
  padding: clamp(34px, 5vw, 56px) 24px 26px;
  margin-top: 20px;
}

#site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 90% 0%, rgba(245, 179, 1, 0.18), transparent 60%),
    radial-gradient(500px 260px at 0% 100%, rgba(200, 16, 46, 0.22), transparent 60%);
  pointer-events: none;
}

#site-footer > * {
  position: relative;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

#site-footer section { margin: 0 auto 24px; }

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

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

#site-footer > p {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
}

#site-footer small { color: rgba(255, 255, 255, 0.6); }

/* ---------- Back to top ---------- */
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 90;
  padding: 11px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--grad-brand);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  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 var(--ease), box-shadow 0.35s var(--ease);
}

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

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

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  #main-nav {
    gap: 12px;
    padding: 10px 18px;
  }

  #main-nav > ul a {
    padding: 6px 9px;
    font-size: 0.85rem;
  }

  #site-search { flex-basis: 220px; }
}

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

  #main-nav {
    align-items: center;
  }

  #main-nav > ul {
    order: 5;
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 0 4px;
    border-top: 1px solid var(--line);
  }

  #main-nav > ul.is-open { display: flex; }

  #main-nav > ul a {
    display: block;
    padding: 10px 14px;
    font-size: 0.92rem;
    border-radius: var(--radius-sm);
  }

  #main-nav > ul a::after { display: none; }

  #menu-toggle { display: inline-block; margin-left: auto; }

  #site-search {
    order: 6;
    flex-basis: 100%;
    display: none;
  }

  #site-search.is-open { display: flex; }

  #theme-toggle { order: 4; }

  #banner-carousel {
    grid-auto-columns: minmax(240px, 82%);
    gap: 14px;
  }

  main { padding: 20px 16px 56px; }
}

@media (max-width: 560px) {
  :root {
    --radius: 14px;
    --radius-lg: 20px;
  }

  body { font-size: 15px; }

  .top-bar {
    justify-content: flex-start;
    font-size: 0.72rem;
    padding: 6px 14px;
    gap: 4px 14px;
  }

  #main-nav { padding: 8px 14px; }

  #main-nav .logo { font-size: 1.05rem; padding: 4px 10px; }

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

  main > section { margin-bottom: 20px; }

  #hero { padding: 24px 18px; }

  #hero > p { font-size: 0.95rem; }

  #banner-carousel { grid-auto-columns: 88%; }

  #stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  #stats li { padding: 12px 14px; }

  #news,
  #articles { grid-template-columns: 1fr; }

  #howto ol li { padding: 12px 14px 12px 52px; }

  #contact address { padding: 16px; }

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

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

@media print {
  #site-header,
  #back-to-top,
  #site-search,
  #theme-toggle,
  #menu-toggle {
    display: none !important;
  }

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

  #hero {
    color: #000;
    background: none;
  }

  #hero h1,
  #hero > p,
  #stats li,
  #stats strong { color: #000; }
}