:root {
  --bg: #0d0d18;
  --bg-soft: #14142a;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --text: #eef0ff;
  --text-soft: #b9bcd8;
  --text-dim: #8b8fb0;
  --primary: #7c5cff;
  --primary-2: #ff5ca8;
  --accent: #33e0c4;
  --accent-2: #ffb347;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 20px;
  --radius-sm: 12px;
  --max: 1180px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 92, 255, 0.35), transparent 60%),
    radial-gradient(1000px 500px at 95% 0%, rgba(255, 92, 168, 0.28), transparent 60%),
    radial-gradient(900px 600px at 50% 110%, rgba(51, 224, 196, 0.18), transparent 65%),
    linear-gradient(180deg, #0b0b16 0%, #0d0d18 40%, #101024 100%);
  background-attachment: fixed;
  line-height: 1.75;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 80%);
  z-index: 0;
}

header,
main,
footer {
  position: relative;
  z-index: 1;
}

/* ============ HEADER ============ */
header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 88px 24px 64px;
  text-align: center;
  animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

header h1 {
  margin: 0 0 24px;
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(100deg, #ffffff 0%, #c9b8ff 35%, #ff9ecd 65%, #7ff3e2 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shimmer 7s ease-in-out infinite;
  text-shadow: 0 0 60px rgba(124, 92, 255, 0.25);
}

header p {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 30px;
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  color: var(--text-soft);
  text-align: left;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

header p::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.7), rgba(255, 92, 168, 0.35), rgba(51, 224, 196, 0.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ============ MAIN LAYOUT ============ */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

section {
  padding: 34px 32px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.45s ease,
              border-color 0.45s ease,
              background 0.45s ease;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

section::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 92, 255, 0.8), rgba(255, 92, 168, 0.6), transparent);
  opacity: 0.7;
}

section:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 92, 255, 0.45);
  box-shadow: 0 22px 60px rgba(124, 92, 255, 0.22), 0 8px 24px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

/* ============ TYPOGRAPHY ============ */
h2 {
  margin: 0 0 20px;
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.4px;
  color: #ffffff;
  position: relative;
  padding-left: 18px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 1.15em;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2), var(--accent));
  box-shadow: 0 0 18px rgba(124, 92, 255, 0.7);
}

h3 {
  margin: 26px 0 12px;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 700;
  color: #f2f0ff;
  letter-spacing: 0.3px;
  transition: color 0.3s ease;
}

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

h4 {
  margin: 18px 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(51, 224, 196, 0.1);
  border: 1px solid rgba(51, 224, 196, 0.28);
  transition: background 0.3s ease, transform 0.3s ease;
}

h4:hover {
  background: rgba(51, 224, 196, 0.2);
  transform: translateY(-1px);
}

p {
  margin: 0 0 14px;
  color: var(--text-soft);
  font-size: 0.98rem;
}

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

/* ============ LINKS ============ */
a {
  color: var(--accent);
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
  word-break: break-word;
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1.5px;
  background: linear-gradient(90deg, var(--accent), var(--primary-2));
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

a:hover {
  color: #ffffff;
}

a:hover::after {
  width: 100%;
}

/* ============ ARTICLE CARDS ============ */
article {
  padding: 22px 24px;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.4s ease,
              border-color 0.4s ease,
              box-shadow 0.4s ease;
  position: relative;
  overflow: hidden;
}

article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  opacity: 0;
  transition: opacity 0.4s ease;
}

article:hover {
  transform: translateX(6px);
  background: rgba(124, 92, 255, 0.1);
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: 0 12px 30px rgba(124, 92, 255, 0.18);
}

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

article h3 {
  margin-top: 0;
  font-size: 1.05rem;
}

article p {
  font-size: 0.9rem;
  color: var(--text-dim);
}

article p a {
  display: inline-block;
  margin-top: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 5px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.25), rgba(255, 92, 168, 0.2));
  border: 1px solid rgba(124, 92, 255, 0.45);
  color: #e6dfff;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

article p a::after {
  display: none;
}

article p a:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.5);
  transform: translateY(-2px);
}

/* ============ LISTS / SITEMAP ============ */
ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

ul li {
  margin: 0;
}

ul li a {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

ul li a::after {
  display: none;
}

ul li a:hover {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.4), rgba(255, 92, 168, 0.3));
  border-color: rgba(124, 92, 255, 0.6);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(124, 92, 255, 0.3);
}

/* ============ FOOTER ============ */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 24px 70px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

footer p {
  margin: 6px 0;
  font-size: 0.86rem;
  color: var(--text-dim);
  letter-spacing: 0.3px;
  transition: color 0.3s ease;
}

footer p:hover {
  color: var(--text-soft);
}

footer p:last-child {
  margin-top: 14px;
  color: var(--text-soft);
  font-weight: 600;
}

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

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

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

/* ============ SCROLL REVEAL (CSS-only via view timeline fallback) ============ */
@supports (animation-timeline: view()) {
  section {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }

  @keyframes reveal {
    from {
      opacity: 0;
      transform: translateY(40px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  header {
    padding: 60px 20px 44px;
  }

  main {
    padding: 0 18px 60px;
    gap: 20px;
  }

  section {
    padding: 26px 22px;
    border-radius: 16px;
  }

  header p {
    padding: 22px 22px;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 15px;
    line-height: 1.7;
  }

  header {
    padding: 46px 16px 34px;
  }

  header h1 {
    margin-bottom: 18px;
    letter-spacing: 0.2px;
  }

  header p {
    padding: 20px 18px;
    border-radius: 14px;
  }

  main {
    padding: 0 14px 48px;
    gap: 16px;
  }

  section {
    padding: 22px 18px;
    border-radius: 14px;
  }

  section:hover {
    transform: none;
  }

  h2 {
    padding-left: 14px;
    margin-bottom: 16px;
  }

  h2::before {
    width: 4px;
  }

  article {
    padding: 18px 16px;
  }

  article:hover {
    transform: none;
  }

  ul {
    gap: 10px;
  }

  ul li a {
    padding: 8px 16px;
    font-size: 0.88rem;
  }

  footer {
    padding: 30px 16px 56px;
  }
}

@media (max-width: 380px) {
  header h1 {
    font-size: 1.55rem;
  }

  section {
    padding: 18px 14px;
  }
}

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

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5fb;
    --bg-soft: #ffffff;
    --card: rgba(255, 255, 255, 0.72);
    --card-border: rgba(20, 20, 60, 0.1);
    --text: #1a1a2e;
    --text-soft: #4a4d6b;
    --text-dim: #71748f;
    --shadow: 0 18px 50px rgba(60, 60, 120, 0.12);
  }

  body {
    background:
      radial-gradient(1200px 600px at 10% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
      radial-gradient(1000px 500px at 95% 0%, rgba(255, 92, 168, 0.15), transparent 60%),
      radial-gradient(900px 600px at 50% 110%, rgba(51, 224, 196, 0.12), transparent 65%),
      linear-gradient(180deg, #f7f7fd 0%, #f2f3fb 100%);
  }

  body::before {
    background-image:
      linear-gradient(rgba(20, 20, 60, 0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(20, 20, 60, 0.04) 1px, transparent 1px);
  }

  header h1 {
    background: linear-gradient(100deg, #3a2a8f 0%, #7c5cff 35%, #ff5ca8 65%, #1ba894 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
  }

  header p {
    color: var(--text-soft);
  }

  h2,
  h3 {
    color: #1a1a2e;
  }

  h2::before {
    box-shadow: 0 0 14px rgba(124, 92, 255, 0.4);
  }

  h4 {
    color: #0f9c86;
    background: rgba(51, 224, 196, 0.14);
    border-color: rgba(51, 224, 196, 0.4);
  }

  a {
    color: #6247e0;
  }

  a:hover {
    color: #1a1a2e;
  }

  article {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(20, 20, 60, 0.08);
  }

  article:hover {
    background: rgba(124, 92, 255, 0.08);
  }

  article p a {
    color: #4a37b8;
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.16), rgba(255, 92, 168, 0.12));
    border-color: rgba(124, 92, 255, 0.35);
  }

  article p a:hover {
    color: #ffffff;
  }

  ul li a {
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(20, 20, 60, 0.1);
  }

  ul li a:hover {
    color: #ffffff;
  }

  section::after {
    opacity: 0.35;
  }
}
