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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.config-section,
.upload-section,
.action-section,
.result-section,
.tips-section {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
}

h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

h3 {
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.input-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group label {
    min-width: 100px;
    font-weight: 500;
    color: #555;
}

.input-group input[type="password"],
.input-group input[type="text"],
.input-group select {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
}

.toggle-btn {
    padding: 12px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.toggle-btn:hover {
    background: #5568d3;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.upload-box {
    position: relative;
}

.upload-label {
    display: block;
    cursor: pointer;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    background: white;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f8f9fa;
}

.upload-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    color: #667eea;
    stroke-width: 2;
}

.upload-area p {
    margin: 5px 0;
    color: #555;
    font-size: 16px;
}

.upload-area .hint {
    font-size: 12px;
    color: #999;
}

.image-preview {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    border: 3px solid #667eea;
    background: white;
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: contain;
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.remove-btn:hover {
    background: rgba(255, 0, 0, 1);
}

.generate-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.generate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.result-item {
    background: white;
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #e0e0e0;
}

.result-image-container,
.result-video-container {
    margin: 20px 0;
    text-align: center;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.result-image-container img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.result-video-container video {
    max-width: 100%;
    max-height: 500px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.download-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.3s;
    margin-top: 15px;
}

.download-btn:hover {
    background: #5568d3;
}

.progress-info {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #667eea;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.tips-section ul {
    list-style: none;
    padding-left: 0;
}

.tips-section li {
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    line-height: 1.6;
}

.tips-section code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #e83e8c;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2em;
    }

    .upload-grid {
        grid-template-columns: 1fr;
    }

    .input-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .input-group label {
        min-width: auto;
    }
}
