/* =========================================================
 * 文章页增强样式
 * ========================================================= */

/* ---------- 1. 阅读进度条 ---------- */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #1a2a6c, #3a5a9a, #1a2a6c);
    background-size: 200% 100%;
    z-index: 9999;
    transition: width 0.1s ease;
    animation: progressFlow 3s linear infinite;
    box-shadow: 0 0 8px rgba(26, 42, 108, 0.5);
}
@keyframes progressFlow {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ---------- 2. 阅读时长 ---------- */
#readingTime {
    font-size: 0.85rem;
    color: #6a7a8a;
}
#readingTime::before {
    content: '⏱ ';
    margin-right: 2px;
}

/* ---------- 3. 分享按钮增强 ---------- */
.share-buttons-enhanced {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
    padding: 20px;
    background: #e8edf2;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 6px 6px 12px #c8cdd2, -6px -6px 12px #ffffff;
}
.share-buttons-enhanced .share-label {
    font-weight: 600;
    color: #0a1a3a;
    flex-shrink: 0;
}
.share-buttons-enhanced .share-buttons-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.share-buttons-enhanced .share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: #e8edf2;
    box-shadow: 3px 3px 6px #c8cdd2, -3px -3px 6px #ffffff;
    color: #1a2a5a;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-weight: 500;
}
.share-buttons-enhanced .share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 5px 5px 10px #c8cdd2, -5px -5px 10px #ffffff;
}
.share-buttons-enhanced .share-btn:active {
    box-shadow: inset 3px 3px 6px #c8cdd2, inset -3px -3px 6px #ffffff;
}
.share-buttons-enhanced .share-wechat:hover { color: #07c160; }
.share-buttons-enhanced .share-weibo:hover  { color: #e6162d; }
.share-buttons-enhanced .share-qq:hover     { color: #12b7f5; }
.share-buttons-enhanced .share-copy:hover   { color: #1a2a6c; }

/* ---------- 4. 微信二维码弹层 ---------- */
.wechat-qrcode-popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.wechat-qrcode-popup.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}
.wechat-qrcode-inner {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.wechat-qrcode-inner h4 {
    margin: 0 0 20px;
    color: #0a1a3a;
    font-size: 1.2rem;
}
.wechat-qrcode-inner #wechatQrcode {
    display: inline-block;
    margin: 10px auto 15px;
    padding: 10px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}
.wechat-qrcode-inner #wechatQrcode img,
.wechat-qrcode-inner #wechatQrcode canvas {
    display: block;
}
.wechat-qrcode-inner p {
    color: #6a7a8a;
    font-size: 0.9rem;
    margin: 0 0 15px;
}
.wechat-popup-close {
    padding: 8px 24px;
    border-radius: 30px;
    border: none;
    background: #1a2a6c;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}
.wechat-popup-close:hover {
    background: #0d1b4a;
    transform: translateY(-2px);
}

/* ---------- 5. 相关文章 ---------- */
.related-posts-section {
    margin: 40px 0 20px;
    padding: 30px 0;
}
.related-posts-section .advantages-header {
    margin-bottom: 30px;
}
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.related-post-item {
    background: #e8edf2;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 6px 6px 12px #c8cdd2, -6px -6px 12px #ffffff;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}
.related-post-item:hover {
    box-shadow: 10px 10px 20px #c0c5ca, -10px -10px 20px #ffffff;
    transform: translateY(-4px);
}
.related-post-thumb {
    display: block;
    width: 100%;
    height: 140px;
    overflow: hidden;
}
.related-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.related-post-item:hover .related-post-thumb img {
    transform: scale(1.06);
}
.related-post-body {
    padding: 14px 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.related-post-body h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0a1a3a;
    line-height: 1.4;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}
.related-post-body h3 a {
    color: inherit;
    text-decoration: none;
}
.related-post-body h3 a:hover {
    color: #1a2a6c;
}
.related-post-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: #8a9aae;
    margin-top: auto;
}
.related-post-meta i {
    margin-right: 3px;
}

/* ---------- 6. 评论区 ---------- */
.comments-section {
    margin: 40px 0;
    padding: 30px;
    background: #e8edf2;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 8px 8px 16px #c8cdd2, -8px -8px 16px #ffffff;
}
.comments-area .comments-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0a1a3a;
    margin: 0 0 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(26, 42, 108, 0.1);
}
.comments-area .comments-count {
    color: #1a2a6c;
    font-size: 1.5rem;
}

/* 评论列表 */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
}
.comment-list ol.children {
    list-style: none;
    padding-left: 50px;
    margin-top: 20px;
}
.comment-list .comment-body {
    padding: 20px;
    background: #f5f8fb;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 3px 3px 8px #d4dae0, -3px -3px 8px #ffffff;
    position: relative;
}
.comment-list .comment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.comment-list .comment-author img {
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.comment-list .comment-author .fn {
    font-weight: 600;
    color: #0a1a3a;
    font-size: 1rem;
}
.comment-list .comment-metadata {
    font-size: 0.8rem;
    color: #8a9aae;
}
.comment-list .comment-metadata a {
    color: inherit;
    text-decoration: none;
}
.comment-list .comment-content {
    color: #2a3a5a;
    line-height: 1.8;
    font-size: 0.95rem;
}
.comment-list .comment-content p {
    margin: 0 0 10px;
}
.comment-list .comment-content p:last-child {
    margin-bottom: 0;
}
.comment-list .reply {
    margin-top: 10px;
}
.comment-list .comment-reply-link {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    background: #e8edf2;
    color: #1a2a6c;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 2px 2px 4px #c8cdd2, -2px -2px 4px #ffffff;
    transition: all 0.3s ease;
}
.comment-list .comment-reply-link:hover {
    background: #1a2a6c;
    color: #fff;
}

/* 评论分页 */
.comments-area .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: #f5f8fb;
    color: #1a2a5a;
    border-radius: 8px;
    text-decoration: none;
    margin: 0 3px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 2px 2px 4px #c8cdd2, -2px -2px 4px #ffffff;
}
.comments-area .page-numbers.current {
    background: #1a2a6c;
    color: #fff;
}

/* 评论表单 */
.comment-reply-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0a1a3a;
    margin: 30px 0 15px;
}
.comment-notes {
    font-size: 0.85rem;
    color: #6a7a8a;
    margin-bottom: 15px;
}
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.comment-form p {
    margin: 0;
}
.comment-form label {
    display: block;
    font-weight: 600;
    color: #1a2a5a;
    font-size: 0.9rem;
    margin-bottom: 6px;
}
.comment-form .required {
    color: #e74c3c;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: #f5f8fb;
    box-shadow: inset 4px 4px 8px #d4dae0, inset -4px -4px 8px #ffffff;
    color: #0a1a3a;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
    resize: vertical;
}
.comment-form input:focus,
.comment-form textarea:focus {
    box-shadow: inset 5px 5px 10px #c4cad0, inset -5px -5px 10px #ffffff;
    border-color: rgba(26, 42, 108, 0.3);
}
.comment-form .form-submit {
    margin: 10px 0 0;
}
.comment-form .submit-btn {
    padding: 12px 36px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #1a2a6c, #3a5a9a);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(26, 42, 108, 0.35);
}
.comment-form .submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 42, 108, 0.45);
}

/* ---------- 7. 响应式 ---------- */
@media (max-width: 992px) {
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 576px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .related-post-thumb {
        height: 180px;
    }
    .comments-section {
        padding: 20px 16px;
        border-radius: 16px;
    }
    .comment-list ol.children {
        padding-left: 20px;
    }
    .share-buttons-enhanced {
        flex-direction: column;
        align-items: flex-start;
    }
    .share-buttons-enhanced .share-btn {
        font-size: 0.85rem;
        padding: 7px 14px;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}