:root {
  --pink: #ff6b9d;
  --pink-light: #ff9ec4;
  --pink-deep: #e8457a;
  --yellow: #ffe66d;
  --teal: #4ecdc4;
  --navy: #1a1a2e;
  --navy-2: #16213e;
  --navy-3: #0f3460;
  --purple: #6c5ce7;
  --bg: #f7f7fb;
  --bg-alt: #ffffff;
  --bg-soft: #f0f0f8;
  --text: #22223a;
  --text-soft: #5a5a72;
  --text-mute: #8a8aa0;
  --border: rgba(26, 26, 46, 0.08);
  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #ffffff;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.65);
  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow: 0 8px 28px rgba(26, 26, 46, 0.09);
  --shadow-lg: 0 18px 48px rgba(26, 26, 46, 0.14);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --grad-hero: linear-gradient(135deg, #ff6b9d 0%, #a06bff 48%, #4ecdc4 100%);
  --grad-btn: linear-gradient(135deg, #ff6b9d 0%, #e8457a 100%);
  --grad-btn-2: linear-gradient(135deg, #6c5ce7 0%, #4ecdc4 100%);
  --grad-text: linear-gradient(120deg, #ff6b9d, #6c5ce7, #4ecdc4);
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html[data-theme="dark"] {
  --bg: #10101c;
  --bg-alt: #181828;
  --bg-soft: #1e1e32;
  --text: #eef0f8;
  --text-soft: #b6b9cc;
  --text-mute: #8b8fa8;
  --border: rgba(255, 255, 255, 0.1);
  --card: rgba(30, 30, 50, 0.66);
  --card-solid: #1c1c30;
  --glass: rgba(28, 28, 46, 0.6);
  --glass-border: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -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", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1000px 520px at 8% -8%, rgba(255, 107, 157, 0.16), transparent 62%),
    radial-gradient(900px 480px at 96% 4%, rgba(78, 205, 196, 0.14), transparent 60%),
    radial-gradient(760px 460px at 50% 100%, rgba(108, 92, 231, 0.1), transparent 65%);
  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(--pink-deep);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

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

html[data-theme="dark"] a {
  color: var(--pink-light);
}

html[data-theme="dark"] a:hover,
html[data-theme="dark"] a:focus-visible {
  color: var(--teal);
}

:focus-visible {
  outline: 3px solid rgba(255, 107, 157, 0.55);
  outline-offset: 2px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

h1 {
  font-size: clamp(1.6rem, 4.2vw, 2.5rem);
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

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

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: 6px;
  background: var(--grad-btn);
}

h3 {
  font-size: clamp(1.08rem, 2.2vw, 1.28rem);
  color: var(--text);
}

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

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

ul,
ol {
  color: var(--text-soft);
}

blockquote {
  margin: 0 0 18px;
  padding: 18px 22px;
  background: var(--card);
  border-left: 5px solid var(--pink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

blockquote:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

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

/* ============ Header ============ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 4px 20px rgba(26, 26, 46, 0.06);
  transition: background 0.35s var(--ease), box-shadow 0.35s 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;
  flex-wrap: wrap;
}

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

.brand-logo svg {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(255, 107, 157, 0.35);
  transition: transform 0.4s var(--ease);
}

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

.brand-name {
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

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

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

#main-nav a {
  display: inline-block;
  padding: 6px 11px;
  font-size: 0.9rem;
  color: var(--text-soft);
  border-radius: var(--radius-pill);
  position: relative;
  transition: color 0.25s var(--ease), background 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-btn);
  transform: translateX(-50%);
  transition: width 0.3s var(--ease);
}

#main-nav a:hover,
#main-nav a:focus-visible {
  color: var(--pink-deep);
  background: rgba(255, 107, 157, 0.1);
}

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

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

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

#site-search:focus-within {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.18);
}

#search-input {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.88rem;
  padding: 6px 4px;
  width: 150px;
  outline: none;
  font-family: inherit;
}

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

#site-search button,
#theme-toggle,
#menu-toggle {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 7px 15px;
  color: #fff;
  background: var(--grad-btn);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
  white-space: nowrap;
}

#site-search button:hover,
#theme-toggle:hover,
#menu-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(232, 69, 122, 0.35);
  filter: brightness(1.05);
}

#theme-toggle {
  background: var(--grad-btn-2);
}

#theme-toggle:hover {
  box-shadow: 0 8px 20px rgba(108, 92, 231, 0.35);
}

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

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

main > section {
  margin-bottom: 34px;
  padding: clamp(20px, 3.4vw, 38px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  opacity: 0;
  transform: translateY(28px);
  animation: riseIn 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; }
main > section:nth-of-type(9) { animation-delay: 0.34s; }
main > section:nth-of-type(10) { animation-delay: 0.38s; }
main > section:nth-of-type(11) { animation-delay: 0.42s; }
main > section:nth-of-type(12) { animation-delay: 0.46s; }
main > section:nth-of-type(13) { animation-delay: 0.5s; }
main > section:nth-of-type(14) { animation-delay: 0.54s; }
main > section:nth-of-type(15) { animation-delay: 0.58s; }
main > section:nth-of-type(16) { animation-delay: 0.62s; }
main > section:nth-of-type(17) { animation-delay: 0.66s; }

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

main > section:hover {
  border-color: rgba(255, 107, 157, 0.32);
  box-shadow: var(--shadow-lg);
}

/* ============ Breadcrumb ============ */
#breadcrumb {
  margin-bottom: 18px;
  padding: 0 4px;
}

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

#breadcrumb li + li::before {
  content: "›";
  margin-right: 8px;
  color: var(--text-mute);
  opacity: 0.7;
}

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

#breadcrumb a:hover {
  color: var(--pink-deep);
}

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

/* ============ Hero ============ */
#hero {
  position: relative;
  overflow: hidden;
  background: var(--grad-hero) !important;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 24px 60px rgba(232, 69, 122, 0.28);
  padding: clamp(20px, 3.4vw, 40px);
}

#hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 70%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.4), transparent);
  pointer-events: none;
}

#hero .hero-slider {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(26, 26, 46, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 14px 38px rgba(26, 26, 46, 0.35);
  min-height: 180px;
}

#hero .slide {
  display: none;
  animation: fadeSlide 0.6s var(--ease);
}

#hero .slide.active {
  display: block;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

#hero .slider-controls {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  gap: 8px;
}

#hero .slider-controls button {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

#hero .slider-controls button:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

#hero .hero-text {
  margin-top: 24px;
  padding: clamp(16px, 2.6vw, 26px);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#hero h1 {
  -webkit-text-fill-color: #fff;
  color: #fff;
  text-shadow: 0 2px 18px rgba(26, 26, 46, 0.35);
}

#hero .hero-text p {
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 8px rgba(26, 26, 46, 0.25);
}

.cta {
  display: inline-block;
  margin: 4px 10px 4px 0;
  padding: 11px 26px;
  font-weight: 700;
  font-size: 0.94rem;
  color: #fff;
  background: rgba(26, 26, 46, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 26px rgba(26, 26, 46, 0.3);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

.cta:hover,
.cta:focus-visible {
  color: #fff;
  transform: translateY(-3px) scale(1.02);
  background: rgba(26, 26, 46, 0.95);
  box-shadow: 0 16px 34px rgba(26, 26, 46, 0.42);
}

.cta.secondary {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cta.secondary:hover {
  background: rgba(255, 255, 255, 0.38);
  color: #1a1a2e;
}

/* ============ Anchor nav ============ */
#anchor-nav {
  margin-bottom: 34px;
  padding: 14px 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 50;
}

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

#anchor-nav a {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: all 0.25s var(--ease);
}

#anchor-nav a:hover,
#anchor-nav a:focus-visible {
  color: #fff;
  background: var(--grad-btn);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(232, 69, 122, 0.32);
}

/* ============ Cards / articles ============ */
#news,
#articles {
  display: block;
}

#news article,
#articles article {
  position: relative;
  margin-bottom: 18px;
  padding: 20px 22px 18px;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  overflow: hidden;
}

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

#news article:hover,
#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 107, 157, 0.3);
}

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

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

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

#news article p:first-of-type,
#articles article p:first-of-type {
  font-size: 0.82rem;
  color: var(--text-mute);
  margin-bottom: 10px;
}

#news article p:first-of-type::before,
#articles article p:first-of-type::before {
  content: "🗓 ";
  margin-right: 2px;
}

#news article a,
#articles article a {
  display: inline-block;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 5px 16px;
  border-radius: var(--radius-pill);
  background: rgba(255, 107, 157, 0.1);
  transition: all 0.25s var(--ease);
}

#news article a:hover,
#articles article a:hover {
  background: var(--grad-btn);
  color: #fff;
  transform: translateX(4px);
}

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

#faq details:hover {
  border-color: rgba(255, 107, 157, 0.32);
  box-shadow: var(--shadow);
}

#faq details[open] {
  border-color: rgba(255, 107, 157, 0.4);
  box-shadow: var(--shadow);
}

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

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

#faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pink-deep);
  background: rgba(255, 107, 157, 0.12);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}

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

#faq summary:hover {
  color: var(--pink-deep);
  background: rgba(255, 107, 157, 0.05);
}

#faq details p {
  margin: 0;
  padding: 0 20px 18px;
  font-size: 0.94rem;
  color: var(--text-soft);
  border-top: 1px dashed var(--border);
  padding-top: 14px;
  animation: fadeIn 0.35s var(--ease);
}

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

/* ============ Contact / sitemap lists ============ */
#contact ul,
#sitemap ul {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

#contact ul li,
#sitemap ul li {
  padding: 11px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

#contact ul li:hover,
#sitemap ul li:hover {
  transform: translateY(-2px);
  border-color: rgba(78, 205, 196, 0.5);
  box-shadow: 0 8px 18px rgba(78, 205, 196, 0.16);
}

#sitemap ul li a {
  font-weight: 600;
}

/* ============ Footer ============ */
#site-footer {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, var(--navy-3) 100%);
  color: rgba(255, 255, 255, 0.82);
  padding: 40px 20px 30px;
  margin-top: 20px;
  border-top: 3px solid transparent;
  border-image: var(--grad-hero) 1;
}

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

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

.footer-inner p:first-child {
  font-weight: 700;
  color: #fff;
}

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

#site-footer nav a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
  position: relative;
  padding-bottom: 2px;
}

#site-footer nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--yellow);
  transition: width 0.3s var(--ease);
}

#site-footer nav a:hover {
  color: var(--yellow);
}

#site-footer nav a:hover::after {
  width: 100%;
}

/* ============ Back to top ============ */
#back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 120;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  padding: 12px 16px;
  border-radius: 50%;
  width: 58px;
  height: 58px;
  background: var(--grad-btn);
  box-shadow: 0 12px 30px rgba(232, 69, 122, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s, box-shadow 0.35s var(--ease);
}

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

#back-to-top:hover {
  box-shadow: 0 18px 40px rgba(232, 69, 122, 0.6);
  transform: translateY(-4px) scale(1.05);
}

/* ============ Responsive ============ */
@media (min-width: 900px) {
  #hero {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 28px;
    align-items: center;
  }

  #hero .hero-text {
    margin-top: 0;
  }

  #hero .hero-slider {
    min-height: 260px;
  }

  #articles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  #articles > h2,
  #articles > p {
    grid-column: 1 / -1;
  }

  #articles article {
    margin-bottom: 0;
    height: 100%;
  }

  #news {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  #news > h2 {
    grid-column: 1 / -1;
  }

  #news article {
    margin-bottom: 0;
    height: 100%;
  }
}

@media (max-width: 1080px) {
  #main-nav a {
    padding: 6px 8px;
    font-size: 0.86rem;
  }

  #search-input {
    width: 110px;
  }
}

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

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

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

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

  #main-nav.open {
    max-height: 520px;
    opacity: 1;
    margin-top: 6px;
  }

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

  #main-nav a {
    display: block;
    padding: 10px 14px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
  }

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

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

  #search-input {
    width: 120px;
  }

  #anchor-nav {
    position: static;
  }

  #anchor-nav ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  #anchor-nav a {
    white-space: nowrap;
  }
}

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

  main {
    padding: 16px 12px 48px;
  }

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

  #site-search {
    display: none;
  }

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

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

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

  #hero .hero-text {
    padding: 16px;
  }

  .cta {
    display: block;
    text-align: center;
    margin-right: 0;
  }

  #contact ul,
  #sitemap ul {
    grid-template-columns: 1fr;
  }

  #back-to-top {
    width: 50px;
    height: 50px;
    font-size: 0.72rem;
    right: 14px;
    bottom: 16px;
  }
}

@media (max-width: 380px) {
  .brand-name {
    display: none;
  }
}

/* ============ Motion & accessibility ============ */
@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 {
    opacity: 1;
    transform: none;
  }
}

@media print {
  #site-header,
  #anchor-nav,
  #back-to-top,
  #site-footer {
    display: none !important;
  }

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

  main > section {
    box-shadow: none;
    border: 1px solid #ccc;
    opacity: 1;
    transform: none;
  }
}