/* 论坛主题详情页样式 */

/* 主题和帖子样式 */
.topic-header, .post-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
}

.topic-header {
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
}

.topic-title {
    font-size: 1.5rem;
    font-weight: normal;
    margin-bottom: 15px;
    color: #333;
}

.topic-meta {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #666;
    margin-top: 10px;
}

.topic-meta .fas.fa-eye,
.topic-meta .fas.fa-comment,
.topic-meta .user-icon,
.topic-meta .fas.fa-clock {
    color: #888;
    margin-right: 2px;
}

.topic-content, .post-content {
    padding: 20px 25px;
    line-height: 1.6;
    color: #333;
}

.topic-content {
    background-color: #fff;
    border-radius: 0 0 10px 10px;
}

.topic-content img {
    max-width: 300px;
    max-height: 200px;
    object-fit: contain;
    display: block;
    margin-top: 10px;
    margin-left: 0;
    margin-right: auto;
}

/* 用户头像样式 */
.author-avatar, .comment-avatar {
    border-radius: 50%;
    object-fit: cover;
}

.author-avatar {
    width: 48px;
    height: 48px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
}

.author-name {
    font-weight: normal;
    color: #333;
}

/* 帖子项样式 */
.post-item {
    margin-top: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    background-color: #fff;
}

.post-header {
    display: flex;
    border-radius: 10px 10px 0 0;
}

.post-footer {
    padding: 10px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: 0 0 10px 10px;
}

.post-actions {
    display: flex;
    gap: 10px;
}

/* 回复表单样式 */
.reply-form {
    margin-top: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* 点赞按钮样式 */
.like-btn, .comment-action-btn {
    background: none;
    border: none;
    color: #666;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.like-btn {
    gap: 5px;
    transition: color 0.2s ease;
}

.like-btn:hover, .comment-like:hover i, .comment-like:hover span {
    color: #ff4d4d;
}

.liked, .comment-like.active i, .comment-like.active span {
    color: #ff4d4d;
}

.like-btn i {
    font-size: 1.1rem;
}

/* 编辑器样式 */
.editor-toolbar {
    border-radius: 5px 5px 0 0;
    border: 1px solid #ced4da;
    background-color: #f8f9fa;
}

.editor-container {
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 5px 5px;
    min-height: 150px;
}

/* 徽章样式 */
.badge-essence {
    background-color: #198754;
    color: #fff;
}

.badge-sticky {
    background-color: #5c7cfa;
    color: #fff;
}

.badge-locked {
    background-color: #dc3545;
    color: #fff;
}

/* 引用样式 */
.post-quote {
    background-color: #f8f9fa;
    border-left: 3px solid #333;
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #333;
}

.quote-author {
    font-weight: normal;
    color: #333;
}

.quote-content {
    margin-top: 5px;
    color: #555;
    word-break: break-word;
}

/* 链接和按钮样式 */
a, a:hover, a:focus, a:active {
    color: #333;
    text-decoration: none;
}

.breadcrumb-item a, .breadcrumb-item.active {
    color: #333;
}

.btn-primary, .btn-outline-primary {
    color: #333;
    border-color: #333;
}

.btn-primary {
    background-color: #f8f9fa;
}

.btn-primary:hover, .btn-outline-primary:hover {
    background-color: #e9ecef;
    border-color: #333;
    color: #333;
}

.text-muted, .small {
    color: #333 !important;
}

/* 子帖子样式 */
.child-post {
    border-left: 3px solid #e0e0e0;
    margin-top: 5px !important;
    margin-bottom: 5px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.child-post .post-header {
    padding: 10px 15px;
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #f0f0f0;
}

.child-post .post-content {
    padding: 15px;
    background-color: #fafbfc;
}

.child-post .post-footer {
    padding: 8px 15px;
    background-color: #f8f9fa;
}

.toggle-replies-btn {
    font-size: 0.85rem;
    color: #666;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 4px 12px;
    transition: all 0.2s ease;
}

.toggle-replies-btn:hover {
    background-color: #e9ecef;
    color: #333;
}

.child-replies-container {
    transition: max-height 0.3s ease;
}

/* 评论输入样式 */
.comment-input-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.comment-input {
    width: 100%;
    border: none;
    background-color: #f8f9fa;
    padding: 10px 0;
    resize: none;
    outline: none;
    font-size: 15px;
}

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

.comment-tool-buttons {
    display: flex;
    gap: 15px;
}

.comment-tool-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 18px;
}

/* 分页样式 */
.pagination-custom {
    display: flex;
    padding-left: 0;
    list-style: none;
    justify-content: center;
}

.page-item-custom .page-link-custom {
    color: #6c757d;
    background-color: #fff;
    border: 1px solid #dee2e6;
}

.page-item-custom.active .page-link-custom {
    z-index: 1;
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.page-item-custom.disabled .page-link-custom {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

.page-link-custom {
    position: relative;
    display: block;
    padding: .5rem .75rem;
    margin-left: -1px;
    line-height: 1.25;
}

/* 评论提交按钮 */
.comment-submit-btn {
    background-color: #8fcdee;
    border: none;
    color: white;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.comment-submit-btn:hover {
    background-color: #59adf3;
}

/* 评论点赞按钮样式 */
.comment-like {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.comment-like:hover {
    color: #dc3545;
}

.comment-like:active {
    color: #c82333;
}

.comment-like.active i,
.comment-like.active span {
    color: #dc3545;
}

.comment-like i {
    margin-right: 2px;
    transition: transform 0.2s ease;
}

.comment-like[data-processing="true"] {
    pointer-events: none;
    position: relative;
}

.comment-like[data-processing="true"]::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -15px;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border: 2px solid rgba(220, 53, 69, 0.2);
    border-top-color: #dc3545;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.comment-item-new {
    animation: replyAppear 0.5s ease forwards;
}

/* 动画关键帧 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes replyAppear {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 评论区域样式 */
.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.comments-title {
    font-size: 16px;
    font-weight: normal;
    color: #333;
}

.comments-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #666;
}

/* 评论项样式 */
.comment-item {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
}

/* 菜单项样式 */
.menu-item {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background-color: #f5f5f5;
}

.menu-item i {
    margin-right: 8px;
}

.comment-user {
    font-weight: bold;
    font-size: 15px;
    margin-left: 10px;
    flex-grow: 1;
}

.comment-content {
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
}

.comment-footer {
    display: flex;
    align-items: center;
    margin-left: 52px;
    font-size: 13px;
    color: #999;
}

.comment-info {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-action-btn:hover {
    color: #333;
}

/* 评论点赞样式 */
.comment-like {
    display: flex;
    align-items: center;
}

.comment-like i {
    font-size: 16px;
    margin-right: 4px;
    color: #777;
    transition: color 0.2s ease;
}

.comment-reply-btn {
    font-size: 14px;
}

.comment-more-btn {
    font-size: 16px;
}

.comment-actions-dropdown {
    position: relative;
}

/* 查看回复链接 */
.show-all-replies {
    margin-left: 52px;
    color: #080808;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
    display: inline-block;
}

.show-all-replies:hover {
    text-decoration: underline;
}

/* 评论图片样式 */
.comment-image-thumbnail {
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.comment-image-thumbnail:hover {
    transform: scale(1.05);
}

/* 图片预览容器 */
#imagePreviewContainer {
    position: relative;
    display: inline-block;
}

#removeImage {
    position: absolute;
    top: -8px;
    right: -8px;
    border-radius: 50%;
    padding: 0.25rem 0.5rem;
}
