:root {
  --primary: #5b21b6;
  --primary-light: #7c3aed;
  --primary-dark: #4c1d95;
  --accent: #06b6d4;
  --accent-light: #22d3ee;
  --accent-dark: #0891b2;
  --gradient-1: linear-gradient(135deg, #5b21b6 0%, #7c3aed 40%, #06b6d4 100%);
  --gradient-2: linear-gradient(120deg, #4c1d95 0%, #6d28d9 50%, #0891b2 100%);
  --gradient-3: linear-gradient(45deg, #7c3aed, #06b6d4, #22d3ee);
  --bg: #f8f7fc;
  --bg-alt: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-glass: rgba(255, 255, 255, 0.55);
  --text: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #7a7a9a;
  --border: rgba(91, 33, 182, 0.12);
  --border-glass: rgba(255, 255, 255, 0.35);
  --shadow-sm: 0 2px 8px rgba(91, 33, 182, 0.08);
  --shadow-md: 0 8px 24px rgba(91, 33, 182, 0.12);
  --shadow-lg: 0 16px 48px rgba(91, 33, 182, 0.16);
  --shadow-glow: 0 0 32px rgba(124, 58, 237, 0.25);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0a1a;
    --bg-alt: #1a1228;
    --bg-card: rgba(30, 20, 50, 0.75);
    --bg-glass: rgba(30, 20, 50, 0.55);
    --text: #e8e4f0;
    --text-secondary: #b0a8c8;
    --text-muted: #7a7290;
    --border: rgba(124, 58, 237, 0.2);
    --border-glass: rgba(124, 58, 237, 0.25);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 32px rgba(124, 58, 237, 0.35);
  }
}

*,
*::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;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
  -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 80% 60% at 10% 0%, rgba(91, 33, 182, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 20%, rgba(6, 182, 212, 0.06), transparent 60%),
    radial-gradient(ellipse 70% 60% at 50% 100%, rgba(124, 58, 237, 0.06), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

@media (prefers-color-scheme: dark) {
  body::before {
    background:
      radial-gradient(ellipse 80% 60% at 10% 0%, rgba(124, 58, 237, 0.12), transparent 60%),
      radial-gradient(ellipse 60% 50% at 90% 20%, rgba(6, 182, 212, 0.08), transparent 60%),
      radial-gradient(ellipse 70% 60% at 50% 100%, rgba(91, 33, 182, 0.1), transparent 60%);
  }
}

/* ===== Header & Navigation ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), box-shadow var(--transition);
}

@media (prefers-color-scheme: dark) {
  header {
    background: rgba(15, 10, 26, 0.78);
  }
}

header nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

header nav > a:first-child {
  font-size: 1.35rem;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
  position: relative;
  transition: opacity var(--transition);
}

header nav > a:first-child::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-1);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

header nav > a:first-child:hover::after {
  transform: scaleX(1);
}

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

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

header nav ul li a:hover {
  color: var(--primary-light);
  background: rgba(91, 33, 182, 0.08);
  transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
  header nav ul li a:hover {
    background: rgba(124, 58, 237, 0.15);
  }
}

/* ===== Main Layout ===== */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

main > article > h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.03em;
  margin: 48px 0 16px;
  background: var(--gradient-2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  padding-bottom: 20px;
  animation: fadeInUp 0.8s ease both;
}

main > article > h1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 4px;
  background: var(--gradient-3);
  border-radius: 2px;
  animation: expandWidth 0.8s 0.3s ease both;
}

/* ===== Sections ===== */
section {
  margin: 40px 0;
  padding: 36px 32px;
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease both;
}

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

section:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(124, 58, 237, 0.2);
}

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

section:nth-child(odd) {
  animation-delay: 0.05s;
}

section:nth-child(even) {
  animation-delay: 0.1s;
}

/* ===== Headings ===== */
h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  line-height: 1.35;
  position: relative;
  padding-left: 18px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 5px;
  background: var(--gradient-1);
  border-radius: 3px;
}

h3 {
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  font-weight: 600;
  color: var(--primary-light);
  margin: 28px 0 12px;
  letter-spacing: -0.01em;
  line-height: 1.4;
  transition: color var(--transition);
}

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

/* ===== Paragraphs & Text ===== */
p {
  margin-bottom: 14px;
  color: var(--text-secondary);
  font-size: 0.975rem;
  line-height: 1.85;
}

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

strong {
  color: var(--text);
  font-weight: 600;
}

/* ===== Links ===== */
a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
  position: relative;
}

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

section a:not([href^="#"]) {
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}

section a:not([href^="#"]):hover {
  border-bottom-color: var(--accent);
}

/* ===== Lists ===== */
ul, ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

li {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
  transition: color var(--transition), transform var(--transition);
}

li:hover {
  color: var(--text);
}

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

ol li::marker {
  color: var(--primary-light);
  font-weight: 600;
}

/* ===== Blockquote ===== */
blockquote {
  margin: 24px 0;
  padding: 20px 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 4px solid var(--primary-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}

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

blockquote p {
  font-style: italic;
  color: var(--text);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

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

blockquote p::before {
  content: "\201C";
  font-size: 2rem;
  color: var(--primary-light);
  opacity: 0.4;
  margin-right: 4px;
  line-height: 0;
  vertical-align: -0.3em;
}

/* ===== Article Cards (News & Articles) ===== */
section article {
  padding: 24px;
  margin: 16px 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

section article::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: var(--gradient-1);
  opacity: 0.04;
  border-radius: 0 0 0 120px;
  transition: opacity var(--transition), transform var(--transition);
}

section article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(124, 58, 237, 0.25);
}

section article:hover::after {
  opacity: 0.08;
  transform: scale(1.1);
}

section article h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

section article h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

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

section article > p:first-of-type {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

section article > p:first-of-type::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

section article a[href^="/"] {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-light);
  margin-top: 8px;
  transition: gap var(--transition), color var(--transition);
}

section article a[href^="/"]:hover {
  gap: 8px;
  color: var(--accent);
}

section article a[href^="/"]::after {
  content: "\2192";
  transition: transform var(--transition);
}

section article a[href^="/"]:hover::after {
  transform: translateX(2px);
}

/* ===== FAQ ===== */
#faq h3 {
  padding: 16px 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  margin-bottom: 0;
  margin-top: 24px;
  cursor: default;
  transition: background var(--transition), color var(--transition);
  position: relative;
}

#faq h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: var(--border);
}

#faq h3:hover {
  background: rgba(91, 33, 182, 0.06);
  color: var(--primary-light);
}

@media (prefers-color-scheme: dark) {
  #faq h3:hover {
    background: rgba(124, 58, 237, 0.1);
  }
}

#faq h3 + p {
  padding: 16px 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  margin-bottom: 0;
  margin-top: 0;
  font-size: 0.93rem;
  transition: background var(--transition);
}

#faq h3 + p:hover {
  background: var(--bg-glass);
}

/* ===== Contact Section ===== */
#contact p {
  line-height: 2;
}

#contact h3 {
  margin-top: 24px;
}

/* ===== Footer ===== */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  transition: background var(--transition), border-color var(--transition);
  position: relative;
}

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

footer p {
  max-width: 1280px;
  margin: 0 auto 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

footer p:first-child {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  margin: 0 4px;
}

footer a:hover {
  color: var(--primary-light);
}

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

#sitemap ul li,
#links ul li {
  margin-bottom: 0;
}

#sitemap ul li a,
#links ul li a {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}

#sitemap ul li a:hover,
#links ul li a:hover {
  background: var(--gradient-1);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* ===== Breadcrumb ===== */
#breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding-left: 0;
  font-size: 0.88rem;
}

#breadcrumb ol li {
  display: flex;
  align-items: center;
  margin-bottom: 0;
}

#breadcrumb ol li + li::before {
  content: "/";
  margin: 0 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

#breadcrumb ol li a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

#breadcrumb ol li a:hover {
  color: var(--primary-light);
}

#breadcrumb ol li:last-child a {
  color: var(--primary-light);
  font-weight: 600;
  pointer-events: none;
}

/* ===== Updates ===== */
#updates ul {
  list-style: none;
  padding-left: 0;
}

#updates ul li {
  position: relative;
  padding-left: 24px;
  padding-bottom: 12px;
  border-left: 2px solid var(--border);
  margin-left: 8px;
  transition: border-color var(--transition);
}

#updates ul li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

#updates ul li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  background: var(--gradient-1);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  transition: transform var(--transition), box-shadow var(--transition);
}

#updates ul li:hover::before {
  transform: scale(1.3);
  box-shadow: var(--shadow-glow);
}

#updates ul li:hover {
  border-left-color: var(--primary-light);
}

/* ===== Legal & About ===== */
#legal h3,
#about h3 {
  margin-top: 24px;
}

#legal p,
#about p {
  font-size: 0.93rem;
}

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

@keyframes expandWidth {
  from {
    width: 0;
  }
  to {
    width: 80px;
  }
}

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

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.3);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(124, 58, 237, 0);
  }
}

/* ===== Scroll-driven entrance for sections ===== */
@supports (animation-timeline: view()) {
  section {
    animation: fadeInUp 0.6s ease both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
}

/* ===== Responsive: Tablet ===== */
@media (max-width: 900px) {
  header nav {
    height: auto;
    padding: 12px 20px;
    flex-direction: column;
    gap: 10px;
  }

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

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

  main {
    padding: 0 20px 48px;
  }

  main > article > h1 {
    margin-top: 32px;
  }

  section {
    padding: 28px 24px;
    margin: 28px 0;
    border-radius: var(--radius-md);
  }

  blockquote {
    padding: 16px 20px;
  }

  section article {
    padding: 20px;
  }
}

/* ===== Responsive: Mobile ===== */
@media (max-width: 600px) {
  html {
    font-size: 15px;
  }

  header nav {
    padding: 10px 16px;
  }

  header nav > a:first-child {
    font-size: 1.15rem;
  }

  header nav ul {
    gap: 0;
  }

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

  main {
    padding: 0 14px 40px;
  }

  main > article > h1 {
    font-size: 1.5rem;
    margin: 24px 0 12px;
    padding-bottom: 16px;
  }

  main > article > h1::after {
    width: 60px;
    height: 3px;
  }

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

  h2 {
    font-size: 1.25rem;
    padding-left: 14px;
    margin-bottom: 16px;
  }

  h2::before {
    width: 4px;
  }

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

  p {
    font-size: 0.92rem;
    line-height: 1.8;
  }

  blockquote {
    padding: 14px 16px;
    margin: 18px 0;
  }

  blockquote p {
    font-size: 0.88rem;
  }

  section article {
    padding: 16px;
    margin: 12px 0;
  }

  section article h3 {
    font-size: 1rem;
  }

  #faq h3 {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  #faq h3 + p {
    padding: 12px 14px;
    font-size: 0.88rem;
  }

  #sitemap ul,
  #links ul {
    gap: 6px 10px;
  }

  #sitemap ul li a,
  #links ul li a {
    padding: 5px 10px;
    font-size: 0.78rem;
  }

  #breadcrumb ol {
    font-size: 0.8rem;
  }

  #breadcrumb ol li + li::before {
    margin: 0 5px;
  }

  footer {
    padding: 28px 16px;
  }

  footer p {
    font-size: 0.78rem;
  }

  ul, ol {
    padding-left: 18px;
  }

  li {
    font-size: 0.9rem;
  }
}

/* ===== 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,
  #sitemap,
  #links,
  #breadcrumb,
  #updates {
    display: none;
  }

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

  section {
    box-shadow: none;
    border: 1px solid #ddd;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #fff;
    page-break-inside: avoid;
  }

  main > article > h1 {
    -webkit-text-fill-color: #000;
    background: none;
    color: #000;
  }
}

/* ===== Focus Visible ===== */
:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-light), var(--accent));
  border-radius: 5px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary), var(--accent-dark));
}