/* 评价区域 - 暗黑卡片网格布局 */

/* 评价区域 - 透明背景 */
.review-section {
    background: transparent;
    margin: 30px 0;
    padding: 0;
}

/* 标题区域 - 暗黑玻璃效果 */
.review-section .section-header {
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 15px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    position: relative; /* ✅ 重要：为 tooltip 提供定位上下文 */
}

.review-section .section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #ff6b9d 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.review-section .section-header h2 i {
    font-size: 1.3rem;
    color: #ff6b9d;
    -webkit-text-fill-color: #ff6b9d;
}

/* 平均评分显示 */
.avg-score-display {
    display: flex;
    align-items: center;
    gap: 16px;
}

.total-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.score-number {
    font-size: 2rem;
    font-weight: 900;
    color: #ff6b9d;
    text-shadow: 0 2px 8px rgba(255, 107, 157, 0.4);
}

.star-rating {
    display: flex;
    gap: 3px;
}

.star-rating i {
    color: #fbbf24;
    font-size: 0.95rem;
}

.star-rating i.half {
    color: #fbbf24;
    opacity: 0.5;
}

.star-rating i.empty {
    color: #4b5563;
}

.review-count {
    font-size: 0.9rem;
    color: #9ca3af;
    white-space: nowrap;
}

/* 写评价按钮 */
.write-review-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #a855f7 0%, #ff6b9d 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
    white-space: nowrap;
}

.write-review-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}

.write-review-btn i {
    font-size: 1rem;
}

/* ✅ 禁用状态的写评价按钮 */
.write-review-btn.disabled {
    background: linear-gradient(135deg, #555, #666) !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
    pointer-events: none !important;
    transform: none !important;
}

/* ✅ Tooltip 提示框 */
.review-disabled-tooltip {
    display: none;
    position: absolute;
    top: -60px;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    animation: fadeInTooltip 0.3s ease;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.review-disabled-tooltip::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 24px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(0, 0, 0, 0.95);
}

@keyframes fadeInTooltip {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 评分详情 */
.score-breakdown {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.score-item:last-child {
    margin-bottom: 0;
}

.score-label {
    min-width: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #e5e7eb;
}

.score-bar-container {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.score-bar {
    height: 100%;
    background: linear-gradient(90deg, #a855f7, #ff6b9d);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.score-value {
    min-width: 40px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 800;
    color: #ff6b9d;
}

/* 评价列表 - 网格布局 */
.reviews-container {
    min-height: 200px;
}

.reviews-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* 单条评价卡片 */
.review-card {
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.review-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
    border-color: #a855f7;
}

/* 评价头部 */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 10px;
}

.reviewer-info {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex: 1;
}

.reviewer-avatar-link {
    display: block;
    flex-shrink: 0;
}

.reviewer-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #a855f7;
    transition: all 0.3s ease;
}

.reviewer-avatar-link:hover .reviewer-avatar {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.4);
}

.reviewer-avatar.default {
    background: linear-gradient(135deg, #a855f7 0%, #ff6b9d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
}

.reviewer-details {
    flex: 1;
    min-width: 0;
}

.reviewer-details h4 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #e5e7eb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reviewer-name-link {
    color: #e5e7eb;
    text-decoration: none;
    transition: color 0.3s ease;
}

.reviewer-name-link:hover {
    color: #ff6b9d;
}

.review-date {
    font-size: 0.75rem;
    color: #9ca3af;
}

.review-avg-score {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.review-score-number {
    font-size: 1.3rem;
    font-weight: 900;
    color: #ff6b9d;
}

.review-stars {
    display: flex;
    gap: 2px;
}

.review-stars i {
    color: #fbbf24;
    font-size: 0.7rem;
}

/* 女生信息卡片 */
.companion-mini-card {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 12px;
}

.companion-mini-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ff6b9d;
    flex-shrink: 0;
}

.companion-mini-info {
    flex: 1;
    min-width: 0;
}

.companion-mini-info h5 {
    margin: 0 0 3px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ff6b9d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.companion-mini-meta {
    font-size: 0.7rem;
    color: #9ca3af;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 评价内容 */
.review-content {
    flex: 1;
    margin-bottom: 12px;
}

.review-text {
    font-size: 0.85rem;
    color: #d1d5db;
    line-height: 1.6;
    margin: 0;
}

.review-text.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.expand-btn {
    background: none;
    border: none;
    color: #a855f7;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 6px;
    transition: color 0.3s ease;
    font-weight: 600;
}

.expand-btn:hover {
    color: #ff6b9d;
}

/* 评分详情 */
.review-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid rgba(168, 85, 247, 0.15);
}

.score-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 0.7rem;
}

.score-badge-label {
    color: #9ca3af;
    font-weight: 600;
}

.score-badge-value {
    color: #ff6b9d;
    font-weight: 800;
}

/* 加载/空/错误状态 */
.review-loading,
.empty-reviews,
.error-reviews {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 15px;
}

.loading-spinner i {
    font-size: 3rem;
    color: #a855f7;
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-content i,
.error-content i {
    font-size: 4rem;
    color: #6b7280;
    margin-bottom: 16px;
}

.empty-content h3,
.error-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e5e7eb;
    margin: 0 0 8px;
}

.empty-content p,
.error-content p {
    font-size: 0.9rem;
    color: #9ca3af;
    margin: 0;
}

.retry-btn {
    margin-top: 16px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #a855f7 0%, #ff6b9d 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

/* 分页 */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
    padding: 20px 0;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover:not(.active):not(:disabled) {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.2);
    transform: translateY(-2px);
}

.page-btn.active {
    background: linear-gradient(135deg, #a855f7 0%, #ff6b9d 100%);
    border-color: transparent;
    color: white;
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-btn:disabled:hover {
    transform: none;
}

/* 隐藏查看所有按钮 */
.view-more-reviews {
    display: none;
}

/* ========================================
   响应式设计 - 平板
   ======================================== */
@media (max-width: 1024px) {
    .reviews-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .review-section .section-header h2 {
        font-size: 1.3rem;
    }

    .review-disabled-tooltip {
        font-size: 0.8rem;
        padding: 10px 14px;
    }
}

/* ========================================
   响应式设计 - 手机
   ======================================== */
@media (max-width: 768px) {
    .review-section .section-header {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px;
        border-radius: 12px;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header-right {
        width: 100%;
        position: relative;
    }

    .write-review-btn {
        width: 100%;
        justify-content: center;
    }

    /* ✅ 手机端 tooltip 显示在按钮下方 */
    .review-disabled-tooltip {
        top: auto;
        bottom: -65px;
        right: 0;
        left: 0;
        margin: 0 auto;
        max-width: 90%;
        text-align: center;
        font-size: 0.75rem;
        white-space: normal;
        padding: 10px 12px;
    }

    .review-disabled-tooltip::after {
        bottom: auto;
        top: -10px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        border-top: none;
        border-bottom: 10px solid rgba(0, 0, 0, 0.95);
    }

    .avg-score-display {
        width: 100%;
        justify-content: space-between;
    }

    .score-number {
        font-size: 1.8rem;
    }

    .reviews-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .review-card {
        padding: 16px;
    }

    .review-header {
        flex-direction: row;
        gap: 10px;
    }

    .reviewer-avatar {
        width: 40px;
        height: 40px;
    }

    .reviewer-details h4 {
        font-size: 0.9rem;
    }

    .review-score-number {
        font-size: 1.2rem;
    }

    .companion-mini-card {
        padding: 8px;
    }

    .companion-mini-avatar {
        width: 35px;
        height: 35px;
    }

    .review-scores {
        gap: 6px;
    }

    .score-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    .score-breakdown {
        padding: 16px;
    }

    .pagination-container {
        gap: 6px;
    }

    .page-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}

/* ========================================
   响应式设计 - 小手机
   ======================================== */
@media (max-width: 480px) {
    .review-section {
        margin: 20px 0;
    }

    .review-section .section-header {
        padding: 14px 16px;
        margin-bottom: 15px;
    }

    .review-section .section-header h2 {
        font-size: 1.1rem;
        gap: 8px;
    }

    .score-number {
        font-size: 1.6rem;
    }

    .review-disabled-tooltip {
        font-size: 0.7rem;
        padding: 8px 10px;
        max-width: 95%;
    }

    .reviews-list {
        gap: 12px;
    }

    .review-card {
        padding: 14px;
        border-radius: 12px;
    }

    .reviewer-avatar {
        width: 38px;
        height: 38px;
    }

    .reviewer-details h4 {
        font-size: 0.85rem;
    }

    .review-text {
        font-size: 0.8rem;
    }

    .companion-mini-card {
        padding: 8px;
        gap: 8px;
    }

    .companion-mini-avatar {
        width: 32px;
        height: 32px;
    }

    .companion-mini-info h5 {
        font-size: 0.8rem;
    }

    .companion-mini-meta {
        font-size: 0.65rem;
    }

    .review-loading,
    .empty-reviews,
    .error-reviews {
        padding: 60px 15px;
    }

    .page-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 0.8rem;
    }
}
