:root {
  --primary: #e94560;
  --primary-dark: #c72b47;
  --primary-light: #ff6b81;
  --accent: #533483;
  --accent-2: #0f3460;
  --bg: #f7f8fc;
  --bg-alt: #ffffff;
  --bg-soft: #eef1f8;
  --text: #1a1a2e;
  --text-soft: #4a4a63;
  --text-muted: #7b7b93;
  --border: rgba(26, 26, 46, 0.08);
  --border-strong: rgba(26, 26, 46, 0.16);
  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 8px 28px rgba(26, 26, 46, 0.1);
  --shadow-lg: 0 18px 48px rgba(26, 26, 46, 0.16);
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.5);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --maxw: 1180px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --grad-hero: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #533483 75%, #e94560 130%);
  --grad-btn: linear-gradient(135deg, #e94560 0%, #c72b47 100%);
  --grad-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.1), rgba(83, 52, 131, 0.1));
}

html[data-theme="dark"],
html.dark {
  --primary: #ff5c76;
  --primary-dark: #e94560;
  --primary-light: #ff8397;
  --bg: #0e0e1a;
  --bg-alt: #161628;
  --bg-soft: #1d1d33;
  --text: #f0f0f8;
  --text-soft: #c3c3d8;
  --text-muted: #8e8ea8;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6);
  --glass-bg: rgba(26, 26, 46, 0.55);
  --glass-border: rgba(255, 255, 255, 0.1);
  --grad-hero: linear-gradient(135deg, #0e0e1a 0%, #16213e 45%, #3a1f5c 78%, #e94560 140%);
  --grad-soft: linear-gradient(135deg, rgba(255, 92, 118, 0.14), rgba(83, 52, 131, 0.18));
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -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(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

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

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

a:hover {
  color: var(--primary-dark);
}

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

h1 { font-size: clamp(1.75rem, 4.2vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.1rem, 2.2vw, 1.35rem); }

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

ul, ol {
  padding-left: 1.3em;
  color: var(--text-soft);
}

li {
  margin-bottom: 0.4em;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea {
  font-family: inherit;
  font-size: 1rem;
}

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

.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: 1000;
  height: var(--header-h);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.4s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.4s var(--ease);
}

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

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--text);
}

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

.brand svg {
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(233, 69, 96, 0.35);
  transition: transform 0.4s var(--ease);
}

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

.brand-name {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--grad-btn);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  line-height: 1.4;
  white-space: nowrap;
}

#site-header nav {
  flex: 1;
  min-width: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.nav-list li {
  margin: 0;
  flex-shrink: 0;
}

.nav-list a {
  display: block;
  padding: 8px 11px;
  font-size: 0.9rem;
  color: var(--text-soft);
  border-radius: 999px;
  position: relative;
  white-space: nowrap;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}

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

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--primary);
  background: var(--grad-soft);
}

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

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.search-form {
  display: flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 3px 3px 14px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
    background-color 0.4s var(--ease);
}

.search-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.14);
}

.search-form input {
  border: none;
  background: transparent;
  color: var(--text);
  width: 150px;
  padding: 6px 0;
  font-size: 0.88rem;
  outline: none;
}

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

.search-form button {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--grad-btn);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  transition: transform 0.25s var(--ease), filter 0.25s var(--ease);
}

.search-form button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

#theme-toggle,
#menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform 0.3s var(--ease), background-color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

#theme-toggle:hover,
#menu-toggle:hover {
  transform: rotate(12deg) scale(1.08);
  border-color: var(--primary);
}

#menu-toggle {
  display: none;
}

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

main > section {
  padding: 56px 0;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

main > section + section {
  border-top: 1px solid var(--border);
}

/* ============ HERO ============ */
.hero {
  position: relative;
  margin: 24px -20px 0;
  padding: 64px 20px 72px;
  border-radius: var(--radius-lg);
  background: var(--grad-hero);
  background-size: 200% 200%;
  animation: heroShift 16s ease infinite;
  overflow: hidden;
  border-top: none !important;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
}

.hero::before {
  width: 340px;
  height: 340px;
  background: var(--primary);
  top: -120px;
  right: -80px;
  animation: float 12s ease-in-out infinite;
}

.hero::after {
  width: 280px;
  height: 280px;
  background: var(--accent);
  bottom: -120px;
  left: -60px;
  animation: float 14s ease-in-out infinite reverse;
}

@keyframes heroShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

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

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  color: #ffffff;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
  margin-bottom: 0.5em;
}

.hero-lead {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  max-width: 780px;
  margin: 0 auto 1.2em;
}

.hero-answer {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  max-width: 760px;
  margin: 0 auto 2em;
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    background-color 0.3s var(--ease);
}

.btn-primary {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 10px 26px rgba(233, 69, 96, 0.45);
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(233, 69, 96, 0.55);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-3px);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
}

.stat {
  padding: 18px 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform 0.35s var(--ease), background-color 0.35s var(--ease);
}

.stat:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.18);
}

.stat-num {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 4px;
}

/* ============ CAROUSEL ============ */
.carousel {
  position: relative;
}

.carousel-track {
  position: relative;
  min-height: 320px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-alt);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.slide.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  position: relative;
}

.slide svg {
  width: 100%;
  height: auto;
  aspect-ratio: 800 / 300;
  object-fit: cover;
}

.slide h3 {
  margin: 20px 24px 6px;
}

.slide p {
  margin: 0 24px 24px;
  color: var(--text-soft);
}

.carousel-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.carousel-controls button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease),
    color 0.3s var(--ease), border-color 0.3s var(--ease);
}

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

/* ============ SECTION HEADINGS ============ */
main > section > h2 {
  position: relative;
  padding-left: 18px;
  margin-bottom: 1.1em;
}

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

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

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

/* ============ CARDS / ARTICLES ============ */
#news article,
#articles article {
  position: relative;
  padding: 24px 26px;
  margin-bottom: 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  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), background-color 0.4s var(--ease);
  overflow: hidden;
}

#news article::before,
#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--grad-btn);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.35s var(--ease);
}

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

#news article:hover::before,
#articles article:hover::before {
  transform: scaleY(1);
}

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

#news article time,
#articles article time {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

#articles article a {
  display: inline-block;
  margin-top: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--grad-soft);
  transition: background-color 0.3s var(--ease), transform 0.3s var(--ease);
}

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

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

#faq details[open] {
  border-color: var(--primary);
  box-shadow: 0 8px 30px rgba(233, 69, 96, 0.16);
}

#faq summary {
  position: relative;
  padding: 18px 52px 18px 22px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  transition: color 0.25s var(--ease);
}

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-soft);
  color: var(--primary);
  font-size: 1.15rem;
  font-weight: 700;
  transition: transform 0.35s var(--ease), background-color 0.3s var(--ease);
}

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

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

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

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

/* ============ FORMS ============ */
#contact form {
  display: grid;
  gap: 8px;
  max-width: 560px;
  padding: 28px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

#contact form label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 8px;
}

#contact form input,
#contact form textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
    background-color 0.4s var(--ease);
  resize: vertical;
}

#contact form input:focus,
#contact form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.14);
  background: var(--bg-alt);
}

#contact form button {
  margin-top: 14px;
  padding: 13px 28px;
  border-radius: 999px;
  background: var(--grad-btn);
  color: #fff;
  font-weight: 600;
  font-size: 0.98rem;
  box-shadow: 0 10px 24px rgba(233, 69, 96, 0.35);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    filter 0.3s var(--ease);
}

#contact form button:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 16px 32px rgba(233, 69, 96, 0.45);
}

/* ============ 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-block;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.88rem;
  transition: transform 0.3s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), background-color 0.3s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  transform: translateY(-3px);
  color: #fff;
  background: var(--grad-btn);
  border-color: transparent;
}

/* ============ FOOTER ============ */
footer {
  margin-top: 40px;
  padding: 56px 20px 32px;
  background: var(--grad-hero);
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: var(--primary);
  filter: blur(120px);
  opacity: 0.25;
  top: -160px;
  right: -100px;
  pointer-events: none;
}

.footer-inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.4fr;
  gap: 36px;
}

footer h2 {
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 14px;
}

footer p,
footer li {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

footer a {
  color: rgba(255, 255, 255, 0.78);
  transition: color 0.25s var(--ease), padding-left 0.25s var(--ease);
}

footer a:hover {
  color: #fff;
  padding-left: 4px;
}

/* ============ BACK TO TOP ============ */
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--grad-btn);
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 10px 26px rgba(233, 69, 96, 0.45);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease),
    visibility 0.35s, box-shadow 0.3s var(--ease);
  z-index: 999;
}

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

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

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

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

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

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .nav-list a {
    padding: 8px 8px;
    font-size: 0.84rem;
  }

  .search-form input {
    width: 110px;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-inner section:first-child {
    grid-column: 1 / -1;
  }
}

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

  #menu-toggle {
    display: grid;
  }

  #site-header nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    backdrop-filter: blur(22px) saturate(160%);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s var(--ease);
    box-shadow: var(--shadow-md);
  }

  #site-header nav.open {
    max-height: 80vh;
    overflow-y: auto;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 20px;
    gap: 2px;
  }

  .nav-list a {
    padding: 12px 16px;
    font-size: 0.98rem;
    border-radius: var(--radius-sm);
  }

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

  .search-form input {
    width: 100px;
  }

  .brand-sub {
    display: none;
  }

  main > section {
    padding: 40px 0;
  }

  .hero {
    padding: 48px 18px 56px;
    margin-top: 16px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .carousel-track {
    min-height: 280px;
  }

  .slide h3 {
    margin: 16px 18px 4px;
  }

  .slide p {
    margin: 0 18px 18px;
  }
}

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

  .header-inner {
    gap: 10px;
    padding: 0 14px;
  }

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

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

  .search-form {
    padding-left: 10px;
  }

  .search-form input {
    width: 78px;
    font-size: 0.82rem;
  }

  .search-form button {
    padding: 6px 10px;
    font-size: 0.76rem;
  }

  #theme-toggle,
  #menu-toggle {
    width: 36px;
    height: 36px;
  }

  main {
    padding: 0 14px;
  }

  main > section {
    padding: 32px 0;
  }

  .hero {
    margin: 12px -14px 0;
    padding: 40px 16px 44px;
    border-radius: var(--radius);
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 32px;
  }

  .btn-primary,
  .btn-secondary {
    text-align: center;
    padding: 12px 20px;
  }

  .hero-stats {
    gap: 10px;
  }

  .stat {
    padding: 14px 8px;
  }

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

  #faq summary {
    padding: 15px 46px 15px 16px;
    font-size: 0.95rem;
  }

  #faq details p {
    padding: 0 16px 16px;
    font-size: 0.92rem;
  }

  #contact form {
    padding: 20px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 26px;
  }

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

@media (max-width: 400px) {
  .search-form {
    display: none;
  }
}