/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

/* 商品图片区域 */
.product-images {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    aspect-ratio: 1;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.main-image:hover img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.main-image:hover .image-overlay {
    opacity: 1;
}

.zoom-icon {
    color: white;
    font-size: 24px;
}

.thumbnail-images {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #007bff;
    transform: scale(1.05);
}

/* 商品信息区域 */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.product-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stars {
    color: #ffc107;
    font-size: 18px;
}

.rating-text {
    color: #666;
    font-size: 14px;
}

/* 价格区域 */
.price-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.price-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.unit-price {
    font-size: 18px;
    color: #666;
    font-weight: 500;
}

.total-price {
    font-size: 36px;
    font-weight: 700;
    color: #e74c3c;
}

.total-price span {
    color: #e74c3c;
}

/* 商品变体选择 */
.product-variants {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.variant-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.variant-group label {
    font-weight: 600;
    color: #333;
}

.color-options {
    display: flex;
    gap: 10px;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.color-option:hover,
.color-option.active {
    border-color: #007bff;
    transform: scale(1.1);
}

.color-option[style*="white"] {
    border: 3px solid #ddd;
}

.version-options {
    display: flex;
    gap: 10px;
}

.version-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.version-btn:hover,
.version-btn.active {
    border-color: #007bff;
    background: #007bff;
    color: white;
}

/* 数量选择 */
.quantity-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.quantity-section label {
    font-weight: 600;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.quantity-btn:hover {
    background: #e9ecef;
}

#quantityInput {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.stock-info {
    color: #28a745;
    font-size: 14px;
    font-weight: 500;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    flex: 1;
    min-width: 180px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
    flex: 1;
    min-width: 200px;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.btn-icon {
    width: 50px;
    padding: 15px;
    background: white;
    border: 2px solid #ddd;
    color: #666;
}

.btn-icon:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

/* 产品特色 */
.product-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
}

.feature-item i {
    color: #28a745;
    font-size: 16px;
}

/* 商品详细信息 */
.product-details {
    background: white;
    margin: 20px auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    flex: 1;
    padding: 20px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn:hover,
.tab-btn.active {
    color: #007bff;
    background: #f8f9fa;
    border-bottom: 3px solid #007bff;
}

.tab-content {
    padding: 30px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-panel h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.feature-list li {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.specs-table td:first-child {
    font-weight: 600;
    color: #666;
    width: 30%;
}

/* 评价区域 */
.reviews-summary {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.rating-overview {
    display: flex;
    gap: 30px;
    align-items: center;
}

.overall-rating {
    font-size: 48px;
    font-weight: 700;
    color: #ffc107;
}

.rating-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.rating-bar span:first-child {
    width: 30px;
}

.bar {
    flex: 1;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.fill {
    height: 100%;
    background: #ffc107;
    transition: width 0.3s ease;
}

.rating-bar span:last-child {
    width: 40px;
    text-align: right;
}

.review-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.reviewer-details {
    flex: 1;
}

.reviewer-name {
    font-weight: 600;
    color: #333;
}

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

.review-rating {
    color: #ffc107;
}

.review-content {
    color: #666;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 10px;
        padding: 15px;
    }
    
    .product-header h1 {
        font-size: 24px;
    }
    
    .total-price {
        font-size: 28px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        min-width: auto;
    }
    
    .product-features {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        text-align: left;
    }
    
    .rating-overview {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .thumbnail-images {
        flex-wrap: wrap;
    }
    
    .quantity-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .price-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .version-options {
        flex-direction: column;
    }
    
    .version-btn {
        text-align: left;
    }
    
    .color-options {
        justify-content: flex-start;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container,
.product-details {
    animation: fadeIn 0.6s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

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