:root {
  --bg-primary: #0a0e27;
  --bg-secondary: #0f1435;
  --bg-card: rgba(255, 255, 255, 0.06);
  --bg-card-hover: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text-primary: #eef1ff;
  --text-secondary: #a7b0d0;
  --text-muted: #7c86ab;
  --accent-1: #6a5cff;
  --accent-2: #c44dff;
  --accent-3: #2ec5ff;
  --gradient-hero: linear-gradient(135deg, #1a1040 0%, #2d1b69 35%, #4a1d96 65%, #1e3a8a 100%);
  --gradient-accent: linear-gradient(135deg, #6a5cff 0%, #c44dff 100%);
  --gradient-text: linear-gradient(135deg, #8b7dff 0%, #d97dff 50%, #5cd0ff 100%);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 40px rgba(106, 92, 255, 0.25);
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f4f5fb;
    --bg-secondary: #eef0f8;
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-card-hover: rgba(255, 255, 255, 0.92);
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(106, 92, 255, 0.15);
    --text-primary: #1a1d3a;
    --text-secondary: #4a5070;
    --text-muted: #7a819e;
    --gradient-hero: linear-gradient(135deg, #e8e4ff 0%, #d9ccff 35%, #c4b5fd 65%, #bfdbfe 100%);
    --shadow-sm: 0 2px 8px rgba(106, 92, 255, 0.08);
    --shadow-md: 0 8px 24px rgba(106, 92, 255, 0.12);
    --shadow-lg: 0 16px 48px rgba(106, 92, 255, 0.16);
    --shadow-glow: 0 0 40px rgba(106, 92, 255, 0.12);
  }
}

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

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

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(106, 92, 255, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(196, 77, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(46, 197, 255, 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

@media (prefers-color-scheme: light) {
  body::before {
    background:
      radial-gradient(ellipse 80% 50% at 20% 0%, rgba(106, 92, 255, 0.1) 0%, transparent 60%),
      radial-gradient(ellipse 60% 40% at 80% 20%, rgba(196, 77, 255, 0.06) 0%, transparent 60%);
  }
}

::selection {
  background: var(--accent-1);
  color: #fff;
}

a {
  color: var(--accent-3);
  text-decoration: none;
  transition: color var(--transition);
}

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

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

/* ========== HEADER / NAV ========== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--glass-bg);
  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);
}

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

header nav > a {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
  transition: filter var(--transition);
}

header nav > a:hover {
  filter: brightness(1.2);
}

header nav ul {
  display: flex;
  list-style: none;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

header nav ul li a:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

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

/* ========== BREADCRUMB ========== */
nav[aria-label="面包屑"] {
  padding: 20px 0 0;
}

nav[aria-label="面包屑"] ol {
  list-style: none;
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

nav[aria-label="面包屑"] ol li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--text-muted);
}

nav[aria-label="面包屑"] ol li a {
  color: var(--text-secondary);
}

nav[aria-label="面包屑"] ol li a:hover {
  color: var(--accent-3);
}

/* ========== HERO ========== */
#hero {
  position: relative;
  margin: 24px 0 56px;
  padding: 72px 48px;
  border-radius: var(--radius-xl);
  background: var(--gradient-hero);
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-glow);
  animation: heroFadeIn 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(196, 77, 255, 0.2) 0%, transparent 45%);
  z-index: -1;
}

#hero::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(106, 92, 255, 0.3), transparent 70%);
  filter: blur(60px);
  z-index: -1;
  animation: heroOrb 8s ease-in-out infinite alternate;
}

#hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: light) {
  #hero h1 {
    color: #1a1d3a;
    text-shadow: none;
  }
}

#hero p {
  max-width: 780px;
  font-size: clamp(0.95rem, 1.5vw, 1.08rem);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.85;
  margin-bottom: 20px;
}

@media (prefers-color-scheme: light) {
  #hero p {
    color: var(--text-secondary);
  }
}

#hero p:last-child {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 32px;
  margin-bottom: 0;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}

@media (prefers-color-scheme: light) {
  #hero p:last-child {
    color: var(--text-muted);
  }
}

#hero p:last-child a {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--transition);
}

#hero p:last-child a:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  color: #fff;
}

#hero p:last-child a:first-child {
  background: var(--gradient-accent);
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(106, 92, 255, 0.4);
}

#hero p:last-child a:first-child:hover {
  box-shadow: 0 8px 32px rgba(106, 92, 255, 0.55);
  filter: brightness(1.1);
}

@media (prefers-color-scheme: light) {
  #hero p:last-child a {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--glass-border);
  }
  #hero p:last-child a:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
  }
  #hero p:last-child a:first-child {
    color: #fff;
    background: var(--gradient-accent);
  }
  #hero p:last-child a:first-child:hover {
    color: #fff;
  }
}

/* ========== SECTIONS ========== */
section {
  margin-bottom: 56px;
  animation: sectionReveal 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  animation-timeline: view();
  animation-range: entry 0% entry 25%;
}

section:not(#hero) {
  padding: 40px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

section:not(#hero):hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(106, 92, 255, 0.25);
}

section h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
  padding-bottom: 16px;
  position: relative;
  color: var(--text-primary);
}

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

section h3 {
  font-size: clamp(1.02rem, 1.8vw, 1.18rem);
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text-primary);
  line-height: 1.5;
  transition: color var(--transition);
}

section h3:first-of-type {
  margin-top: 0;
}

section p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.85;
  font-size: 0.95rem;
}

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

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

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

#articles article:hover {
  background: var(--bg-card-hover);
  border-color: rgba(106, 92, 255, 0.3);
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
}

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

#articles article h3 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 1.05rem;
  transition: color var(--transition);
}

#articles article:hover h3 {
  color: var(--accent-2);
}

#articles article p {
  font-size: 0.9rem;
  margin-bottom: 8px;
}

#articles article p:first-of-type {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

#articles article p:last-child a {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-3);
  gap: 4px;
  transition: gap var(--transition), color var(--transition);
}

#articles article p:last-child a::after {
  content: "→";
  transition: transform var(--transition);
}

#articles article p:last-child a:hover {
  color: var(--accent-2);
}

#articles article p:last-child a:hover::after {
  transform: translateX(4px);
}

/* ========== FAQ ========== */
#faq h3 {
  position: relative;
  padding-left: 28px;
  cursor: default;
  transition: color var(--transition);
}

#faq h3::before {
  content: "Q";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--gradient-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

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

#faq p {
  padding-left: 28px;
  border-left: 2px solid transparent;
  transition: border-color var(--transition);
}

#faq h3:hover + p {
  border-left-color: var(--accent-1);
}

/* ========== HOWTO ========== */
#howto {
  position: relative;
  overflow: hidden;
}

#howto::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(106, 92, 255, 0.15), transparent 70%);
  pointer-events: none;
}

#howto h3 {
  padding-left: 16px;
  border-left: 3px solid var(--accent-1);
}

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

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

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

/* ========== CONTACT ========== */
#contact p {
  padding: 10px 0;
  border-bottom: 1px dashed var(--glass-border);
}

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

/* ========== LEGAL ========== */
#legal {
  border-color: rgba(196, 77, 255, 0.2);
}

#legal h3 {
  color: var(--accent-2);
}

/* ========== FOOTER ========== */
footer {
  position: relative;
  z-index: 1;
  margin-top: 40px;
  padding: 48px 24px 40px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--glass-border);
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

footer p:last-child {
  margin-bottom: 0;
  margin-top: 16px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

footer p:last-child a {
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  transition: all var(--transition);
}

footer p:last-child a:hover {
  color: #fff;
  background: var(--gradient-accent);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(106, 92, 255, 0.35);
}

/* ========== SCROLL ANIMATIONS ========== */
@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes heroOrb {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-60px, 40px) scale(1.15);
  }
}

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

@supports not (animation-timeline: view()) {
  section {
    animation: sectionReveal 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  }
}

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

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

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

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

/* ========== FOCUS VISIBLE ========== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-3);
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* ========== RESPONSIVE: TABLET ========== */
@media (max-width: 1024px) {
  header nav {
    padding: 0 20px;
    min-height: 60px;
  }

  header nav ul {
    gap: 2px;
  }

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

  main {
    padding: 0 20px 64px;
  }

  #hero {
    padding: 56px 36px;
  }

  section:not(#hero) {
    padding: 32px;
  }
}

/* ========== RESPONSIVE: MOBILE ========== */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  header nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
    gap: 10px;
  }

  header nav ul {
    justify-content: flex-start;
    gap: 2px;
    width: 100%;
  }

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

  main {
    padding: 0 16px 56px;
  }

  nav[aria-label="面包屑"] {
    padding-top: 16px;
  }

  #hero {
    padding: 40px 24px;
    border-radius: var(--radius-lg);
    margin: 16px 0 40px;
  }

  #hero p:last-child {
    gap: 10px;
    margin-top: 24px;
  }

  #hero p:last-child a {
    padding: 10px 20px;
    font-size: 0.88rem;
    flex: 1;
    min-width: 130px;
    justify-content: center;
  }

  section {
    margin-bottom: 40px;
  }

  section:not(#hero) {
    padding: 24px 20px;
    border-radius: var(--radius-md);
  }

  section h2 {
    margin-bottom: 22px;
    padding-bottom: 12px;
  }

  section h3 {
    margin: 22px 0 10px;
  }

  #articles article {
    padding: 18px 20px;
  }

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

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

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

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

  footer p:last-child {
    gap: 6px;
  }

  footer p:last-child a {
    padding: 5px 12px;
    font-size: 0.78rem;
  }
}

/* ========== RESPONSIVE: SMALL MOBILE ========== */
@media (max-width: 400px) {
  #hero {
    padding: 32px 18px;
  }

  section:not(#hero) {
    padding: 20px 16px;
  }

  #hero p:last-child a {
    flex: 1 1 100%;
  }

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

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

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

  section:not(#hero) {
    box-shadow: none;
    border: 1px solid #ccc;
    backdrop-filter: none;
  }

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