/* ============================================================
   RJTT 站点美化 v1.1.0  (子比/zibll 主题独立增强)
   所有颜色走主题变量 --theme-color / --focus-color，
   跟随后台「全局主题配色」自动同步，主题更新不影响本文件。
   ============================================================ */

:root {
  --rjtt-accent: #ff7a45;            /* 暖橙点缀，用作渐变收尾 */
  --rjtt-radius: 12px;
  --rjtt-shadow: 0 6px 20px rgba(0, 0, 0, .08);
  --rjtt-shadow-hover: 0 12px 30px rgba(0, 0, 0, .12);
}

/* ---------- 1. 卡片 / 盒子：统一圆角 + 柔和阴影 ---------- */
.theme-box,
.box,
.card,
.posts-item,
.main-bg,
.forum-list,
.list-inline .item {
  border-radius: var(--rjtt-radius) !important;
  box-shadow: var(--rjtt-shadow);
  overflow: hidden;
  transition: box-shadow .25s ease, transform .25s ease;
}
.theme-box:hover,
.box:hover,
.posts-item:hover {
  box-shadow: var(--rjtt-shadow-hover);
  transform: translateY(-3px);
}

/* ---------- 2. 缩略图：圆角 + 悬浮放大 ---------- */
.item-thumbnail,
.posts-item .item-thumbnail img,
.thumb,
.article-thumb {
  border-radius: var(--rjtt-radius) var(--rjtt-radius) 0 0;
  overflow: hidden;
}
.posts-item .item-thumbnail img,
.item-thumbnail img {
  transition: transform .4s ease;
}
.posts-item:hover .item-thumbnail img,
.item-thumbnail:hover img {
  transform: scale(1.06);
}

/* ---------- 3. 顶部导航：毛玻璃 + 固定阴影 ---------- */
@media (min-width: 769px) {
  .navbar,
  .header .navbar {
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    background-color: rgba(255, 255, 255, .82) !important;
    box-shadow: 0 2px 18px rgba(0, 0, 0, .06);
  }
  .navbar.navbar-fixed-top,
  body.navbar-fixed .navbar {
    box-shadow: 0 4px 22px rgba(0, 0, 0, .08);
  }
}
/* 菜单项 hover / 当前项高亮为主题色 */
.navbar .menu-item > a:hover,
.navbar .current-menu-item > a,
.navbar .current-menu-ancestor > a {
  color: var(--theme-color) !important;
}
/* 菜单项底部小横条统一主题色 */
.navbar .menu-item > a:after {
  background: var(--theme-color) !important;
}

/* ---------- 4. 按钮：hover 上浮 + 阴影 ---------- */
.btn,
.theme-btn,
.button,
.go-to-comments,
.actions .action {
  border-radius: 8px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover,
.theme-btn:hover,
.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--rjtt-shadow);
}

/* ---------- 5. 悬浮按钮：主题色→暖橙渐变、圆角、hover 放大 ---------- */
.float-btn,
.fixed-box .float-btn,
.go-top {
  border-radius: 14px !important;
  background: linear-gradient(135deg, var(--theme-color), var(--rjtt-accent)) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  transition: transform .25s ease, box-shadow .25s ease;
}
.float-btn:hover,
.go-top:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
}

/* ---------- 6. 文章彩色标签（发文后自动生效） ---------- */
.article-tags a,
.post-tags a {
  padding: 4px 11px;
  border-radius: 20px;
  color: #fff !important;
  font-size: 12px;
  font-weight: 400;
  margin: 0 6px 6px 0;
  display: inline-block;
  transition: transform .2s ease, opacity .2s ease;
}
.article-tags a:hover,
.post-tags a:hover {
  transform: translateY(-2px);
  opacity: .9;
}
.article-tags a:nth-child(5n+1),
.post-tags a:nth-child(5n+1) { background: #ff5e5c; }
.article-tags a:nth-child(5n+2),
.post-tags a:nth-child(5n+2) { background: #ffbb50; }
.article-tags a:nth-child(5n+3),
.post-tags a:nth-child(5n+3) { background: #1ac756; }
.article-tags a:nth-child(5n+4),
.post-tags a:nth-child(5n+4) { background: #19b5fe; }
.article-tags a:nth-child(5n),
.post-tags a:nth-child(5n)   { background: #9b6bff; }

/* ---------- 7. 细节：平滑滚动、选中色、滚动条、图片/头像 --------- */
html { scroll-behavior: smooth; }
::selection { background: var(--theme-color); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .18);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--theme-color); }
.article-content img,
.post-content img { border-radius: 8px; }
.avatar,
.author-avatar img { border-radius: 50%; }

/* ---------- 8. 阅读进度条（beautify.js 注入容器） ---------- */
#rjtt-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  z-index: 99999;
  background: linear-gradient(90deg, var(--theme-color), var(--rjtt-accent));
  box-shadow: 0 0 8px rgba(0, 0, 0, .15);
  transition: width .08s linear;
}

/* ---------- 9. Logo 扫光（来自子比美化社区教程，夫子猫） ---------- */
.navbar-brand {
  position: relative;
  overflow: hidden;
}
.navbar-brand:before {
  content: "";
  position: absolute;
  left: -160px; top: -40px;
  width: 90px; height: 140px;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .75), transparent);
  transform: rotate(-25deg);
  animation: rjtt-searchlight 5.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes rjtt-searchlight {
  0%   { left: -160px; top: -40px; }
  55%  { left: 130px;  top: 100px; }
  100% { left: -160px; top: -40px; }
}

/* ---------- 10. 文章页排版精修 ---------- */
.article-content,
.post-content,
.entry-content {
  font-size: 16px;
  line-height: 1.9;
  color: #2b2b2b;
  word-break: break-word;
}
.article-content p,
.post-content p,
.entry-content p {
  margin: 0 0 1.2em;
}
.article-content h2,
.post-content h2,
.entry-content h2,
.article-content h3,
.post-content h3,
.entry-content h3 {
  margin: 1.6em 0 .8em;
  font-weight: 700;
  line-height: 1.4;
}
.article-content h2,
.post-content h2,
.entry-content h2 {
  padding-left: 14px;
  border-left: 4px solid var(--theme-color);
}
/* 首段首字下沉，提升阅读质感 */
.article-content > p:first-of-type:first-letter,
.post-content > p:first-of-type:first-letter {
  font-size: 3.2em;
  font-weight: 700;
  float: left;
  line-height: 1;
  margin: 6px 10px 0 0;
  color: var(--theme-color);
}
/* 引用块 */
.article-content blockquote,
.post-content blockquote,
.entry-content blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  border-left: 4px solid var(--theme-color);
  background: rgba(0, 0, 0, .035);
  border-radius: 0 8px 8px 0;
  color: #555;
}
/* 代码块 */
.article-content pre,
.post-content pre,
.entry-content pre {
  border-radius: 8px;
  padding: 16px;
  background: #282c34;
  color: #abb2bf;
  overflow: auto;
}
.article-content code,
.post-content code,
.entry-content code {
  background: rgba(0, 0, 0, .05);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .92em;
}

/* ---------- 11. 页脚分隔线 ---------- */
.footer,
.site-footer {
  border-top: 1px solid rgba(0, 0, 0, .06);
}

/* ---------- 暗色模式适配 ---------- */
body.dark-mode #rjtt-progress,
body.theme-dark #rjtt-progress {
  box-shadow: 0 0 8px rgba(255, 255, 255, .2);
}
body.dark-mode .navbar,
body.theme-dark .navbar {
  background-color: rgba(20, 20, 22, .82) !important;
}
body.dark-mode .article-content,
body.dark-mode .post-content,
body.theme-dark .article-content {
  color: #d8d8d8;
}
body.dark-mode .article-content blockquote,
body.dark-mode .post-content blockquote {
  background: rgba(255, 255, 255, .06);
  color: #bbb;
}
