:root {
  --bg: #0f0f1a;
  --bg-2: #16162a;
  --bg-3: #1e1e35;
  --card: rgba(30, 30, 55, 0.65);
  --card-border: rgba(120, 120, 200, 0.18);
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text: #e8e8f0;
  --text-2: #a8a8c0;
  --text-3: #707090;
  --accent: #7c5cfc;
  --accent-2: #00d4ff;
  --accent-3: #ff6b9d;
  --gradient: linear-gradient(135deg, #7c5cfc 0%, #00d4ff 50%, #ff6b9d 100%);
  --gradient-2: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 16px 48px rgba(124, 92, 252, 0.2);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f0f2f8;
    --bg-2: #ffffff;
    --bg-3: #e8eaf2;
    --card: rgba(255, 255, 255, 0.72);
    --card-border: rgba(124, 92, 252, 0.12);
    --glass: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(124, 92, 252, 0.15);
    --text: #1a1a2e;
    --text-2: #4a4a6a;
    --text-3: #8888a8;
    --shadow: 0 8px 32px rgba(124, 92, 252, 0.1);
    --shadow-hover: 0 16px 48px rgba(124, 92, 252, 0.18);
    --gradient-2: linear-gradient(135deg, #e8eaf8 0%, #dce4f8 50%, #d0dcf8 100%);
  }
}

*,
*::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 0.4s ease, color 0.4s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(124, 92, 252, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 20%, rgba(0, 212, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(255, 107, 157, 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

::selection {
  background: rgba(124, 92, 252, 0.35);
  color: #fff;
}

a {
  color: var(--accent-2);
  text-decoration: none;
  transition: color var(--transition);
  position: relative;
}

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

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

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

ul, ol {
  padding-left: 1.4em;
}

li {
  margin-bottom: 0.35em;
}

/* ===== HEADER ===== */
header[role="banner"] {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(15, 15, 26, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--transition), box-shadow var(--transition);
}

@media (prefers-color-scheme: light) {
  header[role="banner"] {
    background: rgba(240, 242, 248, 0.78);
  }
}

header[role="banner"] > div {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 20px;
}

header[role="banner"] > div > a:first-child {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity var(--transition), transform var(--transition);
}

header[role="banner"] > div > a:first-child:hover {
  opacity: 0.85;
  transform: scale(1.03);
}

nav[aria-label="主导航"] ul {
  list-style: none;
  display: flex;
  gap: 4px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

nav[aria-label="主导航"] ul li {
  margin: 0;
}

nav[aria-label="主导航"] ul li a {
  display: inline-block;
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 8px;
  transition: all var(--transition);
  position: relative;
  white-space: nowrap;
}

nav[aria-label="主导航"] ul li a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: var(--gradient);
  border-radius: 2px;
  transition: transform var(--transition);
}

nav[aria-label="主导航"] ul li a:hover {
  color: var(--text);
  background: var(--glass);
}

nav[aria-label="主导航"] ul li a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* ===== MAIN ===== */
main {
  position: relative;
  z-index: 1;
}

main > article {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ===== H1 BANNER ===== */
h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.35;
  color: #fff;
  text-align: center;
  padding: 80px 24px 72px;
  margin: 0 -24px 48px;
  position: relative;
  overflow: hidden;
  background: var(--gradient-2);
  letter-spacing: 0.01em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  animation: bannerFadeIn 0.9s ease both;
}

@media (prefers-color-scheme: light) {
  h1 {
    color: #1a1a2e;
    text-shadow: 0 2px 20px rgba(255, 255, 255, 0.5);
  }
}

h1::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(124, 92, 252, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(0, 212, 255, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(255, 107, 157, 0.25) 0%, transparent 50%);
  animation: bannerGlow 6s ease-in-out infinite alternate;
}

h1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 92, 252, 0.6), rgba(0, 212, 255, 0.6), rgba(255, 107, 157, 0.6), transparent);
}

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

@keyframes bannerGlow {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.15); }
}

/* ===== SECTIONS ===== */
section {
  margin-bottom: 56px;
  padding: 36px 32px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  opacity: 0;
  transform: translateY(30px);
  animation: sectionReveal 0.7s ease forwards;
}

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; }

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

section:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(124, 92, 252, 0.25);
  transform: translateY(-3px);
}

section:target {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.15), var(--shadow-hover);
}

/* ===== HEADINGS ===== */
h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 14px;
  position: relative;
  letter-spacing: 0.01em;
}

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

section:hover h2::after {
  width: 90px;
}

h3 {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 650;
  color: var(--text);
  margin: 28px 0 12px;
  padding-left: 16px;
  position: relative;
  letter-spacing: 0.01em;
}

h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.25em;
  bottom: 0.25em;
  width: 4px;
  background: var(--gradient);
  border-radius: 4px;
  transition: transform var(--transition);
}

h3:hover::before {
  transform: scaleY(1.2);
}

/* ===== PARAGRAPHS ===== */
p {
  color: var(--text-2);
  margin-bottom: 14px;
  font-size: 0.95rem;
  line-height: 1.85;
}

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

/* ===== LISTS ===== */
section ul,
section ol {
  margin: 12px 0 18px;
  padding-left: 1.5em;
}

section ul li,
section ol li {
  color: var(--text-2);
  font-size: 0.93rem;
  line-height: 1.8;
  padding-left: 4px;
  transition: color var(--transition), padding-left var(--transition);
}

section ul li::marker {
  color: var(--accent);
  font-size: 1.1em;
}

section ol li::marker {
  color: var(--accent-2);
  font-weight: 700;
}

section ul li:hover,
section ol li:hover {
  color: var(--text);
  padding-left: 8px;
}

/* ===== BLOCKQUOTE ===== */
blockquote {
  margin: 20px 0;
  padding: 20px 24px;
  background: var(--glass);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

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

blockquote:hover {
  transform: translateX(4px);
  box-shadow: -4px 0 20px rgba(124, 92, 252, 0.15);
}

blockquote p {
  color: var(--text-2);
  font-style: italic;
  margin-bottom: 0;
  font-size: 0.93rem;
}

/* ===== ARTICLE CARDS ===== */
section article {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 18px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
}

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

section article:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(124, 92, 252, 0.15);
  border-color: rgba(124, 92, 252, 0.3);
  background: var(--card);
}

section article:hover::before {
  transform: scaleX(1);
}

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

section article h3::before {
  display: none;
}

section article h3 {
  padding-left: 0;
}

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

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

section article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent-2);
  margin-top: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 20px;
  transition: all var(--transition);
}

section article a:hover {
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--accent-2);
  color: var(--accent-2);
  gap: 10px;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
}

section article a::after {
  content: "\2192";
  transition: transform var(--transition);
}

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

/* ===== FAQ ===== */
#faq h3 {
  cursor: default;
  padding: 14px 18px 14px 22px;
  margin: 10px 0 6px;
  background: var(--glass);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all var(--transition);
  font-size: 1rem;
}

#faq h3::before {
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 3px;
}

#faq h3:hover {
  background: rgba(124, 92, 252, 0.08);
  border-color: rgba(124, 92, 252, 0.2);
  transform: translateX(4px);
}

#faq h3 + p {
  padding: 0 18px 14px 22px;
  margin-bottom: 6px;
}

/* ===== HOWTO ===== */
#howto ol {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

#howto ol li {
  counter-increment: step;
  position: relative;
  padding: 16px 20px 16px 64px;
  margin-bottom: 10px;
  background: var(--glass);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  transition: all var(--transition);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(124, 92, 252, 0.3);
}

#howto ol li:hover {
  background: rgba(124, 92, 252, 0.08);
  border-color: rgba(124, 92, 252, 0.25);
  transform: translateX(6px);
  padding-left: 70px;
}

#howto ul li {
  padding: 6px 0;
}

#howto ul li::marker {
  color: var(--accent-3);
}

/* ===== CONTACT ===== */
#contact ul {
  list-style: none;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

#contact ul li {
  padding: 14px 18px;
  background: var(--glass);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  font-size: 0.9rem;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

#contact ul li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  flex-shrink: 0;
  box-shadow: 0 0 10px var(--accent-2);
}

#contact ul li:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.1);
}

/* ===== SITEMAP / LINKS ===== */
#sitemap ul,
#links ul {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

#sitemap ul li a,
#links ul li a {
  display: inline-block;
  padding: 8px 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
  transition: all var(--transition);
}

#sitemap ul li a:hover,
#links ul li a:hover {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 92, 252, 0.3);
}

/* ===== LEGAL ===== */
#legal h3 {
  margin-top: 22px;
}

/* ===== FOOTER ===== */
footer[role="contentinfo"] {
  position: relative;
  z-index: 1;
  background: var(--bg-2);
  border-top: 1px solid var(--glass-border);
  padding: 48px 24px 36px;
  margin-top: 20px;
}

footer[role="contentinfo"] > div {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

footer[role="contentinfo"] p {
  color: var(--text-3);
  font-size: 0.85rem;
  margin-bottom: 8px;
  transition: color var(--transition);
}

footer[role="contentinfo"] p:first-child {
  font-size: 0.95rem;
  color: var(--text-2);
  font-weight: 600;
  margin-bottom: 14px;
}

footer[role="contentinfo"] nav {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--glass-border);
}

footer[role="contentinfo"] nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
}

footer[role="contentinfo"] nav ul li {
  margin: 0;
}

footer[role="contentinfo"] nav ul li a {
  font-size: 0.85rem;
  color: var(--text-3);
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition);
}

footer[role="contentinfo"] nav ul li a:hover {
  color: var(--accent-2);
  background: var(--glass);
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(124, 92, 252, 0.35);
  border-radius: 4px;
  transition: background var(--transition);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 92, 252, 0.6);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  header[role="banner"] > div {
    height: auto;
    padding: 12px 16px;
    flex-direction: column;
    gap: 10px;
  }

  nav[aria-label="主导航"] ul {
    justify-content: center;
    gap: 2px;
  }

  nav[aria-label="主导航"] ul li a {
    padding: 6px 10px;
    font-size: 0.82rem;
  }

  main > article {
    padding: 0 16px 60px;
  }

  h1 {
    padding: 60px 16px 54px;
    margin: 0 -16px 36px;
    font-size: clamp(1.35rem, 5vw, 1.8rem);
  }

  section {
    padding: 26px 20px;
    margin-bottom: 36px;
    border-radius: var(--radius);
  }

  section article {
    padding: 20px 18px;
  }

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

  #howto ol li {
    padding: 14px 16px 14px 56px;
  }

  #howto ol li::before {
    left: 14px;
    width: 28px;
    height: 28px;
    font-size: 0.78rem;
  }

  #howto ol li:hover {
    padding-left: 60px;
  }
}

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

  header[role="banner"] > div {
    padding: 10px 12px;
  }

  header[role="banner"] > div > a:first-child {
    font-size: 1.15rem;
  }

  nav[aria-label="主导航"] ul li a {
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  main > article {
    padding: 0 12px 48px;
  }

  h1 {
    padding: 48px 12px 42px;
    margin: 0 -12px 28px;
  }

  section {
    padding: 22px 16px;
    margin-bottom: 28px;
  }

  h2 {
    font-size: 1.15rem;
  }

  h3 {
    font-size: 0.98rem;
  }

  blockquote {
    padding: 16px 18px;
  }

  #sitemap ul,
  #links ul {
    gap: 8px;
  }

  #sitemap ul li a,
  #links ul li a {
    padding: 6px 14px;
    font-size: 0.82rem;
  }

  footer[role="contentinfo"] {
    padding: 36px 16px 28px;
  }
}

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

  section {
    opacity: 1;
    transform: none;
  }
}

/* ===== PRINT ===== */
@media print {
  header[role="banner"],
  footer[role="contentinfo"] {
    display: none;
  }

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

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

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

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

  section {
    border-width: 2px;
  }

  a {
    text-decoration: underline;
  }
}