:root {
  --primary: #7C3AED;
  --primary-light: #A78BFA;
  --primary-dark: #5B21B6;
  --secondary: #EC4899;
  --secondary-light: #F9A8D4;
  --accent: #06B6D4;
  --accent-light: #67E8F9;
  --bg: #F8F7FF;
  --bg-alt: #FFFFFF;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-glass: rgba(255, 255, 255, 0.55);
  --bg-glass-strong: rgba(255, 255, 255, 0.82);
  --text: #1E1B2E;
  --text-secondary: #4B4566;
  --text-muted: #7A7490;
  --border: rgba(124, 58, 237, 0.12);
  --border-strong: rgba(124, 58, 237, 0.2);
  --shadow-sm: 0 2px 8px rgba(124, 58, 237, 0.06);
  --shadow: 0 8px 32px rgba(124, 58, 237, 0.1);
  --shadow-lg: 0 16px 48px rgba(124, 58, 237, 0.14);
  --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.15);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient-primary: linear-gradient(135deg, #7C3AED 0%, #A78BFA 50%, #EC4899 100%);
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 30%, #EC4899 70%, #F9A8D4 100%);
  --gradient-card: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(236, 72, 153, 0.04));
  --gradient-accent: linear-gradient(135deg, #06B6D4, #7C3AED);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0D1A;
    --bg-alt: #1A1729;
    --bg-card: rgba(30, 27, 46, 0.72);
    --bg-glass: rgba(30, 27, 46, 0.55);
    --bg-glass-strong: rgba(30, 27, 46, 0.85);
    --text: #EDEAF6;
    --text-secondary: #B8B0D0;
    --text-muted: #7A7490;
    --border: rgba(167, 139, 250, 0.15);
    --border-strong: rgba(167, 139, 250, 0.25);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.25);
    --gradient-card: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(236, 72, 153, 0.08));
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition), color var(--transition);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 5%, rgba(124, 58, 237, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 15%, rgba(236, 72, 153, 0.06), transparent 55%),
    radial-gradient(ellipse 70% 60% at 50% 90%, rgba(6, 182, 212, 0.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
}

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

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

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

ul, ol {
  list-style: none;
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), box-shadow var(--transition);
}

header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0.3;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

nav > div a {
  font-size: 1.35rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.02em;
  transition: opacity var(--transition-fast);
}

nav > div a:hover {
  opacity: 0.8;
}

nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

nav ul li a {
  display: block;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
}

nav ul li a::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: transform var(--transition-fast);
}

nav ul li a:hover {
  color: var(--primary);
  background: rgba(124, 58, 237, 0.06);
}

nav ul li a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* ===== SECTIONS ===== */
section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 24px;
  position: relative;
}

section + section {
  border-top: 1px solid var(--border);
}

/* ===== HERO ===== */
#hero {
  max-width: 100%;
  padding: 0;
  margin: 0;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle 400px at 20% 30%, rgba(255, 255, 255, 0.15), transparent 70%),
    radial-gradient(circle 300px at 80% 70%, rgba(255, 255, 255, 0.1), transparent 70%),
    radial-gradient(circle 200px at 50% 50%, rgba(255, 255, 255, 0.05), transparent 70%);
  pointer-events: none;
}

#hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
  z-index: 1;
}

#hero h1 {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 24px 16px;
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 2;
}

#hero p {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.85;
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
}

#hero p:first-of-type {
  padding-top: 0;
  padding-bottom: 20px;
}

#hero p:last-of-type {
  padding-bottom: 100px;
}

/* ===== HEADINGS ===== */
h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 32px;
  line-height: 1.35;
  position: relative;
  padding-bottom: 16px;
  letter-spacing: -0.01em;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 64px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 4px;
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 700;
  color: var(--text);
  margin-top: 40px;
  margin-bottom: 16px;
  line-height: 1.4;
}

h3:first-of-type {
  margin-top: 0;
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 28px;
  margin-bottom: 10px;
  line-height: 1.45;
}

p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.85;
  font-size: 0.95rem;
}

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

/* ===== CARDS (articles, cases, news) ===== */
article {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition);
}

article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--border-strong);
  background: var(--bg-glass-strong);
}

article:hover::before {
  opacity: 1;
}

article h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.15rem;
}

article h3 a {
  color: var(--text);
  transition: color var(--transition-fast);
}

article h3 a:hover {
  color: var(--primary);
}

article p {
  font-size: 0.9rem;
}

article p:first-of-type {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

article a[href="#articles"] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  padding: 6px 0;
  transition: gap var(--transition-fast), color var(--transition-fast);
}

article a[href="#articles"]::after {
  content: "→";
  transition: transform var(--transition-fast);
}

article a[href="#articles"]:hover {
  gap: 10px;
  color: var(--secondary);
}

article a[href="#articles"]:hover::after {
  transform: translateX(4px);
}

/* ===== LISTS ===== */
section ul {
  display: grid;
  gap: 12px;
}

section ul li {
  padding: 14px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.925rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  line-height: 1.65;
}

section ul li:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}

section ul li a {
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

section ul li a::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gradient-primary);
  flex-shrink: 0;
}

/* ===== CONTACT SECTION ===== */
#contact ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

#contact ul li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  font-weight: 500;
}

#contact ul li::before {
  content: "";
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gradient-card);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== SITEMAP & LINKS ===== */
#sitemap ul,
#links ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

#sitemap ul li,
#links ul li {
  padding: 0;
  background: transparent;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#sitemap ul li:hover,
#links ul li:hover {
  transform: none;
  box-shadow: none;
}

#sitemap ul li a,
#links ul li a {
  display: block;
  padding: 14px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

#sitemap ul li a::before,
#links ul li a::before {
  display: none;
}

#sitemap ul li a:hover,
#links ul li a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
  color: var(--primary);
  background: var(--bg-glass-strong);
}

/* ===== FAQ ===== */
#faq h3 {
  padding: 20px 24px 0;
  margin-top: 16px;
  margin-bottom: 0;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 1rem;
  color: var(--text);
  transition: color var(--transition-fast), border-color var(--transition-fast);
  cursor: default;
}

#faq h3 + p {
  padding: 8px 24px 20px;
  margin-bottom: 0;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

#faq h3:hover,
#faq h3:hover + p {
  border-color: var(--border-strong);
}

#faq h3:hover {
  color: var(--primary);
}

#faq > h3 + p {
  margin-bottom: 4px;
}

/* ===== HOWTO ===== */
#howto h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 20px;
  margin-bottom: 12px;
  font-size: 0.95rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

#howto h4:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
}

#howto h4 + p {
  padding-left: 20px;
  border-left: 3px solid var(--primary-light);
  margin-left: 4px;
  font-size: 0.925rem;
}

/* ===== LEGAL ===== */
#legal h3 {
  font-size: 1.05rem;
  color: var(--primary);
  margin-top: 32px;
}

#legal p {
  font-size: 0.9rem;
}

/* ===== FOOTER ===== */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 48px 24px;
  text-align: center;
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
}

footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.7;
}

footer p:last-child {
  margin-bottom: 0;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ===== SCROLL ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

section {
  animation: fadeInUp 0.6s ease-out both;
}

section:nth-child(2) { animation-delay: 0.05s; }
section:nth-child(3) { animation-delay: 0.1s; }
section:nth-child(4) { animation-delay: 0.15s; }
section:nth-child(5) { animation-delay: 0.2s; }
section:nth-child(6) { animation-delay: 0.25s; }
section:nth-child(7) { animation-delay: 0.3s; }

article {
  animation: fadeInUp 0.5s ease-out both;
}

article:nth-child(1) { animation-delay: 0.05s; }
article:nth-child(2) { animation-delay: 0.1s; }
article:nth-child(3) { animation-delay: 0.15s; }
article:nth-child(4) { animation-delay: 0.2s; }
article:nth-child(5) { animation-delay: 0.25s; }
article:nth-child(6) { animation-delay: 0.3s; }
article:nth-child(7) { animation-delay: 0.35s; }
article:nth-child(8) { animation-delay: 0.4s; }
article:nth-child(9) { animation-delay: 0.45s; }
article:nth-child(10) { animation-delay: 0.5s; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 8px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ===== SELECTION ===== */
::selection {
  background: rgba(124, 58, 237, 0.2);
  color: var(--text);
}

/* ===== FOCUS ===== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  section {
    padding: 56px 20px;
  }

  #hero h1 {
    padding-top: 80px;
  }

  nav {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  nav {
    flex-direction: column;
    padding: 12px 16px;
    min-height: auto;
    gap: 8px;
  }

  nav ul {
    justify-content: center;
    gap: 2px;
  }

  nav ul li a {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  section {
    padding: 44px 16px;
  }

  #hero h1 {
    padding: 64px 16px 12px;
    font-size: 1.5rem;
  }

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

  #hero p:last-of-type {
    padding-bottom: 72px;
  }

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

  article {
    padding: 22px 20px;
  }

  article h3 {
    font-size: 1.05rem;
  }

  h2 {
    font-size: 1.35rem;
    margin-bottom: 24px;
  }

  h3 {
    font-size: 1.1rem;
    margin-top: 32px;
  }

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

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

  #faq h3 {
    padding: 16px 18px 0;
    font-size: 0.95rem;
  }

  #faq h3 + p {
    padding: 6px 18px 16px;
    font-size: 0.85rem;
  }

  section ul li {
    padding: 12px 16px;
    font-size: 0.875rem;
  }

  footer {
    padding: 36px 16px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  nav ul {
    gap: 0;
  }

  nav ul li a {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  section {
    padding: 36px 14px;
  }

  #hero h1 {
    padding: 52px 14px 10px;
    font-size: 1.3rem;
  }

  #hero p {
    padding: 0 14px;
    font-size: 0.85rem;
  }

  #hero p:last-of-type {
    padding-bottom: 56px;
  }

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

  article {
    padding: 18px 16px;
    border-radius: var(--radius-sm);
  }

  h2 {
    font-size: 1.2rem;
  }

  h2::after {
    width: 48px;
    height: 3px;
  }

  h3 {
    font-size: 1rem;
    margin-top: 28px;
  }

  h4 {
    font-size: 0.95rem;
  }

  p {
    font-size: 0.875rem;
  }

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

  #sitemap ul li a,
  #links ul li a {
    padding: 12px 16px;
    font-size: 0.85rem;
  }

  #contact ul li {
    padding: 16px 18px;
    font-size: 0.875rem;
  }

  #faq h3 {
    padding: 14px 16px 0;
    font-size: 0.9rem;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }

  #faq h3 + p {
    padding: 4px 16px 14px;
    font-size: 0.825rem;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  }

  #howto h4 {
    padding: 12px 16px;
    font-size: 0.875rem;
  }

  section ul li {
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  footer {
    padding: 28px 14px;
  }

  footer p {
    font-size: 0.8rem;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== PRINT ===== */
@media print {
  header,
  footer,
  #hero::after,
  body::before {
    display: none;
  }

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

  section {
    padding: 20px 0;
    page-break-inside: avoid;
  }

  article {
    border: 1px solid #ddd;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}