:root {
  --brand-red: #c8102e;
  --brand-red-dark: #7a0a1c;
  --brand-yellow: #ffd166;
  --brand-orange: #ffb703;
  --brand-navy: #2b2d42;
  --brand-slate: #8d99ae;
  --bg: #fff8f3;
  --bg-alt: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --text: #2b1a1e;
  --text-soft: #6b4a52;
  --text-muted: #8a6a72;
  --border: rgba(200, 16, 46, 0.14);
  --shadow-sm: 0 2px 10px rgba(122, 10, 28, 0.08);
  --shadow-md: 0 10px 30px rgba(122, 10, 28, 0.12);
  --shadow-lg: 0 20px 56px rgba(122, 10, 28, 0.18);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --grad-hero: linear-gradient(135deg, #c8102e 0%, #e63946 42%, #ffb703 100%);
  --grad-brand: linear-gradient(120deg, #c8102e 0%, #ff6b6b 55%, #ffd166 100%);
  --grad-soft: linear-gradient(160deg, rgba(255, 209, 102, 0.28), rgba(200, 16, 46, 0.08));
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --header-h: 132px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.32s var(--ease);
}

html[data-theme="dark"] {
  --bg: #14121a;
  --bg-alt: #1c1922;
  --bg-elevated: rgba(30, 26, 38, 0.72);
  --text: #f3e9ee;
  --text-soft: #cbb8c1;
  --text-muted: #9d8792;
  --border: rgba(255, 209, 102, 0.18);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 56px rgba(0, 0, 0, 0.62);
  --grad-soft: linear-gradient(160deg, rgba(255, 183, 3, 0.16), rgba(200, 16, 46, 0.12));
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.78;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% 4%, rgba(255, 209, 102, 0.22), transparent 42%),
    radial-gradient(circle at 92% 12%, rgba(200, 16, 46, 0.12), transparent 46%),
    radial-gradient(circle at 50% 100%, rgba(255, 183, 3, 0.1), transparent 55%);
  background-attachment: fixed;
  transition: background-color var(--transition), color var(--transition);
  overflow-x: hidden;
}

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

a {
  color: var(--brand-red);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

html[data-theme="dark"] a {
  color: var(--brand-yellow);
}

a:hover,
a:focus-visible {
  color: var(--brand-red-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

html[data-theme="dark"] a:hover,
html[data-theme="dark"] a:focus-visible {
  color: #fff;
}

:focus-visible {
  outline: 3px solid var(--brand-orange);
  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;
}

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

h1 { font-size: clamp(1.6rem, 3.6vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); }
h3 { font-size: clamp(1.12rem, 1.9vw, 1.35rem); }
h4 { font-size: clamp(1rem, 1.5vw, 1.12rem); }

p { margin: 0 0 1.05em; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.35em; }
li { margin-bottom: 0.45em; }

blockquote {
  margin: 1.2em 0;
  padding: 1em 1.3em;
  border-left: 4px solid var(--brand-red);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--bg-elevated);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-soft);
  font-style: normal;
}

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

time {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 0.5em;
}

address { font-style: normal; }

/* ============ HEADER ============ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-elevated);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), box-shadow var(--transition);
}

.brand-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px 8px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: transform var(--transition);
}

.brand-logo:hover { transform: translateY(-2px) scale(1.02); text-decoration: none; }

.brand-logo svg {
  filter: drop-shadow(0 4px 10px rgba(200, 16, 46, 0.32));
  transition: transform var(--transition);
}

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

.brand-name {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.brand-slogan {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

#main-nav {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: thin;
}

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

#main-nav a {
  display: inline-block;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

#main-nav a:hover,
#main-nav a:focus-visible {
  background: var(--grad-brand);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(200, 16, 46, 0.3);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 12px;
}

#site-search {
  display: flex;
  flex: 1 1 260px;
  max-width: 460px;
  gap: 6px;
}

#search-input {
  flex: 1;
  min-width: 0;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

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

#site-search button,
#theme-toggle,
#menu-toggle {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 6px 16px rgba(200, 16, 46, 0.26);
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

#theme-toggle,
#menu-toggle {
  color: var(--brand-red-dark);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] #theme-toggle,
html[data-theme="dark"] #menu-toggle {
  color: var(--brand-yellow);
}

#site-search button:hover,
#theme-toggle:hover,
#menu-toggle:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: var(--shadow-md);
}

#site-search button:active,
#theme-toggle:active,
#menu-toggle:active { transform: translateY(0) scale(0.98); }

#menu-toggle { display: none; }

/* ============ MAIN LAYOUT ============ */
#main-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

#main-content > section {
  background: var(--bg-elevated);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(20px, 3.4vw, 42px);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  animation: fadeUp 0.7s var(--ease) both;
}

#main-content > section:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(200, 16, 46, 0.24);
}

#main-content > section h2 {
  position: relative;
  padding-bottom: 0.55em;
  margin-bottom: 1em;
}

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

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

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

#main-content section > section,
#main-content section > article {
  margin-bottom: 1.4em;
}

/* ============ HERO ============ */
#hero {
  position: relative;
  overflow: hidden;
  background: var(--grad-hero) !important;
  color: #fff;
  border: none !important;
  box-shadow: var(--shadow-lg) !important;
}

#hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.5), transparent 65%);
  border-radius: 50%;
  pointer-events: none;
  animation: floatGlow 9s ease-in-out infinite;
}

#hero::after {
  content: "";
  position: absolute;
  inset: auto auto -30% -15%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 68%);
  border-radius: 50%;
  pointer-events: none;
  animation: floatGlow 11s ease-in-out infinite reverse;
}

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

#hero h1 {
  color: #fff;
  text-shadow: 0 4px 22px rgba(61, 5, 16, 0.4);
}

#hero h1::after { background: #ffd166 !important; }

.hero-lead {
  font-size: clamp(0.95rem, 1.5vw, 1.08rem);
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.94);
  max-width: 88ch;
  background: rgba(255, 255, 255, 0.1);
  padding: 1em 1.2em;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ============ CAROUSEL ============ */
.banner-carousel {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 26px;
  box-shadow: 0 18px 44px rgba(61, 5, 16, 0.36);
  background: rgba(0, 0, 0, 0.2);
}

.banner-carousel .slide {
  display: none;
  animation: fadeIn 0.7s var(--ease) both;
}

.banner-carousel .slide.active { display: block; }

.banner-carousel .slide svg {
  width: 100%;
  display: block;
  border-radius: var(--radius-lg);
}

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: rgba(43, 45, 66, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), transform var(--transition);
}

.carousel-prev::before,
.carousel-next::before {
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 44px;
  display: block;
}

.carousel-prev::before { content: "‹"; }
.carousel-next::before { content: "›"; }

.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }

.carousel-prev:hover,
.carousel-next:hover {
  background: rgba(200, 16, 46, 0.86);
  transform: translateY(-50%) scale(1.1);
}

/* ============ STATS ============ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 26px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 18px 12px;
  text-align: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.stat-item:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.26);
  box-shadow: 0 14px 30px rgba(61, 5, 16, 0.3);
}

.stat-num {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 900;
  color: #ffd166;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 12px rgba(61, 5, 16, 0.4);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.03em;
}

/* ============ BREADCRUMB ============ */
#breadcrumb {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  animation: none !important;
}

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

#breadcrumb li + li::before {
  content: "›";
  margin-right: 6px;
  color: var(--text-muted);
  opacity: 0.7;
}

#breadcrumb a { font-weight: 600; }

/* ============ ARTICLES / NEWS ============ */
#news article,
#articles article {
  padding: 20px 22px;
  margin-bottom: 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

#news article:hover,
#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(200, 16, 46, 0.3);
}

#news article h3,
#articles article h3 {
  margin-top: 0;
  color: var(--text);
}

#articles article h3 {
  padding-left: 14px;
  border-left: 4px solid var(--brand-red);
  line-height: 1.45;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 4px 14px rgba(200, 16, 46, 0.24);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

#articles article a:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(200, 16, 46, 0.34);
}

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

/* ============ FAQ ============ */
#faq dl { margin: 0; }

#faq dt { margin-bottom: 8px; }

#faq dt button {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--text);
  padding: 14px 52px 14px 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

#faq dt button::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--brand-red);
  transition: transform var(--transition), color var(--transition);
}

#faq dt button:hover {
  border-color: var(--brand-red);
  box-shadow: var(--shadow-md);
}

#faq dt button[aria-expanded="true"] {
  background: var(--grad-brand);
  color: #fff;
  border-color: transparent;
}

#faq dt button[aria-expanded="true"]::after {
  content: "−";
  color: #fff;
  transform: translateY(-50%) rotate(180deg);
}

#faq dd {
  margin: 0 0 14px;
  padding: 0 18px;
  color: var(--text-soft);
  font-size: 0.95rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.45s var(--ease), opacity 0.35s var(--ease), padding 0.35s var(--ease);
}

#faq dd.is-open {
  max-height: 1200px;
  opacity: 1;
  padding: 14px 18px;
  background: var(--grad-soft);
  border-radius: var(--radius-md);
}

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

#howto ol li {
  position: relative;
  counter-increment: step;
  padding: 14px 18px 14px 60px;
  margin-bottom: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 900;
  color: #fff;
  background: var(--grad-brand);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(200, 16, 46, 0.3);
}

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

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

#contact address li {
  padding: 14px 18px;
  margin: 0;
  font-size: 0.92rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-red);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

#contact address li:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

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

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

/* ============ LEGAL ============ */
#legal h3 {
  display: inline-block;
  padding: 4px 14px;
  font-size: 1rem;
  border-radius: var(--radius-pill);
  background: var(--grad-soft);
  border: 1px solid var(--border);
}

/* ============ FOOTER ============ */
#site-footer {
  position: relative;
  margin-top: 20px;
  padding: 40px 20px 56px;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(160deg, #2b2d42 0%, #3d0510 60%, #7a0a1c 100%);
  border-top: 4px solid var(--brand-yellow);
}

#site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, rgba(255, 209, 102, 0.16), transparent 45%);
  pointer-events: none;
}

.footer-info {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.9;
}

.footer-info p { margin: 0 0 8px; }

.footer-info a {
  color: var(--brand-yellow);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-info a:hover { color: #fff; }

#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 90;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: var(--grad-brand);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(200, 16, 46, 0.42);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition), box-shadow var(--transition);
}

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

#back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(200, 16, 46, 0.55);
}

/* ============ ANIMATIONS ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-24px, 26px) scale(1.08); }
}

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

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}

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

  .brand-bar { padding-bottom: 6px; }

  .brand-slogan {
    width: 100%;
    font-size: 0.78rem;
  }

  #main-nav {
    position: static;
    max-height: 0;
    padding: 0 20px;
    overflow: hidden;
    transition: max-height 0.4s var(--ease);
  }

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

  #main-nav ul {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 2px;
    padding: 8px 0 12px;
  }

  #main-nav a {
    display: block;
    width: 100%;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
  }

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

  .header-tools { padding-bottom: 10px; }

  #site-search { max-width: none; flex-basis: 100%; }

  #main-content { padding-top: 20px; gap: 22px; }
}

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

  #main-content { padding-left: 14px; padding-right: 14px; }

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

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

  .brand-logo svg { width: 34px; height: 34px; }

  .banner-carousel .slide svg { height: 190px; }

  .carousel-prev,
  .carousel-next {
    width: 36px;
    height: 36px;
  }

  .carousel-prev::before,
  .carousel-next::before { line-height: 36px; }

  .carousel-prev { left: 8px; }
  .carousel-next { right: 8px; }

  .stat-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-item { padding: 14px 8px; }

  .stat-label { font-size: 0.75rem; }

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

  #faq dt button {
    font-size: 0.94rem;
    padding: 12px 46px 12px 14px;
  }

  #howto ol li { padding-left: 54px; }

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

@media (max-width: 400px) {
  .stat-row { grid-template-columns: 1fr; }
}

/* ============ ACCESSIBILITY / MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal { opacity: 1; transform: none; }
}

/* ============ PRINT ============ */
@media print {
  #site-header,
  #back-to-top,
  .banner-carousel .carousel-prev,
  .banner-carousel .carousel-next,
  #site-search,
  #theme-toggle,
  #menu-toggle { display: none !important; }

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

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

  a { color: #000; text-decoration: underline; }
}