:root {
  --primary: #FF6B35;
  --primary-dark: #E85520;
  --primary-light: #FF8B5E;
  --secondary: #2D3047;
  --accent: #1B998B;
  --accent-light: #2DBFAF;
  --bg: #F7F8FC;
  --bg-alt: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --text: #1F2233;
  --text-secondary: #5A5F73;
  --text-muted: #8A8FA3;
  --border: #E4E7F0;
  --shadow-sm: 0 2px 8px rgba(31, 34, 51, 0.06);
  --shadow-md: 0 8px 24px rgba(31, 34, 51, 0.08);
  --shadow-lg: 0 16px 48px rgba(31, 34, 51, 0.12);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 72px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  --primary: #FF7B4A;
  --primary-dark: #FF6B35;
  --primary-light: #FF9C73;
  --secondary: #C8CBE0;
  --accent: #2DBFAF;
  --accent-light: #4FD4C4;
  --bg: #12141C;
  --bg-alt: #1A1D28;
  --bg-elevated: #222533;
  --text: #EDEFF7;
  --text-secondary: #A8AEC4;
  --text-muted: #6E7488;
  --border: #2E3242;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --glass-bg: rgba(26, 29, 40, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
}

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

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

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

ul,
ol {
  padding-left: 1.4em;
}

li {
  margin-bottom: 0.5em;
}

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

h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.6rem;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

h3 {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  margin: 1.6rem 0 0.7rem;
}

h4 {
  font-size: 1.05rem;
  margin: 1.2rem 0 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

time {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.visually-hidden {
  position: absolute;
  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;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--transition), box-shadow var(--transition);
}

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

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

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

.brand svg {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.35);
  transition: transform var(--transition);
}

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

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

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

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

#main-nav li {
  margin: 0;
}

#main-nav a {
  display: block;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all var(--transition);
  white-space: nowrap;
}

#main-nav a:hover,
#main-nav a:focus-visible {
  color: var(--primary);
  background: rgba(255, 107, 53, 0.1);
}

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

#site-search {
  display: flex;
  align-items: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#site-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

#search-input {
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-size: 0.875rem;
  color: var(--text);
  width: 160px;
  outline: none;
  font-family: inherit;
}

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

#site-search button {
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: filter var(--transition);
}

#site-search button:hover {
  filter: brightness(1.08);
}

#theme-toggle,
#menu-toggle {
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-secondary);
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  white-space: nowrap;
}

#theme-toggle:hover,
#menu-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}

#menu-toggle {
  display: none;
}

/* ===== Hero ===== */
#hero {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 24px;
}

.hero-inner {
  position: relative;
  z-index: 2;
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 107, 53, 0.18), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(27, 153, 139, 0.18), transparent 45%),
    linear-gradient(135deg, rgba(255, 107, 53, 0.08), rgba(27, 153, 139, 0.08));
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.hero-inner::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.15), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

#hero-title {
  max-width: 900px;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text) 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  max-width: 860px;
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 2.5rem;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 30px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(255, 107, 53, 0.5);
}

.btn-secondary {
  color: var(--text);
  background: var(--glass-bg);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat {
  padding: 20px 16px;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  text-align: center;
  transition: all var(--transition);
}

.stat:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.stat-num {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Banner carousel ===== */
.hero-banner {
  position: relative;
  margin-top: 24px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 800 / 220;
  background: var(--bg-alt);
}

.banner-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.7s ease, transform 0.7s ease;
  pointer-events: none;
}

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

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

/* ===== Breadcrumb ===== */
#breadcrumb {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px 0;
}

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

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

#breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--text-muted);
}

#breadcrumb a {
  color: var(--text-secondary);
}

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

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

/* ===== Main sections ===== */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

main > section:not(#hero):not(#breadcrumb) {
  margin-top: 56px;
  padding: 40px;
  border-radius: var(--radius-lg);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

main > section:not(#hero):not(#breadcrumb):hover {
  box-shadow: var(--shadow-md);
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

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

/* Author box */
.author-box {
  margin-top: 1.5rem;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.08), rgba(27, 153, 139, 0.08));
  border-left: 4px solid var(--primary);
}

.author-box h4 {
  margin-top: 0;
  color: var(--primary);
}

.author-box p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* Product list */
#products ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 1rem;
}

#products ul li {
  position: relative;
  margin: 0;
  padding: 16px 18px 16px 46px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

#products ul li::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.12);
}

#products ul li:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

/* Blockquotes */
blockquote {
  position: relative;
  margin: 1.25rem 0;
  padding: 20px 24px 20px 56px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

blockquote::before {
  content: "\201C";
  position: absolute;
  left: 18px;
  top: 6px;
  font-size: 3rem;
  line-height: 1;
  font-family: Georgia, serif;
  color: var(--primary);
  opacity: 0.6;
}

blockquote p {
  margin: 0;
  font-style: italic;
  color: var(--text-secondary);
}

blockquote:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

/* News articles */
#news article {
  padding: 20px 24px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

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

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

#news article h3 {
  margin-top: 0;
  font-size: 1.15rem;
}

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

/* Article cards */
#articles {
  display: block;
}

#articles > p {
  margin-bottom: 1.5rem;
}

#articles article {
  padding: 22px 24px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition);
}

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

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

#articles article h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-size: 1.15rem;
}

#articles article h3 a {
  color: var(--text);
  transition: color var(--transition);
}

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

#articles article p {
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

#articles article > a:last-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
}

#articles article > a:last-child::after {
  content: "\2192";
  transition: transform var(--transition);
}

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

/* FAQ */
#faq details {
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all var(--transition);
}

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

#faq details:hover {
  border-color: var(--primary-light);
}

#faq summary {
  position: relative;
  padding: 18px 52px 18px 22px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  transition: color var(--transition), background var(--transition);
}

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  color: var(--primary);
  transition: transform var(--transition);
}

#faq details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

#faq summary:hover {
  color: var(--primary);
  background: rgba(255, 107, 53, 0.05);
}

#faq details p {
  padding: 0 22px 20px;
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  animation: fadeIn 0.35s ease;
}

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

/* HowTo */
#howto ol {
  padding-left: 0;
  list-style: none;
  counter-reset: step;
  margin: 1rem 0;
}

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

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
}

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

/* Contact */
#contact ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 1rem 0 1.5rem;
}

#contact ul li {
  margin: 0;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  word-break: break-word;
}

#contact ul li:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* 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: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.3);
}

/* ===== Footer ===== */
#site-footer {
  position: relative;
  margin-top: 64px;
  padding: 56px 24px 32px;
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}

.footer-inner h2 {
  font-size: 1.15rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
}

.footer-inner h2::after {
  width: 36px;
  height: 3px;
}

.footer-inner p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

#back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--transition);
  font-family: inherit;
}

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

#back-to-top:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 12px 32px rgba(255, 107, 53, 0.55);
}

/* ===== Focus states ===== */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(255, 107, 53, 0.5);
  outline-offset: 2px;
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  #main-nav a {
    padding: 8px 9px;
    font-size: 0.85rem;
  }

  #search-input {
    width: 120px;
  }
}

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

  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 20px;
    height: auto;
    min-height: var(--header-h);
  }

  #main-nav {
    order: 3;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

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

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

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

  .header-tools {
    margin-left: auto;
  }

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

  #site-search {
    display: none;
  }

  #site-search.mobile-open {
    display: flex;
    order: 4;
    flex-basis: 100%;
    margin-top: 8px;
  }

  #site-search.mobile-open #search-input {
    flex: 1;
    width: auto;
  }

  .hero-inner {
    padding: 32px 24px;
  }

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

  main > section:not(#hero):not(#breadcrumb) {
    padding: 28px 22px;
    margin-top: 40px;
  }
}

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

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

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

  #hero {
    padding: 24px 16px 16px;
  }

  .hero-inner {
    padding: 28px 20px;
    border-radius: var(--radius-md);
  }

  .hero-actions {
    margin-bottom: 1.75rem;
  }

  .btn-primary,
  .btn-secondary {
    flex: 1;
    min-width: 140px;
    padding: 12px 20px;
    font-size: 0.95rem;
  }

  .hero-stats {
    gap: 10px;
  }

  .stat {
    padding: 14px 10px;
  }

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

  #breadcrumb {
    padding: 12px 16px 0;
  }

  main {
    padding: 0 16px 48px;
  }

  main > section:not(#hero):not(#breadcrumb) {
    padding: 22px 18px;
    margin-top: 32px;
    border-radius: var(--radius-md);
  }

  h2::after {
    width: 40px;
    height: 3px;
  }

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

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

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

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

  blockquote {
    padding: 18px 18px 18px 48px;
  }

  blockquote::before {
    left: 14px;
    font-size: 2.4rem;
  }

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

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

  #site-footer {
    padding: 40px 16px 24px;
  }

  #back-to-top {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
    font-size: 0.7rem;
  }
}

@media (max-width: 400px) {
  .hero-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== Reduced motion ===== */
@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;
  }

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

/* ===== Print ===== */
@media print {
  #site-header,
  #back-to-top,
  .hero-banner,
  .hero-actions,
  .header-tools {
    display: none !important;
  }

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

  main > section {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}