:root {
  --primary: #1a3a6b;
  --primary-light: #2b5aa0;
  --primary-lighter: #3a6cb5;
  --primary-dark: #0f2a4f;
  --accent: #f2b705;
  --accent-light: #ffd54f;
  --bg: #f5f7fb;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-border: rgba(255, 255, 255, 0.5);
  --text: #1c2536;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow: 0 8px 24px rgba(16, 24, 40, 0.1);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, 0.16);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --header-h: 72px;
  --ease: 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;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --bg-card: #131c2e;
    --bg-glass: rgba(19, 28, 46, 0.72);
    --bg-glass-border: rgba(255, 255, 255, 0.12);
    --text: #e8edf5;
    --text-secondary: #b6c2d4;
    --text-muted: #8494ab;
    --border: #24314a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(
      circle at 12% 0%,
      rgba(43, 90, 160, 0.1),
      transparent 42%
    ),
    radial-gradient(circle at 88% 8%, rgba(242, 183, 5, 0.08), transparent 40%);
  background-attachment: fixed;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  display: block;
}

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

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

h1,
h2,
h3,
h4 {
  line-height: 1.35;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  margin: 2.4rem 0 1rem;
  position: relative;
  padding-left: 18px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  bottom: 0.28em;
  width: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--accent), var(--primary-light));
}

h3 {
  font-size: clamp(1.08rem, 1.6vw, 1.28rem);
  margin: 1.8rem 0 0.6rem;
}

h4 {
  font-size: 1.02rem;
  margin: 1.2rem 0 0.4rem;
  color: var(--primary-light);
}

p {
  margin: 0 0 1rem;
  color: var(--text-secondary);
}

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

li {
  margin: 0.35rem 0;
}

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--bg-glass-border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

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

.logo svg {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(26, 58, 107, 0.35);
  transition: transform 0.4s var(--ease);
}

.logo:hover svg {
  transform: rotate(-6deg) scale(1.06);
}

.main-nav {
  flex: 1 1 auto;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.main-nav a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.25s var(--ease);
}

.main-nav a:hover {
  color: var(--primary);
  background: rgba(43, 90, 160, 0.1);
  transform: translateY(-1px);
}

.site-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.site-search label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.site-search input {
  width: 190px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.3s var(--ease);
}

.site-search input:focus {
  outline: none;
  width: 230px;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(43, 90, 160, 0.16);
}

.site-search button {
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  box-shadow: 0 4px 14px rgba(43, 90, 160, 0.3);
}

.site-search button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(43, 90, 160, 0.42);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

/* ============ 面包屑 ============ */
.breadcrumb {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 20px 0;
}

.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--text-muted);
  opacity: 0.6;
}

.breadcrumb a {
  color: var(--text-muted);
}

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

/* ============ Hero 渐变 Banner ============ */
.hero {
  position: relative;
  max-width: 1240px;
  margin: 20px auto 0;
  padding: 0 20px;
}

.hero-slider {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
}

.hero-slider .slide {
  display: none;
  animation: slideFade 0.9s var(--ease);
}

.hero-slider .slide:first-child {
  display: block;
}

.hero-slider .slide svg {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  object-fit: cover;
}

@keyframes slideFade {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hero-content {
  position: relative;
  margin-top: -100px;
  margin-left: 0;
  max-width: 780px;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--bg-glass-border);
  box-shadow: var(--shadow-lg);
  animation: riseIn 0.9s var(--ease) both;
}

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

.hero-content h1 {
  margin: 0 0 14px;
  background: linear-gradient(120deg, var(--primary), var(--primary-light) 55%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--primary);
}

.hero-lead {
  font-size: 0.98rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.hero-keywords {
  display: inline-block;
  margin: 0;
  padding: 6px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(242, 183, 5, 0.16);
  border: 1px solid rgba(242, 183, 5, 0.4);
  border-radius: var(--radius-pill);
}

/* ============ 锚点导航 ============ */
.anchor-nav {
  max-width: 1240px;
  margin: 28px auto 0;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.anchor-title {
  margin: 0 0 12px;
  padding-left: 0;
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.anchor-title::before {
  display: none;
}

.anchor-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.anchor-nav a {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: all 0.25s var(--ease);
}

.anchor-nav a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(43, 90, 160, 0.32);
}

/* ============ 主内容区 ============ */
main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

main > section {
  margin-top: 32px;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
  animation: fadeUp 0.7s var(--ease) both;
}

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

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

main > section > h2:first-child {
  margin-top: 0;
}

/* ============ 技术文章卡片 ============ */
#articles article {
  padding: 20px 22px;
  margin: 14px 0;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.35s var(--ease);
}

#articles article:hover {
  transform: translateY(-4px);
  border-color: rgba(43, 90, 160, 0.4);
  box-shadow: var(--shadow);
  background: var(--bg-card);
}

#articles article h3 {
  margin-top: 0;
}

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

#articles article a {
  display: inline-block;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: rgba(43, 90, 160, 0.1);
  color: var(--primary-light);
  transition: all 0.3s var(--ease);
}

#articles article a:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff;
  transform: translateX(4px);
}

/* ============ FAQ 折叠 ============ */
#faq details {
  margin: 12px 0;
  padding: 0;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.35s var(--ease);
}

#faq details[open] {
  border-color: rgba(43, 90, 160, 0.4);
  box-shadow: var(--shadow-sm);
  background: var(--bg-card);
}

#faq summary {
  cursor: pointer;
  padding: 16px 48px 16px 20px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  position: relative;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

#faq summary::-webkit-details-marker {
  display: none;
}

#faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--primary-light);
  transition: transform 0.35s var(--ease);
}

#faq details[open] summary::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
}

#faq summary:hover {
  color: var(--primary-light);
  background: rgba(43, 90, 160, 0.06);
}

#faq details p {
  margin: 0;
  padding: 0 20px 18px;
  animation: fadeUp 0.4s var(--ease);
}

/* ============ 引用评价 ============ */
#reviews blockquote {
  margin: 16px 0;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(43, 90, 160, 0.08), rgba(242, 183, 5, 0.08));
  border-left: 4px solid var(--accent);
  position: relative;
  transition: all 0.35s var(--ease);
}

#reviews blockquote:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
}

#reviews blockquote p {
  margin: 0 0 8px;
  font-style: italic;
  color: var(--text);
}

#reviews blockquote cite {
  font-size: 0.86rem;
  font-style: normal;
  color: var(--text-muted);
  font-weight: 600;
}

/* ============ 网站地图 / 链接列表 ============ */
#sitemap ul,
#links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sitemap a,
#links a {
  display: inline-block;
  padding: 7px 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: all 0.25s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  border-color: transparent;
  transform: translateY(-2px);
}

/* ============ 页脚 ============ */
.site-footer {
  margin-top: 48px;
  padding: 48px 20px 32px;
  background: linear-gradient(160deg, var(--primary-dark), var(--primary));
  color: #dbe4f0;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(242, 183, 5, 0.14), transparent 45%);
  pointer-events: none;
}

.site-footer > section {
  max-width: 1240px;
  margin: 0 auto 22px;
  padding: 0 4px;
  position: relative;
}

.site-footer h2 {
  font-size: 1.02rem;
  color: #fff;
  margin: 0 0 8px;
  padding-left: 14px;
}

.site-footer h2::before {
  width: 4px;
  background: var(--accent);
}

.site-footer p {
  color: #b9c7db;
  font-size: 0.9rem;
  margin: 4px 0;
}

.site-footer .copyright {
  max-width: 1240px;
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
  font-size: 0.84rem;
  color: #93a5bd;
  position: relative;
}

/* ============ 返回顶部 ============ */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 8px 24px rgba(26, 58, 107, 0.45);
  transition: all 0.35s var(--ease);
  overflow: hidden;
}

.back-to-top:hover {
  color: var(--primary-dark);
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 30px rgba(242, 183, 5, 0.5);
}

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
  .header-inner {
    gap: 14px;
  }

  .main-nav {
    order: 3;
    flex-basis: 100%;
  }

  .main-nav ul {
    gap: 2px;
  }

  .main-nav a {
    padding: 5px 10px;
    font-size: 0.86rem;
  }

  .site-search {
    margin-left: auto;
  }

  .hero-content {
    margin-top: -70px;
    padding: 24px 26px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  body {
    font-size: 15px;
  }

  .header-inner {
    padding: 10px 16px;
  }

  .main-nav ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .main-nav ul::-webkit-scrollbar {
    display: none;
  }

  .main-nav a {
    white-space: nowrap;
  }

  .site-search {
    flex: 1 1 100%;
    order: 4;
    margin: 0;
  }

  .site-search input {
    flex: 1;
    width: auto;
  }

  .site-search input:focus {
    width: auto;
  }

  .breadcrumb {
    padding: 12px 16px 0;
  }

  .hero {
    padding: 0 16px;
    margin-top: 14px;
  }

  .hero-slider .slide svg {
    aspect-ratio: 16 / 9;
  }

  .hero-content {
    margin-top: -40px;
    padding: 20px;
    border-radius: var(--radius);
  }

  .hero-lead {
    font-size: 0.92rem;
  }

  .anchor-nav {
    margin: 20px 16px 0;
    padding: 18px;
  }

  main {
    padding: 0 16px 32px;
  }

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

  main > section:hover {
    transform: none;
  }

  h2 {
    padding-left: 14px;
  }

  h2::before {
    width: 4px;
  }

  #articles article {
    padding: 16px;
  }

  #faq summary {
    padding: 14px 44px 14px 16px;
    font-size: 0.94rem;
  }

  #reviews blockquote {
    padding: 16px 18px;
  }

  .site-footer {
    padding: 36px 16px 24px;
  }

  .back-to-top {
    width: 44px;
    height: 44px;
    right: 14px;
    bottom: 18px;
    font-size: 0.7rem;
  }
}

@media (max-width: 420px) {
  .logo-text {
    font-size: 1rem;
  }

  .hero-keywords {
    font-size: 0.78rem;
  }

  .anchor-nav a {
    font-size: 0.8rem;
    padding: 5px 12px;
  }
}

/* ============ 减少动画偏好 ============ */
@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;
  }
}

/* ============ 打印样式 ============ */
@media print {
  .site-header,
  .hero-slider,
  .back-to-top,
  .anchor-nav,
  .site-search {
    display: none !important;
  }

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

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