/* 广告位样式 */
.ad-banner {
    position: relative;
    height: 300px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 20px;
}

.ad-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 20px;
}

.ad-caption h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.ad-caption p {
    font-size: 14px;
}

/* 文章内容样式 */
.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    margin: 30px 0;
}

.article-content h1, .article-content h2, .article-content h3, .article-content h4, .article-content h5, .article-content h6 {
    margin: 20px 0 10px;
    font-weight: 600;
}

.article-content p {
    margin-bottom: 15px;
}

.article-content ul, .article-content ol {
    margin: 15px 0;
    padding-left: 20px;
}

.article-content li {
    margin-bottom: 5px;
}

/* 文章页脚样式 */
.article-footer {
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    margin: 30px 0;
    font-size: 14px;
    color: #666;
}

.article-footer p {
    margin-bottom: 10px;
}

/* 评论区样式 */
.comment-section {
    margin: 40px 0;
}

.comment-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
}

.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.comment-button {
    padding: 8px 16px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.comment-button:hover {
    background-color: #0069d9;
}

.comments-list {
    margin-top: 30px;
}

.comment-item {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.comment-author {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author img,
.comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    background-color: #eef2f7;
    flex-shrink: 0;
}

.comment-content {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.comment-time {
    font-size: 12px;
    color: #999;
}

/* 相关推荐样式 */
.related-articles {
    margin: 40px 0;
}

.related-articles h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.related-articles ul {
    list-style: none;
}

.related-articles li {
    margin-bottom: 10px;
}

.related-articles a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    display: block;
    padding: 5px 0;
}

.related-articles a:hover {
    color: #007bff;
    padding-left: 5px;
}

/* 回复评论样式 */
.comment-item.reply {
    margin-left: 40px;
    margin-bottom: 10px;
    padding: 15px;
    background-color: #f0f0f0;
    border-left: 3px solid #007bff;
}

.comment-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.reply-btn {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.reply-btn:hover {
    background-color: #e0e0e0;
}

.reply-form {
    margin-top: 15px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.reply-to {
    font-weight: 600;
    color: #007bff;
}

/* 收藏按钮样式 */
.favorite-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.favorite-btn:hover {
    border-color: #ffc107;
    color: #ffc107;
}

.favorite-btn.favorited {
    border-color: #ffc107;
    color: #ffc107;
    background-color: #fff8e1;
}

.favorite-btn i {
    font-size: 16px;
}

.favorite-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.favorite-info {
    color: #999;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.favorite-info i {
    font-size: 16px;
}

/* ===== 文章页右侧：章节目录卡片 ===== */
.toc-card {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 22px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    /* 吸顶：滚动阅读时长驻视口，方便随时跳转章节 */
    position: sticky;
    top: 90px;
}

.toc-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.toc-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-card h3 i {
    color: var(--primary-color);
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 62vh;
    overflow-y: auto;
}

.toc-item {
    line-height: 1.5;
}

/* 子级标题缩进，营造章节层级 */
.toc-item.toc-h3 {
    padding-left: 14px;
}

.toc-list a {
    display: block;
    padding: 7px 10px;
    font-size: 14px;
    color: var(--text-secondary, #555);
    text-decoration: none;
    border-radius: 6px;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toc-list a:hover {
    color: var(--primary-color);
    background: rgba(74, 108, 247, 0.08);
    border-left-color: var(--primary-color);
}

.toc-list a.active {
    color: var(--primary-color);
    background: rgba(74, 108, 247, 0.12);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.toc-empty {
    font-size: 13px;
    color: #999;
    padding: 8px 4px;
}