/* Comments System Styles */

/* 评论区容器 */
.comments-section {
    max-width: 800px;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.comments-header h3 {
    font-size: 1.25rem;
    color: var(--text-color);
}

.comments-count {
    color: #6b7280;
    font-size: 0.875rem;
}

/* 评论输入框 */
.comment-form {
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    line-height: 1.5;
    resize: vertical;
    background: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.2s;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.comment-form-actions .btn-submit {
    padding: 0.5rem 1.25rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.comment-form-actions .btn-submit:hover {
    opacity: 0.9;
}

.comment-form-actions .btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-login-hint {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.comment-login-hint a {
    color: var(--primary-color);
}

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

.comments-empty .empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* 加载中 */
.comments-loading {
    text-align: center;
    padding: 1.5rem;
    color: #9ca3af;
}

/* 回复框 */
.reply-form-wrapper {
    margin: 0.5rem 0 0.5rem 0;
    padding-left: 1rem;
    display: none;
}

.reply-form-wrapper.active {
    display: block;
}

.reply-form-wrapper textarea {
    width: 100%;
    min-height: 60px;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    background: var(--bg-color);
    color: var(--text-color);
}

.reply-form-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.reply-form-wrapper .reply-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.375rem;
}

.reply-form-wrapper .btn-reply-submit {
    padding: 0.375rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8125rem;
    cursor: pointer;
}

.reply-form-wrapper .btn-cancel {
    padding: 0.375rem 1rem;
    background: transparent;
    color: #6b7280;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8125rem;
    cursor: pointer;
}

/* 评论列表 */
.comments-list {
    list-style: none;
}

.comment-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.comment-author-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
    flex-shrink: 0;
}

.comment-author {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-color);
}

.comment-time {
    color: #9ca3af;
    font-size: 0.75rem;
}

.comment-status-badge {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
}

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

.badge-approved {
    background: #d1fae5;
    color: #065f46;
}

.badge-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.comment-body {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0.375rem 0;
    word-break: break-word;
}

.comment-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.375rem;
}

.comment-actions button,
.comment-actions a {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0;
}

.comment-actions button:hover,
.comment-actions a:hover {
    color: var(--primary-color);
}

/* 楼中楼 */
.comment-replies {
    list-style: none;
    margin-left: 2.5rem;
    padding-top: 0.5rem;
}

.comment-replies .comment-item {
    padding: 0.625rem 0;
    border-bottom: none;
}

.comment-replies .comment-item + .comment-item {
    border-top: 1px solid var(--border-color);
}

.comment-replies .comment-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.6875rem;
}

/* 审核按钮 */
.review-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.btn-approve,
.btn-approve:focus {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
}

.btn-approve:hover {
    background: #a7f3d0;
}

.btn-reject,
.btn-reject:focus {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
}

.btn-reject:hover {
    background: #fecaca;
}

/* 通知链接 (用户名后面的计数) */
.notification-link {
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    margin-left: 0.25rem;
}

.notification-link:hover {
    text-decoration: underline;
}

/* 通知页面 */
.notifications-page {
    max-width: 640px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.notifications-header h2 {
    margin: 0;
}

.notifications-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color);
    transition: background 0.15s;
}

.notification-item:hover {
    background: var(--hover-bg, #f9fafb);
}

.notification-item.unread {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    flex-shrink: 0;
    margin-top: 0.375rem;
}

.notification-dot.unread {
    background: var(--primary-color);
}

.notification-content {
    flex: 1;
    min-width: 0;
    text-decoration: none;
}

.notification-content:hover {
    text-decoration: none;
}

.notification-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374151;
}

.notification-time {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* 移动端适配 */
@media (max-width: 640px) {
    .comment-replies {
        margin-left: 1.25rem;
    }

    .comments-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* 微博内嵌评论 */
.microblog-comments {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
}

.microblog-comments .comments-section {
    margin: 0;
    padding-top: 0;
    border-top: none;
}

.post-actions .btn-comment {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.post-actions .btn-comment:hover {
    color: var(--primary-color);
}

