/* =============================================================================
   杨梅AI百科网 · 色彩令牌层 (design-ambience.css)
   -----------------------------------------------------------------------------
   红黑高级暗色风格：低饱和酒红为主色，低饱和钢蓝仅作微小辅助。
   不改动布局、动画、交互逻辑。
   ============================================================================= */

:root {
  /* —— 主强调色：低饱和酒红/暗红 —— */
  --color-primary: #8B1A2B;
  --color-primary-light: #A52538;
  --color-primary-dark: #6E1422;
  --color-primary-bg: rgba(139, 26, 43, 0.08);
  --color-on-primary: #FFFFFF;
  --color-info-bg: rgba(139, 26, 43, 0.08);
  --color-info-text: #8B1A2B;

  /* —— 辅助蓝：低饱和钢蓝，仅微小点缀 —— */
  --color-accent-blue: #5B7FA5;
  --color-accent-blue-bg: rgba(91, 127, 165, 0.08);
}

[data-theme="dark"] {
  --color-primary: #C4304A;
  --color-primary-light: #D94A60;
  --color-primary-dark: #9B2438;
  --color-primary-bg: rgba(196, 48, 74, 0.14);
  --color-info-bg: rgba(196, 48, 74, 0.14);
  --color-info-text: #D94A60;

  --color-accent-blue: #7A9CC4;
  --color-accent-blue-bg: rgba(122, 156, 196, 0.10);
}

/* ========================================================================== */
/* 导航 Logo：全站 Y 图形强制翻白（含学习模块子页面）                          */
/* ========================================================================== */
.navbar-logo-img,
img.navbar-logo-img,
a.navbar-logo img,
img[src*="brand-logo-transparent"] {
  filter: brightness(0) invert(1) !important;
}

/* ========================================================================== */
/* 首页排版统一：标题居中、卡片文字左对齐、行高一致                              */
/* ========================================================================== */
.section-title, .brand-strip-text {
  text-align: center !important;
  line-height: 1.4 !important;
  letter-spacing: 0.02em;
}
.section-subtitle, .brand-strip-en {
  text-align: center !important;
  line-height: 1.5 !important;
}
.wiki-card, .pick-card, .entry-card {
  text-align: left !important;
  line-height: 1.6 !important;
}
.wiki-title, .pick-title, .card-title {
  line-height: 1.35 !important;
  margin-bottom: 6px;
}
.wiki-desc, .pick-desc, .card-desc {
  line-height: 1.65 !important;
  word-break: break-word;
}
/* 模块间距统一 */
.section-block, .home-section {
  margin-bottom: 48px !important;
}
/* 中英文间距：在英文与中文之间自动加间距 */
body {
  word-break: normal;
  overflow-wrap: break-word;
}

/* 今日精选知识卡片：加大内边距，文字不贴边 */
.pick-card {
  padding: 28px !important;
}
.pick-title {
  margin-bottom: 10px !important;
}
.pick-desc {
  margin-bottom: 4px !important;
}
/* 模块容器统一最大宽度与居中 */
.picks-section, .latest-section, .wiki-section {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* 今日精选知识：section-header 全部居中（桌面/移动双端强制） */
.home-picks .section-header,
.home-picks .section-title,
.home-picks .section-subtitle,
section.home-picks .section-header > * {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.home-picks .section-subtitle {
  margin-top: 8px !important;
  margin-bottom: 20px !important;
  line-height: 1.6 !important;
  max-width: 100% !important;
}

/* 首页全部模块 header 统一居中（今日翻到的/百科板块/最新收录/今日精选知识） */
.section.home-picks .section-header,
.section.home-wiki .section-header,
.section.home-latest .section-header,
.section.home-roam .section-header,
section .section-header,
section .section-title,
section .section-subtitle,
section .section-header > * {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
section .section-subtitle {
  margin-top: 8px !important;
  margin-bottom: 20px !important;
  line-height: 1.6 !important;
  max-width: 100% !important;
}

/* 侧边目录 TOC：全部文字靠左对齐，保留层级缩进 */
.toc, .table-of-contents, .article-toc, .sidebar-toc, .se-toc,
.toc ul, .toc ol, .table-of-contents ul, .article-toc ul,
.se-toc ul, .se-toc-item, .se-toc a, .toc a {
  text-align: left !important;
}
/* TOC 缩进收敛：一级条目贴左，二级保留小缩进区分层级 */
.se-toc { padding: 12px 10px !important; }
.se-toc-item { padding: 6px 6px !important; }
.se-toc-item.sub { padding-left: 16px !important; }
.toc a, .table-of-contents a, .article-toc a { padding: 4px 6px !important; }
.toc ul ul a, .table-of-contents ul ul a { padding-left: 18px !important; }

/* 全局隐藏浮动"我的"胶囊按钮（统一由导航"我的收藏"入口） */
.float-user-btn, .floating-my-btn, .floating-my, .ach-float-btn, #floatingMyBtn {
  display: none !important;
}

/* 学习中心 移动端按钮竖排 */
@media (max-width: 640px) {
  .lq-fun-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
}
/* 相关知识卡片箭头浅色模式可见 */
.lm-card::after { color: var(--color-primary, #C4304A) !important; }
/* 课程子页 TOC 占位 */
.lm-toc {
  position: fixed; right: 24px; top: 50%; transform: translateY(-50%);
  width: 180px; max-height: 60vh; overflow-y: auto;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 10px; padding: 12px; z-index: 90; font-size: 12px;
}
.lm-toc a { display: block; padding: 4px 6px; color: var(--color-text-muted); text-decoration: none; border-radius: 4px; }
.lm-toc a:hover, .lm-toc a.active { color: var(--color-primary); background: rgba(196,48,74,.08); }
@media (max-width: 1200px) { .lm-toc { display: none; } }
/* footer 移动端两列 */
@media (max-width: 640px) {
  footer .footer-links, footer .footer-cols {
    grid-template-columns: repeat(2, 1fr) !important;
    display: grid !important;
    gap: 8px 16px !important;
  }
}
