:root {
  --primary: #6C5CE7;
  --primary-light: #a29bfe;
  --primary-dark: #4834d4;
  --secondary: #fd79a8;
  --accent: #00cec9;
  --accent-warm: #fdcb6e;
  --bg: #f8f9fe;
  --bg-alt: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-glass: rgba(255, 255, 255, 0.55);
  --text: #2d3436;
  --text-secondary: #636e72;
  --text-light: #b2bec3;
  --border: rgba(108, 92, 231, 0.12);
  --shadow-sm: 0 2px 8px rgba(108, 92, 231, 0.08);
  --shadow-md: 0 8px 24px rgba(108, 92, 231, 0.12);
  --shadow-lg: 0 16px 48px rgba(108, 92, 231, 0.16);
  --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.2);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-slow: 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --max-width: 1200px;
  --header-height: 72px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e17;
    --bg-alt: #1a1928;
    --bg-card: rgba(30, 28, 48, 0.78);
    --bg-glass: rgba(30, 28, 48, 0.6);
    --text: #e8e6f0;
    --text-secondary: #a8a4b8;
    --text-light: #6c6880;
    --border: rgba(162, 155, 254, 0.15);
    --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 30px rgba(108, 92, 231, 0.3);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(108, 92, 231, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(253, 121, 168, 0.06), transparent),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(0, 206, 201, 0.05), transparent);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

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

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

/* ===== Header ===== */
header {
  position: relative;
  padding: 100px 24px 60px;
  background: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 30%, #fd79a8 70%, #fdcb6e 100%);
  background-size: 300% 300%;
  animation: gradientShift 12s ease infinite;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%);
  margin-bottom: 40px;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 15% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 85% 70%, rgba(255, 255, 255, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
  pointer-events: none;
}

header::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 40px,
    rgba(255, 255, 255, 0.03) 40px,
    rgba(255, 255, 255, 0.03) 80px
  );
  animation: headerDrift 20s linear infinite;
  pointer-events: none;
}

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

@keyframes headerDrift {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-40px, -40px) rotate(5deg); }
}

header h1 {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto 20px;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
  letter-spacing: -0.02em;
  line-height: 1.3;
  animation: fadeInUp 0.8s ease both;
}

header > p {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto 32px;
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.9;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
  animation: fadeInUp 0.8s 0.15s ease both;
}

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

/* ===== Navigation ===== */
nav[aria-label="主导航"] {
  position: relative;
  z-index: 3;
  max-width: var(--max-width);
  margin: 0 auto;
  animation: fadeInUp 0.8s 0.3s ease both;
}

nav[aria-label="主导航"] ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

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

nav[aria-label="主导航"] ul li a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: inherit;
  transform: scale(0);
  transition: transform var(--transition);
}

nav[aria-label="主导航"] ul li a:hover::before,
nav[aria-label="主导航"] ul li a:focus-visible::before {
  transform: scale(1);
}

nav[aria-label="主导航"] ul li a:hover,
nav[aria-label="主导航"] ul li a:focus-visible {
  transform: translateY(-2px);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  outline: none;
}

/* ===== Main ===== */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ===== Sections ===== */
section {
  margin-bottom: 48px;
  padding: 40px 36px;
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}

section:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

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

section h2::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

section h3 {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  font-weight: 600;
  color: var(--primary-dark);
  margin: 28px 0 12px;
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

section h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 4px;
}

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

section p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.9;
  text-align: justify;
}

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

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

section ul li {
  padding: 8px 0 8px 24px;
  position: relative;
  color: var(--text-secondary);
  transition: color var(--transition);
}

section ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  transition: transform var(--transition);
}

section ul li:hover::before {
  transform: translateY(-50%) scale(1.5);
}

section ul li a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

section ul li a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width var(--transition);
  border-radius: 2px;
}

section ul li a:hover {
  color: var(--secondary);
}

section ul li a:hover::after {
  width: 100%;
}

/* ===== Articles ===== */
article {
  padding: 24px 28px;
  margin-bottom: 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 4px 0 0 4px;
  transform: scaleY(0);
  transition: transform var(--transition);
  transform-origin: bottom;
}

article:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(108, 92, 231, 0.2);
}

article:hover::before {
  transform: scaleY(1);
}

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

article h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.05rem;
  color: var(--text);
}

article h3::before {
  background: linear-gradient(180deg, var(--accent), var(--primary));
}

article p {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

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

article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50px;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
  position: relative;
  overflow: hidden;
}

article a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  opacity: 0;
  transition: opacity var(--transition);
}

article a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.45);
}

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

article a span,
article a {
  position: relative;
  z-index: 1;
}

/* ===== FAQ ===== */
#faq h3 {
  padding: 16px 20px;
  margin: 12px 0 0;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.95rem;
  position: relative;
  padding-left: 44px;
}

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

#faq h3:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

#faq h3 + p {
  padding: 12px 20px 12px 44px;
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-left: 2px solid var(--border);
  margin-left: 14px;
  transition: all var(--transition);
}

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

/* ===== HowTo ===== */
#howto h3 {
  counter-increment: howto-step;
}

#howto h3::before {
  content: counter(howto-step);
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  line-height: 1;
}

#howto {
  counter-reset: howto-step;
}

/* ===== Contact ===== */
#contact p {
  padding: 8px 0;
}

/* ===== Footer ===== */
footer {
  position: relative;
  padding: 48px 24px;
  background: linear-gradient(135deg, #1a1928 0%, #2d2b3d 50%, #1a1928 100%);
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent), var(--accent-warm));
  background-size: 300% 100%;
  animation: gradientShift 6s ease infinite;
}

footer p {
  max-width: var(--max-width);
  margin: 0 auto 10px;
  font-size: 0.88rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.7);
}

footer p:last-child {
  margin-bottom: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

/* ===== Sitemap & Links ===== */
#sitemap ul,
#links ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
}

#sitemap ul li,
#links ul li {
  padding: 6px 0 6px 24px;
}

#links ul li a {
  color: var(--text-secondary);
}

#links ul li a:hover {
  color: var(--primary);
}

/* ===== Scroll Animations ===== */
@media (prefers-reduced-motion: no-preference) {
  section {
    opacity: 0;
    transform: translateY(30px);
    animation: sectionReveal 0.7s ease forwards;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }

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

@supports not (animation-timeline: view()) {
  section {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  :root {
    --max-width: 100%;
  }

  header {
    padding: 80px 20px 50px;
  }

  main {
    padding: 0 20px 60px;
  }

  section {
    padding: 32px 28px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  body {
    font-size: 15px;
  }

  header {
    padding: 64px 16px 44px;
    clip-path: polygon(0 0, 100% 0, 100% 96%, 0 100%);
    margin-bottom: 28px;
  }

  header h1 {
    font-size: 1.4rem;
  }

  header > p {
    font-size: 0.88rem;
    line-height: 1.8;
  }

  nav[aria-label="主导航"] ul {
    gap: 4px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  nav[aria-label="主导航"] ul::-webkit-scrollbar {
    display: none;
  }

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

  main {
    padding: 0 12px 48px;
  }

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

  section h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
  }

  section h3 {
    font-size: 0.95rem;
    margin: 20px 0 10px;
  }

  section p {
    font-size: 0.88rem;
    text-align: left;
  }

  article {
    padding: 18px 16px;
  }

  article h3 {
    font-size: 0.95rem;
  }

  article a {
    padding: 6px 16px;
    font-size: 0.8rem;
  }

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

  #faq h3::before {
    left: 10px;
    width: 20px;
    height: 20px;
    font-size: 0.65rem;
  }

  #faq h3 + p {
    padding: 10px 14px 10px 38px;
    font-size: 0.84rem;
    margin-left: 10px;
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: repeat(2, 1fr);
  }

  footer {
    padding: 36px 16px;
  }

  footer p {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  header {
    padding: 48px 12px 36px;
  }

  header h1 {
    font-size: 1.2rem;
  }

  header > p {
    font-size: 0.82rem;
  }

  nav[aria-label="主导航"] ul {
    padding: 6px 8px;
  }

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

  section {
    padding: 20px 14px;
    border-radius: var(--radius-sm);
  }

  section h2 {
    font-size: 1.1rem;
  }

  article {
    padding: 14px 12px;
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: 1fr;
  }
}

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

/* ===== Print ===== */
@media print {
  header {
    background: none;
    color: #000;
    clip-path: none;
    padding: 20px;
  }

  header h1,
  header > p {
    color: #000;
    text-shadow: none;
  }

  nav[aria-label="主导航"] {
    display: none;
  }

  section {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
    opacity: 1;
    transform: none;
    animation: none;
  }

  footer {
    background: none;
    color: #000;
  }

  footer p {
    color: #000;
  }
}

/* ===== High Contrast ===== */
@media (prefers-contrast: high) {
  :root {
    --border: rgba(108, 92, 231, 0.4);
    --text-secondary: #444;
  }

  section {
    border-width: 2px;
  }

  nav[aria-label="主导航"] ul {
    border-width: 2px;
  }
}

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

  header {
    animation: none;
    background-position: 0% 50%;
  }

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