/* ==========================================================================
   HT-社区主题 内容增强样式（阅读进度/相关推荐/热门排行/回到顶部）
   ========================================================================== */

/* ---------- 阅读进度条 ---------- */
.ht-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ht-primary), #764ba2);
    z-index: 9999;
    width: 0;
    transition: width .1s linear;
    box-shadow: 0 0 8px rgba(99, 102, 241, .4);
}

/* ---------- 回到顶部 ---------- */
.ht-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ht-primary);
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(99, 102, 241, .3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all .3s;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ht-back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.ht-back-to-top:hover {
    background: #5a5dd8;
    transform: translateY(-2px);
}

/* ---------- 阅读时长元信息 ---------- */
.ht-meta-reading {
    color: var(--ht-text-muted);
    font-size: 13px;
}

/* ---------- 文章底部操作区 ---------- */
.ht-single-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    margin: 20px 0;
    border-top: 1px solid var(--ht-border);
    border-bottom: 1px solid var(--ht-border);
}

/* ---------- 相关推荐 ---------- */
.ht-related-posts {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--ht-border);
}
.ht-related-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
    padding-left: 10px;
    border-left: 3px solid var(--ht-primary);
}
.ht-related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.ht-related-item {
    background: var(--ht-bg-card);
    border-radius: var(--ht-radius);
    padding: 14px 16px;
    box-shadow: var(--ht-shadow);
    transition: transform .2s;
}
.ht-related-item:hover { transform: translateY(-2px); }
.ht-related-item a {
    display: block;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--ht-text);
    margin-bottom: 6px;
}
.ht-related-item a:hover { color: var(--ht-primary); }
.ht-related-meta {
    font-size: 12px;
    color: var(--ht-text-muted);
    display: flex;
    gap: 10px;
}

/* ---------- 热门排行小工具 ---------- */
.ht-hot-widget {
    background: var(--ht-bg-card);
    border-radius: var(--ht-radius);
    box-shadow: var(--ht-shadow);
    padding: 18px;
    margin-bottom: 20px;
}
.ht-hot-widget-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ht-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.ht-hot-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: hot-counter;
}
.ht-hot-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--ht-border);
    counter-increment: hot-counter;
}
.ht-hot-item:last-child { border-bottom: none; }
.ht-hot-rank {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: #f0f2f8;
    color: var(--ht-text-muted);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.ht-hot-item:nth-child(1) .ht-hot-rank { background: #fde8ec; color: #c5304e; }
.ht-hot-item:nth-child(2) .ht-hot-rank { background: #fff4e5; color: #b8741a; }
.ht-hot-item:nth-child(3) .ht-hot-rank { background: #e8f0fe; color: #1a73e8; }
.ht-hot-item-title {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ht-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ht-hot-item-title:hover { color: var(--ht-primary); }
.ht-hot-item-views {
    font-size: 11px;
    color: var(--ht-text-muted);
    margin-top: 2px;
}

/* ---------- 文章版权声明 ---------- */
.ht-post-copyright {
    background: #f8f9fc;
    border-left: 3px solid var(--ht-primary);
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    margin: 20px 0;
    font-size: 13px;
    line-height: 1.8;
    color: var(--ht-text-muted);
}
.ht-post-copyright p { margin: 4px 0; }
.ht-post-copyright a { color: var(--ht-primary); }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .ht-related-list { grid-template-columns: 1fr; }
    .ht-back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
}
