:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.65);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-hover: rgba(255, 255, 255, 0.1);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.4);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --accent-secondary: #a855f7;
  --gradient-1: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --gradient-2: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  --gradient-hero: linear-gradient(160deg, #0a0e17 0%, #1a1040 40%, #2d1b69 70%, #0f172a 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --max-width: 1200px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-glass: rgba(255, 255, 255, 0.6);
  --bg-glass-hover: rgba(255, 255, 255, 0.85);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(99, 102, 241, 0.5);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.1);
  --gradient-hero: linear-gradient(160deg, #eef2ff 0%, #e0e7ff 40%, #ede9fe 70%, #f8fafc 100%);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
  color: var(--accent);
}

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

ul,
ol {
  list-style: none;
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 14, 23, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

[data-theme="light"] header {
  background: rgba(248, 250, 252, 0.85);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px clamp(16px, 4vw, 48px);
  font-size: 0.78rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar span {
  white-space: nowrap;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 48px);
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 16px;
  flex-wrap: wrap;
}

.logo a {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  transition: opacity var(--transition-fast);
}

.logo a:hover {
  opacity: 0.8;
}

nav > ul {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

nav > ul li a {
  display: block;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  position: relative;
}

nav > ul li a:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

nav > ul li a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: var(--gradient-1);
  border-radius: 2px;
  transition: transform var(--transition-base);
}

nav > ul li a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* Search form */
nav form[role="search"] {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

nav form[role="search"] label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

nav form[role="search"] input[type="search"] {
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  outline: none;
  width: 180px;
  transition: all var(--transition-base);
  font-family: var(--font-sans);
}

nav form[role="search"] input[type="search"]::placeholder {
  color: var(--text-muted);
}

nav form[role="search"] input[type="search"]:focus {
  width: 240px;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-glass-hover);
}

nav form[role="search"] button[type="submit"] {
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-1);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  white-space: nowrap;
}

nav form[role="search"] button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

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

#theme-toggle:hover,
#menu-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
}

#menu-toggle {
  display: none;
}

/* ===== MAIN ===== */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}

/* ===== HERO ===== */
#hero {
  position: relative;
  margin: 24px 0 32px;
  padding: clamp(32px, 6vw, 72px) clamp(24px, 5vw, 64px);
  background: var(--gradient-hero);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

#hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: floatOrb 8s ease-in-out infinite;
}

#hero::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: floatOrb 10s ease-in-out infinite reverse;
}

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

#hero h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#hero > p {
  position: relative;
  z-index: 1;
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  color: var(--text-secondary);
  max-width: 720px;
  margin-bottom: 28px;
  line-height: 1.8;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.hero-actions a {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.hero-actions a:first-child {
  color: #fff;
  background: var(--gradient-1);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.hero-actions a:first-child:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
  color: #fff;
}

.hero-actions a:last-child {
  color: var(--text-primary);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hero-actions a:last-child:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

/* Banner carousel */
.banner-carousel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.banner-carousel article {
  padding: 22px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  cursor: default;
}

.banner-carousel article:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.banner-carousel article h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.banner-carousel article p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ===== BREADCRUMB ===== */
nav[aria-label="面包屑导航"] {
  display: block;
  padding: 0;
  margin: 0 0 28px;
  max-width: none;
}

nav[aria-label="面包屑导航"] ol {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

nav[aria-label="面包屑导航"] ol li:not(:last-child)::after {
  content: '›';
  margin-left: 8px;
  color: var(--text-muted);
}

nav[aria-label="面包屑导航"] ol li a {
  color: var(--text-secondary);
}

nav[aria-label="面包屑导航"] ol li a:hover {
  color: var(--accent-light);
}

/* ===== SECTIONS ===== */
main > section {
  margin-bottom: 56px;
  scroll-margin-top: 100px;
}

main > section > h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 800;
  margin-bottom: 20px;
  padding-bottom: 12px;
  position: relative;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

main > section > h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 56px;
  height: 3px;
  background: var(--gradient-1);
  border-radius: 3px;
}

main > section > p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.85;
}

main > section > h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

main > section > h3::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--gradient-1);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ===== LISTS ===== */
main > section > ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

main > section > ul > li {
  padding: 12px 18px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  position: relative;
  padding-left: 36px;
  line-height: 1.6;
}

main > section > ul > li::before {
  content: '✦';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--accent-light);
}

main > section > ul > li:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

/* Ordered lists (HowTo) */
main > section > ol {
  counter-reset: step-counter;
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

main > section > ol > li {
  counter-increment: step-counter;
  padding: 14px 18px 14px 52px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  position: relative;
  line-height: 1.6;
}

main > section > ol > li::before {
  content: counter(step-counter);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-1);
  border-radius: 50%;
}

main > section > ol > li:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

/* ===== ARTICLES (news & articles) ===== */
#news article,
#articles article {
  padding: 22px 24px;
  margin-bottom: 14px;
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

#news article::before,
#articles article::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--gradient-1);
  opacity: 0;
  transition: opacity var(--transition-base);
}

#news article:hover,
#articles article:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

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

#news article h3,
#articles article h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-primary);
  line-height: 1.5;
  transition: color var(--transition-fast);
}

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

#news article time,
#articles article time {
  display: inline-block;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding: 3px 10px;
  background: var(--bg-glass);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

#news article p,
#articles article p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-light);
  transition: all var(--transition-fast);
}

#articles article a:hover {
  color: var(--accent);
  gap: 8px;
}

#articles article a::after {
  content: '→';
  transition: transform var(--transition-fast);
}

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

/* ===== BLOCKQUOTE (testimonials) ===== */
blockquote {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

blockquote p {
  padding: 20px 22px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  position: relative;
  transition: all var(--transition-base);
  line-height: 1.7;
  font-style: normal;
}

blockquote p::before {
  content: '"';
  position: absolute;
  top: 8px;
  left: 14px;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.2;
  line-height: 1;
  font-family: Georgia, serif;
}

blockquote p:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

/* ===== FAQ DETAILS ===== */
#faq details {
  margin-bottom: 10px;
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-base);
}

#faq details:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

#faq details[open] {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  background: var(--bg-glass-hover);
}

#faq details summary {
  padding: 16px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color var(--transition-fast);
  user-select: none;
}

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

#faq details summary::after {
  content: '+';
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--accent-light);
  transition: transform var(--transition-base);
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border-radius: 50%;
  border: 1px solid var(--border-color);
}

#faq details[open] summary::after {
  content: '−';
  transform: rotate(180deg);
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

#faq details summary:hover {
  color: var(--accent-light);
}

#faq details > p {
  padding: 0 22px 18px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.8;
  animation: fadeSlideIn 0.3s ease;
}

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

/* ===== CONTACT ===== */
#contact ul {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

#contact ul li::before {
  content: '▸';
  color: var(--accent);
  font-size: 0.8rem;
}

/* ===== SITEMAP & LINKS ===== */
#sitemap ul,
#links ul {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

#sitemap ul li::before {
  content: '›';
  font-size: 0.9rem;
  font-weight: 700;
}

#links ul li::before {
  content: '🔗';
  font-size: 0.7rem;
}

#links ul li a {
  color: var(--accent-light);
  font-weight: 500;
}

#links ul li a:hover {
  color: var(--accent);
}

/* ===== FOOTER ===== */
footer {
  margin-top: 64px;
  padding: 40px clamp(16px, 4vw, 48px);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  text-align: center;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-1);
}

footer p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.7;
}

footer p:first-child {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

footer p a {
  color: var(--text-secondary);
  margin: 0 4px;
}

footer p a:hover {
  color: var(--accent-light);
}

/* ===== BACK TO TOP ===== */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: all var(--transition-base);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  font-family: var(--font-sans);
  writing-mode: vertical-lr;
  letter-spacing: 1px;
}

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

#back-to-top:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 32px var(--accent-glow);
}

/* ===== SCROLL ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ===== SELECTION ===== */
::selection {
  background: var(--accent);
  color: #fff;
}

/* ===== FOCUS VISIBLE ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  nav > ul li a {
    padding: 5px 9px;
    font-size: 0.8rem;
  }

  nav form[role="search"] input[type="search"] {
    width: 140px;
  }

  nav form[role="search"] input[type="search"]:focus {
    width: 180px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .topbar {
    justify-content: center;
    text-align: center;
    font-size: 0.72rem;
    padding: 6px 16px;
  }

  nav {
    padding: 10px 16px;
    gap: 10px;
  }

  .logo a {
    font-size: 1.35rem;
  }

  nav > ul {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 2px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
  }

  nav > ul.open {
    max-height: 500px;
    padding-top: 10px;
  }

  nav > ul li a {
    font-size: 0.78rem;
    padding: 6px 10px;
  }

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

  nav form[role="search"] {
    order: 2;
    flex: 1;
    min-width: 0;
  }

  nav form[role="search"] input[type="search"] {
    width: 100%;
    min-width: 0;
  }

  nav form[role="search"] input[type="search"]:focus {
    width: 100%;
  }

  nav form[role="search"] button[type="submit"] {
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  #theme-toggle {
    padding: 8px 10px;
    font-size: 0.72rem;
  }

  #hero {
    margin: 16px 0 24px;
    padding: 28px 20px;
    border-radius: var(--radius-lg);
  }

  #hero h1 {
    font-size: 1.45rem;
  }

  #hero > p {
    font-size: 0.86rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 10px;
  }

  .hero-actions a {
    justify-content: center;
    padding: 12px 20px;
    font-size: 0.86rem;
  }

  .banner-carousel {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  main > section {
    margin-bottom: 40px;
  }

  main > section > h2 {
    font-size: 1.2rem;
  }

  main > section > ul {
    grid-template-columns: 1fr;
  }

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

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

  #faq details summary {
    padding: 14px 16px;
    font-size: 0.86rem;
  }

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

  footer {
    padding: 28px 16px;
  }

  #back-to-top {
    bottom: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    font-size: 0.62rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .topbar span:last-child {
    display: none;
  }

  nav {
    flex-wrap: wrap;
  }

  .logo {
    flex: 1;
  }

  nav form[role="search"] {
    order: 3;
    width: 100%;
    flex: none;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
  }

  nav form[role="search"] input[type="search"] {
    width: 100%;
  }

  #hero {
    padding: 22px 16px;
  }

  #hero h1 {
    font-size: 1.25rem;
  }

  .banner-carousel article {
    padding: 16px;
  }

  main > section > ol > li {
    padding: 12px 14px 12px 46px;
    font-size: 0.82rem;
  }

  main > section > ul > li {
    padding: 10px 14px 10px 32px;
    font-size: 0.82rem;
  }
}

/* ===== PRINT ===== */
@media print {
  header,
  footer,
  #back-to-top,
  .hero-actions,
  nav form[role="search"] {
    display: none;
  }

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

  #hero {
    background: none;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

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