/* =============================================
   小溪的博客 — 精致化增强 v1.0
   在 main.css 基础上做增量打磨,不改动原规则
   ============================================= */

/* ── 全局微调 ── */
::selection { background: rgba(59,130,246,.22); }

/* 自定义滚动条 (Webkit) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Header 增强:更深的毛玻璃与阴影 ── */
.header {
  box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 8px 24px -12px rgba(0,0,0,.08);
}
body.dark .header {
  box-shadow: 0 1px 0 rgba(0,0,0,.2), 0 8px 24px -12px rgba(0,0,0,.4);
}
.header-inner { position: relative; }

/* logo 悬停微动 */
.logo { transition: transform .2s ease; }
.logo:hover { transform: translateY(-1px); }

/* 导航链接:下划线动效 */
.nav-links a { position: relative; }
.nav-links a:not(.active)::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px;
  height: 2px; border-radius: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .22s ease;
}
.nav-links a:not(.active):hover::after { transform: scaleX(1); }

/* ── 文章卡片:更细腻的 hover ── */
.post-item {
  position: relative;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.post-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  opacity: 0; transition: opacity .25s ease;
}
.post-item:hover::before { opacity: 1; }
.post-item:hover { transform: translateY(-3px); }

/* 标题 hover 色彩过渡更顺滑 */
.post-title a { transition: color .2s ease; }

/* 阅读更多:箭头微移 */
.read-more i { transition: transform .2s ease; }
.read-more:hover i { transform: translateX(3px); }

/* ── 按钮按压反馈 ── */
.btn, .btn-submit, .cf-submit, .slot-btn, .story-refresh, .nav-btn {
  -webkit-tap-highlight-color: transparent;
}
.btn:active, .btn-submit:active, .cf-submit:active, .slot-btn:active {
  transform: scale(.96);
}
.btn { transition: transform .15s ease, background .2s, color .2s, border-color .2s; }

/* ── 侧边栏卡片 ── */
.s-card { transition: box-shadow .25s ease, transform .25s ease; }
.s-card:hover { transform: translateY(-2px); }
.s-list li { transition: padding-left .2s ease; }
.s-list li:hover { padding-left: 20px; }
.s-list li a { transition: color .2s ease; }

/* 作者头像悬停微放大 */
.avatar { transition: transform .3s ease, box-shadow .3s ease; }
.author-card:hover .avatar { transform: scale(1.08); box-shadow: 0 4px 14px rgba(0,0,0,.16); }

/* ── 文章正文细节 ── */
.post-body a { text-decoration: none; border-bottom: 1px solid rgba(59,130,246,.35); transition: border-color .2s; }
.post-body a:hover { border-color: var(--accent); }
.post-body img { box-shadow: 0 2px 12px rgba(0,0,0,.06); }

/* 正文段落首行阅读优化 */
.post-body p { text-align: justify; }

/* ── 页面元素淡入 (仅非动画敏感页) ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.post-item, .post-full, .comments-section, .s-card {
  animation: fadeUp .4s ease both;
}
.post-item:nth-child(2) { animation-delay: .04s; }
.post-item:nth-child(3) { animation-delay: .08s; }
.post-item:nth-child(4) { animation-delay: .12s; }
.post-item:nth-child(5) { animation-delay: .16s; }

/* 考试页/菜单页禁用列表动画(避免抖动) */
body.exam-page .post-item, body.no-sidebar .post-item,
body.exam-page .s-card, body.no-sidebar .s-card { animation: none; }

/* ── 评论区 ── */
.comments-title { position: relative; display: inline-block; }
.comment-avatar { transition: transform .2s ease; }
.comment-item:hover .comment-avatar { transform: scale(1.06); }

/* ── 移动端增强 ── */
@media (max-width: 768px) {
  .post-item:hover { transform: none; }
  .post-item::before { display: none; }
  .post-item:active { transform: scale(.99); }
  .s-card:hover { transform: none; }
  .s-list li:hover { padding-left: 16px; }
}

/* 尊重系统减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Vue 增量组件:回到顶部 ── */
.vtop-btn {
  position: fixed; right: 20px; bottom: 84px; z-index: 300;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; box-shadow: 0 4px 16px rgba(59,130,246,.35);
  transition: background .2s, transform .2s;
}
.vtop-btn:hover { background: var(--accent-h); transform: translateY(-2px); }
.vtop-btn:active { transform: scale(.94); }
.vtop-fade-enter-active, .vtop-fade-leave-active { transition: opacity .25s, transform .25s; }
.vtop-fade-enter-from, .vtop-fade-leave-to { opacity: 0; transform: translateY(10px); }

@media (max-width: 768px) {
  .vtop-btn { bottom: 76px; right: 16px; width: 42px; height: 42px; }
}

/* ── Vue 增量组件:搜索建议下拉 ── */
.ss-dropdown {
  position: fixed; z-index: 400;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.12);
  overflow: hidden; padding: 4px;
}
.ss-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-radius: 7px; color: var(--text);
  font-size: 13px; cursor: pointer; transition: background .15s;
}
.ss-item:hover, .ss-item.active { background: var(--bg); }
.ss-title {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ss-date { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
body.dark .ss-dropdown { box-shadow: 0 8px 30px rgba(0,0,0,.4); }
