:root {
  --primary: #1F3A5F;
  --primary-light: #2E5A8E;
  --primary-dark: #142840;
  --accent: #4A9EFF;
  --accent-glow: rgba(74, 158, 255, 0.4);
  --secondary: #7C5CFC;
  --secondary-glow: rgba(124, 92, 252, 0.3);
  --bg: #F0F4FA;
  --bg-alt: #FFFFFF;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-card-hover: rgba(255, 255, 255, 0.88);
  --text: #1A1D2B;
  --text-secondary: #4A5568;
  --text-muted: #8899AA;
  --border: rgba(31, 58, 95, 0.12);
  --border-light: rgba(31, 58, 95, 0.06);
  --shadow-sm: 0 2px 8px rgba(31, 58, 95, 0.06);
  --shadow-md: 0 8px 32px rgba(31, 58, 95, 0.10);
  --shadow-lg: 0 16px 48px rgba(31, 58, 95, 0.14);
  --shadow-glow: 0 0 40px rgba(74, 158, 255, 0.15);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --max-width: 1200px;
  --header-height: 72px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C1220;
    --bg-alt: #111827;
    --bg-card: rgba(17, 24, 39, 0.72);
    --bg-card-hover: rgba(17, 24, 39, 0.88);
    --text: #E8EDF5;
    --text-secondary: #A0AEC0;
    --text-muted: #64748B;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(74, 158, 255, 0.2);
    --primary: #4A9EFF;
    --primary-light: #6BB3FF;
    --primary-dark: #2E5A8E;
  }
}

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

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

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

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

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

a:hover {
  color: var(--primary-light);
}

ul, ol {
  list-style: none;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ===== Selection ===== */
::selection {
  background: var(--accent);
  color: #fff;
}

/* ===== Header ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(240, 244, 250, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

@media (prefers-color-scheme: dark) {
  header {
    background: rgba(12, 18, 32, 0.78);
  }
}

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

nav[aria-label="主导航"] {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

nav[aria-label="主导航"] > a:first-child {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
  position: relative;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity var(--transition-fast);
}

nav[aria-label="主导航"] > a:first-child:hover {
  opacity: 0.8;
}

nav[aria-label="主导航"] ul {
  display: flex;
  align-items: center;
  gap: 4px;
}

nav[aria-label="主导航"] ul li a {
  display: block;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  position: relative;
  transition: color var(--transition-fast), background var(--transition-fast);
  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: linear-gradient(90deg, var(--accent), var(--secondary));
  border-radius: 2px;
  transition: transform var(--transition-base);
}

nav[aria-label="主导航"] ul li a:hover {
  color: var(--primary);
  background: rgba(74, 158, 255, 0.08);
}

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

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

/* ===== H1 Banner ===== */
main > h1 {
  position: relative;
  margin: 0 -24px;
  padding: 100px 48px 80px;
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  text-align: center;
  color: #FFFFFF;
  background: linear-gradient(135deg, #1F3A5F 0%, #2E5A8E 30%, #4A9EFF 65%, #7C5CFC 100%);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  overflow: hidden;
  isolation: isolate;
}

main > h1::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 40%, rgba(74, 158, 255, 0.35) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 60%, rgba(124, 92, 252, 0.3) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 50% 0%, rgba(255, 255, 255, 0.12) 0%, transparent 60%);
  z-index: -1;
}

main > h1::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}

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

/* ===== Sections ===== */
section {
  margin-top: 64px;
  opacity: 0;
  transform: translateY(32px);
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 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; }

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

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

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

/* ===== H3 ===== */
h3 {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  margin-top: 28px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

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

/* ===== Cards (glass morphism) ===== */
section > p,
section > h3 + p,
section > h3 ~ p,
section > ol,
section > ul {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
}

section > p:hover,
section > h3 + p:hover,
section > h3 ~ p:hover,
section > ol:hover,
section > ul:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
  border-color: rgba(74, 158, 255, 0.2);
  transform: translateY(-2px);
}

/* ===== Article Cards ===== */
article {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
  position: relative;
  overflow: hidden;
}

article::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--secondary));
  opacity: 0;
  transition: opacity var(--transition-base);
}

article:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
  border-color: rgba(74, 158, 255, 0.2);
  transform: translateY(-3px);
}

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

article h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

article .date,
article > p:first-of-type {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

article > p {
  margin-bottom: 12px;
}

article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  padding: 6px 0;
  position: relative;
  transition: color var(--transition-fast), gap var(--transition-fast);
}

article a::after {
  content: '→';
  transition: transform var(--transition-fast);
}

article a:hover {
  color: var(--primary);
  gap: 10px;
}

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

/* ===== Ordered List (HowTo) ===== */
ol {
  counter-reset: step-counter;
  padding-left: 0 !important;
}

ol li {
  counter-increment: step-counter;
  position: relative;
  padding: 14px 0 14px 56px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
  border-bottom: 1px solid var(--border-light);
  transition: color var(--transition-fast), background var(--transition-fast);
}

ol li:last-child {
  border-bottom: none;
}

ol li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 14px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  border-radius: 50%;
  box-shadow: 0 4px 12px var(--accent-glow);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

ol li:hover::before {
  transform: scale(1.1);
  box-shadow: 0 6px 20px var(--accent-glow);
}

ol li:hover {
  color: var(--text);
}

/* ===== Unordered List (Sitemap/Links) ===== */
section > ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 24px !important;
}

section > ul li {
  flex: 0 0 auto;
}

section > ul li a {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(74, 158, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all var(--transition-fast);
}

section > ul li a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  border-color: transparent;
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-2px);
}

/* ===== FAQ (H3 + P) ===== */
#faq h3 {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 20px 24px 12px;
  margin-top: 20px;
  margin-bottom: 0;
  font-size: 1rem;
  color: var(--text);
  transition: background var(--transition-base), border-color var(--transition-base);
}

#faq h3:hover {
  background: var(--bg-card-hover);
  border-color: rgba(74, 158, 255, 0.2);
}

#faq h3 + p {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  margin-top: 0;
  border-top: none;
  padding-top: 8px;
  padding-bottom: 20px;
}

#faq h3 + p:hover {
  transform: none;
  border-color: rgba(74, 158, 255, 0.2);
}

/* ===== Contact Section ===== */
#contact p {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

#contact p:first-of-type {
  font-weight: 600;
  color: var(--text);
}

/* ===== Footer ===== */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 48px 24px 32px;
  margin-top: 48px;
  transition: background var(--transition-base), border-color var(--transition-base);
}

footer > section {
  max-width: var(--max-width);
  margin: 0 auto 24px;
  opacity: 1;
  transform: none;
  animation: none;
}

footer h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  padding-left: 14px;
}

footer h2::before {
  width: 3px;
  height: 60%;
}

footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

footer > p {
  max-width: var(--max-width);
  margin: 0 auto 8px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

footer > p:last-child {
  border-top: none;
  padding-top: 0;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  nav[aria-label="主导航"] {
    padding: 0 16px;
    gap: 12px;
  }

  nav[aria-label="主导航"] ul {
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
  }

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

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

  main > h1 {
    padding: 80px 24px 64px;
    margin: 0 -16px;
  }

  main {
    padding: 0 16px 64px;
  }

  section > p,
  section > h3 + p,
  section > h3 ~ p,
  section > ol,
  section > ul,
  article {
    padding: 20px 20px;
  }

  #faq h3 {
    padding: 16px 20px 10px;
  }

  #faq h3 + p {
    padding: 6px 20px 16px;
  }
}

@media (max-width: 600px) {
  :root {
    --header-height: 60px;
  }

  body {
    font-size: 15px;
  }

  nav[aria-label="主导航"] {
    flex-direction: column;
    height: auto;
    padding: 12px 16px;
    gap: 8px;
  }

  nav[aria-label="主导航"] > a:first-child {
    font-size: 1.1rem;
  }

  nav[aria-label="主导航"] ul {
    width: 100%;
    justify-content: flex-start;
  }

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

  main > h1 {
    padding: 64px 20px 56px;
    font-size: 1.5rem;
  }

  main > h1::after {
    height: 48px;
  }

  h2 {
    font-size: 1.25rem;
    padding-left: 16px;
  }

  h3 {
    font-size: 1rem;
  }

  section {
    margin-top: 40px;
  }

  section > p,
  section > h3 + p,
  section > h3 ~ p,
  section > ol,
  section > ul,
  article {
    padding: 16px 16px;
    border-radius: var(--radius-sm);
  }

  article {
    padding: 16px 16px;
  }

  ol li {
    padding: 12px 0 12px 48px;
  }

  ol li::before {
    width: 30px;
    height: 30px;
    font-size: 0.78rem;
    top: 12px;
  }

  section > ul {
    padding: 14px 16px !important;
    gap: 6px;
  }

  section > ul li a {
    padding: 6px 14px;
    font-size: 0.82rem;
  }

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

  #faq h3 {
    padding: 14px 16px 8px;
    font-size: 0.95rem;
  }

  #faq h3 + p {
    padding: 4px 16px 14px;
  }
}

@media (max-width: 380px) {
  nav[aria-label="主导航"] ul li a {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  main > h1 {
    font-size: 1.3rem;
    padding: 48px 16px 40px;
  }
}

/* ===== 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,
  footer,
  nav {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

  main > h1 {
    background: none;
    color: #000;
    padding: 0;
    margin: 0 0 24px;
  }

  section {
    opacity: 1;
    transform: none;
    page-break-inside: avoid;
  }

  section > p,
  section > h3 + p,
  section > h3 ~ p,
  section > ol,
  section > ul,
  article {
    background: none;
    backdrop-filter: none;
    border: 1px solid #ddd;
    box-shadow: none;
  }
}