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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: url('images/1.png') no-repeat center center;
    background-size: cover;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    position: relative;
    width: 100vw;
    height: 100vh;
    display: block;
    box-sizing: border-box;
}

.container {
    width: 90%;
    max-height: 40vh;
    margin: 0 auto;
    padding: 15px;
    background: white;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.15);
    backdrop-filter: none;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: visible;
    max-width: none;
    border-radius: 10px;
    flex-wrap: wrap;
    position: absolute;
    bottom: 10%;
    left: 5%;
    right: 5%;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    width: 100%;
}

h2 {
    text-align: center;
    color: #555;
    margin: 10px 0;
    font-size: 12px;
}

/* 左右区域布局 */
.left-section,
.right-section {
    flex: 1;
    min-width: 150px;
    padding: 10px;
    box-sizing: border-box;
}

.left-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.right-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

/* 上传区域 */
.upload-section {
    text-align: center;
    margin-bottom: 0;
    width: 100%;
    max-width: 200px;
}

.upload-btn {
    display: inline-block;
    padding: 12px 25px;
    background: rgba(7, 193, 96, 0.9);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 15px rgba(7, 193, 96, 0.4);
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    outline: none;
    text-decoration: none;
}

.upload-btn:hover {
    background: rgba(5, 173, 84, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 3px 11px rgba(7, 193, 96, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

.upload-btn input[type="file"] {
    display: none;
}

/* 预览区域 */
.preview-section {
    text-align: center;
    margin-bottom: 0;
    width: 100%;
    max-width: none;
}

.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.2);
}

.avatar-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center center;
}

.avatar-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-size: cover;
    background-position: center;
    z-index: 10;
}

/* 缩放控制 */
.zoom-control {
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.zoom-control label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

#zoom-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #07c160;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.4);
    transition: all 0.3s ease;
    border: 2px solid white;
}

#zoom-slider::-webkit-slider-thumb:hover {
    background: #05ad54;
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(7, 193, 96, 0.5);
}

#zoom-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #07c160;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.4);
    transition: all 0.3s ease;
}

#zoom-slider::-moz-range-thumb:hover {
    background: #05ad54;
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(7, 193, 96, 0.5);
}

#zoom-value {
    font-weight: bold;
    color: #07c160;
}

/* 边框选择区域 */
.frame-section {
    margin-bottom: 25px;
    width: 100%;
    max-width: 350px;
}

.frame-list {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    overflow-x: auto;
    padding: 15px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.frame-list::-webkit-scrollbar {
    display: none;
}

.frame-item {
    position: relative;
    width: 85px;
    height: 85px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.frame-item:hover {
    transform: scale(1.1);
    border-color: #07c160;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.frame-item.active {
    border-color: #07c160;
    box-shadow: 0 0 0 4px rgba(7, 193, 96, 0.4);
}

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

.frame-item .frame-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

/* 下载按钮 */
.download-section {
    text-align: center;
    margin-top: 0;
    width: 100%;
    max-width: 200px;
}

.download-btn {
    display: inline-block;
    padding: 12px 25px;
    background: rgba(18, 150, 219, 0.9);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 15px rgba(18, 150, 219, 0.4);
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    outline: none;
    text-decoration: none;
}

.download-btn:hover:not(:disabled) {
    background: rgba(14, 119, 179, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 3px 11px rgba(18, 150, 219, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

.download-btn:disabled {
    background: rgba(18, 150, 219, 0.6);
    cursor: not-allowed;
    box-shadow: 0 2px 7px rgba(18, 150, 219, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    opacity: 0.8;
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding: 15px;
        margin: 0 auto;
    }
    
    h1 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    h2 {
        font-size: 16px;
        margin: 15px 0;
    }
    
    .avatar-container {
        width: 150px;
        height: 150px;
    }
    
    .upload-btn {
        padding: 14px 25px;
        font-size: 12px;
    }
    
    .download-btn {
        padding: 16px 30px;
        font-size: 12px;
    }
    
    .zoom-control {
        margin-top: 15px;
    }
    
    .frame-list {
        gap: 10px;
        margin-top: 10px;
    }
    
    .frame-item {
        width: 70px;
        height: 70px;
    }
}

/* 小屏手机优化 */
@media (max-width: 360px) {
    .avatar-container {
        width: 130px;
        height: 130px;
    }
    
    .frame-item {
        width: 60px;
        height: 60px;
    }
    
    .upload-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .download-btn {
        padding: 14px 25px;
        font-size: 17px;
    }
}