* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* 主要内容区域 */
.main-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.product-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
}

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

.main-image {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.main-image img {
    width: 100%;
    height: 400px;
    object-fit: contain; /* 保证图片完整显示 */
    background: #fff;
    display: block;
    margin: 0 auto;
}

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

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

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

.thumbnail-images img:hover {
    border-color: #667eea;
    transform: scale(1.1);
}

.thumbnail-images img.thumbnail.active {
    border: 2px solid #667eea;
    box-shadow: 0 0 8px #667eea33;
}

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

.product-info h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 10px;
}

.price {
    font-size: 2.5rem;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 20px;
}

/* 款式选择 */
.variants h3, .quantity h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #555;
}

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

.variant-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.variant-option:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.variant-option input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

/* 数量控制 */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-controls button {
    width: 40px;
    height: 40px;
    border: none;
    background: #667eea;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.quantity-controls button:hover {
    background: #5a6fd8;
    transform: scale(1.1);
}

.quantity-controls input {
    width: 80px;
    height: 40px;
    text-align: center;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1.1rem;
}

/* 总价 */
.total {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
}

.total h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

/* 按钮样式 */
.order-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.3);
}

.order-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(231, 76, 60, 0.4);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close:hover {
    color: #e74c3c;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

/* 订单摘要 */
.order-summary {
    background: #f8f9ff;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
}

.order-summary h3 {
    margin-bottom: 15px;
    color: #333;
}

/* 订单项目样式 - 三列对齐 */
.order-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 15px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item strong {
    text-align: left;
    color: #333;
    font-size: 1rem;
}

.order-item .item-quantity {
    text-align: right;
    color: #666;
    font-size: 0.9rem;
}

.order-item .item-price {
    text-align: right;
    color: #e74c3c;
    font-weight: bold;
    font-size: 1rem;
}

.order-total {
    font-size: 1.3rem;
    font-weight: bold;
    color: #e74c3c;
    margin-top: 15px;
    text-align: right;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* 支付选项 */
.payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.payment-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    border: 2px solid #eee;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.payment-option:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
    transform: translateY(-5px);
}

.payment-option i {
    font-size: 3rem;
    margin-bottom: 10px;
    color: #667eea;
}

.payment-option span {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
}

.payment-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
}

.payment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(39, 174, 96, 0.3);
}

/* 商品详情图片区 */
.detail-images {
    width: 100%;
    margin: 40px auto 0 auto;
    padding: 0;
    background: #fff;
}
.detail-image-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}
.detail-image-list img {
    width: 100%;
    max-width: 700px;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    background: #fff;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* 堆叠式款式选择区 */
#variant-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 18px;
}
.variant-row {
    display: grid;
    grid-template-columns: 70px 2.8fr 1.2fr 1.6fr 1.2fr; /* 图片、名称、价格、数量、小计 */
    align-items: center;
    gap: 10px;
    background: #f8f9ff;
    border-radius: 12px;
    padding: 12px 8px;
    box-shadow: 0 2px 8px rgba(102,126,234,0.04);
}
.variant-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #eee;
    transition: border 0.2s;
}
.variant-thumb:hover {
    border: 2px solid #667eea;
}
.variant-name {
    text-align: left;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.variant-price,
.variant-qty,
.variant-subtotal {
    text-align: right;
}
.variant-stock {
    color: #888;
    font-size: 0.95em;
    min-width: 70px;
}
.variant-qty {
    display: flex;
    align-items: center;
    gap: 4px;
}
.variant-qty button {
    width: 28px;
    height: 28px;
    border: none;
    background: #eee;
    color: #333;
    border-radius: 6px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.2s;
}
.variant-qty button:hover {
    background: #667eea;
    color: #fff;
}
.variant-qty input {
    width: 38px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    padding: 2px 0;
}
.variant-subtotal {
    min-width: 90px;
    color: #e67e22;
    font-weight: bold;
    text-align: right;
}
.variant-total {
    text-align: right;
    font-size: 1.2em;
    color: #e74c3c;
    font-weight: bold;
    margin-top: 10px;
}

/* 大图预览弹窗 */
.preview-modal-content {
    max-width: 95vw;
    width: 400px;
    padding: 18px 8px 8px 8px;
    text-align: center;
    background: #fff;
    border-radius: 18px;
}
#previewImage {
    width: 100%;
    max-width: 350px;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 10px;
}
.preview-caption {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 8px;
}
.preview-nav {
    display: flex;
    justify-content: center;
    gap: 18px;
}
.preview-btn {
    background: #eee;
    border: none;
    border-radius: 6px;
    font-size: 1.5em;
    padding: 4px 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.preview-btn:hover {
    background: #667eea;
    color: #fff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .product-section {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .product-info h2 {
        font-size: 1.5rem;
    }
    
    .price {
        font-size: 2rem;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
    
    .payment-options {
        grid-template-columns: 1fr;
    }
    .variant-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 4px;
    }
    .variant-thumb {
        width: 80px;
        height: 80px;
    }
    .preview-modal-content {
        width: 98vw;
        max-width: 98vw;
        padding: 8px 2px 2px 2px;
    }
    #previewImage {
        max-width: 95vw;
    }
}

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

.modal-content {
    animation: fadeIn 0.3s ease;
} 

.choose-variant-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1.2em;
    font-weight: bold;
    padding: 16px 0;
    margin: 18px 0 10px 0;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(102,126,234,0.08);
    transition: background 0.2s;
}
.choose-variant-btn:hover {
    background: linear-gradient(135deg, #5a6fd8, #764ba2);
}
.selected-summary {
    margin: 10px 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 1em;
}
.selected-summary .summary-item {
    background: #f8f9ff;
    border-radius: 8px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.selected-summary .summary-thumb {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
}
.selected-summary .summary-total {
    color: #e74c3c;
    font-weight: bold;
    margin-left: 12px;
}
.selected-summary .no-select {
    color: #aaa;
}
/* 规格弹窗样式 */
.variant-modal-content {
    max-width: 90vw;
    width: 600px;
    padding: 18px 8px 8px 8px;
    text-align: center;
    background: #fff;
    border-radius: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#variant-list-modal {
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    margin: 18px 0 0 0;
    padding: 0 4px;
}
.variant-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    padding: 0 8px;
    width: 100%;
}
.confirm-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 1.1em;
    font-weight: bold;
    padding: 10px 28px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(231,76,60,0.08);
    transition: background 0.2s;
}
.confirm-btn:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
}
@media (max-width: 768px) {
    .variant-modal-content {
        width: 100vw;
        max-width: 100vw;
        min-height: 90vh;
        border-radius: 16px 16px 0 0;
        position: fixed;
        left: 0;
        bottom: 0;
        right: 0;
        top: auto;
        padding: 8px 2px 2px 2px;
    }
    #variant-list-modal {
        max-height: 60vh;
        padding: 0 2px;
    }
    .variant-modal-footer {
        flex-direction: column;
        gap: 10px;
        padding: 0 2px;
    }
    .choose-variant-btn {
        font-size: 1.1em;
        padding: 12px 0;
    }
} 

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.variant-modal-content {
    animation: slideUp 0.35s cubic-bezier(0.23, 1, 0.32, 1);
} 

.main-total {
    margin: 18px 0 0 0;
    font-size: 1.6em;
    color: #e74c3c;
    font-weight: bold;
    text-align: right;
    background: #f8f9ff;
    border-radius: 12px;
    padding: 12px 18px;
    box-shadow: 0 2px 8px rgba(102,126,234,0.04);
} 

#imagePreviewModal {
    z-index: 10001 !important;
}
.preview-modal-content {
    margin: 0 auto;
} 