:root {
  --bg: #f4f6fb;
  --bg-alt: #ffffff;
  --bg-elev: rgba(255, 255, 255, 0.72);
  --text: #1a1a2e;
  --text-soft: #4a4a63;
  --text-mute: #6b6b85;
  --brand: #6c5ce7;
  --brand-2: #a29bfe;
  --brand-3: #00cec9;
  --accent: #fd79a8;
  --border: rgba(26, 26, 46, 0.1);
  --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);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --header-h: 72px;
  --grad-banner: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 45%, #00cec9 100%);
  --grad-btn: linear-gradient(135deg, #6c5ce7, #a29bfe);
  --glass: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.45);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --focus: 0 0 0 3px rgba(108, 92, 231, 0.35);
}

html[data-theme="dark"] {
  --bg: #12121f;
  --bg-alt: #1a1a2e;
  --bg-elev: rgba(30, 30, 50, 0.7);
  --text: #eef0ff;
  --text-soft: #c3c6e0;
  --text-mute: #9a9dbd;
  --brand: #a29bfe;
  --brand-2: #6c5ce7;
  --brand-3: #55efc4;
  --accent: #fd79a8;
  --border: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  --grad-banner: linear-gradient(135deg, #2d2b55 0%, #4a3f8f 45%, #0b6e69 100%);
  --glass: rgba(30, 30, 50, 0.6);
  --glass-border: rgba(255, 255, 255, 0.14);
  --focus: 0 0 0 3px rgba(162, 155, 254, 0.45);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #12121f;
    --bg-alt: #1a1a2e;
    --bg-elev: rgba(30, 30, 50, 0.7);
    --text: #eef0ff;
    --text-soft: #c3c6e0;
    --text-mute: #9a9dbd;
    --brand: #a29bfe;
    --brand-2: #6c5ce7;
    --brand-3: #55efc4;
    --border: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
    --grad-banner: linear-gradient(135deg, #2d2b55 0%, #4a3f8f 45%, #0b6e69 100%);
    --glass: rgba(30, 30, 50, 0.6);
    --glass-border: rgba(255, 255, 255, 0.14);
    --focus: 0 0 0 3px rgba(162, 155, 254, 0.45);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  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-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(108, 92, 231, 0.12), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(0, 206, 201, 0.1), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(253, 121, 168, 0.08), transparent 55%);
  background-attachment: fixed;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
  overflow-x: hidden;
}

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 {
  color: var(--brand-3);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 6px;
}

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

h1 {
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
}

h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  position: relative;
  padding-left: 18px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: 6px;
  background: var(--grad-btn);
  box-shadow: 0 0 14px rgba(108, 92, 231, 0.5);
}

h3 {
  font-size: clamp(1.05rem, 1.9vw, 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;
}

time {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--text-mute);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 12px;
  margin-bottom: 0.5em;
}

.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: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.brand-area {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-area a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo-text {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  background: var(--grad-banner);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  transition: filter 0.3s var(--ease);
}

.brand-area a:hover .logo-text {
  filter: brightness(1.15) drop-shadow(0 0 8px rgba(108, 92, 231, 0.45));
}

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

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

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

#main-nav a {
  display: inline-block;
  padding: 6px 11px;
  font-size: 0.9rem;
  color: var(--text-soft);
  border-radius: 999px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

#main-nav a:hover {
  color: #fff;
  background: var(--grad-btn);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.35);
}

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

.header-tools form {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.header-tools form:focus-within {
  border-color: var(--brand);
  box-shadow: var(--focus);
}

.header-tools input[type="search"] {
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 0.88rem;
  padding: 7px 14px;
  width: 190px;
  min-width: 0;
  border-radius: 999px;
}

.header-tools input[type="search"]::placeholder {
  color: var(--text-mute);
}

.header-tools button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--grad-btn);
  padding: 7px 16px;
  border-radius: 999px;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease),
    filter 0.25s var(--ease);
}

.header-tools button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.4);
  filter: brightness(1.06);
}

.header-tools button:active {
  transform: translateY(0) scale(0.98);
}

#theme-toggle {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 14px;
}

#theme-toggle:hover {
  background: var(--grad-btn);
  color: #fff;
  border-color: transparent;
}

#menu-toggle {
  display: none;
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 14px;
}

#menu-toggle:hover {
  background: var(--grad-btn);
  color: #fff;
  border-color: transparent;
}

/* ============ Layout ============ */
main {
  display: block;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 36px) clamp(14px, 4vw, 40px) 60px;
}

main > section {
  margin-bottom: clamp(28px, 4vw, 52px);
  scroll-margin-top: calc(var(--header-h) + 20px);
}

/* ============ Banner ============ */
#banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 60px);
  background: var(--grad-banner);
  background-size: 200% 200%;
  animation: bannerShift 16s ease infinite;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

#banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.28), transparent 38%),
    radial-gradient(circle at 10% 88%, rgba(255, 255, 255, 0.16), transparent 42%);
  pointer-events: none;
  z-index: -1;
}

#banner::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -110px;
  bottom: -140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  filter: blur(6px);
  pointer-events: none;
  z-index: -1;
}

.banner-slide {
  position: relative;
  max-width: 860px;
  animation: fadeUp 0.8s var(--ease) both;
}

#banner h1 {
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.22);
  margin-bottom: 0.5em;
}

#banner p {
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  max-width: 780px;
  margin-bottom: 1.6em;
}

.cta,
.cta-secondary {
  display: inline-block;
  margin: 6px 12px 6px 0;
  padding: 12px 28px;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), box-shadow 0.3s var(--ease),
    background 0.3s var(--ease), color 0.3s var(--ease);
}

.cta {
  color: #4a3f8f;
  background: #fff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.cta:hover {
  color: #4a3f8f;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26);
}

.cta-secondary {
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.cta-secondary:hover {
  color: #4a3f8f;
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

/* ============ Breadcrumb ============ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0 0 22px;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-mute);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--text-mute);
  opacity: 0.6;
}

.breadcrumb a {
  color: var(--brand);
  font-weight: 600;
}

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

/* ============ Anchor nav ============ */
#anchor-nav {
  margin-bottom: 32px;
}

#anchor-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

#anchor-nav a {
  display: inline-block;
  padding: 5px 13px;
  font-size: 0.82rem;
  color: var(--text-soft);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 0.25s var(--ease);
}

#anchor-nav a:hover {
  color: #fff;
  background: var(--grad-btn);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.32);
}

/* ============ Section cards ============ */
main > section:not(#banner) {
  position: relative;
  padding: clamp(20px, 3.4vw, 38px);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
    border-color 0.35s var(--ease);
}

main > section:not(#banner):hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(108, 92, 231, 0.28);
}

main > section:not(#banner) > h2:first-child {
  margin-top: 0;
}

/* ============ Articles & cards ============ */
#news article,
#articles article {
  position: relative;
  margin-bottom: 18px;
  padding: 20px 22px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

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

#news article:hover,
#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(108, 92, 231, 0.35);
}

#news article h3,
#articles article h3 {
  margin-bottom: 0.35em;
  transition: color 0.25s var(--ease);
}

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

#articles article > a {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  color: var(--brand);
  background: rgba(108, 92, 231, 0.1);
  transition: all 0.25s var(--ease);
}

#articles article > a:hover {
  color: #fff;
  background: var(--grad-btn);
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.32);
  transform: translateY(-2px);
}

#articles article > div {
  margin-top: 14px;
  padding: 14px 16px;
  font-size: 0.92rem;
  color: var(--text-soft);
  background: var(--bg);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

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

/* ============ Blockquote ============ */
blockquote {
  position: relative;
  margin: 0 0 16px;
  padding: 18px 22px 18px 52px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

blockquote::before {
  content: "\201C";
  position: absolute;
  left: 16px;
  top: 4px;
  font-size: 3rem;
  line-height: 1;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--brand);
  opacity: 0.5;
}

blockquote:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

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

/* ============ FAQ ============ */
#faq h3 {
  position: relative;
  margin-top: 22px;
  padding: 12px 16px 12px 44px;
  font-size: 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.25s var(--ease);
}

#faq h3::before {
  content: "Q";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
  color: #fff;
  background: var(--grad-btn);
  border-radius: 50%;
}

#faq h3:hover {
  border-color: rgba(108, 92, 231, 0.4);
  box-shadow: var(--shadow-sm);
  transform: translateX(3px);
}

#faq p {
  padding: 0 4px 0 18px;
  border-left: 2px dashed var(--border);
  margin-left: 8px;
}

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

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 12px 16px 12px 52px;
  margin-bottom: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.25s var(--ease);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  background: var(--grad-btn);
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(108, 92, 231, 0.35);
}

#howto ol li:hover {
  transform: translateX(4px);
  border-color: rgba(108, 92, 231, 0.4);
  box-shadow: var(--shadow-sm);
}

/* ============ Contact ============ */
address {
  font-style: normal;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

address p {
  margin: 0;
  padding: 12px 16px;
  font-size: 0.9rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.25s var(--ease);
}

address p:hover {
  border-color: rgba(108, 92, 231, 0.4);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

/* ============ Sitemap & links ============ */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
}

#sitemap li,
#links li {
  margin: 0;
}

#sitemap a,
#links a {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--text-soft);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 0.25s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: var(--grad-btn);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.32);
}

/* ============ Footer ============ */
footer {
  margin-top: 40px;
  padding: clamp(28px, 4vw, 48px) clamp(16px, 4vw, 48px) 32px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  color: var(--text-soft);
}

footer > section {
  max-width: 1180px;
  margin: 0 auto 28px;
}

footer h2 {
  font-size: 1.05rem;
  padding-left: 14px;
}

footer h2::before {
  width: 4px;
}

footer p {
  font-size: 0.88rem;
  color: var(--text-mute);
}

#legal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px 28px;
}

#legal h2 {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

#legal h2:not(:first-child) {
  margin-top: 8px;
}

#footer-info {
  padding-top: 22px;
  border-top: 1px solid var(--border);
  text-align: center;
}

#footer-info p {
  margin: 4px 0;
  font-size: 0.82rem;
}

/* ============ Back to top ============ */
#back-to-top {
  position: fixed;
  right: clamp(14px, 3vw, 32px);
  bottom: clamp(14px, 3vw, 32px);
  z-index: 90;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--grad-btn);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(108, 92, 231, 0.42);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
    visibility 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

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

#back-to-top:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 16px 34px rgba(108, 92, 231, 0.55);
}

#back-to-top:active {
  transform: translateY(0) scale(0.98);
}

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

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

@keyframes floatSoft {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  main > section,
  footer > section {
    animation: fadeUp 0.7s var(--ease) both;
    animation-timeline: view();
    animation-range: entry 0% cover 22%;
  }

  #banner .banner-slide {
    animation: fadeUp 0.8s var(--ease) both;
  }
}

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

/* ============ Responsive ============ */
@media (max-width: 1080px) {
  #main-nav {
    order: 3;
    flex-basis: 100%;
  }

  #main-nav ul {
    justify-content: flex-start;
  }

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

@media (max-width: 860px) {
  #site-header {
    gap: 10px 14px;
    padding: 10px 16px;
  }

  .header-tools input[type="search"] {
    width: 130px;
  }

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

  #main-nav {
    display: none;
    flex-basis: 100%;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }

  #main-nav.is-open {
    display: block;
    animation: fadeUp 0.35s var(--ease) both;
  }

  #main-nav ul {
    flex-direction: column;
    gap: 4px;
  }

  #main-nav a {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-alt);
    border: 1px solid var(--border);
  }

  #main-nav a:hover {
    transform: none;
  }

  #banner {
    border-radius: var(--radius);
  }

  blockquote {
    padding-left: 46px;
  }
}

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

  #site-header {
    position: sticky;
  }

  .brand-slogan {
    display: none;
  }

  .header-tools {
    flex-basis: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .header-tools form {
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-tools input[type="search"] {
    width: 100%;
    flex: 1 1 auto;
  }

  #theme-toggle,
  #menu-toggle {
    padding: 8px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  main {
    padding: 14px 12px 40px;
  }

  main > section:not(#banner) {
    padding: 18px 16px;
    border-radius: var(--radius);
  }

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 4px;
  }

  #banner {
    padding: 26px 20px;
  }

  .cta,
  .cta-secondary {
    display: block;
    width: 100%;
    text-align: center;
    margin: 8px 0;
  }

  .breadcrumb {
    font-size: 0.78rem;
    padding: 8px 12px;
  }

  #anchor-nav ul {
    padding: 10px;
    gap: 6px;
  }

  #anchor-nav a {
    font-size: 0.76rem;
    padding: 4px 10px;
  }

  #news article,
  #articles article {
    padding: 16px 14px;
  }

  #faq h3 {
    padding: 10px 12px 10px 40px;
    font-size: 0.94rem;
  }

  #howto ol li {
    padding: 10px 12px 10px 46px;
  }

  address {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 400px) {
  .logo-text {
    font-size: 1rem;
  }

  .header-tools button {
    padding: 7px 10px;
    font-size: 0.76rem;
  }
}

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

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

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