/* 前端评论展示样式 */

.reviews-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    box-sizing: border-box;
}

.reviews-header {
    text-align: center;
    margin-bottom: 40px;
}

.reviews-header h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 10px;
}

.reviews-header .business-info {
    color: #666;
    font-size: 1.1em;
}

/* 全宽评论网格 */
.reviews-grid {
    display: grid;
    grid-template-columns: 1fr; /* 改为单列全宽 */
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

/* 全宽评论卡片 */
.review-card {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    width: 100%; /* 确保卡片占满容器宽度 */
    max-width: 100%; /* 最大宽度为100% */
    box-sizing: border-box; /* 确保padding不会超出宽度 */
}

.review-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 全宽评论头部 */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    width: 100%;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1; /* 让用户信息占据更多空间 */
}

.reviewer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    text-transform: uppercase;
    flex-shrink: 0; /* 防止头像被压缩 */
}

.reviewer-details {
    flex: 1;
    min-width: 0; /* 允许文本换行 */
}

.reviewer-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 4px;
}

.review-date {
    color: #666;
    font-size: 14px;
}

.review-stars {
    display: flex;
    gap: 2px;
    margin-top: 4px;
}

.star {
    font-size: 18px;
    color: #ddd;
}

.star.filled {
    color: #ffd700;
}

/* 全宽评论内容 */
.review-content {
    color: #444;
    line-height: 1.6;
    font-size: 15px;
    margin-bottom: 16px;
    width: 100%;
    word-wrap: break-word; /* 确保长文本正确换行 */
}

/* 全宽分类标签 */
.review-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
}

.category-tag {
    background: #f0f4ff;
    color: #3b82f6;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

/* 全宽照片展示 */
.review-photos {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    width: 100%;
}

.review-photo {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
    flex-shrink: 0; /* 防止照片被压缩 */
}

.review-photo:hover {
    transform: scale(1.05);
}

/* 加载更多按钮 */
.load-more-container {
    text-align: center;
    margin: 40px 0;
}

.load-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

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

/* 无评论状态 */
.no-reviews {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-reviews h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .reviews-container {
        padding: 15px;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .reviews-header h1 {
        font-size: 2em;
    }
    
    .reviews-grid {
        grid-template-columns: 1fr; /* 保持单列全宽 */
        gap: 15px;
        width: 100%;
    }
    
    .review-card {
        padding: 20px;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
    }
    
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }
    
    .review-stars {
        align-self: flex-start;
    }
    
    .review-content {
        width: 100%;
        word-wrap: break-word;
    }
    
    .review-categories {
        width: 100%;
    }
    
    .review-photos {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .reviews-container {
        padding: 12px;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .review-card {
        padding: 16px;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
    }
    
    .reviewer-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .reviewer-name {
        font-size: 15px;
    }
    
    .review-content {
        font-size: 14px;
        width: 100%;
    }
    
    .review-header {
        width: 100%;
    }
    
    .review-categories {
        width: 100%;
    }
    
    .review-photos {
        width: 100%;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .reviews-container {
        padding: 10px;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .review-card {
        padding: 12px;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
    }
    
    .reviewer-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .reviewer-name {
        font-size: 14px;
    }
    
    .review-content {
        font-size: 13px;
        width: 100%;
    }
}

/* 照片查看器模态框 */
.photo-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.photo-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-photo {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #ddd;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s ease;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-prev {
    left: -60px;
}

.modal-next {
    right: -60px;
}

/* 动画效果 */
.review-card {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滚动条样式 */
.review-photos::-webkit-scrollbar {
    height: 6px;
}

.review-photos::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.review-photos::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.review-photos::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
