@charset "utf-8";

html.theme-dark {
  color-scheme: dark;
}

html.theme-dark body {
  --jx-bg: #0f1419;
  --jx-surface: #161b22;
  --jx-text: #e6edf3;
  --jx-muted: #8b949e;
  --jx-border: #30363d;
  --jx-blue: #58a6ff;
  --jx-blue-dim: #388bfd;
  --jx-green: #3fb950;
  --jx-orange: #ffa657;
  --jx-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html.theme-dark .jx-header {
  background: rgba(22, 27, 34, 0.92);
  border-bottom-color: var(--jx-border);
}

html.theme-dark .jx-search {
  background: #0d1117;
  border-color: var(--jx-border);
}

/* 修复 style.css 中 jxu-style-mist/future 亮底在夜间继续命中 */
html.theme-dark.jxu-style-mist body,
html.theme-dark.jxu-style-future body {
  background: var(--jxu-page-bg, var(--jx-bg)) !important;
}

html.theme-dark.jxu-style-mist .jx-single-body,
html.theme-dark.jxu-style-future .jx-single-body,
html.theme-dark.jxu-style-mist .jx-card,
html.theme-dark.jxu-style-future .jx-card,
html.theme-dark.jxu-style-mist .jxu-card,
html.theme-dark.jxu-style-future .jxu-card,
html.theme-dark.jxu-style-mist .jx-sidebar .function,
html.theme-dark.jxu-style-future .jx-sidebar .function {
  background: var(--jxu-panel-bg, var(--jx-surface)) !important;
  border-color: var(--jxu-panel-border, var(--jx-border)) !important;
}

/* 文章/独立页正文内手写 HTML：夜间压平白底块、统一正文色与描边（内联 background 无 !important 时可被覆盖） */
html.theme-dark .jx-single-body .jx-content {
  color: var(--jx-text);
}

html.theme-dark .jx-single-body .jx-content :where(
  div,
  section,
  article,
  aside,
  header,
  footer,
  nav,
  figure,
  figcaption,
  blockquote,
  table,
  thead,
  tbody,
  tfoot,
  tr,
  th,
  td,
  ul,
  ol,
  li,
  dl,
  dt,
  dd,
  details,
  summary,
  p
) {
  background-color: transparent !important;
  background-image: none !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

/* 剑侠 ai.html 类整页 article：去掉外层渐变卡片投影，改由 .jx-single-body 承担面板 */
html.theme-dark .jx-single-body .jx-content article {
  box-shadow: none !important;
  color: var(--jx-text) !important;
}

/* 内联「使用须知」条：左侧强调线 + 暗底（对应 background:#eef2ff;border-left:4px solid #6366f1） */
html.theme-dark .jx-single-body .jx-content p[style*="border-left"] {
  background: rgba(30, 41, 59, 0.72) !important;
  background-image: none !important;
  color: var(--jx-text) !important;
  border-left-color: var(--jx-blue) !important;
  border-top-color: transparent !important;
  border-right-color: transparent !important;
  border-bottom-color: transparent !important;
}

html.theme-dark .jx-single-body .jx-content :where(h1, h2, h3, h4, h5, h6) {
  color: var(--jx-text) !important;
}

html.theme-dark .jx-single-body .jx-content :where(p, li, td, th, dd, dt, label) {
  color: var(--jx-text) !important;
}

html.theme-dark .jx-single-body .jx-content figcaption {
  color: var(--jx-muted) !important;
}

html.theme-dark .jx-single-body .jx-content blockquote {
  background: rgba(30, 41, 59, 0.55) !important;
  border-left: 4px solid var(--jx-blue) !important;
  border-top-color: rgba(148, 163, 184, 0.22) !important;
  border-right-color: rgba(148, 163, 184, 0.22) !important;
  border-bottom-color: rgba(148, 163, 184, 0.22) !important;
  color: var(--jx-text) !important;
}

html.theme-dark .jx-single-body .jx-content a {
  color: var(--jx-blue);
}

html.theme-dark .jx-single-body .jx-content hr {
  border-color: var(--jx-border) !important;
  background-color: var(--jx-border) !important;
}

html.theme-dark .jx-single-body .jx-content input,
html.theme-dark .jx-single-body .jx-content textarea,
html.theme-dark .jx-single-body .jx-content select,
html.theme-dark .jx-single-body .jx-content button {
  background-color: rgba(13, 17, 23, 0.96) !important;
  color: var(--jx-text) !important;
  border-color: var(--jx-border) !important;
}

html.theme-dark .jx-single-body .jx-content pre {
  background: rgba(1, 4, 9, 0.78) !important;
  background-image: none !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
}

html.theme-dark .jx-single-body .jx-content :not(pre) > code {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
}

html.theme-dark .jx-single-body .jx-content pre code {
  background: transparent !important;
  border: 0 !important;
  color: inherit !important;
}

html.theme-dark .jx-search input[type="text"] {
  color: var(--jx-text);
}

html.theme-dark .jx-theme-toggle,
html.theme-dark .jx-nav-toggle {
  background: #161b22;
  border-color: var(--jx-border);
  color: var(--jx-text);
}

html.theme-dark .jx-nav li ul {
  background: #161b22;
  border-color: var(--jx-border);
}

html.theme-dark .jx-nav.is-open li ul {
  background: rgba(88, 166, 255, 0.08);
}

html.theme-dark .jxu-hero__input {
  background: rgba(30, 30, 30, 0.9);
  color: #e6edf3;
  border-color: rgba(255, 255, 255, 0.12);
}

html.theme-dark .jxu-suggest a {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.theme-dark .jxu-dlbox__meta {
  color: #94a3b8;
}

html.theme-dark .jx-footer {
  background: #0d1117;
  border-top-color: var(--jx-border);
}

html.theme-dark .jx-footer.jx-footer--hero {
  background-color: #0b1018;
  border-top-color: transparent;
}
html.theme-dark .jx-footer.jx-footer--hero::before {
  background: linear-gradient(180deg, rgba(3, 6, 12, 0.82), rgba(3, 6, 12, 0.92));
}
html.theme-dark .jx-footer.jx-footer--hero.jx-footer--bg-image::before {
  background: linear-gradient(180deg, rgba(3, 6, 12, 0.5), rgba(3, 6, 12, 0.76));
}
html.theme-dark .jx-footer.jx-footer--hero .jx-footer-title {
  color: #ffffff !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), 0 6px 18px rgba(0, 0, 0, 0.34);
}

html.theme-dark .jx-footer-friend {
  --jx-fl-chip-bg: linear-gradient(180deg, rgba(30, 58, 138, 0.46), rgba(30, 64, 175, 0.36));
  --jx-fl-chip-border: rgba(125, 177, 255, 0.58);
  --jx-fl-chip-shadow: 0 6px 14px rgba(15, 23, 42, 0.3);
  --jx-fl-chip-border-hover: rgba(186, 230, 253, 0.95);
  --jx-fl-chip-shadow-hover: 0 8px 16px rgba(37, 99, 235, 0.28);
  border-color: rgba(96, 165, 250, 0.28);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.66), rgba(15, 23, 42, 0.4));
}

html.theme-dark .jx-footer-friend__item {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(96, 165, 250, 0.44);
  color: #f8fafc !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.34);
}

html.theme-dark .jx-footer-friend__title {
  color: var(--jx-footer-friend-title-color, #ffffff) !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.24), 0 0 12px rgba(96, 165, 250, 0.45), 0 8px 20px rgba(0, 0, 0, 0.36);
}

html.theme-dark .jx-card-media {
  background: linear-gradient(135deg, #0d1117, #21262d);
}

html.theme-dark .jx-pagebar a,
html.theme-dark .jx-pagebar span {
  background: #161b22;
  border-color: var(--jx-border);
  color: var(--jx-text);
}

html.theme-dark mark {
  background: rgba(187, 128, 9, 0.45);
  color: var(--jx-text);
}

/* 默认风格 + 夜间：评论区统一深色，避免白底残留 */
html.theme-dark .jx-comments,
html.theme-dark .jx-comment,
html.theme-dark .jx-commentpost,
html.theme-dark .jx-comment-pickerpanel,
html.theme-dark .jx-comment-replybox,
html.theme-dark .jx-commentpost__submit-row,
html.theme-dark .jx-commentlist__head {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(20, 30, 52, 0.9));
  border-color: #2a3a57;
  color: #e2e8f0;
}

html.theme-dark .jx-commentpost__title,
html.theme-dark .jx-commentlist__title,
html.theme-dark .jx-comment__name a,
html.theme-dark .jx-commentlist__count strong {
  color: #f8fafc;
}

html.theme-dark .jx-comment__meta,
html.theme-dark .jx-commentlist__count,
html.theme-dark .jx-commentlist__empty,
html.theme-dark .jx-commentpost__guest {
  color: #9fb0ce;
}

html.theme-dark .jx-commentpost__input,
html.theme-dark .jx-commentpost__textarea,
html.theme-dark .jx-comment-replybox__textarea,
html.theme-dark .jx-comment-captcha__input {
  background: rgba(15, 23, 42, 0.78);
  border-color: #4b5f7d;
  color: #e2e8f0;
}

html.theme-dark .jx-commentpost__input::placeholder,
html.theme-dark .jx-commentpost__textarea::placeholder,
html.theme-dark .jx-comment-replybox__textarea::placeholder {
  color: #7f94b2;
}

html.theme-dark .jx-commentpost__submit,
html.theme-dark .jx-commentlist__sort-btn,
html.theme-dark .jx-comment-replybox__cancel,
html.theme-dark .jx-comment-pickerbar__toggle,
html.theme-dark .jx-comment-quick__btn,
html.theme-dark .jx-comment-emoji__btn {
  background: rgba(15, 23, 42, 0.86);
  border-color: #4b5f7d;
  color: #e2e8f0;
}

html.theme-dark .jx-commentpost__submit:hover,
html.theme-dark .jx-commentlist__sort-btn:hover,
html.theme-dark .jx-comment-replybox__cancel:hover,
html.theme-dark .jx-comment-pickerbar__toggle:hover,
html.theme-dark .jx-comment-quick__btn:hover,
html.theme-dark .jx-comment-emoji__btn:hover {
  background: rgba(30, 58, 138, 0.34);
  border-color: #7fb0ff;
  color: #ffffff;
}

html.theme-dark .jx-commentlist__sort-btn.is-active {
  background: rgba(30, 58, 138, 0.4);
  border-color: #60a5fa;
  color: #f1f5ff;
}

/* 右侧模块夜间高亮：标题/正文/链接在暗底可读 */
html.theme-dark .jx-sidebar .function_t,
html.theme-dark .jx-sidebar .function_t.function_t--embed,
html.theme-dark .jx-sidebar .function_c > .function_t--embed {
  color: #e5edff !important;
}

html.theme-dark .jx-sidebar .function_c,
html.theme-dark .jx-sidebar .function_c li,
html.theme-dark .jx-sidebar .function_c p,
html.theme-dark .jx-sidebar .function_c span {
  color: #c8d7ef !important;
}

html.theme-dark .jx-sidebar .function_c a {
  color: #dbeafe !important;
}

html.theme-dark #mobile-sidebar .sidebar-menu .function_t,
html.theme-dark #mobile-sidebar .sidebar-menu .function_t.function_t--embed,
html.theme-dark #mobile-sidebar .sidebar-menu .function_c > .function_t--embed {
  color: #e5edff !important;
}

html.theme-dark #mobile-sidebar .sidebar-menu .function_c,
html.theme-dark #mobile-sidebar .sidebar-menu .function_c li,
html.theme-dark #mobile-sidebar .sidebar-menu .function_c p,
html.theme-dark #mobile-sidebar .sidebar-menu .function_c span {
  color: #c8d7ef !important;
}

html.theme-dark #mobile-sidebar .sidebar-menu .function_c a {
  color: #dbeafe !important;
}

/* 风格切换 + 夜间模式并用时，保证按钮/模块文字可见 */
html.theme-dark.jxu-style-mist .jx-sidebar .function_t,
html.theme-dark.jxu-style-future .jx-sidebar .function_t,
html.theme-dark.jxu-style-mist .jx-sidebar .function_t.function_t--embed,
html.theme-dark.jxu-style-future .jx-sidebar .function_t.function_t--embed {
  color: var(--jxu-module-title-text, #dbeafe);
}

html.theme-dark.jxu-style-mist .jx-sidebar .function_c,
html.theme-dark.jxu-style-future .jx-sidebar .function_c,
html.theme-dark.jxu-style-mist .jx-sidebar .function_c a,
html.theme-dark.jxu-style-future .jx-sidebar .function_c a {
  color: var(--jxu-module-text, #e2e8f0);
}

html.theme-dark.jxu-style-mist .jx-theme-toggle,
html.theme-dark.jxu-style-future .jx-theme-toggle,
html.theme-dark.jxu-style-mist .jx-style-toggle,
html.theme-dark.jxu-style-future .jx-style-toggle,
html.theme-dark.jxu-style-mist .jx-fx-toggle,
html.theme-dark.jxu-style-future .jx-fx-toggle,
html.theme-dark.jxu-style-mist .jx-music-toggle,
html.theme-dark.jxu-style-future .jx-music-toggle,
html.theme-dark.jxu-style-mist .jxu-home-viewbar__btn,
html.theme-dark.jxu-style-future .jxu-home-viewbar__btn,
html.theme-dark.jxu-style-mist .jx-cat-toolbar__a,
html.theme-dark.jxu-style-future .jx-cat-toolbar__a,
html.theme-dark.jxu-style-mist .jx-cat-toolbar__sorta,
html.theme-dark.jxu-style-future .jx-cat-toolbar__sorta {
  color: var(--jxu-action-text, #e2e8f0);
}

html.theme-dark.jxu-style-mist .jxu-home-viewbar__btn.is-active,
html.theme-dark.jxu-style-future .jxu-home-viewbar__btn.is-active,
html.theme-dark.jxu-style-mist .jx-cat-toolbar__a.is-current,
html.theme-dark.jxu-style-future .jx-cat-toolbar__a.is-current,
html.theme-dark.jxu-style-mist .jx-cat-toolbar__sorta.is-current,
html.theme-dark.jxu-style-future .jx-cat-toolbar__sorta.is-current {
  color: var(--jxu-chip-active-text, #f1f5ff);
}

/* z_hide 插件（登录/评论可见）夜间适配：覆盖插件内联浅色样式 */
html.theme-dark .jx-single-body .z-hideLoad,
html.theme-dark .jx-single-body div[style*="background-color:#fffffa"],
html.theme-dark .jx-single-body div[style*="background-color:#f9f9f9"],
html.theme-dark .jx-single-body div[style*="background-color:#FFF4FF"] {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(20, 30, 52, 0.9)) !important;
  border-color: rgba(96, 165, 250, 0.45) !important;
  color: #dbeafe !important;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.24);
}

html.theme-dark .jx-single-body .z-hideLoad span,
html.theme-dark .jx-single-body .z-hideLoad p,
html.theme-dark .jx-single-body div[style*="background-color:#fffffa"] span,
html.theme-dark .jx-single-body div[style*="background-color:#f9f9f9"] span,
html.theme-dark .jx-single-body div[style*="background-color:#FFF4FF"] span,
html.theme-dark .jx-single-body div[style*="background-color:#fffffa"] p,
html.theme-dark .jx-single-body div[style*="background-color:#f9f9f9"] p,
html.theme-dark .jx-single-body div[style*="background-color:#FFF4FF"] p {
  color: #dbeafe !important;
}

html.theme-dark .jx-single-body .z-hideLoad a,
html.theme-dark .jx-single-body div[style*="background-color:#fffffa"] a,
html.theme-dark .jx-single-body div[style*="background-color:#f9f9f9"] a,
html.theme-dark .jx-single-body div[style*="background-color:#FFF4FF"] a {
  color: #7dd3fc !important;
  text-decoration-color: rgba(125, 211, 252, 0.6) !important;
}

/* 评论提交按钮：夜间高亮 + 若隐若现呼吸感 */
html.theme-dark .jx-commentpost__submit {
  background: linear-gradient(180deg, rgba(30, 58, 138, 0.42), rgba(37, 99, 235, 0.34)) !important;
  border-color: rgba(125, 211, 252, 0.72) !important;
  color: #f8fbff !important;
  box-shadow:
    0 0 0 1px rgba(147, 197, 253, 0.26) inset,
    0 8px 18px rgba(30, 64, 175, 0.36);
  animation: jxCommentSubmitBreath 2.8s ease-in-out infinite;
}

html.theme-dark .jx-commentpost__submit:hover {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.56), rgba(59, 130, 246, 0.42)) !important;
  border-color: rgba(186, 230, 253, 0.9) !important;
  box-shadow:
    0 0 0 1px rgba(186, 230, 253, 0.35) inset,
    0 10px 24px rgba(37, 99, 235, 0.45);
}

@keyframes jxCommentSubmitBreath {
  0%, 100% {
    filter: brightness(1);
    box-shadow:
      0 0 0 1px rgba(147, 197, 253, 0.2) inset,
      0 8px 18px rgba(30, 64, 175, 0.26);
  }
  50% {
    filter: brightness(1.08);
    box-shadow:
      0 0 0 1px rgba(186, 230, 253, 0.34) inset,
      0 0 18px rgba(59, 130, 246, 0.32),
      0 10px 22px rgba(37, 99, 235, 0.42);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.theme-dark .jx-commentpost__submit {
    animation: none !important;
    transition: none !important;
    filter: none !important;
  }
}
