/* AI试衣间 - 顾客端H5页面样式 */

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

/* 根元素字体大小，用于响应式单位 */
html {
    font-size: 16px;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', sans-serif;
    background-color: #fff5f7;
    color: #333;
    line-height: 1.5;
    padding-bottom: 2rem;
}

/* 顶部导航栏 */
.header {
    background: linear-gradient(135deg, #ff9eb5, #ffb6c1);
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 10px rgba(255, 158, 181, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.store-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

.logo {
    background-color: white;
    color: #ff9eb5;
    padding: 0.3rem 0.8rem;
    border-radius: 1.5rem;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 主容器 */
.container {
    max-width: 100%;
    padding: 1rem;
    margin: 0 auto;
}

/* 区块标题 */
section h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #ff6b95;
    border-bottom: 2px solid #ffd1dc;
    padding-bottom: 0.5rem;
}

/* 个人信息区 */
.personal-info {
    background-color: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.2);
}

.required-info,
.female-info,
.optional-info {
    margin-bottom: 1.5rem;
}

.female-info h3,
.optional-info h3 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    color: #ff8fab;
    font-weight: normal;
}

/* 输入框组 */
.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ffd1dc;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fff9fb;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #ff9eb5;
    box-shadow: 0 0 0 3px rgba(255, 158, 181, 0.2);
}

/* 照片上传区 */
.photo-upload {
    background-color: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.2);
}

.upload-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.upload-btn {
    flex: 1;
    padding: 1.5rem 1rem;
    background-color: #fff5f7;
    border: 2px dashed #ffb6c1;
    border-radius: 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-btn:hover {
    background-color: #ffe0e6;
    border-color: #ff9eb5;
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.upload-btn span {
    display: block;
    font-size: 0.9rem;
    color: #ff6b95;
}

/* 照片预览区 */
.photo-preview {
    position: relative;
    margin-top: 1rem;
    text-align: center;
}

.photo-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.8rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background-color: #ff6b95;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 服装选择区 */
.clothing-selection {
    background-color: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.2);
}

.clothing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.clothing-item {
    position: relative;
    cursor: pointer;
    border-radius: 0.8rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background-color: #fff5f7;
}

.clothing-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 158, 181, 0.3);
}

.clothing-item.selected {
    border: 3px solid #ff6b95;
    box-shadow: 0 0 0 3px rgba(255, 107, 149, 0.2);
}

.clothing-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

/* 服装名称标签 */
.clothing-name {
    display: block;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    background-color: #fff9fb;
    border-top: 1px solid #ffd1dc;
}

/* 男性服装样式 */
.clothing-item[data-gender='male'] {
    background-color: #f0f8ff;
}

.clothing-item[data-gender='male'] .clothing-name {
    background-color: #e6f2ff;
    border-top: 1px solid #b8d9ff;
}

/* 服装筛选提示 */
.clothing-filter-tip {
    margin-top: 1rem;
    padding: 0.8rem;
    background-color: #fff0f5;
    border-radius: 0.5rem;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.clothing-filter-tip p {
    color: #ff6b95;
    font-size: 0.9rem;
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 服装切换动画 */
.clothing-item {
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 生成按钮 */
.generate-btn {
    display: block;
    width: 80%;
    margin: 2rem auto;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #ff6b95, #ff9eb5);
    color: white;
    border: none;
    border-radius: 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 107, 149, 0.3);
    transition: all 0.3s ease;
}

.generate-btn:hover {
    background: linear-gradient(135deg, #ff5583, #ff8fab);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 149, 0.4);
}

/* 生成中状态 */
.loading {
    text-align: center;
    padding: 2rem;
    background-color: white;
    border-radius: 1rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.2);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #ffd1dc;
    border-top: 5px solid #ff6b95;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading p {
    color: #ff6b95;
    font-size: 1rem;
}

/* 结果展示区 */
.result {
    background-color: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.2);
}

.result-image {
    text-align: center;
    margin-bottom: 1.5rem;
}

.result-image img {
    max-width: 100%;
    border-radius: 0.8rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.result-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.result-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.8rem 1rem;
    background-color: #fff5f7;
    color: #ff6b95;
    border: 2px solid #ffd1dc;
    border-radius: 2rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.result-btn:hover {
    background-color: #ffe0e6;
    border-color: #ff9eb5;
}

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

/* 提示弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 1rem;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #ff6b95;
}

.modal-content p {
    margin-bottom: 1.5rem;
    color: #666;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-btn {
    padding: 0.8rem 2rem;
    border-radius: 2rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#modalConfirm {
    background: linear-gradient(135deg, #ff6b95, #ff9eb5);
    color: white;
}

#modalConfirm:hover {
    background: linear-gradient(135deg, #ff5583, #ff8fab);
}

#modalCancel {
    background-color: #f0f0f0;
    color: #666;
}

#modalCancel:hover {
    background-color: #e0e0e0;
}

/* 响应式设计 */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }

    .clothing-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .store-name {
        font-size: 1rem;
    }

    .upload-buttons {
        flex-direction: column;
    }

    .result-buttons {
        flex-direction: column;
    }

    .result-btn {
        width: 100%;
    }
}

/* 兼容性优化 */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type='number'] {
    -moz-appearance: textfield;
}

/* 微信浏览器兼容 */
.wechat-browser .upload-btn {
    position: relative;
    z-index: 1;
}

/* 抖音浏览器兼容 */
.douyin-browser .modal-content {
    padding: 1.5rem;
}

/* 小红书浏览器兼容 */
.xiaohongshu-browser .result-btn {
    border-radius: 0.5rem;
}
