* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: #1f2937;
    margin-bottom: 30px;
    padding: 20px 20px 0;
}

header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #4f46e5;
}

.subtitle {
    font-size: 18px;
    color: #6b7280;
}

.main-content {
    margin-bottom: 40px;
}

.converter-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.preview-section h3,
.options-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #1f2937;
    font-weight: 600;
}

.preview-box {
    background: #f9fafb;
    border-radius: 12px;
    padding: 24px;
    height: 340px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px dashed #d1d5db;
    position: relative;
}

.preview-title {
    font-size: 18px;
    color: #1f2937;
    font-weight: 600;
    text-align: center;
}

.preview-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.image-info {
    text-align: center;
    margin-top: 10px;
    color: #6b7280;
    font-size: 13px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.size-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.size-btn {
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    color: #374151;
}

.size-btn:hover {
    border-color: #4f46e5;
    transform: translateY(-2px);
}

.size-btn.active {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.size-btn .recommended {
    display: block;
    font-size: 12px;
    font-weight: 400;
    margin-top: 4px;
    opacity: 0.8;
}

.download-btn {
    width: 100%;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}

.download-btn:hover:not(:disabled) {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.download-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.download-btn svg {
    stroke-width: 2.5;
}

.reupload-btn {
    width: 100%;
    background: #f9fafb;
    color: #4f46e5;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.reupload-btn:hover {
    border-color: #4f46e5;
    background: #eef2ff;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.feature-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
}

.feature-icon {
    color: #4f46e5;
    margin-bottom: 12px;
}

.feature-icon svg {
    stroke-width: 1.5;
    width: 40px;
    height: 40px;
}

.feature-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #1f2937;
    font-weight: 600;
}

.feature-card p {
    color: #6b7280;
    line-height: 1.5;
    font-size: 14px;
}

footer {
    text-align: center;
    color: #9ca3af;
    padding: 20px 20px 10px;
    font-size: 14px;
}

footer p {
    margin: 10px 0;
}

footer a {
    color: #9ca3af;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 968px) {
    .converter-card {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .features {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 30px;
    }
}

@media (max-width: 640px) {
    .size-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    header h1 {
        font-size: 26px;
    }

    .converter-card {
        padding: 20px;
    }

    .feature-card {
        padding: 20px;
    }
}

.preview-box:hover {
    border-color: #4f46e5;
    background: #eef2ff;
}

.preview-box.dragover {
    border-color: #4f46e5;
    background: #eef2ff;
    transform: scale(1.02);
}

.upload-placeholder {
    text-align: center;
    color: #6b7280;
}

.upload-placeholder svg {
    color: #9ca3af;
    margin-bottom: 16px;
}

.upload-placeholder p {
    font-size: 16px;
}

#previewImage {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
