/**
 * 留言/评论系统样式
 */

/* 留言容器 */
.comments-container {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comments-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    color: #333;
}

/* 留言输入区域 */
.comment-form {
    margin-bottom: 30px;
}

.comment-input-wrapper {
    position: relative;
    margin-bottom: 10px;
}

#commentContent {
    width: 100%;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    overflow-y: auto;
    font-family: inherit;
    transition: border-color 0.3s;
}

#commentContent:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

#commentContent::placeholder {
    color: #999;
}

.comment-length-hint {
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 12px;
    color: #666;
    display: none;
}

.comment-length-hint.show {
    display: block;
}

.comment-submit-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

#commentSubmitBtn {
    padding: 8px 20px;
    background: #2196F3;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

#commentSubmitBtn:hover {
    background: #1976D2;
}

#commentSubmitBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 留言列表 */
#commentsList {
    margin-top: 20px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #f5f5f5;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-username {
    font-weight: bold;
    color: #2196F3;
    font-size: 14px;
}

.comment-time {
    font-size: 12px;
    color: #999;
}

.comment-text {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* 加载状态 */
.comment-loading,
.comment-empty,
.comment-error {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
}

.comment-error {
    color: #f44336;
}

/* 分页 */
.comment-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.comment-page-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.comment-page-btn:hover {
    background: #f5f5f5;
    border-color: #2196F3;
    color: #2196F3;
}

.comment-page-current {
    padding: 6px 12px;
    background: #2196F3;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
}

/* 响应式 */
@media (max-width: 768px) {
    .comments-container {
        padding: 15px;
        margin-top: 20px;
    }
    
    .comment-item {
        padding: 12px 0;
    }
    
    .comment-avatar {
        width: 35px;
        height: 35px;
    }
    
    .comment-username {
        font-size: 13px;
    }
    
    .comment-text {
        font-size: 13px;
    }
    
    .comment-pagination {
        flex-wrap: wrap;
    }
}

