:root {
  --brand-red: #c0392b;
  --brand-red-dark: #96281b;
  --brand-gold: #f5d76e;
  --brand-green: #2e7d32;
  --bg: #fdfaf7;
  --bg-alt: #ffffff;
  --bg-soft: #f6f1ec;
  --text: #2b2320;
  --text-soft: #6b5f59;
  --text-muted: #9a8e88;
  --border: rgba(192, 57, 43, 0.14);
  --border-soft: rgba(43, 35, 32, 0.08);
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-solid: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.65);
  --shadow-sm: 0 2px 8px rgba(43, 35, 32, 0.06);
  --shadow-md: 0 8px 24px rgba(43, 35, 32, 0.09);
  --shadow-lg: 0 18px 48px rgba(43, 35, 32, 0.14);
  --gradient-hero: linear-gradient(135deg, #fdf2e9 0%, #fbe4d5 45%, #f5d76e 100%);
  --gradient-brand: linear-gradient(135deg, #c0392b 0%, #e67e22 100%);
  --gradient-accent: linear-gradient(135deg, #c0392b 0%, #f5d76e 100%);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --header-h: 68px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html[data-theme="dark"] {
  --bg: #14100f;
  --bg-alt: #1c1716;
  --bg-soft: #221c1a;
  --text: #f3ece8;
  --text-soft: #c9bdb6;
  --text-muted: #93857e;
  --border: rgba(245, 215, 110, 0.16);
  --border-soft: rgba(255, 255, 255, 0.08);
  --card-bg: rgba(38, 30, 28, 0.62);
  --card-solid: #221c1a;
  --glass-bg: rgba(30, 24, 22, 0.55);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  --gradient-hero: linear-gradient(135deg, #1d1412 0%, #3a1d17 50%, #5c3a12 100%);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 100% -5%, rgba(245, 215, 110, 0.18), transparent 60%),
    radial-gradient(800px 520px at -10% 8%, rgba(192, 57, 43, 0.1), transparent 60%);
  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-red);
  text-decoration: none;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}

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

html[data-theme="dark"] a {
  color: #f0a08f;
}

html[data-theme="dark"] a:hover {
  color: var(--brand-gold);
}

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

h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: clamp(1.12rem, 1.9vw, 1.35rem); }
h4 { font-size: 1.05rem; }

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

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

li {
  margin-bottom: 0.5em;
}

strong {
  color: var(--text);
  font-weight: 600;
}

blockquote {
  margin: 0 0 1em;
  padding: 1em 1.3em;
  background: var(--glass-bg);
  border-left: 4px solid var(--brand-red);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

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

.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-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 4px 20px rgba(43, 35, 32, 0.05);
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3);
  transition: transform 0.5s var(--ease);
}

.brand:hover .brand-logo {
  transform: rotate(12deg) scale(1.06);
}

.brand-name {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--brand-red);
  white-space: nowrap;
}

#main-nav {
  flex: 1 1 auto;
}

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

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

#main-nav a:hover,
#main-nav a:focus-visible {
  background: rgba(192, 57, 43, 0.1);
  color: var(--brand-red);
  transform: translateY(-1px);
  outline: none;
}

html[data-theme="dark"] #main-nav a:hover {
  color: var(--brand-gold);
  background: rgba(245, 215, 110, 0.1);
}

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

#site-search {
  display: flex;
  align-items: center;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

#site-search:focus-within {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

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

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

#site-search button {
  border: 0;
  background: var(--gradient-brand);
  color: #fff;
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.25s var(--ease);
}

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

#theme-toggle,
#menu-toggle {
  border: 1px solid var(--border);
  background: var(--card-solid);
  color: var(--text-soft);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

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

#menu-toggle {
  display: none;
}

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

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

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

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

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

/* ============ Layout / Sections ============ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px 60px;
}

main > section {
  margin: 0 0 28px;
  padding: 32px clamp(18px, 3vw, 40px);
  background: var(--card-bg);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.4s var(--ease);
  animation: fadeUp 0.7s var(--ease) both;
}

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

main > section > h2 {
  position: relative;
  padding-left: 16px;
  margin-bottom: 1.1em;
}

main > section > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 5px;
  border-radius: var(--radius-pill);
  background: var(--gradient-accent);
}

main > section > article {
  padding: 18px 0;
  border-bottom: 1px dashed var(--border-soft);
}

main > section > article:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

main > section > article:first-of-type {
  padding-top: 0;
}

/* ============ Hero ============ */
#hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  background: var(--gradient-hero);
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}

#hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -140px;
  top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 215, 110, 0.5), transparent 65%);
  pointer-events: none;
}

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

.hero-text h1 {
  margin-bottom: 0.6em;
  background: linear-gradient(120deg, var(--brand-red) 0%, #e67e22 60%, var(--brand-red-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--brand-red);
}

html[data-theme="dark"] .hero-text h1 {
  background: linear-gradient(120deg, #f5d76e 0%, #f0a08f 60%, #f5d76e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: 1.02rem;
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
}

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

.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 8px 22px rgba(192, 57, 43, 0.32);
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(192, 57, 43, 0.42);
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text);
  border: 1.5px solid var(--brand-red);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: var(--brand-red);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(192, 57, 43, 0.3);
}

/* ============ Carousel ============ */
.hero-carousel {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--card-solid);
  min-height: 240px;
}

.hero-carousel .slide {
  margin: 0;
  display: none;
  position: relative;
}

.hero-carousel .slide.active {
  display: block;
  animation: fadeIn 0.6s var(--ease) both;
}

.hero-carousel .slide svg {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.hero-carousel figcaption {
  padding: 12px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-soft);
}

.carousel-controls {
  position: absolute;
  right: 12px;
  bottom: 52px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.carousel-controls button {
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  color: var(--brand-red-dark);
  font-size: 0;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  position: relative;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.carousel-controls button::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 10px;
  height: 10px;
  border-top: 2.5px solid currentColor;
  border-right: 2.5px solid currentColor;
}

.carousel-controls .prev::before {
  transform: rotate(-135deg);
  margin-left: 12px;
}

.carousel-controls .next::before {
  transform: rotate(45deg);
  margin-right: 12px;
}

.carousel-controls button:hover {
  background: var(--brand-red);
  color: #fff;
  transform: scale(1.08);
}

/* ============ Stats ============ */
#stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: center;
  background: var(--gradient-brand);
  border: 0;
  color: #fff;
  overflow: hidden;
  position: relative;
}

#stats::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 200px at 20% 0%, rgba(255, 255, 255, 0.18), transparent 70%);
  pointer-events: none;
}

.stat {
  position: relative;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}

.stat:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.1);
}

.stat-num {
  display: block;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--brand-gold);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.92);
}

/* ============ Applications list ============ */
#applications ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

#applications li {
  margin: 0;
  padding: 16px 18px;
  background: var(--card-solid);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font-size: 0.94rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#applications li:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

/* ============ News ============ */
#news > ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 14px;
}

#news > ul > li {
  margin: 0;
  padding: 18px 20px;
  background: var(--card-solid);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--brand-red);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#news > ul > li:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

#news h3 {
  margin-bottom: 0.3em;
  font-size: 1.08rem;
}

#news p {
  margin: 0 0 0.4em;
  font-size: 0.9rem;
}

#news p:first-of-type {
  color: var(--brand-red);
  font-weight: 600;
  font-size: 0.82rem;
}

html[data-theme="dark"] #news p:first-of-type {
  color: var(--brand-gold);
}

/* ============ Articles grid ============ */
#articles {
  display: block;
}

#articles > article {
  display: inline-block;
  vertical-align: top;
  width: calc(50% - 10px);
  margin: 0 10px 20px 0;
  padding: 20px;
  background: var(--card-solid);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

#articles > article:nth-of-type(even) {
  margin-right: 0;
}

#articles > article:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

#articles > article h3 {
  font-size: 1.06rem;
  margin-bottom: 0.35em;
}

#articles > article p:first-of-type {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5em;
}

#articles > article a {
  display: inline-block;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: rgba(192, 57, 43, 0.08);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

#articles > article a:hover {
  background: var(--brand-red);
  color: #fff;
  transform: translateX(3px);
}

/* ============ Article full sections ============ */
main > section[id^="article-"] {
  background: var(--card-solid);
  border-left: 5px solid var(--brand-gold);
}

main > section[id^="article-"] h2 {
  color: var(--brand-red);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
}

html[data-theme="dark"] main > section[id^="article-"] h2 {
  color: var(--brand-gold);
}

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

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

#faq details[open] {
  border-color: rgba(192, 57, 43, 0.35);
}

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

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--brand-red);
  transition: transform 0.3s var(--ease);
}

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

#faq summary:hover {
  background: rgba(192, 57, 43, 0.05);
  color: var(--brand-red);
}

#faq details > p {
  padding: 0 20px 18px;
  margin: 0;
  font-size: 0.94rem;
  animation: fadeIn 0.4s var(--ease) both;
}

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

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 14px 16px 14px 56px;
  margin-bottom: 12px;
  background: var(--card-solid);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

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

#howto ol li:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

#howto ul li {
  padding-left: 4px;
}

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

#contact address p {
  margin: 0;
  padding: 14px 18px;
  background: var(--card-solid);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  font-size: 0.92rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#contact address p:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* ============ 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 16px;
  border-radius: var(--radius-pill);
  background: var(--card-solid);
  border: 1px solid var(--border-soft);
  font-size: 0.88rem;
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  background: var(--brand-red);
  color: #fff;
  border-color: var(--brand-red);
  transform: translateY(-2px);
}

/* ============ Legal ============ */
#legal h3 {
  margin-top: 1.1em;
  color: var(--brand-red);
  font-size: 1.08rem;
}

html[data-theme="dark"] #legal h3 {
  color: var(--brand-gold);
}

#legal p:last-child {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 1.4em;
}

/* ============ Footer ============ */
#site-footer {
  background: linear-gradient(135deg, #2b2320 0%, #3d2b25 100%);
  color: #e8ddd6;
  padding: 40px 20px 32px;
  margin-top: 20px;
  border-top: 4px solid var(--brand-red);
}

html[data-theme="dark"] #site-footer {
  background: linear-gradient(135deg, #0f0b0a 0%, #1d1412 100%);
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  text-align: center;
}

#site-footer p {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: rgba(232, 221, 214, 0.78);
}

#site-footer nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  padding: 0;
  margin: 16px 0 0;
}

#site-footer nav a {
  color: rgba(245, 215, 110, 0.9);
  font-size: 0.88rem;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}

#site-footer nav a:hover {
  color: #fff;
  opacity: 1;
}

/* ============ Back to top ============ */
#back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 90;
  border: 0;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--gradient-brand);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 10px 26px rgba(192, 57, 43, 0.38);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s var(--ease), filter 0.25s var(--ease);
}

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

#back-to-top:hover {
  filter: brightness(1.12);
  transform: translateY(-3px);
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

main > section:nth-child(2) { animation-delay: 0.05s; }
main > section:nth-child(3) { animation-delay: 0.08s; }
main > section:nth-child(4) { animation-delay: 0.11s; }
main > section:nth-child(5) { animation-delay: 0.14s; }
main > section:nth-child(6) { animation-delay: 0.17s; }

/* Scroll reveal helper */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

@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;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .header-inner {
    gap: 14px;
  }

  #search-input {
    width: 150px;
  }

  #main-nav a {
    padding: 8px 10px;
    font-size: 0.88rem;
  }
}

@media (max-width: 900px) {
  #hero {
    grid-template-columns: 1fr;
  }

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

  #articles > article {
    width: 100%;
    margin-right: 0;
  }
}

@media (max-width: 820px) {
  :root {
    --header-h: 60px;
  }

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

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

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

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

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

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

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

  #site-search {
    order: 3;
    flex-basis: 100%;
  }

  #search-input {
    width: 100%;
    flex: 1;
  }

  #site-search button {
    padding: 8px 18px;
  }

  main {
    padding: 0 14px 44px;
  }

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

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

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .carousel-controls {
    bottom: 56px;
  }

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

@media (max-width: 520px) {
  body {
    font-size: 15px;
  }

  #stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 22px 14px;
  }

  .stat-num {
    font-size: 1.7rem;
  }

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

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

  #sitemap ul,
  #links ul {
    gap: 8px;
  }

  #sitemap a,
  #links a {
    padding: 7px 13px;
    font-size: 0.82rem;
  }

  #faq summary {
    padding: 14px 42px 14px 16px;
    font-size: 0.92rem;
  }

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

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

  .carousel-controls {
    right: 8px;
    bottom: 48px;
  }

  .carousel-controls button {
    width: 32px;
    height: 32px;
  }
}

/* ============ Print ============ */
@media print {
  #site-header,
  #breadcrumb,
  #back-to-top,
  #site-footer,
  .hero-carousel,
  .hero-actions,
  #theme-toggle,
  #menu-toggle,
  #site-search {
    display: none !important;
  }

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

  main > section {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}