:root {
    --primary-color: #2ca3b8;
    --text-color: #333;
    --muted-color: #666;
    --border-color: #eee;
    --spacing-sm: 12px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
}

.comment-section {
    max-width: 800px;
    margin:0 0 0 300px;
    padding: var(--spacing-lg);
    /* 新增移动端布局 */
    @media (max-width: 768px) {
        margin: 0 auto;
        padding: var(--spacing-md);
    }
}

.comment-header {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
}

.comment-item {
    padding: var(--spacing-md);
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: var(--spacing-md);
    transition: transform 0.2s;
}

.comment-item:hover {
    transform: translateX(5px);
}

.comment-user {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-color);
}

.comment-meta {
    font-size: 0.875rem;
    color: var(--muted-color);
    margin-bottom: var(--spacing-sm);
}

.comment-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: var(--spacing-md);
}

.rating-category {
    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.rating-stars {
    display: inline-flex;
    position: relative;
    font-size: 0;
}

.star {
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: transform 0.1s;
}

.star:hover {
    transform: scale(1.2);
}

.star::before {
    content: '☆';
    display: block;
    font-size: 24px;
    color: var(--muted-color);
}

.star.active::before {
    content: '★';
    color: var(--primary-color);
}

.star.half::before {
    background: linear-gradient(90deg, var(--primary-color) 50%, var(--muted-color) 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 480px) {
    .rating-category {
        grid-template-columns: 1fr;
    }
}
.rating-card {
    background: #fff;
    border-radius: 8px;
    padding: var(--spacing-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: var(--spacing-md);
}

.review-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--spacing-md);
    display: block;
}

.submit-button {
    background-color: var(--primary-color);
    color: #fff; /* 修正文字颜色为白色 */
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background-color: #e69900; /* 替换darken函数为具体颜色值 */
}

/* 新增点击状态 */
.submit-button:active {
    background-color: #cc8a00; /* 更深的橙色 */
    transform: scale(0.98); /* 添加点击反馈 */
}
.user-rating {
    margin-left: 10px;
    font-size: 14px;
    color: #f39c12; /* 星星颜色 */
    font-weight: bold;
}

@media (max-width: 768px) {
    /* 移动端优化 */
    .comment-header {
        font-size: 1.2rem;
        margin-bottom: var(--spacing-md);
    }

    .rating-categories {
        padding: var(--spacing-sm);
    }
    
    .rating-category {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: var(--spacing-md);
    }

    .rating-stars {
        justify-content: flex-start;
    }

    .submit-button {
        width: 100%;
        padding: var(--spacing-sm);
    }

    .comment-input {
        min-height: 100px;
    }

    /* 标题字号缩小 */
    .review-title {
        font-size: 1rem;
        margin-bottom: var(--spacing-sm);
    }
}

/* 现有480px媒体查询下移并扩展 */
@media (max-width: 480px) {
    .comment-section {
        padding: var(--spacing-sm);
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
    }
    
    .star::before {
        font-size: 20px;
    }
    
    .rating-category span {
        font-size: 14px;
    }
}