:root {
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --bg-glass: rgba(255, 255, 255, 0.55);
  --text: #1a1a2e;
  --text-soft: #4a4a68;
  --text-muted: #6b6b88;
  --primary: #e94560;
  --primary-dark: #c8314a;
  --secondary: #533483;
  --accent: #0f3460;
  --deep: #16213e;
  --border: rgba(26, 26, 46, 0.12);
  --border-strong: rgba(26, 26, 46, 0.2);
  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 26, 46, 0.1);
  --shadow-lg: 0 16px 48px rgba(26, 26, 46, 0.14);
  --shadow-glow: 0 8px 32px rgba(233, 69, 96, 0.28);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --grad-hero: linear-gradient(135deg, #1a1a2e 0%, #0f3460 42%, #533483 78%, #e94560 100%);
  --grad-primary: linear-gradient(135deg, #e94560 0%, #533483 100%);
  --grad-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.08), rgba(83, 52, 131, 0.08));
  --grad-line: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --bg: #0b0b16;
  --bg-soft: #14142a;
  --bg-elevated: rgba(20, 20, 42, 0.82);
  --bg-glass: rgba(20, 20, 42, 0.6);
  --text: #f0f0fa;
  --text-soft: #c3c3d8;
  --text-muted: #8f8fae;
  --border: rgba(240, 240, 250, 0.12);
  --border-strong: rgba(240, 240, 250, 0.22);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 8px 32px rgba(233, 69, 96, 0.42);
  --grad-hero: linear-gradient(135deg, #0b0b16 0%, #16213e 40%, #3a2260 75%, #b8304a 100%);
  --grad-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.14), rgba(83, 52, 131, 0.16));
}

*,
*::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.78;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 8% 4%, rgba(233, 69, 96, 0.08), transparent 42%),
    radial-gradient(circle at 92% 12%, rgba(83, 52, 131, 0.1), transparent 46%),
    radial-gradient(circle at 50% 100%, rgba(15, 52, 96, 0.08), transparent 55%);
  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(--primary);
  text-decoration: none;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}

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

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

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

h1 { font-size: clamp(1.75rem, 3.6vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h3 { font-size: clamp(1.15rem, 1.9vw, 1.4rem); }
h4 { font-size: clamp(1.02rem, 1.5vw, 1.18rem); }

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

ul, ol { padding-left: 1.4em; color: var(--text-soft); }
li { margin-bottom: 0.45em; }

strong { color: var(--text); }

blockquote {
  margin: 1.2em 0;
  padding: 1em 1.3em;
  border-left: 4px solid var(--primary);
  background: var(--grad-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-soft);
  font-style: normal;
}

blockquote p { margin: 0; }

figure {
  margin: 1.6em 0;
  padding: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

figure svg {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
}

figcaption {
  margin-top: 0.8em;
  font-size: 0.86rem;
  color: var(--text-muted);
  text-align: center;
}

/* ============ Header ============ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--bg-glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

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

.header-inner {
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  flex-shrink: 0;
}

.logo svg {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease);
}

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

.logo-text {
  font-weight: 800;
  font-size: 1.06rem;
  letter-spacing: 0.02em;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
}

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

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

#main-nav li { margin: 0; }

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

#main-nav a:hover,
#main-nav a:focus-visible {
  color: var(--primary);
  background: var(--grad-soft);
  transform: translateY(-1px);
}

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

.search-form {
  display: flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.search-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.16);
}

.search-form input {
  width: 118px;
  padding: 7px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: width 0.3s var(--ease);
}

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

.search-form input:focus { width: 150px; }

.search-form button {
  padding: 7px 13px;
  border: none;
  background: var(--grad-primary);
  color: #fff;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.25s var(--ease);
}

.search-form button:hover { filter: brightness(1.1); }

#theme-toggle,
#menu-toggle {
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

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

#menu-toggle { display: none; }

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

main > section {
  margin: 28px 0;
  padding: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: box-shadow 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.4s var(--ease);
}

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

main > section > h2 {
  position: relative;
  margin: 0 0 1em;
  padding-bottom: 0.55em;
}

main > section > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 3px;
  border-radius: 3px;
  background: var(--grad-primary);
}

/* ============ Hero ============ */
#hero {
  margin-top: 22px;
  padding: 0;
  background: var(--grad-hero);
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  color: #fff;
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(233, 69, 96, 0.42), transparent 46%),
    radial-gradient(circle at 82% 78%, rgba(83, 52, 131, 0.5), transparent 52%);
  pointer-events: none;
}

#hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 78%);
  pointer-events: none;
}

.hero-slider {
  position: relative;
  z-index: 1;
  padding: clamp(32px, 5vw, 64px) clamp(22px, 4vw, 56px) clamp(20px, 3vw, 32px);
  min-height: 340px;
}

.slide {
  display: none;
  max-width: 820px;
  animation: slideIn 0.65s var(--ease) both;
}

.slide.active { display: block; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide h1,
.slide h2 {
  color: #fff;
  margin: 0 0 0.5em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.32);
}

.slide h1 {
  background: linear-gradient(100deg, #fff 20%, #ffd6de 60%, #e0c8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.slide p {
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(0.92rem, 1.3vw, 1.02rem);
  line-height: 1.85;
  max-width: 720px;
}

.cta {
  display: inline-block;
  margin-top: 0.6em;
  padding: 12px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e94560, #ff7a92);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow-glow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), filter 0.3s var(--ease);
}

.cta:hover,
.cta:focus-visible {
  color: #fff;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 40px rgba(233, 69, 96, 0.5);
  filter: brightness(1.06);
}

.slider-dots {
  display: flex;
  gap: 10px;
  margin-top: 26px;
}

.dot {
  width: 34px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  color: transparent;
  font-size: 0;
  cursor: pointer;
  transition: background 0.3s var(--ease), width 0.3s var(--ease);
}

.dot:hover { background: rgba(255, 255, 255, 0.5); }

.dot.active {
  width: 52px;
  background: linear-gradient(90deg, #e94560, #ff9db0);
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.stat {
  padding: 22px 16px;
  text-align: center;
  background: rgba(10, 10, 24, 0.22);
  transition: background 0.3s var(--ease);
}

.stat:hover { background: rgba(233, 69, 96, 0.22); }

.stat .num {
  display: block;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.01em;
  background: linear-gradient(120deg, #fff, #ffc2ce);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.stat span:last-child {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.72);
}

/* ============ Breadcrumb & TOC ============ */
#breadcrumb {
  padding: 14px 22px;
  margin: 20px 0 0;
}

#breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.86rem;
}

#breadcrumb li { margin: 0; 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(--primary); }
#breadcrumb [aria-current="page"] { color: var(--primary); font-weight: 600; }

#toc {
  background: var(--grad-soft);
  border: 1px dashed var(--border-strong);
}

#toc h2 { font-size: 1.05rem; margin-bottom: 0.7em; }

#toc ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#toc li { margin: 0; }

#toc a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 0.9rem;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), padding-left 0.25s var(--ease);
}

#toc a::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--grad-primary);
  flex-shrink: 0;
}

#toc a:hover {
  background: var(--bg-soft);
  color: var(--primary);
  padding-left: 18px;
}

/* ============ Timeline ============ */
.timeline {
  position: relative;
  margin: 1.2em 0;
  padding: 0 0 0 26px;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--grad-line);
  border-radius: 2px;
}

.timeline li {
  position: relative;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--grad-primary);
  box-shadow: 0 0 0 3px var(--bg);
}

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

.timeline strong { color: var(--primary); }

/* ============ Posts ============ */
.post {
  position: relative;
  margin: 16px 0;
  padding: 20px 22px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

.post::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 3px;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

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

.post:hover::before { opacity: 1; }

.post h3 { margin: 0 0 0.35em; font-size: 1.12rem; }

.post:hover h3 { color: var(--primary); }

.post time,
article time {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5em;
}

.post p { font-size: 0.94rem; margin-bottom: 0.7em; }

.post a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
}

.post a::after {
  content: "→";
  transition: transform 0.3s var(--ease);
}

.post a:hover::after { transform: translateX(4px); }

#articles > section {
  margin: 18px 0;
  padding: 20px 22px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

#articles > section h4 {
  margin: 0 0 0.7em;
  color: var(--primary);
}

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

/* ============ News ============ */
#news article {
  position: relative;
  padding: 18px 20px 18px 24px;
  margin: 14px 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#news article::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 24px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.16);
}

#news article:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

#news h3 { margin: 0 0 0.3em; font-size: 1.05rem; }

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

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

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

#faq summary {
  position: relative;
  padding: 15px 46px 15px 20px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--grad-soft);
  color: var(--primary);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}

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

#faq summary:hover { background: var(--grad-soft); color: var(--primary); }

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

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

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

#howto ol > li {
  position: relative;
  counter-increment: step;
  padding: 12px 16px 12px 54px;
  margin-bottom: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  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: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

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

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

#howto ul li::marker { color: var(--primary); }

/* ============ Contact ============ */
#contact address {
  font-style: normal;
  padding: 20px 22px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

#contact address ul { list-style: none; padding: 0; margin: 0; }

#contact address li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  font-size: 0.94rem;
}

#contact address li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

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

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

#sitemap a,
#links a {
  display: inline-block;
  padding: 7px 15px;
  font-size: 0.88rem;
  color: var(--text-soft);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

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

/* ============ Search result block ============ */
#search {
  border-left: 4px solid var(--primary);
}

#search h2 { font-size: 1.1rem; }

/* ============ Footer ============ */
#site-footer {
  margin-top: 40px;
  background: var(--deep);
  color: rgba(255, 255, 255, 0.78);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

#site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(233, 69, 96, 0.24), transparent 46%),
    radial-gradient(circle at 88% 100%, rgba(83, 52, 131, 0.34), transparent 50%);
  pointer-events: none;
}

.footer-inner {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 44px 20px 28px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 28px 36px;
}

.footer-brand p { margin: 0 0 6px; color: rgba(255, 255, 255, 0.76); font-size: 0.9rem; }

.footer-brand p strong {
  display: inline-block;
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 4px;
  background: linear-gradient(120deg, #fff, #ffc2ce);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-contact p {
  margin: 0 0 6px;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.7);
  word-break: break-word;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-content: start;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  transition: color 0.25s var(--ease);
}

.footer-links a:hover { color: #ff8fa3; }

.footer-copy {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.56);
}

/* ============ Back to top ============ */
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 900;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: var(--grad-primary);
  color: #fff;
  font-size: 0.84rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  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.1); transform: translateY(-3px); }

/* ============ Scroll reveal ============ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

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

/* ============ Responsive ============ */
@media (max-width: 1080px) {
  #main-nav a { padding: 7px 8px; font-size: 0.84rem; }
  .search-form input { width: 96px; }
  .search-form input:focus { width: 120px; }
}

@media (max-width: 920px) {
  #main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background: var(--bg-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: max-height 0.4s var(--ease);
  }

  #main-nav.is-open { max-height: 70vh; overflow-y: auto; }

  #main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 10px 16px 16px;
    justify-content: flex-start;
  }

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

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

  .search-form input { width: 88px; }
  .search-form input:focus { width: 108px; }

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

  .footer-inner { grid-template-columns: 1fr 1fr; }
}

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

  body { font-size: 15px; }

  main { padding: 0 14px 32px; }

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

  .header-inner { padding: 0 14px; gap: 10px; }

  .logo-text { font-size: 0.94rem; }

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

  .search-form { display: none; }

  #theme-toggle,
  #menu-toggle { padding: 7px 11px; font-size: 0.78rem; }

  #hero { border-radius: var(--radius-lg); }

  .hero-slider {
    padding: 28px 18px 18px;
    min-height: 0;
  }

  .slide p { font-size: 0.9rem; }

  .cta { padding: 11px 22px; font-size: 0.9rem; }

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

  .stat { padding: 16px 10px; }

  .stat span:last-child { font-size: 0.72rem; }

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

  .post { padding: 16px; }

  #articles > section { padding: 16px; }

  #faq summary { padding: 13px 42px 13px 16px; font-size: 0.94rem; }

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

  #howto ol > li { padding: 11px 12px 11px 48px; }

  #howto ol > li::before { left: 11px; width: 25px; height: 25px; font-size: 0.76rem; }

  #contact address { padding: 16px; }

  .footer-inner {
    grid-template-columns: 1fr;
    padding: 32px 16px 22px;
    gap: 20px;
  }

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

  blockquote { padding: 0.9em 1em; }
}

@media (max-width: 400px) {
  .logo-text { display: none; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .dot { width: 26px; }
  .dot.active { width: 40px; }
}

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

@media print {
  #site-header,
  #back-to-top,
  .slider-dots,
  .header-tools,
  #site-footer { display: none !important; }
  body { background: #fff; color: #000; }
  main > section { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  #hero { background: #1a1a2e; }
  a { color: #000; text-decoration: underline; }
}