/* =====================================================================
   盒子增强 Hezi Enhance —— 前端样式
   主题色跟随子比 CSS 变量，自动适配日间/夜间。
   ===================================================================== */
:root {
  --hezienh-mouse: var(--hezi-accent);
  --hezienh-avatar-radius: 12px;
  --hezienh-logo-height: 36px;
  --hezienh-accent: var(--hezi-accent);
  --hezienh-card-bg: var(--main-bg-color, #fff);
  --hezienh-line: rgba(0, 0, 0, .08);
}

/* ---------------- 鼠标指针 ---------------- */
body.hezienh-mouse-none,
body.hezienh-mouse-none * { cursor: none !important; }
/* dot/ring 样式下隐藏原生光标，只保留自定义指针 */
body.hezienh-mouse:not(.hezienh-mouse-none),
body.hezienh-mouse:not(.hezienh-mouse-none) * { cursor: none !important; }
.hezienh-cursor {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 99999;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--hezienh-mouse); transform: translate(-50%, -50%);
  transition: width .15s, height .15s, background .15s; mix-blend-mode: difference;
}
body.hezienh-mouse-ring .hezienh-cursor { background: transparent; border: 2px solid var(--hezienh-mouse); width: 26px; height: 26px; }

/* ---------------- 头像 ---------------- */
body.hezienh-avatar .avatar,
body.hezienh-avatar img.avatar {
  border-radius: var(--hezienh-avatar-radius) !important;
}
body.hezienh-avatar.hezienh-avatar-ring .avatar,
body.hezienh-avatar.hezienh-avatar-ring img.avatar {
  box-shadow: 0 0 0 2px var(--hezienh-accent);
}

/* ---------------- Logo ---------------- */
body.hezienh-logo .logo img,
body.hezienh-logo .navbar-brand img,
body.hezienh-logo .logo a,
body.hezienh-logo .navbar-logo img,
body.hezienh-logo .navbar-logo,
body.hezienh-logo .footer-logo img { height: var(--hezienh-logo-height) !important; width: auto !important; }

/* ---------------- 文章页 ---------------- */
body.hezienh-post-shadow .entry-content img { box-shadow: 0 6px 22px rgba(0,0,0,.08); border-radius: 8px; }
body.hezienh-post pre { position: relative; }
.hezienh-copy {
  position: absolute; top: 8px; right: 8px; z-index: 2; cursor: pointer;
  border: none; border-radius: 6px; padding: 4px 10px; font-size: 12px;
  background: var(--hezienh-accent); color: #fff; opacity: .85;
}
.hezienh-copy:hover { opacity: 1; }

/* ---------------- 评论徽章 ---------------- */
.hezienh-badge {
  display: inline-block; font-size: 11px; line-height: 1; padding: 3px 7px;
  border-radius: 999px; color: #fff; background: var(--hezienh-accent); margin-left: 6px; vertical-align: middle;
}

/* ---------------- 角标 ---------------- */
.thumb, .item-thumb, .posts-list .thumb, .zib-posts .thumb, .article .thumb, .item-thumbnail { position: relative; }
.hezienh-badge-new, .hezienh-badge-hot {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  font-size: 12px; font-weight: 700; color: #fff; padding: 2px 8px; border-radius: 4px;
}
.hezienh-badge-new { background: #2db7f5; }
.hezienh-badge-hot { background: #ff5b4c; left: auto; right: 8px; }

/* ---------------- 转载声明 ---------------- */
.hezienh-reprint {
  margin-top: 28px; padding: 16px 18px; border-left: 3px solid var(--hezienh-accent);
  background: var(--hezienh-card-bg); border-radius: 0 8px 8px 0; font-size: 14px; color: #888;
}

/* ---------------- 小工具通用 ---------------- */
.hezienh-music, .hezienh-ip, .hezienh-countdown, .hezienh-rank, .hezienh-welcome {
  background: var(--hezienh-card-bg); border: 1px solid var(--hezienh-line); border-radius: 10px; padding: 14px;
}
.hezienh-music-audio { width: 100%; margin-bottom: 10px; }
.hezienh-music-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; }
.hezienh-music-list li { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.hezienh-music-list li:hover, .hezienh-music-list li.active { background: rgba(240,68,148,.1); color: var(--hezienh-accent); }

.hezienh-ip { color: #fff; border: none; background: linear-gradient(135deg, var(--hezi-accent), #7b2ff7); }
.hezienh-ip-1 { background: linear-gradient(135deg, var(--hezi-accent), #7b2ff7); }
.hezienh-ip-2 { background: linear-gradient(135deg, #11998e, #38ef7d); }
.hezienh-ip-3 { background: linear-gradient(135deg, #2193b0, #6dd5ed); }
.hezienh-ip-4 { background: linear-gradient(135deg, #f7971e, #ffd200); }
.hezienh-ip-5 { background: linear-gradient(135deg, #fc466b, #3f5efb); }
.hezienh-ip-6 { background: linear-gradient(135deg, #8e2de2, #4a00e0); }
.hezienh-ip-ip { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.hezienh-ip-tip { font-size: 13px; opacity: .9; margin-top: 4px; }

.hezienh-cd-grid { font-size: 18px; font-weight: 700; margin-top: 8px; }
.hezienh-cd-grid span { color: var(--hezienh-accent); }

.hezienh-rank { margin: 0; padding-left: 20px; }
.hezienh-rank li { padding: 5px 0; border-bottom: 1px dashed var(--hezienh-line); }
.hezienh-rank li a:hover { color: var(--hezienh-accent); }

.hezienh-welcome-hi { font-size: 15px; font-weight: 600; }
.hezienh-welcome-stats { display: flex; gap: 14px; margin-top: 10px; font-size: 13px; color: #888; }
.hezienh-welcome-stats b { color: var(--hezienh-accent); font-size: 16px; }

/* ---------------- 夜间模式微调 ---------------- */
body.dark-theme {
  --hezienh-line: rgba(255,255,255,.1);
  --hezienh-card-bg: var(--main-bg-color, #292a2d);
}
body.dark-theme .hezienh-reprint { color: #aaa; }

/* ---------------- 评论夸夸 ---------------- */
.hezienh-praise { margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; background: rgba(240,68,148,.08); color: var(--hezienh-accent); font-size: 14px; }

/* ---------------- 底部欢迎气泡 ---------------- */
.hezienh-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: var(--hezienh-accent); color: #fff; padding: 12px 22px; border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0,0,0,.22); opacity: 0; transition: opacity .35s, transform .35s;
  z-index: 9999; font-size: 14px; max-width: 80vw; text-align: center;
}
.hezienh-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 页面增强短代码 ---------------- */
.hezienh-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.hezienh-site { display: block; padding: 14px 16px; border: 1px solid var(--hezienh-line); border-radius: 10px; background: var(--hezienh-card-bg); text-decoration: none; color: inherit; transition: transform .2s, border-color .2s; }
.hezienh-site:hover { transform: translateY(-2px); border-color: var(--hezienh-accent); }
.hezienh-site-name { font-weight: 600; font-size: 15px; }
.hezienh-site-desc { font-size: 13px; color: #888; margin-top: 4px; }

.hezienh-colorpicker { display: inline-flex; align-items: center; gap: 10px; }
.hezienh-colorpicker input[type=color] { width: 48px; height: 36px; border: none; background: none; cursor: pointer; padding: 0; }
.hezienh-colorpicker span { font-family: monospace; font-size: 14px; padding: 4px 10px; border-radius: 6px; background: var(--hezienh-card-bg); border: 1px solid var(--hezienh-line); }

.hezienh-shuoshuo { display: flex; flex-direction: column; gap: 12px; }
.hezienh-sh-item { padding: 12px 14px; border: 1px solid var(--hezienh-line); border-radius: 10px; background: var(--hezienh-card-bg); }
.hezienh-sh-text { font-size: 15px; line-height: 1.7; }
.hezienh-sh-meta { font-size: 12px; color: #999; margin-top: 6px; }

/* 搜索结果高亮 */
mark { background: #fff3a3; color: inherit; padding: 0 2px; border-radius: 2px; }
body.dark-theme mark { background: #5a4d00; color: #fff; }

/* ---------------- 小工具补全 ---------------- */
.hezienh-scroll { height: 26px; overflow: hidden; font-size: 13px; color: #888; }
.hezienh-scroll-track { animation: hezienh-scroll 12s linear infinite; }
.hezienh-scroll li { height: 26px; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; list-style: none; }
@keyframes hezienh-scroll { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.hezienh-scroll:hover .hezienh-scroll-track { animation-play-state: paused; }

.hezienh-share { display: flex; gap: 8px; flex-wrap: wrap; }
.hezienh-share-btn { display: inline-block; padding: 6px 14px; border-radius: 8px; background: var(--hezienh-accent); color: #fff; font-size: 13px; text-decoration: none; border: none; cursor: pointer; }
.hezienh-share-btn:hover { opacity: .9; }

.hezienh-imgcol { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.hezienh-imgcol-item { display: block; text-decoration: none; color: inherit; }
.hezienh-imgcol-item img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; display: block; transition: transform .2s; }
.hezienh-imgcol-item:hover img { transform: scale(1.04); }
.hezienh-imgcol-item span { display: block; font-size: 12px; text-align: center; margin-top: 4px; color: #888; }

.hezienh-infostat { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; color: #888; }
.hezienh-infostat b { color: var(--hezienh-accent); font-size: 18px; margin-right: 4px; }

.hezienh-ad img { max-width: 100%; height: auto; border-radius: 8px; }

.hezienh-welcome-weather { display: inline-block; margin-left: 6px; font-size: 13px; color: var(--hezienh-accent); }
