* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

/* 添加全局动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.container {
    max-width: 850px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 40px;
    animation: fadeIn 0.6s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.container:hover {
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
    transform: translateY(-5px);
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 20px;
    animation: slideIn 0.8s ease-out;
}

h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
    flex: 1;
    min-width: 250px;
}

/* 返回按钮样式 */
.back-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.3);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.back-btn:hover::before {
    left: 100%;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(66, 153, 225, 0.4);
    background: linear-gradient(135deg, #3182ce 0%, #2b6cb0 100%);
}

.back-btn:active {
    transform: translateY(0);
}

.container > p {
    text-align: center;
    color: #718096;
    margin-bottom: 40px;
    font-size: 1.2rem;
    font-weight: 400;
    animation: slideIn 0.8s ease-out 0.2s both;
    line-height: 1.6;
}

.upload-section {
    text-align: center;
    margin-bottom: 40px;
    animation: slideIn 0.8s ease-out 0.3s both;
}

.drop-area {
    border: 2px dashed rgba(102, 126, 234, 0.6);
    border-radius: 20px;
    padding: 50px 30px;
    margin-bottom: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(247, 250, 252, 0.8) 0%, rgba(237, 242, 247, 0.8) 100%);
    position: relative;
    overflow: hidden;
    min-height: 320px;
    cursor: pointer;
}

.drop-area:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(235, 248, 255, 0.9) 0%, rgba(240, 255, 244, 0.9) 100%);
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.2);
}

.drop-area.drag-over {
    border-color: #48bb78;
    background: linear-gradient(135deg, rgba(240, 255, 244, 0.95) 0%, rgba(220, 252, 231, 0.95) 100%);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 50px rgba(72, 187, 120, 0.3);
    animation: pulse 0.6s ease-in-out;
}

/* 上传预览区域 */
.upload-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.98);
    z-index: 10;
    overflow-y: auto;
    animation: fadeIn 0.4s ease-out;
}

.upload-preview.show {
    display: flex;
}

/* 单张图片预览项 */
.preview-item {
    position: relative;
    width: 150px;
    height: 150px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.preview-item:hover {
    border-color: #4299e1;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.preview-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.preview-item:hover img {
    transform: scale(1.1);
}

/* 单张图片的关闭按钮 */
.preview-item .close-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
    top: 8px;
    right: 8px;
    background: rgba(229, 62, 62, 0.8);
    backdrop-filter: blur(5px);
}

/* 关闭按钮 */
.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(229, 62, 62, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
}

.close-btn:hover {
    background: rgba(229, 62, 62, 1);
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.5);
}

/* 上传提示区域 */
.upload-prompt {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
}

.upload-prompt.hidden {
    display: none;
}

.upload-prompt p {
    margin: 0 0 25px 0;
    color: #4a5568;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.6;
}

.upload-label {
    display: inline-block;
    padding: 16px 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.2rem;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.upload-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.upload-label:hover::before {
    left: 100%;
}

.upload-label:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.upload-label:active {
    transform: translateY(-1px);
}

.upload-label input[type="file"] {
    display: none;
}

.file-info {
    margin-top: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(247, 250, 252, 0.9) 0%, rgba(237, 242, 247, 0.9) 100%);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.5s ease-out;
}

.file-info.error {
    color: #e53e3e;
    background: linear-gradient(135deg, rgba(255, 245, 245, 0.9) 0%, rgba(254, 237, 237, 0.9) 100%);
    border-color: rgba(237, 137, 137, 0.6);
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.1);
}

.file-info.success {
    color: #38a169;
    background: linear-gradient(135deg, rgba(240, 255, 244, 0.9) 0%, rgba(220, 252, 231, 0.9) 100%);
    border-color: rgba(110, 231, 183, 0.6);
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.1);
}

.convert-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    animation: slideIn 0.8s ease-out 0.4s both;
}

.button-group {
    display: flex;
    gap: 15px;
}

.format-select {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.8);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.format-select label {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
}

.format-select select {
    padding: 12px 20px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    font-size: 1.1rem;
    background: white;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.format-select select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

/* 转换按钮样式 */
.convert-btn {
    padding: 14px 35px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
    position: relative;
    overflow: hidden;
}

.convert-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.convert-btn:hover:not(:disabled)::before {
    left: 100%;
}

.convert-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(72, 187, 120, 0.4);
}

.convert-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* 重置按钮样式 */
.reset-btn {
    padding: 14px 35px;
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(160, 174, 192, 0.3);
    position: relative;
    overflow: hidden;
}

.reset-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.reset-btn:hover::before {
    left: 100%;
}

.reset-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(160, 174, 192, 0.4);
}

.result-section {
    display: none;
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    animation: fadeIn 0.8s ease-out 0.5s both;
}

.result-section h2 {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.converted-images {
    text-align: center;
}

.converted-images h3 {
    color: #4a5568;
    margin-bottom: 25px;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.image-preview {
    width: 100%;
    min-height: 450px;
    border: 2px dashed rgba(102, 126, 234, 0.4);
    border-radius: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 35px;
    padding: 40px;
    background: linear-gradient(135deg, rgba(247, 250, 252, 0.9) 0%, rgba(237, 242, 247, 0.9) 100%);
    overflow: auto;
    box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.image-preview:hover {
    border-color: #667eea;
    box-shadow: inset 0 3px 20px rgba(0, 0, 0, 0.08);
}

/* 单张图片预览项 */
.preview-item-large {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 300px;
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeIn 0.6s ease-out;
}

.preview-item-large:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
}

.preview-item-large img {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    background: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.preview-item-large:hover img {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* 单张图片的下载按钮 */
.image-download-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.3);
    position: relative;
    overflow: hidden;
}

.image-download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.image-download-btn:hover::before {
    left: 100%;
}

.image-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(237, 137, 54, 0.4);
    background: linear-gradient(135deg, #dd6b20 0%, #c05621 100%);
}

.image-download-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        align-items: flex-start;
        justify-content: flex-start;
    }
    
    .container {
        margin: 10px auto;
        padding: 25px 20px;
        max-width: 100%;
        border-radius: 15px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    }
    
    .header-section {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    h1 {
        font-size: 2rem;
        text-align: center;
    }
    
    .back-btn {
        padding: 10px 24px;
        font-size: 1rem;
    }
    
    .container > p {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .drop-area {
        padding: 40px 20px;
        min-height: 250px;
    }
    
    .upload-prompt p {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .upload-label {
        padding: 14px 30px;
        font-size: 1.1rem;
    }
    
    .convert-section {
        flex-direction: column;
        gap: 20px;
    }
    
    .format-select {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .format-select label {
        font-size: 1rem;
    }
    
    .format-select select {
        width: 100%;
        max-width: 250px;
    }
    
    .button-group {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .convert-btn, .reset-btn {
        width: 100%;
        padding: 14px 25px;
        font-size: 1.1rem;
    }
    
    .image-preview {
        min-height: 300px;
        padding: 25px 20px;
        gap: 20px;
    }
    
    .preview-item-large {
        max-width: 100%;
        padding: 20px;
    }
    
    .preview-item-large img {
        max-height: 180px;
    }
    
    .result-section {
        margin-top: 30px;
        padding-top: 30px;
    }
    
    .result-section h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .container {
        margin: 5px;
        padding: 20px 15px;
        border-radius: 12px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .back-btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
    
    .container > p {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }
    
    .drop-area {
        padding: 30px 15px;
        min-height: 200px;
        border-radius: 12px;
    }
    
    .upload-prompt p {
        font-size: 0.95rem;
        margin-bottom: 15px;
    }
    
    .upload-label {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    .file-info {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .format-select select {
        padding: 10px 15px;
        font-size: 1rem;
    }
    
    .convert-btn, .reset-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .image-preview {
        min-height: 250px;
        padding: 20px 15px;
        gap: 15px;
    }
    
    .preview-item-large {
        padding: 15px;
        gap: 15px;
    }
    
    .preview-item-large img {
        max-height: 150px;
    }
    
    .image-download-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .result-section {
        margin-top: 25px;
        padding-top: 25px;
    }
    
    .result-section h2 {
        font-size: 1.6rem;
    }
    
    .converted-images h3 {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }
    
    .preview-item {
        width: 120px;
        height: 120px;
    }
    
    .preview-item .close-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
}