/*
Theme Name: Hedeb
Theme URL: https://744h.com
Description: 黑布袋 - 何健的第一款 Typecho 主题，内置完整会员系统（登录注册/等级权限/积分/收藏/通知/认证/企业会员）
Version: 1.0.0
Author: 何健
Author URL: https://744h.com
Tags: 会员系统, 响应式, 博客, 社区, 积分
*/

/* 全局重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}
a { color: #667eea; text-decoration: none; transition: color 0.2s; }
a:hover { color: #764ba2; }
img { max-width: 100%; height: auto; }

/* SVG 图标通用样式 */
.icon-svg { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; flex-shrink: 0; }
.icon-svg svg { display: block; }
.meta-item { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; font-size: 13px; color: #999; }
.meta-item .icon-svg { color: #bbb; }

/* 内容区域 */
.content-area { max-width: 800px; margin: 0 auto; }

/* 文章卡片 */
.post-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s, transform 0.2s;
}
.post-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.post-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}
.post-title a { color: #2c3e50; }
.post-title a:hover { color: #667eea; }
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #999;
    margin-bottom: 14px;
}
.post-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 16px;
}
.post-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid #f5f5f5;
}
.read-more {
    font-size: 14px;
    color: #667eea;
    font-weight: 500;
}
.read-more:hover { color: #764ba2; }

/* 收藏按钮（header.php 中已定义，这里补充） */
.favorite-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.favorite-btn:hover { border-color: #f39c12; color: #f39c12; }
.favorite-btn.active { background: #fff8e1; border-color: #f39c12; color: #f39c12; }
.favorite-btn .icon { font-size: 15px; }
.favorite-btn.loading { opacity: 0.6; pointer-events: none; }

/* 文章详情页 */
.post-detail {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.post-detail-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 16px;
    line-height: 1.4;
}
.post-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #999;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f5f5f5;
}
.post-detail-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

/* 作者卡片 */
.author-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9ff;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #eef0ff;
}
.author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.author-info { flex: 1; }
.author-name { font-size: 16px; font-weight: 600; color: #333; margin-bottom: 4px; }
.author-stats { font-size: 12px; color: #999; display: flex; gap: 16px; }
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.action-btn:hover { border-color: #667eea; color: #667eea; }
.post-detail-content {
    font-size: 15px;
    line-height: 1.9;
    color: #444;
}
.post-detail-content p { margin-bottom: 16px; }
.post-detail-content h2, .post-detail-content h3 {
    margin: 24px 0 12px;
    color: #2c3e50;
}
.post-detail-content img {
    border-radius: 8px;
    margin: 16px 0;
}
.post-detail-content blockquote {
    border-left: 4px solid #667eea;
    padding: 12px 16px;
    background: #f8f9ff;
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
}
.post-detail-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}
.post-detail-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}
.post-detail-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}
.post-external-link {
    margin-top: 24px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9ff, #f0f4ff);
    border: 1px solid #d6e0ff;
    border-radius: 10px;
}
.post-external-link a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #667eea;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
}
.post-external-link a:hover {
    color: #5a6fd8;
}
.post-detail-tags {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f5f5f5;
}
.post-detail-tags a {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f2f5;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
    margin-right: 8px;
    margin-bottom: 8px;
}
.post-detail-tags a:hover { background: #667eea; color: #fff; }

/* 评论区 */
.post-comments {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
#comments h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
}
.comment-list { list-style: none; }
.comment-body {
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f5;
}
.comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.comment-author { font-weight: 600; color: #333; }
.comment-time { font-size: 12px; color: #999; }
.comment-content { font-size: 14px; color: #555; line-height: 1.7; }
.comment-reply a { font-size: 12px; color: #667eea; }

/* 评论表单 */
.respond { margin-top: 24px; }
.respond h3 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
#comment-form p { margin-bottom: 14px; }
#comment-form .text, #comment-form .textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}
#comment-form .text:focus, #comment-form .textarea:focus {
    outline: none;
    border-color: #667eea;
}
#comment-form .textarea { min-height: 120px; resize: vertical; }
#comment-form .submit {
    padding: 10px 28px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}
#comment-form .submit:hover { opacity: 0.9; }

/* 分页 */
.page-navigator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    list-style: none;
}
.page-navigator li a, .page-navigator li span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
    background: #fff;
}
.page-navigator li.current a, .page-navigator li.current span {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-color: transparent;
}
.page-navigator li a:hover { border-color: #667eea; color: #667eea; }

/* 响应式 */
@media (max-width: 768px) {
    .post-card, .post-detail, .post-comments { padding: 16px; }
    .post-detail-title { font-size: 22px; }
    .post-meta, .post-detail-meta { gap: 10px; font-size: 12px; }
    .post-detail-actions { flex-wrap: wrap; }
}

/* ========== 评论区样式 ========== */
.comment-list, .comment-list ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list {
    margin-top: 20px;
}

.comment-body {
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.comment-body:last-child {
    border-bottom: none;
}

.comment-child {
    margin-left: 56px;
    padding-left: 16px;
    border-left: 2px solid #f0f0f0;
}

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

.comment-avatar-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.comment-avatar-wrap img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.comment-author .fn {
    font-style: normal;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.comment-by-author .fn {
    color: #667eea;
}

.comment-meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    margin-left: 50px;
}

.comment-meta a {
    color: #999;
    text-decoration: none;
}

.comment-meta a:hover {
    color: #667eea;
}

.comment-awaiting-moderation {
    color: #f39c12;
    font-style: normal;
    margin-left: 8px;
}

.comment-content {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
    margin-left: 50px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.comment-content p {
    margin: 0 0 8px 0;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-reply {
    margin-top: 8px;
    margin-left: 50px;
}

.comment-reply a {
    font-size: 12px;
    color: #999;
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.2s;
}

.comment-reply a:hover {
    color: #667eea;
    border-color: #667eea;
    background: #f8f9ff;
}

.comment-children {
    margin-top: 8px;
}

/* 取消评论回复 */
.cancel-comment-reply {
    margin-bottom: 12px;
}

.cancel-comment-reply a {
    font-size: 12px;
    color: #e74c3c;
    text-decoration: none;
}

.cancel-comment-reply a:hover {
    text-decoration: underline;
}

/* 评论区响应式 */
@media (max-width: 600px) {
    .comment-child {
        margin-left: 20px;
        padding-left: 10px;
    }
    .comment-meta, .comment-content, .comment-reply {
        margin-left: 0;
    }
    .comment-avatar-wrap img {
        width: 36px;
        height: 36px;
    }
}
