:root {
  --bg: #f7f7fb;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --text: #1a1a2e;
  --text-soft: #4a4a63;
  --text-muted: #7a7a94;
  --border: rgba(26, 26, 46, 0.1);
  --primary: #e94560;
  --primary-soft: rgba(233, 69, 96, 0.12);
  --accent: #533483;
  --accent-2: #0f3460;
  --accent-3: #16213e;
  --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #0f3460 45%, #533483 100%);
  --gradient-primary: linear-gradient(135deg, #e94560 0%, #533483 100%);
  --gradient-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.1) 0%, rgba(83, 52, 131, 0.1) 100%);
  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 8px 28px rgba(26, 26, 46, 0.1);
  --shadow-lg: 0 18px 48px rgba(26, 26, 46, 0.16);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --blur: saturate(180%) blur(16px);
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --container: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d18;
    --bg-soft: #141422;
    --surface: rgba(28, 28, 46, 0.62);
    --surface-solid: #1a1a2e;
    --text: #f0f0f7;
    --text-soft: #c2c2d6;
    --text-muted: #8f8fa8;
    --border: rgba(255, 255, 255, 0.1);
    --primary-soft: rgba(233, 69, 96, 0.18);
    --gradient-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.16) 0%, rgba(83, 52, 131, 0.16) 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.5);
  }
}

html[data-theme="dark"] {
  --bg: #0d0d18;
  --bg-soft: #141422;
  --surface: rgba(28, 28, 46, 0.62);
  --surface-solid: #1a1a2e;
  --text: #f0f0f7;
  --text-soft: #c2c2d6;
  --text-muted: #8f8fa8;
  --border: rgba(255, 255, 255, 0.1);
  --primary-soft: rgba(233, 69, 96, 0.18);
  --gradient-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.16) 0%, rgba(83, 52, 131, 0.16) 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] {
  --bg: #f7f7fb;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --text: #1a1a2e;
  --text-soft: #4a4a63;
  --text-muted: #7a7a94;
  --border: rgba(26, 26, 46, 0.1);
  --primary-soft: rgba(233, 69, 96, 0.12);
  --gradient-soft: linear-gradient(135deg, rgba(233, 69, 96, 0.1) 0%, rgba(83, 52, 131, 0.1) 100%);
  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 8px 28px rgba(26, 26, 46, 0.1);
  --shadow-lg: 0 18px 48px rgba(26, 26, 46, 0.16);
}

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

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(circle at 12% 8%, rgba(233, 69, 96, 0.08), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(83, 52, 131, 0.1), transparent 40%);
  background-attachment: fixed;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
  overflow-x: hidden;
}

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

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

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3,
h4 {
  line-height: 1.35;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.01em;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

h1 {
  font-size: clamp(1.6rem, 4.2vw, 2.6rem);
  margin: 0 0 0.6em;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  margin: 0 0 0.7em;
  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(--gradient-primary);
}

h3 {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  margin: 1.4em 0 0.5em;
}

h4 {
  font-size: 1.02rem;
  margin: 1.2em 0 0.4em;
  color: var(--text-soft);
}

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

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

li {
  margin-bottom: 0.4em;
}

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

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

#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

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

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

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

.logo:hover {
  color: var(--text);
  transform: translateY(-1px);
}

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

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

.logo-text {
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

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

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

#main-nav li {
  margin: 0;
}

#main-nav a {
  display: inline-block;
  padding: 8px 11px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: 999px;
  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: 3px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-primary);
  transform: translateX(-50%);
  transition: width 0.3s var(--ease);
}

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

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

#menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.25s var(--ease);
}

#menu-toggle:hover {
  background: var(--primary-soft);
  transform: scale(1.05);
}

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

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

#site-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

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

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

#site-search button {
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-primary);
  cursor: pointer;
  transition: transform 0.2s var(--ease), filter 0.25s var(--ease);
  font-family: inherit;
}

#site-search button:hover {
  transform: scale(1.04);
  filter: brightness(1.08);
}

#theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  font-size: 1.05rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), background-color 0.25s var(--ease);
}

#theme-toggle:hover {
  transform: rotate(18deg) scale(1.08);
  background: var(--primary-soft);
}

main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px 60px;
  display: block;
}

main > section {
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3.4vw, 38px);
  margin: 26px 0;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), box-shadow 0.35s var(--ease);
}

main > section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

.breadcrumb {
  margin: 18px 0 0;
}

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

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

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

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

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

#hero {
  position: relative;
  overflow: hidden;
  background: var(--gradient-hero);
  border: 0;
  color: #fff;
  padding: clamp(28px, 5vw, 56px);
  margin-top: 22px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

#hero::before,
#hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(8px);
  opacity: 0.5;
}

#hero::before {
  width: 420px;
  height: 420px;
  top: -160px;
  right: -120px;
  background: radial-gradient(circle, rgba(233, 69, 96, 0.55), transparent 68%);
  animation: floaty 12s ease-in-out infinite;
}

#hero::after {
  width: 360px;
  height: 360px;
  bottom: -150px;
  left: -110px;
  background: radial-gradient(circle, rgba(83, 52, 131, 0.7), transparent 68%);
  animation: floaty 15s ease-in-out infinite reverse;
}

@keyframes floaty {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-18px, 20px, 0) scale(1.08); }
}

#hero h1 {
  color: #fff;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.3);
}

.hero-lead {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(0.92rem, 1.6vw, 1.04rem);
  max-width: 900px;
}

.hero-lead strong {
  color: #ffd6de;
}

.hero-carousel {
  position: relative;
  z-index: 1;
  margin: 26px 0 8px;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.hero-carousel .slide {
  display: none;
  margin: 0;
  position: relative;
  animation: fadeSlide 0.6s var(--ease);
}

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

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

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

.hero-carousel figcaption {
  padding: 14px 18px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.22);
}

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 0.25s var(--ease), transform 0.25s var(--ease);
  z-index: 2;
}

.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }

.carousel-prev:hover,
.carousel-next:hover {
  background: var(--primary);
  transform: translateY(-50%) scale(1.1);
}

.carousel-dots {
  position: absolute;
  bottom: 58px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

.carousel-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 0;
  transition: width 0.3s var(--ease), background-color 0.3s var(--ease);
}

.carousel-dots button[aria-selected="true"] {
  width: 26px;
  border-radius: 999px;
  background: var(--primary);
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 22px;
}

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

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

.hero-stats .num {
  display: block;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #fff, #ffc2cd);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-stats .label {
  display: block;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 2px;
}

.anchor-nav {
  margin: 22px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

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

.anchor-nav li {
  margin: 0;
}

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

.anchor-nav a:hover {
  color: #fff;
  background: var(--gradient-primary);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(233, 69, 96, 0.3);
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0 0 1em;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 2px;
}

.timeline li {
  position: relative;
  padding: 10px 0 10px 34px;
  margin: 0;
  color: var(--text-soft);
  transition: transform 0.25s var(--ease);
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 18px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface-solid);
  border: 3px solid var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.timeline li:hover {
  transform: translateX(4px);
}

.timeline strong {
  color: var(--primary);
  margin-right: 6px;
}

.case,
.news-item,
.article-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 0 0 16px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}

.case::after,
.news-item::after,
.article-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--gradient-primary);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.35s var(--ease);
}

.case:hover,
.news-item:hover,
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(233, 69, 96, 0.35);
}

.case:hover::after,
.news-item:hover::after,
.article-card:hover::after {
  transform: scaleY(1);
}

.case h3,
.news-item h3,
.article-card h3 {
  margin-top: 0;
}

.news-item time,
.article-card time {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.article-card a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 0;
}

.article-card a::after {
  content: "→";
  transition: transform 0.25s var(--ease);
}

.article-card a:hover::after {
  transform: translateX(4px);
}

#articles {
  display: block;
}

#articles > p {
  margin-bottom: 18px;
}

#articles .article-card {
  display: block;
}

blockquote {
  margin: 0 0 14px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  position: relative;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

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

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

details {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 12px;
  padding: 0 18px;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

details[open] {
  border-color: rgba(233, 69, 96, 0.35);
  box-shadow: var(--shadow-sm);
}

details summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--text);
  padding: 15px 30px 15px 0;
  position: relative;
  transition: color 0.25s var(--ease);
}

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

details summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--primary);
  transition: transform 0.3s var(--ease);
}

details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

details summary:hover {
  color: var(--primary);
}

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

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

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

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 14px 16px 14px 58px;
  margin-bottom: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.25s var(--ease), border-color 0.25s 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%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: var(--gradient-primary);
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.35);
}

#howto ol li:hover {
  transform: translateX(4px);
  border-color: rgba(233, 69, 96, 0.35);
}

address {
  font-style: normal;
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 0 0 18px;
}

address p {
  margin: 0 0 6px;
}

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

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

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

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

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: var(--gradient-primary);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(233, 69, 96, 0.28);
}

#legal h2:not(:first-child) {
  margin-top: 1.6em;
}

footer {
  background: var(--gradient-hero);
  color: rgba(255, 255, 255, 0.82);
  padding: 40px 20px 30px;
  text-align: center;
  margin-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

footer p {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.85rem;
  line-height: 1.7;
}

footer a {
  color: #ffc2cd;
  font-weight: 600;
}

footer a:hover {
  color: #fff;
  text-decoration: underline;
}

#back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--gradient-primary);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: all 0.35s var(--ease);
  z-index: 90;
}

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

#back-to-top:hover {
  transform: translateY(-4px) scale(1.06);
  filter: brightness(1.1);
}

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

@media (max-width: 1024px) {
  .header-inner {
    justify-content: space-between;
  }
  #main-nav {
    order: 3;
    flex-basis: 100%;
  }
  #main-nav ul {
    justify-content: flex-start;
  }
  #search-input {
    width: 120px;
  }
}

@media (max-width: 860px) {
  .header-inner {
    gap: 10px;
  }
  #menu-toggle {
    display: grid;
    place-items: center;
    order: 2;
    margin-left: auto;
  }
  .header-tools {
    order: 4;
    flex-basis: 100%;
    justify-content: space-between;
    padding-bottom: 8px;
  }
  #main-nav {
    order: 5;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease);
  }
  #main-nav.open {
    max-height: 640px;
  }
  #main-nav ul {
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
  }
  #main-nav a {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
  }
  #main-nav a::after {
    display: none;
  }
  #site-search {
    flex: 1;
  }
  #search-input {
    width: 100%;
  }
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }
  main {
    padding: 0 12px 40px;
  }
  main > section {
    padding: 20px 16px;
    border-radius: var(--radius);
    margin: 18px 0;
  }
  #hero {
    padding: 24px 18px;
    border-radius: var(--radius);
  }
  .logo-text {
    font-size: 0.82rem;
  }
  .carousel-prev,
  .carousel-next {
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
  }
  .carousel-dots {
    bottom: 52px;
  }
  .hero-stats .stat {
    padding: 12px 8px;
  }
  h2 {
    padding-left: 14px;
  }
  h2::before {
    width: 5px;
  }
  .anchor-nav {
    padding: 12px;
  }
  .anchor-nav a {
    font-size: 0.74rem;
    padding: 5px 10px;
  }
  #sitemap ul,
  #links ul {
    grid-template-columns: repeat(2, 1fr);
  }
  #back-to-top {
    right: 14px;
    bottom: 16px;
    width: 42px;
    height: 42px;
  }
  .case,
  .news-item,
  .article-card {
    padding: 16px;
  }
}

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

@media print {
  #site-header,
  #back-to-top,
  .hero-carousel,
  #menu-toggle,
  .header-tools,
  .anchor-nav {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  main > section {
    opacity: 1;
    transform: none;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}