/* ========================================
   帖子详情页样式
   注意：左侧导航和右侧边栏样式已独立到：
   - sidebar-category-nav.css
   - sidebar-author.css
   ======================================== */

/* 整体容器 */
.single-post-page {
    background-color: #f5f7fa;
    min-height: 100vh;
    padding: 20px 0;
}

.post-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 180px 1fr 320px;
    gap: 20px;
    padding: 0 20px;
}

/* 面包屑导航容器 */
.single-post-page .Community-category-article-container {
    grid-column: 1 / -1;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* 面包屑导航样式 - 复用分类页样式 */
.single-post-page .Community-breadcrumb {
    display: flex;
    align-items: center;
    padding: 16px 0;
    font-size: 14px;
    color: #6b7280;
    background: transparent;
}

.single-post-page .Community-breadcrumb a {
    color: #6b7280;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
}

.single-post-page .Community-breadcrumb a:hover {
    color: #FF6A00;
    background: #fff5f0;
}

.single-post-page .Community-breadcrumb a:first-child::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 4px;
}

.single-post-page .Community-breadcrumb a:first-child:hover::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23FF6A00" stroke-width="2"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>');
}

.single-post-page .Community-breadcrumb .separator {
    margin: 0 8px;
    color: #d1d5db;
    font-weight: 300;
    user-select: none;
}

.single-post-page .Community-breadcrumb .current {
    color: #1f2937;
    font-weight: 600;
    padding: 4px 12px;
    background: linear-gradient(135deg, #fff5f0, #ffe8db);
    border-radius: 6px;
    border: 1px solid #ffd4b3;
    max-width: 500px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   中间主内容区
   ======================================== */
.post-main-content {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* 帖子详情 */
.post-detail {
    padding: 32px;
}

/* 帖子头部 */
.post-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.post-title {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin: 0 0 18px 0;
}

.post-meta-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.author-name {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.post-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #6b7280;
}

.stat-item svg {
    color: #9ca3af;
}

/* 帖子内容 */
.post-content-body {
    font-size: 17px;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 32px;
}

.post-content-body h1,
.post-content-body h2,
.post-content-body h3 {
    margin-top: 28px;
    margin-bottom: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
}

.post-content-body h1 {
    font-size: 28px;
}

.post-content-body h2 {
    font-size: 24px;
}

.post-content-body h3 {
    font-size: 20px;
}

.post-content-body p {
    margin-bottom: 18px;
}

.post-content-body ul,
.post-content-body ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.post-content-body li {
    margin-bottom: 8px;
}

.post-content-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

/* WordPress 图片对齐类 */
.post-content-body .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.post-content-body p .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.post-content-body img.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.post-content-body code {
    background-color: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.post-content-body pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.post-content-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.post-content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.post-content-body table th,
.post-content-body table td {
    border: 1px solid #e5e7eb;
    padding: 12px;
    text-align: left;
}

.post-content-body table th {
    background-color: #f9fafb;
    font-weight: 600;
}

.post-content-body blockquote {
    border-left: 4px solid #FF6A00;
    padding-left: 16px;
    margin: 16px 0;
    color: #6b7280;
    font-style: italic;
}

/* 帖子底部 */
.post-footer {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.action-btn.active {
    background-color: #fff5f0;
    border-color: #FF6A00;
    color: #FF6A00;
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

.action-btn.active svg {
    fill: #FF6A00;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-tag {
    padding: 4px 12px;
    background-color: #f3f4f6;
    color: #6b7280;
    font-size: 13px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
}

.post-tag:hover {
    background-color: #e5e7eb;
    color: #374151;
}

/* ========================================
   评论区
   ======================================== */
.comments-section {
    border-top: 8px solid #f5f7fa;
    padding: 32px;
}

.comments-header {
    margin-bottom: 24px;
}

.comments-title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.comments-count {
    color: #6b7280;
    font-weight: 400;
    font-size: 17px;
}

/* 评论表单 */
.comment-form-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.comment-form-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.comment-form {
    flex: 1;
}

.comment-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s;
}

.comment-textarea:focus {
    outline: none;
    border-color: #FF6A00;
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 12px;
}

.btn-submit-comment {
    padding: 8px 24px;
    background-color: #FF6A00;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-submit-comment:hover {
    background-color: #E65F00;
}

.comment-login-prompt {
    text-align: center;
    padding: 32px;
    background-color: #f9fafb;
    border-radius: 8px;
    margin-bottom: 32px;
}

.comment-login-prompt p {
    color: #6b7280;
    font-size: 14px;
}

.comment-login-prompt a {
    color: #FF6A00;
    text-decoration: none;
    font-weight: 500;
}

.comment-login-prompt a:hover {
    text-decoration: underline;
}

/* 评论列表 */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.comment-item {
    display: flex;
    gap: 12px;
}

.comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.comment-body {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.comment-author {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.comment-date {
    font-size: 13px;
    color: #9ca3af;
}

.comment-content {
    font-size: 16px;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 14px;
}

.comment-content p {
    margin: 0;
}

.comment-actions {
    display: flex;
    gap: 16px;
}

.comment-action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.comment-action-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.comment-action-btn.active {
    color: #FF6A00;
}

/* 回复列表 */
.replies-list {
    margin-top: 16px;
    padding-left: 20px;
    border-left: 2px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reply-item {
    display: flex;
    gap: 10px;
}

.reply-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.reply-body {
    flex: 1;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.reply-author {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.reply-date {
    font-size: 12px;
    color: #9ca3af;
}

.reply-content {
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
}

.reply-content p {
    margin: 0;
}

.no-comments {
    text-align: center;
    padding: 48px 20px;
    color: #9ca3af;
}

/* ========================================
   相关推荐
   ======================================== */
.related-posts-section {
    border-top: 8px solid #f5f7fa;
    padding: 32px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
    margin: 0 0 24px 0;
}

.related-posts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.related-post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    transition: all 0.2s;
}

.related-post-item:last-child {
    border-bottom: none;
}

.related-post-item:hover {
    background-color: #f9fafb;
    padding-left: 8px;
    padding-right: 8px;
    margin-left: -8px;
    margin-right: -8px;
    border-radius: 6px;
}

.related-post-item:hover .related-post-title {
    color: #FF6A00;
}

.related-post-title {
    flex: 1;
    font-size: 15px;
    color: #374151;
    line-height: 1.6;
    transition: color 0.2s;
    padding-right: 16px;
}

.related-post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.related-post-views {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #9ca3af;
}

.related-post-views svg {
    width: 14px;
    height: 14px;
}

.related-post-date {
    font-size: 13px;
    color: #9ca3af;
    white-space: nowrap;
}

/* ========================================
   响应式设计
   ======================================== */

/* 平板 */
@media (max-width: 1024px) {
    .post-container {
        grid-template-columns: 1fr 300px;
        gap: 16px;
    }
}

/* 手机 */
@media (max-width: 768px) {
    .post-container {
        grid-template-columns: 1fr;
        padding: 0 12px;
    }
    
    /* 面包屑导航移动端优化 */
    .single-post-page .Community-breadcrumb {
        padding: 12px 0;
        font-size: 13px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .single-post-page .Community-breadcrumb::-webkit-scrollbar {
        display: none;
    }
    
    .single-post-page .Community-breadcrumb .current {
        max-width: 200px;
    }
    
    .post-detail {
        padding: 20px 16px;
    }
    
    .post-title {
        font-size: 26px;
        line-height: 1.35;
    }

    .post-content-body {
        font-size: 16px;
    }

    .comments-title,
    .section-title {
        font-size: 20px;
    }

    .comment-content {
        font-size: 15px;
    }

    .reply-content {
        font-size: 14px;
    }
    
    .comments-section {
        padding: 20px 16px;
    }
    
    .related-posts-section {
        padding: 20px 16px;
    }
    
    .related-post-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .related-post-meta {
        width: 100%;
        justify-content: space-between;
    }
}
