/* AI虚拟试衣间样式 */
.virtual-fitting-room {
    padding: 80px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    color: #2c3e50;
}

.section-subtitle {
    font-size: 1.1rem;
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 60px;
}

.fitting-interface {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 30px;
    margin-bottom: 0;
}

/* 主展示区域 */
.main-display {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
}

.result-container {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: 15px;
    overflow: hidden;
    background: #f8f9fa;
}

/* 单张图片展示 */
.single-result {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.result-image:hover {
    transform: scale(1.02);
}

/* 多张图片画廊 */
.gallery-result {
    width: 100%;
    height: 100%;
    padding: 15px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    height: 100%;
    overflow-y: auto;
}

.gallery-item {
    position: relative;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1;
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.gallery-item img {
    height: 100%;
    object-fit: cover;
}

.gallery-item .image-index {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e91e63;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 控制面板 */
.control-panel {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 30px;
    height: fit-content;
}

/* 选择容器 */
.selection-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.selection-group {
    margin-bottom: 40px;
}

.selection-group:last-child {
    margin-bottom: 0;
}

.selection-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-icon {
    font-size: 1.3rem;
}

.selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.selection-item {
    position: relative;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.selection-item:hover {
    border-color: #e91e63;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.2);
}

.selection-item.active {
    border-color: #e91e63;
    background: #fff5f8;
}

.selection-item img {
    width: 90px;
    object-fit: cover;
    border-radius: 8px;
}

.clothing-placeholder,
.scene-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    margin: 0 auto 8px;
}

.selection-label {
    display: block;
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.selection-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: #e91e63;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.selection-item.active .selection-indicator {
    opacity: 1;
}

.add-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 120px;
    position: relative;
    z-index: 1;
}

.add-option:hover {
    border-color: #e91e63;
    background: #fff5f8;
}

.add-icon {
    width: 40px;
    height: 40px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #6c757d;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.add-option:hover .add-icon {
    background: #e91e63;
    color: white;
}

.add-option span {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.expanded-options {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.expanded-options.show {
    display: grid;
}

/* 上传图片样式 */
.uploaded-image {
    position: relative;
}

.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.uploaded-image:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: #ff3742;
    transform: scale(1.1);
}

.file-input {
    display: none;
}

/* 生成按钮 */
.generate-action {
    text-align: center;
}

.generate-btn {
    background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
    width: 100%;
    justify-content: center;
}

.generate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.2rem;
}

/* 生成设置样式 */
.generate-settings {
    border-top: 1px solid #e9ecef;
    padding-top: 25px;
}

.settings-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

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

.setting-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
}

.option-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.option-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.option-btn:hover {
    border-color: #e91e63;
    background: #fff5f8;
    transform: translateY(-1px);
}

.option-btn.active {
    background: #e91e63;
    border-color: #e91e63;
    color: white;
    box-shadow: 0 3px 10px rgba(233, 30, 99, 0.3);
}

.option-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.option-cost {
    font-size: 0.8rem;
    opacity: 0.8;
}

.option-btn.active .option-cost {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .fitting-interface {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .control-panel {
        padding: 20px;
        gap: 20px;
    }
    
    .selection-container {
        gap: 20px;
    }
    
    .selection-grid {
        grid-template-columns: 1fr;
    }
    
    .expanded-options {
        grid-template-columns: 1fr;
    }
    
    .result-image {
        height: 400px;
    }
    
    .settings-row {
        gap: 15px;
    }
    
    .option-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .option-btn {
        min-width: 70px;
        padding: 8px 16px;
        flex: 1;
        max-width: 120px;
    }
    
    .generate-btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    
    .selection-title,
    .settings-title {
        font-size: 1.1rem;
    }
}

/* 全屏图片查看器 */
.fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    cursor: pointer;
}

.fullscreen-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    cursor: default;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #e91e63;
}

.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 30px;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.image-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

@media (max-width: 480px) {
    .virtual-fitting-room {
        padding: 40px 0;
    }
    
    .main-display,
    .control-panel {
        padding: 20px;
    }
    
    .option-btn {
        min-width: 60px;
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .selection-item {
        padding: 12px;
    }
    
    .selection-item img {
        width: 70px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .close-btn {
        font-size: 30px;
        top: 15px;
        right: 20px;
    }
    
    .nav-btn {
        font-size: 24px;
        padding: 8px 12px;
    }
    
    .fullscreen-image {
        max-width: 95%;
        max-height: 85%;
    }
}