:root {
  --brand: #e94f37;
  --brand-dark: #c93d28;
  --brand-light: #f28c6b;
  --brand-soft: rgba(233, 79, 55, 0.1);
  --accent: #2b3a55;
  --accent-2: #3a7d5c;
  --text: #1f2430;
  --text-soft: #4a5262;
  --text-muted: #7a8394;
  --bg: #f7f8fb;
  --bg-alt: #ffffff;
  --card: #ffffff;
  --border: #e6e9f0;
  --shadow-sm: 0 2px 8px rgba(31, 36, 48, 0.06);
  --shadow-md: 0 8px 24px rgba(31, 36, 48, 0.08);
  --shadow-lg: 0 16px 48px rgba(31, 36, 48, 0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.6);
  --header-h: 68px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html[data-theme="dark"] {
  --brand: #ff6a4d;
  --brand-dark: #e94f37;
  --brand-light: #ff9a80;
  --brand-soft: rgba(255, 106, 77, 0.14);
  --accent: #8aa4cf;
  --accent-2: #6fc79b;
  --text: #e8ecf4;
  --text-soft: #b6bfd0;
  --text-muted: #8a94a8;
  --bg: #0e1219;
  --bg-alt: #151b25;
  --card: #1a2230;
  --border: #2a3446;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  --glass-bg: rgba(26, 34, 48, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --brand: #ff6a4d;
    --brand-dark: #e94f37;
    --brand-light: #ff9a80;
    --brand-soft: rgba(255, 106, 77, 0.14);
    --accent: #8aa4cf;
    --accent-2: #6fc79b;
    --text: #e8ecf4;
    --text-soft: #b6bfd0;
    --text-muted: #8a94a8;
    --bg: #0e1219;
    --bg-alt: #151b25;
    --card: #1a2230;
    --border: #2a3446;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    --glass-bg: rgba(26, 34, 48, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
  }
}

*,
*::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);
  overflow-x: hidden;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

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-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

h1 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.3rem); }

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

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

li { margin-bottom: 0.4em; }

.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(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

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

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

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

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

.brand-logo:hover {
  text-decoration: none;
  opacity: 0.85;
}

.brand-logo svg {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(233, 79, 55, 0.35);
  transition: transform 0.4s var(--ease);
}

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

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--brand), var(--brand-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-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;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav ul::-webkit-scrollbar { display: none; }

.main-nav li { margin: 0; }

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

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--brand);
  background: var(--brand-soft);
  text-decoration: none;
}

.site-search {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  background: var(--bg-alt);
  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);
}

.site-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.site-search input {
  width: 170px;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 6px 4px;
  outline: none;
}

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

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

.site-search button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(233, 79, 55, 0.35);
  filter: brightness(1.05);
}

.site-search button:active { transform: translateY(0); }

#theme-toggle,
#menu-toggle {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  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.06);
  border-color: var(--brand);
  background: var(--brand-soft);
}

#menu-toggle { display: none; }

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

main > section {
  margin: 0 0 28px;
  padding: 32px clamp(18px, 3vw, 36px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease), background-color 0.35s var(--ease), border-color 0.35s var(--ease);
  animation: rise-in 0.7s var(--ease) both;
}

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

main > section > h2 {
  position: relative;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

main > section > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
}

main > section > h3 {
  margin-top: 1.6em;
  padding-left: 12px;
  border-left: 4px solid var(--brand);
  transition: border-color 0.3s var(--ease), padding-left 0.3s var(--ease);
}

main > section > h3:hover {
  border-left-color: var(--accent);
  padding-left: 16px;
}

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

/* ============ Breadcrumb ============ */
.breadcrumb {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 20px 0;
}

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

.breadcrumb li {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

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

.breadcrumb a {
  color: var(--text-soft);
  padding: 2px 6px;
  border-radius: 6px;
}

.breadcrumb a:hover {
  color: var(--brand);
  background: var(--brand-soft);
  text-decoration: none;
}

.breadcrumb [aria-current="page"] {
  color: var(--brand);
  font-weight: 600;
}

/* ============ Hero ============ */
.hero {
  position: relative;
  margin-top: 16px !important;
  padding: clamp(20px, 4vw, 40px) !important;
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(242, 140, 107, 0.25), transparent 60%),
    radial-gradient(900px 400px at 110% 110%, rgba(58, 125, 92, 0.18), transparent 60%),
    linear-gradient(135deg, #fff5f2 0%, #fdeee9 45%, #f4f7fb 100%) !important;
  border: 1px solid rgba(233, 79, 55, 0.14) !important;
  overflow: hidden;
}

html[data-theme="dark"] .hero {
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(255, 106, 77, 0.2), transparent 60%),
    radial-gradient(900px 400px at 110% 110%, rgba(58, 125, 92, 0.18), transparent 60%),
    linear-gradient(135deg, #1b1420 0%, #171a24 50%, #111820 100%) !important;
  border-color: rgba(255, 106, 77, 0.2) !important;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(233, 79, 55, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 79, 55, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 75%);
}

.hero-slider {
  position: relative;
  display: grid;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 800 / 320;
  margin-bottom: 28px;
  background: var(--accent);
}

.hero-slider .slide {
  grid-area: 1 / 1;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.8s var(--ease), transform 1.2s var(--ease);
  pointer-events: none;
}

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

.hero-slider .slide svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slider::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.18));
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-content h1 {
  margin-bottom: 14px;
  background: linear-gradient(120deg, var(--brand-dark), var(--brand) 45%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: 1rem;
  color: var(--text-soft);
  max-width: 78ch;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 18px 0 22px;
  padding: 12px 16px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.hero-stats .stat {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  min-width: 2ch;
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

.hero-stats .stat:hover {
  transform: scale(1.08);
}

.cta {
  display: inline-block;
  padding: 12px 28px;
  margin: 0 10px 10px 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff !important;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(233, 79, 55, 0.32);
  text-decoration: none !important;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), filter 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}

.cta::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s var(--ease);
}

.cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(233, 79, 55, 0.42);
  filter: brightness(1.04);
}

.cta:hover::after { left: 130%; }

.cta.secondary {
  background: var(--glass-bg);
  color: var(--text) !important;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.cta.secondary:hover {
  border-color: var(--brand);
  color: var(--brand) !important;
  box-shadow: 0 10px 24px rgba(233, 79, 55, 0.18);
}

/* ============ Articles ============ */
#articles article {
  position: relative;
  margin: 0 0 18px;
  padding: 22px 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-light));
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(233, 79, 55, 0.35);
}

#articles article:hover::before { opacity: 1; }

#articles article h3 {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  font-size: 1.12rem;
  transition: color 0.25s var(--ease);
}

#articles article:hover h3 { color: var(--brand); }

#articles article .meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: inline-block;
  padding: 2px 10px;
  background: var(--brand-soft);
  border-radius: 999px;
}

#articles article p:last-child { margin-bottom: 0; }

#articles article a {
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

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

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

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

#faq details:hover {
  border-color: rgba(233, 79, 55, 0.35);
  box-shadow: var(--shadow-sm);
}

#faq details[open] {
  border-color: var(--brand);
  box-shadow: 0 6px 20px rgba(233, 79, 55, 0.12);
  background: var(--card);
}

#faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 52px 16px 20px;
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--text);
  position: relative;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

#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(--brand-soft);
  color: var(--brand);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.35s var(--ease), background-color 0.25s var(--ease), color 0.25s var(--ease);
}

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

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

#faq details p {
  margin: 0;
  padding: 0 20px 18px;
  font-size: 0.93rem;
  animation: fade-drop 0.35s var(--ease) both;
}

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

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

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

.sitemap-list a,
.friend-links a {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 0.3s var(--ease);
}

.sitemap-list a:hover,
.friend-links a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(233, 79, 55, 0.28);
  text-decoration: none;
}

/* ============ Contact ============ */
#contact address {
  font-style: normal;
  display: grid;
  gap: 4px;
  padding: 20px 24px;
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

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

#contact address p a { font-weight: 600; }

/* ============ Footer ============ */
#site-footer {
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  border-top: 1px solid var(--border);
  padding: 48px 20px 24px;
  margin-top: 20px;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.footer-inner section h2 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 700;
}

.footer-inner section p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 6px;
  line-height: 1.7;
}

.footer-inner section a {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.footer-inner section a:hover { color: var(--brand); }

#site-footer > section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 0 0;
  border-top: 1px solid var(--border);
}

#site-footer > section:first-of-type { border-top: 0; padding-top: 0; }

#site-footer > section h2 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--text);
}

#site-footer > section p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0 0 8px;
  max-width: 90ch;
}

.footer-copy {
  max-width: var(--maxw);
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ============ Back to top ============ */
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--brand);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s, background-color 0.25s var(--ease);
}

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

#back-to-top:hover {
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: #fff;
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 28px rgba(233, 79, 55, 0.4);
}

/* ============ Responsive ============ */
@media (max-width: 1080px) {
  .main-nav a { padding: 8px 9px; font-size: 0.85rem; }
  .site-search input { width: 130px; }
}

@media (max-width: 900px) {
  .header-inner { gap: 10px; }
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 99;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease);
  }
  .main-nav.open { max-height: 70vh; overflow-y: auto; }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px 18px;
    gap: 2px;
  }
  .main-nav a {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
  }
  #menu-toggle { display: inline-flex; }
  .site-search { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
}

@media (max-width: 640px) {
  :root { --header-h: 60px; }
  body { font-size: 15px; }
  .header-inner { padding: 0 14px; gap: 8px; }
  .brand-name { font-size: 1rem; }
  .brand-logo svg { width: 34px; height: 34px; }
  main { padding: 0 12px 24px; }
  main > section {
    padding: 22px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
  }
  .breadcrumb { padding: 12px 14px 0; }
  .hero { padding: 16px !important; }
  .hero-slider { aspect-ratio: 16 / 9; margin-bottom: 18px; }
  .hero-stats { font-size: 0.85rem; padding: 10px 12px; gap: 4px 8px; }
  .hero-stats .stat { font-size: 1.25rem; }
  .cta { display: block; text-align: center; margin: 0 0 10px; padding: 13px 20px; }
  #articles article { padding: 18px 16px; }
  #faq summary { padding: 14px 46px 14px 16px; font-size: 0.92rem; }
  #faq details p { padding: 0 16px 16px; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  #site-footer { padding: 32px 14px 20px; }
  #back-to-top { right: 14px; bottom: 14px; width: 44px; height: 44px; }
  .sitemap-list a,
  .friend-links a { padding: 7px 14px; font-size: 0.85rem; }
}

@media (max-width: 380px) {
  .brand-name { display: none; }
}

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

@media print {
  #site-header,
  #back-to-top,
  .site-search,
  #theme-toggle,
  #menu-toggle,
  .hero-slider { display: none !important; }
  body { background: #fff; color: #000; }
  main > section { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
  a { color: #000; text-decoration: underline; }
}