/* ==========================================================================
   XX云 - 【风格 04 · 青空安心】核心样式表
   配色：浅青白 #F2FAF7 | 墨绿 #173F32 | 唯一强调色 翡翠绿 #10B981
   字体：Noto Sans SC 900 / Space Grotesk / JetBrains Mono
   ========================================================================== */

:root {
  --bg-sky: #F2FAF7;          /* 浅青白底色 */
  --bg-card: #FFFFFF;         /* 纯净白卡片 */
  --bg-card-soft: #F8FCFA;
  --text-main: #173F32;       /* 墨绿文字 */
  --text-muted: #3E6356;      /* 墨绿次级文字 */
  --text-light: #6C8B80;      /* 辅助说明小字 */
  --emerald-accent: #10B981;  /* 唯一强调色：翡翠绿 */
  --emerald-hover: #059669;
  --emerald-light: #ECFDF5;   /* 极浅翡翠绿背景 */
  --emerald-subtle: rgba(16, 185, 129, 0.08);
  --border-soft: rgba(23, 63, 50, 0.08);
  --border-emerald: rgba(16, 185, 129, 0.22);
  --border-emerald-hover: rgba(16, 185, 129, 0.45);
  --shadow-soft: 0 4px 20px -2px rgba(23, 63, 50, 0.05);
  --shadow-hover: 0 10px 30px -4px rgba(16, 185, 129, 0.16);
  --font-title: 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-num: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, 'Courier New', monospace;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --max-width: 1200px;
}

/* 无障碍键盘快速跳转入口 (Skip to content) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--emerald-accent);
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  z-index: 9999;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
  outline: 3px solid var(--text-main);
}

/* 全局焦点状态指示 */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 2px solid var(--emerald-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* 固定页眉防遮挡锚点偏移量 */
section[id],
main[id],
div[id] {
  scroll-margin-top: 84px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-sky);
  color: var(--text-main);
  font-family: var(--font-title);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-sky);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

/* 导航 */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(242, 250, 247, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-main);
}

.logo-badge {
  background: var(--emerald-light);
  color: var(--emerald-accent);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-emerald);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-item {
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-item:hover {
  color: var(--emerald-accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
  min-height: 44px;
}

.btn-primary {
  background-color: var(--emerald-accent);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32);
}

.btn-primary:hover {
  background-color: var(--emerald-hover);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.42);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: #FFFFFF;
  color: var(--text-main);
  border: 1px solid var(--border-emerald);
}

.btn-outline:hover {
  border-color: var(--emerald-accent);
  color: var(--emerald-accent);
  background-color: var(--emerald-light);
  transform: translateY(-1px);
}

.btn-large {
  padding: 15px 32px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  min-height: 52px;
}

.btn-block {
  width: 100%;
}

/* 子页面规范排版 */
.page-wrapper {
  padding: 60px 0 100px;
  max-width: 900px;
  margin: 0 auto;
}

.page-breadcrumb {
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-muted);
}

.page-breadcrumb a {
  color: var(--emerald-accent);
  font-weight: 700;
}

.page-breadcrumb a:hover {
  text-decoration: underline;
}

.page-header {
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 24px;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 10px;
}

.page-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.article-content {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 44px 38px;
  line-height: 1.85;
  color: var(--text-main);
  box-shadow: var(--shadow-soft);
  position: relative;
}

.article-content h2 {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text-main);
  margin: 36px 0 16px;
  border-left: 4px solid var(--emerald-accent);
  padding-left: 12px;
}

.article-content h2:first-of-type {
  margin-top: 0;
}

.article-content h3 {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 22px 0 12px;
}

.article-content p {
  margin-bottom: 16px;
  font-size: 1rem;
}

.article-content ul, .article-content ol {
  margin: 16px 0 24px 20px;
}

.article-content li {
  margin-bottom: 10px;
}

.notice-box {
  background: var(--emerald-light);
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin: 24px 0;
  color: var(--text-main);
}

.warning-box {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin: 24px 0;
  color: #991B1B;
}

/* 文章内部 FAQ 专属样式 */
.article-faq-section {
  margin: 36px 0 28px;
  border-top: 1px dashed var(--border-soft);
  padding-top: 28px;
}

.article-faq-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.article-faq-item {
  background: var(--bg-card-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: all 0.2s ease;
}

.article-faq-item:hover {
  border-color: var(--border-emerald);
}

.article-faq-q {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.article-faq-q-tag {
  color: var(--emerald-accent);
  font-family: var(--font-mono);
  font-weight: 900;
  flex-shrink: 0;
}

.article-faq-a {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding-left: 24px;
}

/* 延伸推荐内链卡片 */
.related-posts-section {
  margin: 36px 0 20px;
  border-top: 1px solid var(--border-soft);
  padding-top: 28px;
}

.related-posts-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.related-post-card {
  background: var(--bg-card-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.related-post-card:hover {
  border-color: var(--border-emerald);
  transform: translateY(-2px);
}

.related-post-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.45;
}

.related-post-card-title a {
  color: inherit;
}

.related-post-card-title a:hover {
  color: var(--emerald-accent);
}

.related-post-card-desc {
  font-size: 0.84rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* 网站地图网格 */
.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.sitemap-card {
  background: var(--bg-card-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 24px;
}

.sitemap-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 8px;
}

.sitemap-card ul {
  list-style: none;
}

.sitemap-card li {
  margin-bottom: 8px;
}

.sitemap-card a {
  color: var(--emerald-accent);
  font-weight: 700;
}

.sitemap-card a:hover {
  text-decoration: underline;
}

.sitemap-card-full {
  grid-column: span 2;
}

.sitemap-article-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* 页脚 */
.footer {
  margin-top: auto;
  background-color: #FFFFFF;
  border-top: 1px solid var(--border-soft);
  padding: 56px 0 32px;
}

.footer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.footer-link {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 12px;
}

.footer-link:hover {
  color: var(--emerald-accent);
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid var(--border-soft);
  padding-top: 24px;
  color: var(--text-light);
  font-size: 0.86rem;
}

.footer-bottom p {
  margin-bottom: 6px;
}

/* 响应式 */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  .nav-links {
    display: none;
  }
  .footer-nav {
    flex-direction: column;
    gap: 12px;
  }
  .footer-link {
    width: 100%;
    text-align: center;
    background: #F8FCFA;
    padding: 12px;
  }
  .sitemap-grid {
    grid-template-columns: 1fr;
  }
  .sitemap-card-full {
    grid-column: span 1;
  }
  .sitemap-article-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .article-content {
    padding: 24px 18px;
  }
}

/* 减弱动画无障碍支持 */
@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;
  }
  #bg-canvas {
    display: none !important;
  }
}
