:root {
  --bg: #0f1020;
  --bg-soft: #171834;
  --bg-elev: #1e2044;
  --card: rgba(30, 32, 68, 0.62);
  --card-solid: #1e2044;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9eaf6;
  --text-soft: #b6b9d6;
  --text-mute: #8e92b8;
  --primary: #7c6cff;
  --primary-2: #4ad9d9;
  --accent: #ff7eb3;
  --accent-2: #ffb86b;
  --grad-banner: linear-gradient(135deg, #2b1a5e 0%, #3a2a8a 38%, #1f6f8b 72%, #14495c 100%);
  --grad-btn: linear-gradient(135deg, #7c6cff 0%, #4ad9d9 100%);
  --grad-text: linear-gradient(90deg, #a99bff 0%, #6ee7e7 55%, #ff9ec4 100%);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.38);
  --shadow-glow: 0 0 0 1px rgba(124, 108, 255, 0.28), 0 18px 50px rgba(74, 217, 217, 0.12);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.78;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 12% -8%, rgba(124, 108, 255, 0.22), transparent 62%),
    radial-gradient(900px 560px at 92% 4%, rgba(74, 217, 217, 0.16), transparent 58%),
    radial-gradient(760px 520px at 50% 108%, rgba(255, 126, 179, 0.12), transparent 62%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

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

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

ul,
ol,
dl {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
}

li {
  margin: 0.34em 0;
}

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

h1,
h2,
h3,
h4 {
  margin: 0 0 0.6em;
  line-height: 1.32;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(1.55rem, 3.6vw, 2.55rem);
  letter-spacing: 0.02em;
}

h2 {
  font-size: clamp(1.28rem, 2.5vw, 1.85rem);
  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(--grad-btn);
  box-shadow: 0 0 16px rgba(124, 108, 255, 0.55);
}

h3 {
  font-size: clamp(1.05rem, 1.7vw, 1.22rem);
  color: #f3f4ff;
}

h4 {
  font-size: 1rem;
}

strong,
b {
  color: #f6f7ff;
}

::selection {
  background: rgba(124, 108, 255, 0.45);
  color: #fff;
}

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

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(124, 108, 255, 0.7), rgba(74, 217, 217, 0.6));
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(124, 108, 255, 0.95), rgba(74, 217, 217, 0.85));
  background-clip: padding-box;
}

header {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(38px, 7vw, 84px) clamp(18px, 4vw, 40px) clamp(34px, 5vw, 64px);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background-image: var(--grad-banner);
  background-color: #241a52;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-md);
}

header::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 140%;
  background:
    radial-gradient(46% 58% at 18% 22%, rgba(255, 126, 179, 0.34), transparent 68%),
    radial-gradient(40% 54% at 82% 12%, rgba(74, 217, 217, 0.32), transparent 66%),
    radial-gradient(52% 62% at 62% 92%, rgba(124, 108, 255, 0.4), transparent 70%);
  filter: blur(6px);
  z-index: -2;
  animation: auroraShift 18s ease-in-out infinite alternate;
}

header::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
}

header h1 {
  max-width: 22em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 30px rgba(124, 108, 255, 0.18);
  animation: fadeUp 0.9s var(--ease) both;
}

header p {
  max-width: 62ch;
  margin: 0;
  font-size: clamp(0.95rem, 1.5vw, 1.06rem);
  color: rgba(233, 234, 246, 0.82);
  animation: fadeUp 0.9s var(--ease) 0.12s both;
}

main {
  display: block;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 44px) clamp(16px, 4vw, 40px) clamp(40px, 6vw, 72px);
}

main > section {
  position: relative;
  margin: 0 0 clamp(18px, 2.6vw, 30px);
  padding: clamp(20px, 3.2vw, 36px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-sm);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s var(--ease), background 0.45s var(--ease);
  animation: fadeUp 0.75s var(--ease) both;
  animation-timeline: view();
  animation-range: entry 0% cover 26%;
}

@supports not (animation-timeline: view()) {
  main > section {
    animation: fadeUp 0.7s var(--ease) both;
  }
}

main > section:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(124, 108, 255, 0.16);
}

main > section::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(124, 108, 255, 0.4), rgba(74, 217, 217, 0.12) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
}

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

main > section > h2:first-child {
  margin-top: 0;
}

main > section article {
  position: relative;
  padding: clamp(16px, 2.4vw, 22px) clamp(16px, 2.4vw, 24px);
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.4s var(--ease);
}

main > section article:last-child {
  margin-bottom: 0;
}

main > section article:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 108, 255, 0.38);
  background: linear-gradient(160deg, rgba(124, 108, 255, 0.12), rgba(74, 217, 217, 0.05));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.32);
}

main > section article h3 {
  margin-bottom: 0.45em;
}

main > section article h3 + p {
  font-size: 0.86rem;
  color: var(--text-mute);
  letter-spacing: 0.02em;
}

main > section article p:last-child {
  margin-bottom: 0;
}

main > section > h3 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-left: 0;
  color: #f1f2ff;
}

main > section > h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-2);
  box-shadow: 0 0 12px rgba(74, 217, 217, 0.9);
  flex: 0 0 auto;
}

main > section > h3 + p {
  padding-left: 18px;
  border-left: 2px solid rgba(124, 108, 255, 0.32);
  margin-left: 3px;
}

blockquote {
  position: relative;
  margin: 0 0 16px;
  padding: clamp(18px, 2.6vw, 24px) clamp(18px, 2.8vw, 28px) clamp(18px, 2.6vw, 24px) clamp(46px, 5vw, 58px);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-image: linear-gradient(180deg, var(--primary), var(--primary-2)) 1;
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(124, 108, 255, 0.1), rgba(74, 217, 217, 0.04));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.4s var(--ease);
}

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

blockquote::before {
  content: "\201C";
  position: absolute;
  left: 14px;
  top: 2px;
  font-size: 3rem;
  line-height: 1;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  opacity: 0.85;
}

blockquote:hover {
  transform: translateX(4px);
  background: linear-gradient(150deg, rgba(124, 108, 255, 0.18), rgba(74, 217, 217, 0.07));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

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

dl {
  padding: 0;
  margin: 0;
}

dt {
  position: relative;
  margin: 18px 0 8px;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(124, 108, 255, 0.16), rgba(74, 217, 217, 0.05));
  color: #f4f5ff;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: default;
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease), transform 0.35s var(--ease);
}

dt::before {
  content: "Q";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #10122a;
  background: var(--grad-btn);
  box-shadow: 0 0 12px rgba(124, 108, 255, 0.5);
}

dt:hover {
  border-color: rgba(124, 108, 255, 0.42);
  background: linear-gradient(135deg, rgba(124, 108, 255, 0.26), rgba(74, 217, 217, 0.09));
  transform: translateX(3px);
}

dd {
  margin: 0 0 6px;
  padding: 2px 4px 2px 42px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

dt + dd {
  margin-bottom: 12px;
}

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

ol > li {
  position: relative;
  counter-increment: step;
  margin: 0 0 12px;
  padding: 14px 18px 14px 58px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
  transition: transform 0.38s var(--ease), border-color 0.38s var(--ease), background 0.38s var(--ease);
}

ol > li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 800;
  color: #0d0f22;
  background: var(--grad-btn);
  box-shadow: 0 6px 18px rgba(74, 217, 217, 0.3);
}

ol > li:hover {
  transform: translateX(4px);
  border-color: rgba(74, 217, 217, 0.4);
  background: linear-gradient(150deg, rgba(74, 217, 217, 0.12), rgba(124, 108, 255, 0.05));
}

ul {
  list-style: none;
  padding-left: 0;
}

ul > li {
  position: relative;
  padding-left: 22px;
  margin: 0.5em 0;
}

ul > li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: var(--grad-btn);
  box-shadow: 0 0 10px rgba(124, 108, 255, 0.5);
  transition: transform 0.35s var(--ease);
}

ul > li:hover::before {
  transform: rotate(135deg) scale(1.15);
}

ul > li > a {
  display: inline-block;
  padding: 2px 0;
  color: var(--text-soft);
  position: relative;
}

ul > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: var(--grad-btn);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

ul > li > a:hover {
  color: #fff;
}

ul > li > a:hover::after {
  transform: scaleX(1);
}

section:last-of-type,
main > section:nth-last-child(-n + 4) {
  background: var(--card);
}

a[href^="#article"] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #0e1024;
  background: var(--grad-btn);
  box-shadow: 0 8px 22px rgba(124, 108, 255, 0.28);
  transition: transform 0.32s var(--ease), box-shadow 0.32s var(--ease), filter 0.32s var(--ease);
}

a[href^="#article"]::after {
  content: "→";
  font-size: 0.9em;
  transition: transform 0.32s var(--ease);
}

a[href^="#article"]:hover {
  color: #0e1024;
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 12px 30px rgba(74, 217, 217, 0.34);
}

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

footer {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(26px, 4vw, 44px) clamp(18px, 4vw, 40px) clamp(34px, 5vw, 56px);
  text-align: center;
  border-top: 1px solid var(--border);
}

footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, 70%);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--primary-2), transparent);
  box-shadow: 0 0 18px rgba(124, 108, 255, 0.6);
}

footer p {
  margin: 0.35em 0;
  font-size: 0.86rem;
  color: var(--text-mute);
}

footer p:first-child {
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

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

@keyframes auroraShift {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }
  50% {
    transform: translate3d(2%, 1.5%, 0) scale(1.06);
  }
  100% {
    transform: translate3d(-1%, 2%, 0) scale(1.03);
  }
}

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

@media (max-width: 900px) {
  main > section {
    border-radius: var(--radius);
  }
  header {
    border-radius: 0 0 var(--radius) var(--radius);
  }
  blockquote {
    border-image: none;
    border-left: 3px solid var(--primary);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
    line-height: 1.75;
    background-attachment: scroll;
  }
  header {
    padding-top: 42px;
    padding-bottom: 38px;
  }
  header h1 {
    max-width: none;
  }
  main {
    padding-left: 14px;
    padding-right: 14px;
  }
  main > section {
    padding: 18px 15px;
    margin-bottom: 16px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  h2 {
    padding-left: 15px;
  }
  h2::before {
    width: 4px;
  }
  main > section article {
    padding: 15px 14px;
  }
  blockquote {
    padding: 16px 16px 16px 42px;
  }
  blockquote::before {
    left: 10px;
    font-size: 2.4rem;
  }
  dt {
    padding: 11px 13px 11px 38px;
    font-size: 0.94rem;
  }
  dt::before {
    left: 12px;
    width: 18px;
    height: 18px;
    font-size: 0.68rem;
  }
  dd {
    padding-left: 38px;
    font-size: 0.92rem;
  }
  ol > li {
    padding: 13px 14px 13px 52px;
  }
  ol > li::before {
    left: 13px;
    width: 25px;
    height: 25px;
    font-size: 0.76rem;
  }
  a[href^="#article"] {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
  }
  ul > li > a {
    padding: 4px 0;
  }
}

@media (hover: none) {
  main > section article:hover,
  blockquote:hover,
  dt:hover,
  ol > li:hover {
    transform: none;
  }
  a[href^="#article"]:hover {
    transform: none;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
  }
  header,
  main > section,
  blockquote,
  main > section article {
    background: #fff;
    box-shadow: none;
    border-color: #ccc;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  h1,
  h2,
  h3,
  p,
  dd,
  li {
    color: #111;
  }
  header h1 {
    -webkit-text-fill-color: #111;
    color: #111;
  }
}