:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: rgba(30, 30, 50, 0.65);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-hover: rgba(255, 255, 255, 0.12);
  --border-glass: rgba(255, 255, 255, 0.1);
  --text-primary: #eaeaf0;
  --text-secondary: #a0a0b8;
  --text-muted: #6c6c84;
  --accent-1: #6c5ce7;
  --accent-2: #a29bfe;
  --accent-3: #fd79a8;
  --accent-4: #00cec9;
  --gradient-banner: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 30%, #2d1b69 60%, #6c5ce7 100%);
  --gradient-card: linear-gradient(145deg, rgba(108, 92, 231, 0.15), rgba(253, 121, 168, 0.08));
  --gradient-accent: linear-gradient(135deg, #6c5ce7, #a29bfe, #fd79a8);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 16px 48px rgba(108, 92, 231, 0.25);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --max-width: 1200px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f5f5fa;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.5);
    --bg-glass-hover: rgba(255, 255, 255, 0.8);
    --border-glass: rgba(108, 92, 231, 0.15);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #8888a0;
    --gradient-banner: linear-gradient(135deg, #f5f5fa 0%, #e8e4f8 30%, #d4c8f0 60%, #a29bfe 100%);
    --gradient-card: linear-gradient(145deg, rgba(108, 92, 231, 0.08), rgba(253, 121, 168, 0.05));
    --shadow-card: 0 8px 32px rgba(108, 92, 231, 0.1);
    --shadow-hover: 0 16px 48px rgba(108, 92, 231, 0.2);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(108, 92, 231, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(253, 121, 168, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 206, 201, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

::selection {
  background-color: rgba(108, 92, 231, 0.4);
  color: #ffffff;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--accent-1);
  border-radius: 4px;
}

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

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

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

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

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

ul,
ol {
  list-style: none;
}

/* ===== HEADER ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15, 15, 26, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-glass);
  transition: background var(--transition-smooth), box-shadow var(--transition-smooth);
}

@media (prefers-color-scheme: light) {
  header {
    background: rgba(245, 245, 250, 0.8);
  }
}

header:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

header nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 12px 0;
}

header nav ul::-webkit-scrollbar {
  display: none;
}

header nav ul li {
  flex-shrink: 0;
}

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

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

header nav ul li a:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

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

/* ===== MAIN ===== */
main {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ===== H1 BANNER ===== */
main > h1 {
  margin-top: 80px;
  padding: 80px 40px;
  background: var(--gradient-banner);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  position: relative;
  overflow: hidden;
  animation: bannerFadeIn 0.8s ease-out both;
  background-size: 200% 200%;
  animation: bannerFadeIn 0.8s ease-out both, gradientShift 8s ease infinite;
}

main > h1::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(162, 155, 254, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(253, 121, 168, 0.1) 0%, transparent 50%);
  animation: rotateGlow 12s linear infinite;
  pointer-events: none;
}

main > h1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
}

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

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes rotateGlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===== SECTIONS ===== */
section {
  margin-top: 64px;
  padding: 40px;
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-smooth), transform var(--transition-smooth), border-color var(--transition-smooth);
  position: relative;
  overflow: hidden;
  animation: sectionReveal 0.6s ease-out both;
}

section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

section:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(108, 92, 231, 0.25);
  transform: translateY(-2px);
}

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

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

section:nth-child(1) { animation-delay: 0.05s; }
section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.15s; }
section:nth-child(4) { animation-delay: 0.2s; }
section:nth-child(5) { animation-delay: 0.25s; }
section:nth-child(6) { animation-delay: 0.3s; }
section:nth-child(7) { animation-delay: 0.35s; }
section:nth-child(8) { animation-delay: 0.4s; }
section:nth-child(9) { animation-delay: 0.45s; }
section:nth-child(10) { animation-delay: 0.5s; }
section:nth-child(11) { animation-delay: 0.55s; }
section:nth-child(12) { animation-delay: 0.6s; }
section:nth-child(13) { animation-delay: 0.65s; }
section:nth-child(14) { animation-delay: 0.7s; }
section:nth-child(15) { animation-delay: 0.75s; }
section:nth-child(16) { animation-delay: 0.8s; }
section:nth-child(17) { animation-delay: 0.85s; }

/* ===== HEADINGS ===== */
section > h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  position: relative;
  padding-left: 20px;
}

section > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background: var(--gradient-accent);
  border-radius: 2px;
}

section > h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
  margin-top: 12px;
  opacity: 0.5;
}

h3 {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 12px;
  color: var(--accent-2);
  letter-spacing: -0.01em;
  transition: color var(--transition-fast);
}

h3:hover {
  color: var(--accent-3);
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

/* ===== PARAGRAPHS ===== */
p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  line-height: 1.9;
  font-size: 15px;
}

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

/* ===== ARTICLES ===== */
article {
  padding: 24px;
  margin-bottom: 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

article:hover {
  background: var(--bg-glass-hover);
  transform: translateX(6px);
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.15);
}

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

article h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

article p {
  font-size: 14px;
}

article p:first-of-type {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

article a {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-2);
  background: rgba(108, 92, 231, 0.12);
  border: 1px solid rgba(108, 92, 231, 0.25);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

article a:hover {
  background: var(--accent-1);
  color: #ffffff;
  border-color: var(--accent-1);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.4);
}

/* ===== BLOCKQUOTE ===== */
blockquote {
  padding: 20px 24px;
  margin-bottom: 16px;
  background: var(--bg-glass);
  border-left: 4px solid var(--accent-2);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  position: relative;
  transition: all var(--transition-smooth);
}

blockquote::before {
  content: "\201C";
  position: absolute;
  top: -8px;
  left: 12px;
  font-size: 48px;
  line-height: 1;
  color: var(--accent-2);
  opacity: 0.3;
  font-family: Georgia, serif;
}

blockquote:hover {
  background: var(--bg-glass-hover);
  border-left-color: var(--accent-3);
  transform: translateX(4px);
}

blockquote p {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 0;
}

/* ===== FAQ DL ===== */
dl {
  margin-top: 16px;
}

dt {
  font-weight: 600;
  color: var(--text-primary);
  padding: 16px 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  font-size: 15px;
}

dt::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 400;
  color: var(--accent-2);
  transition: transform var(--transition-fast);
}

dt:hover {
  background: var(--bg-glass-hover);
  color: var(--accent-2);
}

dt:hover::after {
  transform: translateY(-50%) rotate(90deg);
}

dd {
  padding: 16px 20px;
  margin-bottom: 12px;
  background: rgba(108, 92, 231, 0.05);
  border: 1px solid var(--border-glass);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
  transition: background var(--transition-fast);
}

dd:hover {
  background: rgba(108, 92, 231, 0.1);
}

/* ===== ORDERED LIST ===== */
ol {
  counter-reset: step-counter;
  padding-left: 0;
}

ol li {
  counter-increment: step-counter;
  position: relative;
  padding: 12px 16px 12px 56px;
  margin-bottom: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 15px;
  transition: all var(--transition-fast);
}

ol li::before {
  content: counter(step-counter);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.4);
}

ol li:hover {
  background: var(--bg-glass-hover);
  transform: translateX(4px);
  border-color: rgba(108, 92, 231, 0.3);
}

/* ===== SITEMAP & LINKS UL ===== */
section#sitemap ul,
section#links ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

section#sitemap ul li a,
section#links ul li a {
  display: block;
  padding: 10px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  transition: all var(--transition-fast);
}

section#sitemap ul li a:hover,
section#links ul li a:hover {
  background: var(--gradient-card);
  border-color: var(--accent-2);
  color: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.2);
}

/* ===== CONTACT ===== */
section#contact p {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 15px;
}

section#contact p:last-child {
  border-bottom: none;
}

section#contact p strong {
  color: var(--accent-2);
}

/* ===== LEGAL ===== */
section#legal h2 {
  margin-top: 32px;
}

section#legal h2:first-child {
  margin-top: 0;
}

/* ===== FOOTER ===== */
footer {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 48px;
  text-align: center;
  border-top: 1px solid var(--border-glass);
}

footer p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

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

/* ===== SCROLL REVEAL ===== */
@supports (animation-timeline: view()) {
  section {
    animation: none;
    opacity: 1;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  main {
    padding: 0 20px 60px;
  }

  section {
    padding: 32px 28px;
    margin-top: 48px;
  }

  main > h1 {
    padding: 64px 28px;
  }
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: 64px;
  }

  body {
    font-size: 15px;
    line-height: 1.75;
  }

  header nav {
    padding: 0 16px;
  }

  header nav ul {
    padding: 10px 0;
    gap: 2px;
  }

  header nav ul li a {
    padding: 6px 12px;
    font-size: 13px;
  }

  main {
    padding: 0 16px 48px;
  }

  main > h1 {
    margin-top: 64px;
    padding: 48px 20px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    font-size: 1.3rem;
  }

  section {
    padding: 24px 20px;
    margin-top: 36px;
    border-radius: var(--radius-md);
  }

  section > h2 {
    font-size: 1.2rem;
    margin-bottom: 18px;
    padding-left: 16px;
  }

  h3 {
    font-size: 1.05rem;
    margin-top: 22px;
  }

  p {
    font-size: 14px;
    line-height: 1.8;
  }

  article {
    padding: 18px 16px;
  }

  article:hover {
    transform: translateX(3px);
  }

  blockquote {
    padding: 16px 18px;
  }

  dt {
    padding: 12px 16px;
    font-size: 14px;
  }

  dt::after {
    right: 16px;
  }

  dd {
    padding: 12px 16px;
    font-size: 13px;
  }

  ol li {
    padding: 10px 12px 10px 48px;
    font-size: 14px;
  }

  ol li::before {
    left: 12px;
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  section#sitemap ul,
  section#links ul {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 6px;
  }

  section#sitemap ul li a,
  section#links ul li a {
    padding: 8px 12px;
    font-size: 13px;
  }

  footer {
    padding: 24px 16px 36px;
  }
}

@media (max-width: 480px) {
  main > h1 {
    padding: 36px 16px;
    font-size: 1.15rem;
    line-height: 1.5;
  }

  section {
    padding: 20px 16px;
    margin-top: 28px;
  }

  section > h2 {
    font-size: 1.1rem;
  }

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

  blockquote::before {
    font-size: 36px;
    top: -4px;
  }
}

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

  body {
    background: #ffffff;
    color: #000000;
  }

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

  main > h1 {
    background: none;
    color: #000000;
    padding: 20px 0;
  }
}

/* ===== 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;
  }
}

/* ===== HIGH CONTRAST ===== */
@media (prefers-contrast: high) {
  :root {
    --border-glass: rgba(255, 255, 255, 0.3);
    --text-secondary: #c0c0d0;
  }

  section {
    border-width: 2px;
  }

  a {
    text-decoration: underline;
  }
}