:root {
  --primary: #2b6cb0;
  --primary-light: #4299e1;
  --primary-dark: #1a365d;
  --accent: #ed8936;
  --accent-light: #f6ad55;
  --accent-dark: #c05621;
  --pink: #ed64a6;
  --purple: #805ad5;
  --teal: #38b2ac;
  --bg: #f7fafc;
  --bg-alt: #edf2f7;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-glass-strong: rgba(255, 255, 255, 0.85);
  --text: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --border: #e2e8f0;
  --border-light: rgba(226, 232, 240, 0.6);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 30px rgba(43, 108, 176, 0.15);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-full: 999px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --max-width: 1180px;
  --header-height: 70px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #63b3ed;
    --primary-light: #90cdf4;
    --primary-dark: #2b6cb0;
    --accent: #f6ad55;
    --accent-light: #fbd38d;
    --accent-dark: #ed8936;
    --pink: #f687b3;
    --purple: #b794f4;
    --teal: #4fd1c5;
    --bg: #0f1419;
    --bg-alt: #171d26;
    --bg-card: #1c2333;
    --bg-glass: rgba(28, 35, 51, 0.7);
    --bg-glass-strong: rgba(28, 35, 51, 0.88);
    --text: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --border: #2d3748;
    --border-light: rgba(45, 55, 72, 0.6);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 30px rgba(99, 179, 237, 0.12);
  }
}

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

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

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(66, 153, 225, 0.08), transparent),
    radial-gradient(ellipse 60% 50% at 90% 20%, rgba(237, 100, 166, 0.06), transparent),
    radial-gradient(ellipse 70% 60% at 50% 100%, rgba(128, 90, 213, 0.05), transparent);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--transition), color var(--transition);
}

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

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

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

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

ul, ol {
  list-style: none;
}

::selection {
  background: rgba(66, 153, 225, 0.3);
  color: var(--text);
}

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

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

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

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

/* ===== Header ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition), box-shadow var(--transition);
}

header:hover {
  box-shadow: var(--shadow-sm);
}

header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--header-height);
  position: relative;
}

header nav > a {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary), var(--purple), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity var(--transition), transform var(--transition);
}

header nav > a:hover {
  opacity: 0.8;
  transform: scale(1.03);
}

header nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

header nav ul::-webkit-scrollbar {
  display: none;
}

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

header nav ul li a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--pink));
  border-radius: var(--radius-full);
  transform: translateX(-50%);
  transition: width var(--transition);
}

header nav ul li a:hover {
  color: var(--primary);
  background: rgba(66, 153, 225, 0.08);
  transform: translateY(-1px);
}

header nav ul li a:hover::after {
  width: 60%;
}

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

/* ===== Sections ===== */
main > section {
  margin-top: 32px;
  padding: 40px 36px;
  background: var(--bg-glass-strong);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

main > section:hover {
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: rgba(66, 153, 225, 0.25);
  transform: translateY(-2px);
}

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

/* Hero section special */
main > section:first-of-type {
  margin-top: 40px;
  padding: 72px 48px;
  background:
    linear-gradient(135deg, rgba(43, 108, 176, 0.92), rgba(128, 90, 213, 0.88), rgba(237, 100, 166, 0.82)),
    linear-gradient(135deg, var(--primary-dark), var(--purple));
  background-size: 200% 200%;
  color: #fff;
  border: none;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(128, 90, 213, 0.3);
  animation: gradientShift 8s ease infinite, fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

main > section:first-of-type::before {
  display: none;
}

main > section:first-of-type::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

main > section:first-of-type h1 {
  color: #fff;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1;
}

main > section:first-of-type p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.05rem;
  line-height: 1.85;
  max-width: 820px;
  position: relative;
  z-index: 1;
}

main > section:first-of-type:hover {
  transform: translateY(-2px) scale(1.002);
  box-shadow: var(--shadow-lg), 0 0 80px rgba(128, 90, 213, 0.4);
}

/* ===== Breadcrumb ===== */
main > nav[aria-label="面包屑导航"] {
  margin-top: 20px;
  padding: 0 4px;
  animation: fadeUp 0.7s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

main > nav[aria-label="面包屑导航"] ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

main > nav[aria-label="面包屑导航"] ol li {
  display: flex;
  align-items: center;
  gap: 8px;
}

main > nav[aria-label="面包屑导航"] ol li:not(:last-child)::after {
  content: "/";
  color: var(--text-muted);
  opacity: 0.5;
}

main > nav[aria-label="面包屑导航"] ol li a {
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-alt);
  transition: all var(--transition);
}

main > nav[aria-label="面包屑导航"] ol li a:hover {
  color: var(--primary);
  background: rgba(66, 153, 225, 0.12);
}

/* ===== Headings ===== */
h2 {
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: var(--text);
  position: relative;
  padding-left: 18px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 5px;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, var(--primary), var(--purple), var(--pink));
  box-shadow: 0 0 12px rgba(128, 90, 213, 0.4);
}

h3 {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  font-weight: 700;
  line-height: 1.45;
  margin-top: 32px;
  margin-bottom: 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}

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

h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 10px;
  color: var(--primary);
}

p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  line-height: 1.85;
}

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

/* ===== Article cards ===== */
#articles article {
  padding: 24px 26px;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

#articles article:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
  border-color: rgba(66, 153, 225, 0.3);
}

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

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

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

#articles article p {
  font-size: 0.92rem;
  margin-bottom: 10px;
}

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

#articles article p a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(66, 153, 225, 0.1), rgba(128, 90, 213, 0.1));
  color: var(--primary);
  transition: all var(--transition);
}

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

#articles article p a:hover {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(66, 153, 225, 0.35);
}

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

/* ===== FAQ ===== */
#faq h3 {
  padding: 16px 20px;
  background: var(--bg-alt);
  border-radius: var(--radius) var(--radius) 0 0;
  margin-top: 18px;
  margin-bottom: 0;
  font-size: 1rem;
  color: var(--text);
  border-left: 4px solid var(--primary);
  cursor: default;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

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

#faq h3:hover {
  background: rgba(66, 153, 225, 0.1);
  border-left-color: var(--accent);
  color: var(--primary);
}

#faq h3 + p {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: 0;
  font-size: 0.92rem;
  animation: fadeUp 0.4s ease both;
}

/* ===== How-to steps ===== */
#howto h3 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  background: linear-gradient(135deg, rgba(66, 153, 225, 0.12), rgba(128, 90, 213, 0.12));
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  color: var(--primary);
  margin-top: 28px;
}

#howto h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  box-shadow: 0 0 8px rgba(66, 153, 225, 0.5);
}

/* ===== Contact ===== */
#contact p {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 8px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}

#contact p:hover {
  border-left-color: var(--primary);
  background: rgba(66, 153, 225, 0.08);
  transform: translateX(4px);
}

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

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

#sitemap ul li a,
#links ul li a {
  display: block;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

#sitemap ul li a::before,
#links ul li a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 0;
}

#sitemap ul li a span,
#links ul li a span {
  position: relative;
  z-index: 1;
}

#sitemap ul li a:hover,
#links ul li a:hover {
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(66, 153, 225, 0.3);
}

#sitemap ul li a:hover::before,
#links ul li a:hover::before {
  opacity: 1;
}

#sitemap ul li a:hover,
#links ul li a:hover {
  color: #fff;
}

/* ===== Legal ===== */
#legal h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-top: 24px;
}

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

/* ===== Footer ===== */
footer {
  background: linear-gradient(135deg, var(--primary-dark), #1a202c);
  color: rgba(255, 255, 255, 0.85);
  padding: 48px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

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

footer::after {
  content: "";
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(66, 153, 225, 0.12), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

footer p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
  line-height: 1.8;
}

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

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

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Staggered animation delays for articles */
#articles article:nth-child(1) { animation-delay: 0.05s; }
#articles article:nth-child(2) { animation-delay: 0.1s; }
#articles article:nth-child(3) { animation-delay: 0.15s; }
#articles article:nth-child(4) { animation-delay: 0.2s; }
#articles article:nth-child(5) { animation-delay: 0.25s; }
#articles article:nth-child(6) { animation-delay: 0.3s; }
#articles article:nth-child(7) { animation-delay: 0.35s; }
#articles article:nth-child(8) { animation-delay: 0.4s; }
#articles article:nth-child(9) { animation-delay: 0.45s; }
#articles article:nth-child(10) { animation-delay: 0.5s; }

/* Section stagger */
main > section:nth-of-type(1) { animation-delay: 0.05s; }
main > section:nth-of-type(2) { animation-delay: 0.1s; }
main > section:nth-of-type(3) { animation-delay: 0.15s; }
main > section:nth-of-type(4) { animation-delay: 0.2s; }
main > section:nth-of-type(5) { animation-delay: 0.25s; }
main > section:nth-of-type(6) { animation-delay: 0.3s; }
main > section:nth-of-type(7) { animation-delay: 0.35s; }
main > section:nth-of-type(8) { animation-delay: 0.4s; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  main > section {
    padding: 32px 28px;
  }
  main > section:first-of-type {
    padding: 56px 36px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
    --radius-lg: 20px;
  }

  body {
    font-size: 15px;
  }

  header nav {
    padding: 0 16px;
    gap: 12px;
  }

  header nav > a {
    font-size: 1.1rem;
  }

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

  main {
    padding: 0 16px 60px;
  }

  main > section {
    margin-top: 20px;
    padding: 26px 20px;
    border-radius: var(--radius);
  }

  main > section:first-of-type {
    margin-top: 24px;
    padding: 40px 24px;
  }

  main > section:first-of-type h1 {
    font-size: 1.5rem;
  }

  main > section:first-of-type p {
    font-size: 0.95rem;
  }

  h2 {
    font-size: 1.3rem;
    padding-left: 14px;
    margin-bottom: 18px;
  }

  h2::before {
    width: 4px;
  }

  h3 {
    font-size: 1.05rem;
    margin-top: 24px;
  }

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

  #articles article:hover {
    transform: translateY(-2px);
  }

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

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

  #contact p {
    padding: 8px 12px;
    font-size: 0.88rem;
    flex-direction: column;
    gap: 2px;
  }

  #sitemap ul,
  #links ul {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }

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

  footer {
    padding: 32px 16px;
  }

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

@media (max-width: 480px) {
  header nav {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    gap: 8px;
  }

  header nav ul {
    width: 100%;
    justify-content: flex-start;
    padding-bottom: 4px;
  }

  main > section:first-of-type {
    padding: 32px 18px;
  }

  main > section:first-of-type h1 {
    font-size: 1.3rem;
  }

  main > section {
    padding: 22px 16px;
  }

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

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

/* ===== Print ===== */
@media print {
  header,
  footer,
  #sitemap,
  #links {
    display: none;
  }

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

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