/* ============================================================
   自动深色模式（跟随系统 prefers-color-scheme 设置）
   覆盖范围：主站(Bootstrap)、app 子站、chickensoup、
   dispatch/mind、dispatch/act、agreement/help 文档页
   原则：仅覆盖与深色冲突的原版规则，其余靠继承生效
   ============================================================ */

:root {
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  html {
    background-color: #121212;
  }
  body {
    background-color: #121212 !important;
    color: #d4d4d4 !important;
  }

  /* ---------- 全局文本 ----------
     p/li/span 等无显式颜色的元素直接继承 body；
     标题原版为 #333 需覆盖；strong/b 防止链接内加粗文字继承蓝色 */
  h1, h2, h3, h4, h5, h6 {
    color: #ebebeb !important;
  }
  strong, b {
    color: #d4d4d4 !important;
  }
  a {
    color: #8ab4f8 !important;
  }
  a:hover {
    color: #c2d9ff !important;
  }

  /* 原版显式白色、但会被上方 h/a 规则覆盖的元素，保持白色 */
  .intro h1,
  #services h2, #services h3,
  #contact h2, #contact h3,
  .btn-custom, .btn-custom:hover {
    color: #fff !important;
  }

  /* ---------- 导航栏（Bootstrap 主题） ---------- */
  #menu.navbar-default {
    background-color: #1a1a1a !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8) !important;
  }
  #menu a.navbar-brand {
    color: #ebebeb !important;
  }
  #menu.navbar-default .navbar-nav > li > a {
    color: #c6c6c6 !important;
  }
  .navbar-default .navbar-toggle {
    border-color: #5a5a5a !important;
  }
  .navbar-default .navbar-toggle:hover,
  .navbar-default .navbar-toggle:focus {
    background-color: #262626 !important;
  }
  .navbar-default .navbar-toggle .icon-bar {
    background-color: #cfcfcf !important;
  }
  .navbar-default .navbar-toggle:hover > .icon-bar {
    background-color: #5ca9fb !important;
  }
  .navbar-default .navbar-collapse,
  .navbar-default .navbar-form {
    border-color: #333 !important;
  }

  /* ---------- 主站各区块 ---------- */
  #features, #testimonials, #services, #contact {
    background: #1a1a1a !important;
  }
  #features i.fa,
  #services i.fa {
    background: #000 !important;
    border: 1px solid #333;
  }
  #about img {
    background: transparent !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5) !important;
  }
  .intro .overlay {
    background: rgba(0, 0, 0, 0.45) !important;
  }
  .testimonial-meta,
  #footer p {
    color: #9a9a9a !important;
  }
  hr {
    background: linear-gradient(to right, #5ca9fb 0%, #6372ff 100%) !important;
  }

  /* 联系表单输入框（全站唯一的 form-control） */
  #contact .form-control {
    color: #e0e0e0 !important;
    background-color: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
  }
  #contact .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
  }
  #contact .btn-custom {
    background: transparent !important;
    border: 2px solid #fff !important;
  }

  /* ---------- mind 下载页 ---------- */
  .main, .document {
    background: #121212 !important;
  }
  .head {
    background: #1a1a1a !important;
  }
  .appDescription, .footer .copyright {
    color: #9a9a9a !important;
  }

  /* ---------- act 红包页卡片 ---------- */
  .top {
    background: #1e1e1e !important;
  }

  /* ---------- 图片柔化，减少夜间刺眼 ---------- */
  img {
    filter: brightness(0.9);
  }
}
