/* 
前台文章阅读页面样式
作者: Bill  
功能: postRead.html页面样式，包含增强评论功能
创建时间: 25/01/08 15:30
使用者: templates/frontend/postRead.html
路由: /article/<id>
*/

/* 评论区主容器 */
.comments-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.comments-section:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 评论区头部 */
.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.comments-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.comments-title i {
    color: #3b82f6;
}

.comment-count {
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

/* 评论排序选项 */
.comment-sort {
    display: flex;
    gap: 0.5rem;
}

.sort-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.sort-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.sort-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* 评论发表表单 */
.comment-form-container {
    padding: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.comment-form-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-input-group {
    position: relative;
}

.comment-textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fafafa;
}

.comment-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-textarea::placeholder {
    color: #9ca3af;
}

/* 评论表单工具栏 */
.comment-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.format-buttons {
    display: flex;
    gap: 0.5rem;
}

.format-btn {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.format-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.format-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* 提交按钮组 */
.submit-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.submit-btn {
    padding: 0.75rem 1.5rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.preview-btn {
    padding: 0.75rem 1.25rem;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-btn:hover {
    background: #e5e7eb;
}

/* 评论列表 */
.comments-list {
    padding: 0;
}

.comment-item {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.comment-item:hover {
    background: rgba(248, 250, 252, 0.5);
}

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

/* 层级评论缩进 */
.comment-item.level-1 { margin-left: 0; }
.comment-item.level-2 { margin-left: 2rem; }
.comment-item.level-3 { margin-left: 4rem; }
.comment-item.level-4 { margin-left: 6rem; }
.comment-item.level-5 { margin-left: 8rem; }

/* 评论主体 */
.comment-wrapper {
    display: flex;
    gap: 1rem;
}

.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
    transition: border-color 0.2s ease;
}

.comment-avatar:hover {
    border-color: #3b82f6;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

/* 评论头部信息 */
.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

.comment-author:hover {
    color: #3b82f6;
}

.comment-time {
    color: #6b7280;
    font-size: 0.875rem;
}

.comment-status {
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.comment-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.comment-status.private {
    background: #dbeafe;
    color: #1e40af;
}

.comment-status.ai-reply {
    background: #f3e8ff;
    color: #7c3aed;
}

/* 评论正文 */
.comment-body {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 1rem;
    word-wrap: break-word;
}

.comment-body p {
    margin: 0 0 0.75rem 0;
}

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

/* @提及样式 */
.mention {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 500;
}

.mention:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* 评论操作栏 */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #6b7280;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    color: #374151;
    background: #f9fafb;
    border-color: #e5e7eb;
}

.action-btn.liked {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.action-btn.liked:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* 无限点赞动画效果 - 作者: Bill 
   {25/06/19:12:00,+cursor.claude-3.5-sonnet-20241022+因为Bill要求无限点赞模式，添加点赞动画效果} */
.liked-animation {
    animation: likeAnimation 0.6s ease-out;
}

@keyframes likeAnimation {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.3);
        filter: hue-rotate(45deg) brightness(1.2);
    }
    60% {
        transform: scale(1.1);
        filter: hue-rotate(90deg) brightness(1.1);
    }
    100% {
        transform: scale(1);
        filter: none;
    }
}

/* 文章点赞按钮动画 */
.article-action-btn.liked-animation {
    animation: articleLikeAnimation 0.6s ease-out;
}

@keyframes articleLikeAnimation {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.2);
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    }
    100% {
        transform: scale(1);
    }
}

.like-count, .reply-count {
    font-weight: 500;
    min-width: 1.25rem;
    text-align: center;
}

/* 回复表单 */
.reply-form {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.reply-form.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.reply-form-inner {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.reply-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.reply-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.reply-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.reply-submit,
.reply-cancel {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.reply-submit {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.reply-submit:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
}

.reply-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.reply-cancel {
    background: transparent;
    color: #6b7280;
    border-color: #d1d5db;
}

.reply-cancel:hover {
    background: #f3f4f6;
    color: #374151;
}

/* 加载状态 */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f4f6;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-comments {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b7280;
}

.empty-icon {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.empty-description {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* 分页导航 */
.comments-pagination {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.page-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.page-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.page-btn:disabled {
    background: #f9fafb;
    color: #d1d5db;
    cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .comments-section {
        margin: 1rem;
        border-radius: 8px;
    }
    
    .comments-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .comment-sort {
        width: 100%;
        justify-content: center;
    }
    
    .comment-form-container {
        padding: 1rem;
    }
    
    .comment-item {
        padding: 1rem;
    }
    
    .comment-item.level-2 { margin-left: 1rem; }
    .comment-item.level-3 { margin-left: 2rem; }
    .comment-item.level-4 { margin-left: 3rem; }
    .comment-item.level-5 { margin-left: 4rem; }
    
    .comment-wrapper {
        gap: 0.75rem;
    }
    
    .comment-avatar {
        width: 40px;
        height: 40px;
    }
    
    .comment-header {
        gap: 0.5rem;
    }
    
    .comment-actions {
        gap: 0.75rem;
        flex-wrap: wrap;
    }
    
    .submit-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .format-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .comment-item.level-2,
    .comment-item.level-3,
    .comment-item.level-4,
    .comment-item.level-5 {
        margin-left: 0.5rem;
    }
    
    .comment-wrapper {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .comment-avatar {
        align-self: flex-start;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 640px) {
    .reply-actions {
        flex-direction: column;
    }
    
    .reply-submit,
    .reply-cancel {
        justify-content: center;
    }
}

/* 主题适配 */
@media (prefers-color-scheme: dark) {
    .comments-section {
        background: rgba(31, 41, 55, 0.95);
        color: #f9fafb;
    }
    
    .comments-header {
        background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
        border-bottom-color: #4b5563;
    }
    
    .comments-title {
        color: #f9fafb;
    }
    
    .comment-form-container {
        border-bottom-color: #4b5563;
    }
    
    .comment-textarea {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .comment-textarea:focus {
        border-color: #3b82f6;
        background: #4b5563;
    }
    
    .comment-item {
        border-bottom-color: #4b5563;
    }
    
    .comment-item:hover {
        background: rgba(55, 65, 81, 0.5);
    }
    
    .comment-author {
        color: #f9fafb;
    }
    
    .comment-body {
        color: #d1d5db;
    }
    
    .action-btn {
        color: #9ca3af;
    }
    
    .action-btn:hover {
        color: #f3f4f6;
        background: #374151;
        border-color: #4b5563;
    }
} 