:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --primary-light: #ff6b76;
  --accent: #f4a261;
  --accent-2: #2a9d8f;
  --accent-3: #457b9d;
  --bg: #fdf6f0;
  --bg-alt: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --bg-glass: rgba(255, 255, 255, 0.55);
  --bg-glass-strong: rgba(255, 255, 255, 0.82);
  --text: #1d1d29;
  --text-soft: #4a4a5a;
  --text-muted: #7b7b8c;
  --border: rgba(29, 29, 41, 0.08);
  --border-strong: rgba(29, 29, 41, 0.16);
  --shadow-sm: 0 2px 8px rgba(29, 29, 41, 0.06);
  --shadow-md: 0 8px 28px rgba(29, 29, 41, 0.1);
  --shadow-lg: 0 20px 60px rgba(29, 29, 41, 0.16);
  --shadow-glow: 0 12px 40px rgba(230, 57, 70, 0.28);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;
  --grad-banner: linear-gradient(135deg, #e63946 0%, #ff6b76 38%, #f4a261 100%);
  --grad-banner-2: linear-gradient(120deg, #1d3557 0%, #457b9d 55%, #2a9d8f 100%);
  --grad-accent: linear-gradient(135deg, #e63946 0%, #f4a261 100%);
  --grad-soft: linear-gradient(180deg, rgba(230, 57, 70, 0.07), rgba(244, 162, 97, 0.04));
  --header-h: 72px;
  --maxw: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --trans: 0.35s var(--ease);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e14;
    --bg-alt: #16161f;
    --bg-elevated: rgba(28, 28, 40, 0.72);
    --bg-glass: rgba(24, 24, 34, 0.55);
    --bg-glass-strong: rgba(24, 24, 34, 0.85);
    --text: #f2f2f7;
    --text-soft: #c6c6d4;
    --text-muted: #8d8da0;
    --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 20px 60px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 12px 40px rgba(230, 57, 70, 0.35);
    --grad-banner: linear-gradient(135deg, #b81f2c 0%, #e63946 45%, #c96a3f 100%);
    --grad-banner-2: linear-gradient(120deg, #14243b 0%, #2d5470 55%, #1d6b62 100%);
    --grad-soft: linear-gradient(180deg, rgba(230, 57, 70, 0.12), rgba(244, 162, 97, 0.05));
  }
}

html[data-theme="dark"] {
  --bg: #0e0e14;
  --bg-alt: #16161f;
  --bg-elevated: rgba(28, 28, 40, 0.72);
  --bg-glass: rgba(24, 24, 34, 0.55);
  --bg-glass-strong: rgba(24, 24, 34, 0.85);
  --text: #f2f2f7;
  --text-soft: #c6c6d4;
  --text-muted: #8d8da0;
  --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 20px 60px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 12px 40px rgba(230, 57, 70, 0.35);
  --grad-banner: linear-gradient(135deg, #b81f2c 0%, #e63946 45%, #c96a3f 100%);
  --grad-banner-2: linear-gradient(120deg, #14243b 0%, #2d5470 55%, #1d6b62 100%);
  --grad-soft: linear-gradient(180deg, rgba(230, 57, 70, 0.12), rgba(244, 162, 97, 0.05));
}

*,
*::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);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 8% -10%, rgba(230, 57, 70, 0.1), transparent 60%),
    radial-gradient(1000px 520px at 100% 0%, rgba(244, 162, 97, 0.12), transparent 55%),
    radial-gradient(900px 500px at 50% 100%, rgba(42, 157, 143, 0.08), transparent 60%);
  background-attachment: fixed;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

img,
svg {
  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,
a:focus-visible {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
}

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

h1 { font-size: clamp(1.6rem, 3.6vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 2rem); }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.4rem); }
h4 { font-size: 1.05rem; }

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

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

blockquote {
  margin: 1.2em 0;
  padding: 1em 1.2em;
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text-soft);
  font-style: italic;
}

blockquote p { margin: 0; }

time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

strong { color: var(--text); }

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

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

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg);
}

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

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

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

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

.brand:hover { text-decoration: none; }

.brand-logo {
  border-radius: 12px;
  box-shadow: var(--shadow-glow);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

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

.brand-name {
  font-size: 1.18rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
}

.main-nav { flex: 1 1 auto; min-width: 0; }

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

.main-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-soft);
  text-decoration: none;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  background: var(--grad-soft);
  color: var(--primary);
  text-decoration: none;
  transform: translateY(-2px);
}

.site-search {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 0 1 260px;
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  overflow: hidden;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

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

.site-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
}

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

.site-search button {
  flex-shrink: 0;
  border: 0;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  background: var(--grad-accent);
  cursor: pointer;
  transition: filter 0.3s var(--ease), transform 0.2s var(--ease);
}

.site-search button:hover { filter: brightness(1.1); }
.site-search button:active { transform: scale(0.96); }

#theme-toggle,
#menu-toggle {
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#theme-toggle:hover,
#menu-toggle:hover {
  background: var(--grad-accent);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

#menu-toggle { display: none; }

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

.breadcrumb {
  margin: 20px 0 8px;
  font-size: 0.86rem;
}

.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.breadcrumb li { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); }

.breadcrumb li + li::before {
  content: "›";
  color: var(--text-muted);
  font-weight: 700;
}

.breadcrumb a { color: var(--text-soft); font-weight: 600; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb [aria-current="page"] { color: var(--primary); font-weight: 700; }

/* ============ HERO ============ */
.hero {
  position: relative;
  margin: 12px 0 56px;
  padding: clamp(20px, 3vw, 40px);
  border-radius: var(--radius-xl);
  background: var(--grad-banner);
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 90% 10%, rgba(255, 255, 255, 0.28), transparent 60%),
    radial-gradient(500px 260px at 5% 95%, rgba(255, 255, 255, 0.18), transparent 60%);
  z-index: -1;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -120px;
  top: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
  animation: floatOrb 12s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

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

.hero-slider {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.slide {
  display: none;
  animation: fadeSlide 0.6s var(--ease);
}

.slide.is-active { display: block; }

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

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

.hero-text {
  margin-top: 28px;
  color: #fff;
}

.hero-text h1 {
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.18);
  margin-bottom: 0.5em;
}

.hero-lead {
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  line-height: 1.85;
  max-width: 900px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  text-align: center;
  transition: transform 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.stat:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.26);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.stat .num {
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat .label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.update-time {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  margin: 0;
}

.update-time time { color: rgba(255, 255, 255, 0.95); font-weight: 700; }

/* ============ SECTIONS ============ */
.section {
  position: relative;
  margin: 0 0 48px;
  padding: clamp(24px, 3.4vw, 44px);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.4s var(--ease);
  animation: sectionRise 0.7s var(--ease) both;
  animation-timeline: view();
  animation-range: entry 0% cover 30%;
}

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

.section:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.section > h2 {
  position: relative;
  padding-left: 18px;
  margin-bottom: 1.1em;
}

.section > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: var(--radius-pill);
  background: var(--grad-accent);
  box-shadow: var(--shadow-glow);
}

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

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

.section h4 {
  margin-top: 1.2em;
  color: var(--primary);
  font-weight: 800;
}

.section p { margin-bottom: 1em; }

/* ============ ARTICLE CARDS ============ */
.article-card {
  position: relative;
  margin: 18px 0;
  padding: 22px 24px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
  overflow: hidden;
}

.article-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

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

.article-card > * { position: relative; z-index: 1; }

.article-card h3 {
  margin-top: 0;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
}

.article-card .meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.8em;
}

.article-card a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--grad-accent);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), filter 0.3s var(--ease);
}

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

.article-card a:hover {
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  filter: brightness(1.08);
}

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

/* ============ FAQ ============ */
#faq details {
  margin: 12px 0;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.35s var(--ease);
}

#faq details:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

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

#faq summary {
  position: relative;
  padding: 16px 52px 16px 20px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  list-style: none;
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
  user-select: none;
}

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

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

#faq details[open] summary {
  color: var(--primary);
  background: var(--grad-soft);
}

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

#faq details p {
  padding: 0 20px 18px;
  margin: 0;
  animation: faqOpen 0.4s var(--ease);
}

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

/* ============ CONTACT / SITEMAP / LEGAL ============ */
#contact p { margin-bottom: 0.6em; }

#sitemap ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

#sitemap ul li a {
  display: block;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-soft);
  text-decoration: none;
  transition: all 0.3s var(--ease);
}

#sitemap ul li a:hover {
  background: var(--grad-accent);
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  text-decoration: none;
}

#sitemap h3 { margin-top: 1.8em; }

/* ============ FOOTER ============ */
#site-footer {
  position: relative;
  margin-top: 20px;
  padding: 48px 20px 40px;
  background: var(--grad-banner-2);
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
  overflow: hidden;
}

#site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(700px 320px at 50% 0%, rgba(255, 255, 255, 0.16), transparent 65%);
  pointer-events: none;
}

#site-footer p {
  position: relative;
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}

#site-footer time { color: #fff; font-weight: 700; }

#site-footer a {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.5);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

#site-footer a:hover {
  color: #ffe5e7;
  border-bottom-color: #ffe5e7;
  text-decoration: none;
}

/* ============ BACK TO TOP ============ */
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--grad-accent);
  color: #fff;
  font-size: 0;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s var(--ease), filter 0.3s var(--ease);
}

#back-to-top::before {
  content: "↑";
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
}

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

#back-to-top:hover {
  filter: brightness(1.12);
  transform: translateY(-4px) scale(1.06);
}

#back-to-top:active { transform: scale(0.94); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
  .main-nav ul { gap: 2px; }
  .main-nav a { padding: 7px 10px; font-size: 0.88rem; }
  .site-search { flex-basis: 200px; min-width: 150px; }
}

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

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

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

  .main-nav {
    order: 10;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.45s var(--ease), opacity 0.35s var(--ease), margin 0.35s var(--ease);
  }

  .main-nav.is-open {
    max-height: 640px;
    opacity: 1;
    margin-top: 6px;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

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

  .site-search {
    order: 6;
    flex: 1 1 100%;
    max-width: none;
  }

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

  main { padding: 0 16px 64px; }
}

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

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

  .hero {
    border-radius: var(--radius-lg);
    margin-bottom: 36px;
  }

  .hero-text { margin-top: 20px; }

  .hero-stats { gap: 10px; }

  .stat { padding: 12px 8px; }

  .section {
    padding: 20px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 32px;
  }

  .article-card { padding: 18px 16px; }

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

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

  #sitemap ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }

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

  #site-footer { padding: 36px 16px 32px; }
}

@media (max-width: 420px) {
  .hero-stats { grid-template-columns: 1fr; }
  #sitemap ul { grid-template-columns: 1fr; }
}

/* ============ MOTION PREFERENCES ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .section { animation: none; opacity: 1; transform: none; }
}

/* ============ FALLBACK SCROLL ANIMATION ============ */
@supports not (animation-timeline: view()) {
  .section { animation: none; opacity: 1; transform: none; }
}

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

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

  .section,
  .article-card,
  .hero {
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

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