/* 主要内容区域 */
.main-content {
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* 上传区域样式 */
.upload-section {
    padding: 30px 0; /* 原为 80px 0，缩小顶部留白避免与 .main-content 的 60px 顶部外边距叠加造成过大间距 */
    background: #000000;
    min-height: calc(100vh - 60px);
}

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

.upload-content {
    text-align: center;
}

.upload-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

/* 第二行标题样式 - 减小与上方的间距 */
.upload-content h1.upload-title.price {
    font-size: 2rem; /* 将"仅需 ¥29.9"字体从3rem改为2rem，使其比主标题小 */
    margin-top: -0.8rem !important;
    margin-bottom: 2rem !important;
}

.upload-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 3rem;
    font-weight: 400;
    line-height: 1.5;
}

/* 上传输入卡片容器 - 独立卡片 */
.upload-input-container {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 15px 10px; /* 进一步减小内边距 */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 120px; /* 减小最小高度，适应图片预览 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-input-container:hover {
    background: rgba(0, 122, 255, 0.05);
}

.upload-input-container.dragover {
    background: rgba(0, 122, 255, 0.1);
}



.upload-button {
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
    background: linear-gradient(135deg, #0056CC 0%, #003D99 100%);
}

.upload-text {
    color: rgba(255, 255, 255, 0.8);
}

.upload-main-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.upload-sub-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 图片预览容器 */
.image-preview-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0; /* 移除顶部间距 */
    gap: 12px;
    position: relative;
    z-index: 1;
}

/* 图片预览区域 */
.image-preview {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 80px; /* 设置正方形宽度 */
    height: 80px; /* 设置正方形高度 */
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 填充整个容器，保持宽高比但裁剪超出部分 */
    object-position: center; /* 显示图片中间位置 */
    display: block;
    cursor: pointer; /* 添加指针样式，提示可点击查看大图 */
}

/* 删除按钮 */
.remove-image {
    background: #ff4444;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3);
    flex-shrink: 0;
    pointer-events: auto;
    z-index: 1000;
    position: relative;
}

.remove-image:hover {
    background: #ff2222;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.5);
}



/* 性别选择 */
.gender-selection {
    margin: 12px 0;
}

.gender-options {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.gender-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gender-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.gender-option input[type="radio"] {
    display: none;
}

.gender-option input[type="radio"]:checked + .gender-label {
    color: #007AFF;
}

.gender-option:has(input[type="radio"]:checked) {
    background: rgba(0, 122, 255, 0.1);
    border-color: #007AFF;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

.gender-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    transition: color 0.3s ease;
    user-select: none;
}

/* 生成按钮 */
.generate-button {
    position: relative;
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    border: none;
    border-radius: 50px;
    padding: 18px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.3);
    min-width: 200px;
    width: 100%;
}

.generate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 122, 255, 0.4);
}

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

.generate-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button-text {
    position: relative;
    z-index: 2;
}

.button-ripple {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.generate-button:active .button-ripple {
    transform: scale(1);
}

/* 用户积分显示 */
.user-points-display {
    margin-top: 15px;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: rgba(255, 224, 102, 0.1);
    border: 1px solid rgba(255, 224, 102, 0.3);
    border-radius: 8px;
    text-align: center;
}

.user-points-display .points-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

.user-points-display .points-text strong {
    color: #FFE066;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 4px;
}

/* 加载遮罩层 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    color: #ffffff;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
}

/* 响应式设计 */
@media (max-width: 768px) {
    
    .upload-section {
        padding: 40px 0; /* 原为 60px 0，移动端同样适当收紧 */
    }
    
    .upload-title {
        font-size: 2.5rem;
    }
    
    .upload-content h1.upload-title.price {
        font-size: 1.8rem; /* 移动端"仅需 ¥29.9"字体大小，比主标题小 */
    }
    
    .upload-subtitle {
        font-size: 1.2rem;
        margin-bottom: 2rem;
    }
    
    .upload-input-container {
        padding: 20px 15px; /* 保持减小的内边距 */
    }
    
    .comparison-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .comparison-arrow {
        transform: rotate(90deg);
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .action-button {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .upload-title {
        font-size: 2rem;
    }
    
    .upload-content h1.upload-title.price {
        font-size: 1.5rem; /* 小屏幕移动端"仅需 ¥29.9"字体大小，比主标题小 */
    }
    
    .upload-subtitle {
        font-size: 1.1rem;
    }
    
    .upload-input-container {
        padding: 15px 10px; /* 进一步减小移动端的内边距 */
    }
    
    .result-images {
        grid-template-columns: 1fr;
    }
}

/* 微信浏览器特殊优化 */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    /* 修复微信浏览器中的滚动问题 */
    body {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
    }
    
    /* 模态框在微信浏览器中的优化 - 移至主定义中 */
    
    /* 按钮点击效果优化 */
    .generate-button,
    .action-button {
        -webkit-appearance: none;
        appearance: none;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* 进度条在微信浏览器中的优化 */
    .progress-bar {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: width;
    }
    
    /* 图片显示优化 */
    .result-image,
    .comparison-image {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 防止微信浏览器缩放 */
.upload-container,
.progress-container,
.result-container {
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
}

/* 图片展示区域 */
.gallery-section {
    margin-top: 40px;
    padding: 0 20px;
    text-align: center;
}

.gallery-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.6;
}

.gallery-title strong {
    color: #ffd700;
    font-weight: 700;
    text-shadow: 0 2px 6px rgba(255, 215, 0, 0.4);
}

.gallery-subtitle {
    font-size: 0.85rem;
    font-weight: 300;
    color: #999999;
    opacity: 0.9;
    font-style: normal;
    text-shadow: none;
    line-height: 1.4;
    display: block;
}

.gallery-subtitle strong {
    font-weight: 400;
    color: #bbbbbb;
}

/* 生成完成后的重试区域 */
.retry-container {
    margin-top: 12px;
}

.retry-button {
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    border: none;
    border-radius: 35px;
    padding: 16px 32px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.3);
    margin-top: 6px;
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 122, 255, 0.4);
}

.retry-button:active {
    transform: translateY(0);
}

.retry-note {
    margin-top: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.gallery-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Loading状态样式 */
.gallery-item.loading {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-item.loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.gallery-item.loading::after {
    content: '生成中...';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

/* 生成中的模糊效果 */
.gallery-item.generating {
    position: relative;
}

.gallery-item.generating img {
    filter: blur(50px);
    transition: filter 0.3s ease;
}

/* 生成完成的图片样式 */
.gallery-item.generated {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gallery-item.generated img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: none;
    transition: transform 0.3s ease;
}

.gallery-item.generated:hover img {
    transform: scale(1.05);
}


/* 响应式设计 */
@media (max-width: 768px) {
    .gallery-grid {
        gap: 10px;
    }
    
    .gallery-title {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }
}

/* 生成过程显示样式 */
.generation-process {
    margin: 30px 0;
    text-align: center;
}

.process-text {
    font-size: 1rem;
    color: #ffffff;
    margin-bottom: 20px;
    min-height: 24px;
    line-height: 1.5;
    font-weight: 600;
    opacity: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.progress-bar {
    width: 300px;
    height: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    overflow: hidden;
    border: 0.5px solid #ffffff;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #07C160 0%, #06AD56 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 15%;
    box-shadow: 0 1px 3px rgba(7, 193, 96, 0.3);
}

.progress-percentage {
    font-size: 1rem;
    color: #ffffff;
    font-weight: 700;
    min-width: 50px;
    text-align: left;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .progress-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .progress-bar {
        width: 250px;
    }
    
    .process-text {
        font-size: 0.9rem;
    }
}

/* 分类展示区域样式 */
.categories-section {
    margin-top: 40px;
    padding: 0 20px;
}

.categories-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.categories-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.categories-container {
    display: flex;
    flex-direction: column;
    gap: 60px;
    max-width: 800px;
    margin: 0 auto;
}

.category-item {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    transition: none;
}

.category-item:hover {
    transform: none;
    box-shadow: none;
}

.category-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 25px;
    border-bottom: 1.2px solid rgba(255, 255, 255, 0.2);
}

.category-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    flex: 1;
    text-align: left;
}

.category-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 15px;
    margin-bottom: 10px;
}

.category-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 15px;
}

.category-pricing {
    display: flex;
    gap: 10px;
    align-items: center;
}

.category-original-price {
    font-size: 1rem;
    color: #e74c3c;
    text-decoration: line-through;
}

.category-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e74c3c;
    display: flex;
    align-items: center;
}

.category-price .price-label-tag {
    width: 60px;
    height: 32px;
    margin-right: 2px;
}

.category-price .price-currency {
    font-size: 1.1rem;
}

.category-price .price-amount {
    font-size: 1.8rem;
}

/* 会员价样式 - 与优惠价格样式保持一致 */
.category-member-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #FFD700;
    display: flex;
    align-items: center;
}

.category-member-price .member-price-label-tag {
    width: 60px;
    height: 32px;
    margin-right: 2px;
}

.category-member-price .member-price-currency {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e74c3c;
}

.category-member-price .member-price-amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: #e74c3c;
}

/* "立即拥有"按钮样式 */
.own-now-button {
    background: linear-gradient(135deg, #007AFF, #5856D6);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.own-now-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.category-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.category-gallery-item {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.category-gallery-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.category-gallery-item:hover img {
    transform: scale(1.05);
}

.category-gallery-item.loading {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-gallery-item.loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .gallery-section {
        padding: 0 2px;
    }
    
    .categories-section {
        margin-top: 40px;
        padding: 0 2px;
    }
    
    .categories-title {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }
    
    .categories-container {
        gap: 40px;
    }
    
    .category-item {
        padding: 20px 0;
        border-radius: 15px;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px; /* 进一步缩小移动端名称与价格的上下间距 */
        margin-bottom: 20px;
        padding: 0; /* 取消额外的左右内边距，避免相对于图片左边距的偏移 */
    }

    .category-pricing-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    .category-name {
        font-size: 1.3rem;
        line-height: 1.2;
        text-align: left;
    }

    .category-title-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        margin-bottom: 8px;
    }
    

    .category-original-price {
        font-size: 1rem;
    }

    .category-price {
        font-size: 1.2rem;
    }
    
    /* 移动端："限时价"标签样式 */
    .category-price .price-label-tag {
        font-size: 0.7rem;
        padding: 1px 4px;
        margin-right: 4px;
    }
    
    /* 移动端：币符字号 */
    .category-price .price-currency {
        font-size: 1rem;
    }
    
    .category-price .price-amount {
        font-size: 1.3rem;
    }
    
    /* 移动端：会员价样式 */
    .category-member-price {
        font-size: 1.2rem;
    }
    
    /* 移动端："会员价"标签样式 */
    .category-member-price .member-price-label-tag {
        font-size: 0.7rem;
        padding: 1px 4px;
        margin-right: 4px;
    }
    
    /* 移动端：会员价币符字号 */
    .category-member-price .member-price-currency {
        font-size: 1rem;
        font-weight: 700;
        color: #e74c3c;
    }
    
    .category-member-price .member-price-amount {
        font-size: 1.3rem;
        font-weight: 700;
        color: #e74c3c;
    }
    
    /* 移动端："立即拥有"按钮样式 */
    .own-now-button {
        font-size: 0.85rem;
        padding: 9px 14px;
        flex-shrink: 0;
        min-width: auto;
    }
    
    .category-gallery {
        gap: 10px;
        /* 移除内边距，改为复用外层 .categories-section 的 0 20px */
    }
    
    .category-gallery-item {
        aspect-ratio: 2/3;
        border-radius: 8px;
    }
}

/* 图片错误占位符样式 */
.category-gallery-item.error {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
}

.image-error-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    text-align: center;
}

.image-error-placeholder svg {
    opacity: 0.5;
    margin-bottom: 8px;
}
