:root {
  --bg: #f6f7fb;
  --bg-alt: #ffffff;
  --bg-soft: #eef1f8;
  --text: #1a1a2e;
  --text-soft: #4a4f63;
  --text-mute: #7a8099;
  --primary: #1a1a2e;
  --accent: #f5c518;
  --accent-2: #e94560;
  --accent-3: #0f3460;
  --link: #2b4a8b;
  --border: rgba(26, 26, 46, 0.1);
  --glass: rgba(255, 255, 255, 0.6);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 10px 30px rgba(26, 26, 46, 0.1);
  --shadow-lg: 0 20px 50px rgba(26, 26, 46, 0.16);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --grad-hero: linear-gradient(135deg, #1a1a2e 0%, #16213e 45%, #0f3460 100%);
  --grad-accent: linear-gradient(135deg, #f5c518 0%, #e94560 100%);
  --grad-soft: linear-gradient(135deg, rgba(245, 197, 24, 0.14), rgba(15, 52, 96, 0.12));
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 72px;
}

html[data-theme="dark"] {
  --bg: #0d1020;
  --bg-alt: #141a2e;
  --bg-soft: #1a2138;
  --text: #eef1f8;
  --text-soft: #c2c8db;
  --text-mute: #8b93ad;
  --primary: #eef1f8;
  --accent: #f5c518;
  --accent-2: #ff5c7a;
  --accent-3: #4d7fd6;
  --link: #8fb4ff;
  --border: rgba(238, 241, 248, 0.12);
  --glass: rgba(20, 26, 46, 0.55);
  --glass-strong: rgba(20, 26, 46, 0.82);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
  --grad-hero: linear-gradient(135deg, #0b0f1e 0%, #141a2e 45%, #1b2a4a 100%);
}

* {
  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: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 88% -8%, rgba(245, 197, 24, 0.16), transparent 62%),
    radial-gradient(900px 520px at 4% 4%, rgba(15, 52, 96, 0.16), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

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

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(245, 197, 24, 0.75);
  outline-offset: 2px;
  border-radius: 6px;
}

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

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

h2 {
  font-size: clamp(1.35rem, 1.05rem + 1.3vw, 2rem);
  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-accent);
}

h3 {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
}

h4 {
  font-size: 1.03rem;
  color: var(--text-soft);
}

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

blockquote {
  margin: 0 0 1.2em;
  padding: 18px 22px;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

blockquote p {
  margin: 0 0 0.5em;
  color: var(--text);
}

blockquote footer {
  font-size: 0.9rem;
  color: var(--text-mute);
}

time {
  font-size: 0.85rem;
  color: var(--text-mute);
}

address {
  font-style: normal;
}

.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;
  background: var(--glass-strong);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.4s var(--ease), box-shadow 0.3s var(--ease);
}

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

.brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand svg {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(245, 197, 24, 0.35), 0 6px 18px rgba(26, 26, 46, 0.25);
  transition: transform 0.5s var(--ease), box-shadow 0.4s var(--ease);
}

.brand a:hover svg {
  transform: rotate(18deg) scale(1.06);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.6), 0 8px 22px rgba(245, 197, 24, 0.35);
}

.brand-name {
  font-size: 1.15rem;
  white-space: nowrap;
  background: linear-gradient(120deg, var(--text), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

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

#main-nav li {
  margin: 0;
}

#main-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-soft);
  position: relative;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease), transform 0.25s var(--ease);
}

#main-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-accent);
  transform: translateX(-50%);
  transition: width 0.3s var(--ease);
}

#main-nav a:hover {
  color: var(--text);
  background: var(--bg-soft);
  transform: translateY(-1px);
}

#main-nav a:hover::after {
  width: 60%;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

#site-search {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 3px 3px 14px;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#site-search:focus-within {
  border-color: rgba(245, 197, 24, 0.7);
  box-shadow: 0 0 0 4px rgba(245, 197, 24, 0.16);
}

#search-input {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  padding: 6px 8px;
  width: 170px;
  min-width: 0;
  font-family: inherit;
  transition: width 0.3s var(--ease);
}

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

#search-input:focus {
  outline: none;
  width: 210px;
}

#site-search button {
  border: 0;
  cursor: pointer;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  font-family: inherit;
  color: #1a1a2e;
  background: var(--grad-accent);
  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, 69, 96, 0.35);
  filter: brightness(1.05);
}

#theme-toggle,
#menu-toggle {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#theme-toggle:hover,
#menu-toggle:hover {
  transform: translateY(-2px) rotate(8deg);
  background: var(--accent);
  color: #1a1a2e;
  box-shadow: 0 8px 18px rgba(245, 197, 24, 0.35);
}

#menu-toggle {
  display: none;
}

/* ============ Main layout ============ */
main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

main > section,
main > nav.breadcrumb,
main > nav#anchor-nav {
  margin-bottom: 28px;
}

main > section {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 2.4vw, 40px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.4s var(--ease);
}

main > section:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(245, 197, 24, 0.35);
}

/* ============ Breadcrumb ============ */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  font-size: 0.86rem;
  color: var(--text-mute);
}

.breadcrumb li {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb li + li::before {
  content: "›";
  color: var(--text-mute);
  opacity: 0.7;
}

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

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

/* ============ Hero ============ */
#hero {
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--grad-hero);
  color: #fff;
  position: relative;
  isolation: isolate;
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(560px 300px at 82% 8%, rgba(245, 197, 24, 0.28), transparent 65%),
    radial-gradient(620px 340px at 8% 92%, rgba(233, 69, 96, 0.22), transparent 62%);
  z-index: -1;
  animation: heroGlow 12s ease-in-out infinite alternate;
}

#hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 90px 90px, 55px 55px;
  background-position: 0 0, 28px 34px;
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
}

@keyframes heroGlow {
  from { opacity: 0.75; transform: scale(1); }
  to { opacity: 1; transform: scale(1.06); }
}

.hero-carousel {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}

.hero-carousel .slide {
  display: none;
  animation: slideFade 0.7s var(--ease);
}

.hero-carousel .slide.active {
  display: block;
}

.hero-carousel .slide svg {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
}

@keyframes slideFade {
  from { opacity: 0; transform: scale(1.03); }
  to { opacity: 1; transform: scale(1); }
}

.carousel-controls {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  gap: 8px;
  z-index: 3;
}

.carousel-controls button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s var(--ease);
}

.carousel-controls button:hover {
  background: var(--accent);
  color: #1a1a2e;
  border-color: var(--accent);
  transform: scale(1.08);
}

.hero-text {
  padding: clamp(24px, 3vw, 44px);
  color: #fff;
}

.hero-text h1 {
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
  max-width: 22em;
}

.hero-text p {
  color: rgba(255, 255, 255, 0.86);
  max-width: 68ch;
}

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

.hero-stats .stat {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 16px 14px;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.35s var(--ease), background-color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.hero-stats .stat:hover {
  transform: translateY(-6px);
  background: rgba(245, 197, 24, 0.18);
  border-color: rgba(245, 197, 24, 0.55);
}

.hero-stats .num {
  display: block;
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.hero-stats .stat span:last-child {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.btn-primary {
  color: #1a1a2e;
  background: var(--grad-accent);
  box-shadow: 0 10px 26px rgba(233, 69, 96, 0.35);
}

.btn-primary:hover {
  color: #1a1a2e;
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(233, 69, 96, 0.45);
}

.btn-secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  color: #1a1a2e;
  background: #fff;
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(255, 255, 255, 0.25);
}

/* ============ Anchor nav ============ */
#anchor-nav {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: none;
}

#anchor-nav::-webkit-scrollbar {
  display: none;
}

#anchor-nav ul {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

#anchor-nav li {
  margin: 0;
}

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

#anchor-nav a:hover {
  background: var(--grad-accent);
  color: #1a1a2e;
  transform: translateY(-1px);
}

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

#news article::before,
#articles article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 4px;
  background: var(--grad-accent);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

#news article:hover,
#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(245, 197, 24, 0.45);
  background: var(--bg-alt);
}

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

#news article h3,
#articles article h3 {
  margin-bottom: 4px;
}

#articles article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-2);
}

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

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

/* ============ FAQ ============ */
#faq details {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 20px;
  margin-bottom: 12px;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

#faq details:hover {
  border-color: rgba(245, 197, 24, 0.45);
  box-shadow: var(--shadow-sm);
}

#faq details[open] {
  background: var(--bg-alt);
  border-color: rgba(245, 197, 24, 0.55);
  box-shadow: var(--shadow-md);
}

#faq summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 0;
  font-weight: 700;
  color: var(--text);
  position: relative;
  padding-right: 34px;
  transition: color 0.25s var(--ease);
}

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--grad-accent);
  color: #1a1a2e;
  font-weight: 800;
  font-size: 1rem;
  transition: transform 0.35s var(--ease);
}

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

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

#faq details p {
  margin: 0 0 16px;
  padding-top: 2px;
  animation: fadeUp 0.4s var(--ease);
}

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

/* ============ Reviews ============ */
#reviews blockquote {
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

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

/* ============ Contact / sitemap / links / legal ============ */
#contact address {
  background: var(--grad-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 18px;
}

#contact address p {
  margin: 0 0 6px;
}

#contact address p:last-child {
  margin-bottom: 0;
}

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

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

#sitemap a,
#links a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  transform: translateY(-3px);
  background: var(--accent);
  color: #1a1a2e;
  border-color: var(--accent);
}

#legal h3 {
  margin-top: 1.2em;
}

#search-results {
  border-style: dashed;
}

/* ============ Footer ============ */
footer {
  position: relative;
  margin-top: 20px;
  background: var(--grad-hero);
  color: rgba(255, 255, 255, 0.82);
  padding: 40px 20px 56px;
}

footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 260px at 80% 0%, rgba(245, 197, 24, 0.18), transparent 65%);
  pointer-events: none;
}

.footer-inner {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  text-align: center;
}

.footer-inner p {
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.footer-inner a {
  color: var(--accent);
  font-weight: 600;
}

.footer-inner a:hover {
  color: #fff;
}

#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: var(--grad-accent);
  color: #1a1a2e;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(233, 69, 96, 0.4);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), opacity 0.3s var(--ease);
}

#back-to-top:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 16px 34px rgba(233, 69, 96, 0.5);
}

/* ============ Scroll reveal ============ */
main > section,
#news article,
#articles article,
#reviews blockquote,
#faq details {
  opacity: 0;
  transform: translateY(26px);
  animation: reveal 0.7s var(--ease) forwards;
}

main > section:nth-of-type(1) { animation-delay: 0.02s; }
main > section:nth-of-type(2) { animation-delay: 0.06s; }
main > section:nth-of-type(3) { animation-delay: 0.1s; }
main > section:nth-of-type(4) { animation-delay: 0.14s; }
main > section:nth-of-type(5) { animation-delay: 0.18s; }
main > section:nth-of-type(6) { animation-delay: 0.22s; }
main > section:nth-of-type(7) { animation-delay: 0.26s; }
main > section:nth-of-type(8) { animation-delay: 0.3s; }

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@supports (animation-timeline: view()) {
  main > section,
  #news article,
  #articles article,
  #reviews blockquote,
  #faq details {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 42%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  main > section,
  #news article,
  #articles article,
  #reviews blockquote,
  #faq details {
    opacity: 1;
    transform: none;
  }
}

/* ============ Responsive ============ */
@media (max-width: 1080px) {
  #main-nav a {
    padding: 7px 9px;
    font-size: 0.86rem;
  }
  #search-input {
    width: 130px;
  }
  #search-input:focus {
    width: 160px;
  }
}

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

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

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

  #main-nav {
    order: 4;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s var(--ease), opacity 0.3s var(--ease);
    opacity: 0;
  }

  #main-nav.open {
    max-height: 520px;
    opacity: 1;
    overflow-y: auto;
  }

  #main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 0 12px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
  }

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

  #main-nav a::after {
    display: none;
  }

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

  #site-search {
    padding-left: 10px;
  }

  #search-input {
    width: 120px;
  }

  #search-input:focus {
    width: 140px;
  }

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

  #anchor-nav {
    top: calc(var(--header-h) + 6px);
  }

  #hero {
    border-radius: var(--radius-lg);
    margin-top: 4px;
  }
}

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

  main {
    padding: 0 12px 28px;
  }

  main > section {
    padding: 20px 16px;
    border-radius: var(--radius);
    margin-bottom: 18px;
  }

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 5px;
  }

  #site-search {
    display: none;
  }

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

  .brand svg {
    width: 34px;
    height: 34px;
  }

  .hero-text {
    padding: 20px 16px 26px;
  }

  .hero-text p {
    font-size: 0.94rem;
  }

  .hero-stats {
    gap: 10px;
    margin: 20px 0 20px;
  }

  .hero-stats .stat {
    padding: 12px 8px;
    border-radius: var(--radius-sm);
  }

  .hero-stats .stat span:last-child {
    font-size: 0.74rem;
  }

  .btn-primary,
  .btn-secondary {
    flex: 1 1 auto;
    padding: 11px 18px;
    font-size: 0.9rem;
  }

  .carousel-controls {
    right: 10px;
    bottom: 10px;
  }

  .carousel-controls button {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  #anchor-nav {
    border-radius: var(--radius);
    padding: 6px 8px;
  }

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

  #sitemap a,
  #links a {
    padding: 9px 10px;
    font-size: 0.84rem;
    text-align: center;
  }

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

  #faq details {
    padding: 2px 14px;
  }

  #faq summary {
    padding: 12px 0;
    padding-right: 30px;
    font-size: 0.95rem;
  }

  blockquote {
    padding: 14px 16px;
  }

  #contact address {
    padding: 14px 16px;
  }

  #back-to-top {
    right: 12px;
    bottom: 14px;
    width: 42px;
    height: 42px;
    font-size: 1.05rem;
  }

  footer {
    padding: 28px 14px 64px;
  }

  .footer-inner p {
    font-size: 0.82rem;
  }
}

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

/* ============ Print ============ */
@media print {
  #site-header,
  #anchor-nav,
  #back-to-top,
  .carousel-controls,
  .header-tools {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  main > section {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
  a {
    color: #000;
    text-decoration: underline;
  }
}