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

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

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease-out;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.95;
}

main {
    animation: fadeIn 0.8s ease-out;
}

.input-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 1.3em;
    color: #667eea;
    margin-bottom: 15px;
    font-weight: 600;
}

.form-group textarea {
    width: 100%;
    padding: 15px;
    font-size: 1em;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.quick-moods {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #f0f0f0;
}

.quick-moods p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.mood-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mood-tag {
    padding: 10px 20px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95em;
}

.mood-tag:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.result-section, .error-section {
    animation: fadeInUp 0.6s ease-out;
}

.result-card, .error-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.result-card h2 {
    color: #667eea;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2em;
}

.music-info {
    margin-bottom: 30px;
}

.info-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
}

.info-item strong {
    color: #667eea;
    font-size: 1.1em;
}

.info-item p {
    margin-top: 10px;
    line-height: 1.6;
    color: #555;
}

.lyrics {
    white-space: pre-line;
    font-style: italic;
    color: #444;
}

.audio-player {
    margin: 30px 0;
    text-align: center;
}

.audio-player audio {
    width: 100%;
    max-width: 500px;
    border-radius: 10px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 30px;
}

.btn-secondary, .btn-outline {
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary {
    background: #667eea;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.error-card {
    text-align: center;
}

.error-card h3 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.error-card p {
    color: #666;
    margin-bottom: 20px;
}

footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    opacity: 0.9;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .input-section, .result-card {
        padding: 25px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-secondary, .btn-outline {
        width: 100%;
    }
}

/* API Key input styling */
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 15px;
    font-size: 1em;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-family: inherit;
    transition: border-color 0.3s;
}

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

.api-key-hint {
    margin-top: 8px;
    font-size: 0.85em;
    color: #666;
}

.api-key-hint a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.api-key-hint a:hover {
    text-decoration: underline;
}

/* Progress Section Styling */
.progress-section {
    margin-top: 30px;
    animation: fadeIn 0.5s ease-out;
}

.progress-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.progress-card h3 {
    color: #667eea;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.5em;
}

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.progress-step {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 10px;
    transition: all 0.3s;
}

.progress-step.active {
    background: linear-gradient(135deg, #667eea20, #764ba220);
    border-left: 4px solid #667eea;
}

.progress-step.completed {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.progress-step .step-icon {
    font-size: 1.5em;
    margin-right: 15px;
    min-width: 30px;
}

.progress-step.active .step-icon {
    animation: pulse 1.5s infinite;
}

.progress-step.completed .step-icon::before {
    content: "✅";
}

.progress-step .step-text {
    font-size: 1em;
    color: #555;
}

.progress-step.active .step-text {
    font-weight: 600;
    color: #667eea;
}

.progress-step.completed .step-text {
    color: #4caf50;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.progress-message {
    text-align: center;
    color: #667eea;
    font-weight: 600;
    font-size: 1.1em;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

@media (max-width: 768px) {
    .progress-steps {
        gap: 10px;
    }
    
    .progress-step {
        padding: 10px;
    }
    
    .progress-step .step-icon {
        font-size: 1.2em;
        margin-right: 10px;
    }
}

/* Edit Section Styling */
.edit-section {
    margin-top: 30px;
    animation: fadeIn 0.5s ease-out;
}

.edit-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.edit-card h2 {
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
    font-size: 2em;
}

.edit-hint {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1em;
    padding: 15px;
    background: #f0f4ff;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.field-hint {
    margin-top: 8px;
    font-size: 0.85em;
    color: #888;
    font-style: italic;
}

.edit-card .form-group {
    margin-bottom: 25px;
}

.edit-card label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.edit-card input[type="text"],
.edit-card textarea {
    width: 100%;
    padding: 15px;
    font-size: 1em;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-family: inherit;
    transition: all 0.3s;
    background: #fafafa;
}

.edit-card input[type="text"]:focus,
.edit-card textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.edit-card textarea {
    resize: vertical;
    min-height: 200px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .edit-card {
        padding: 25px;
    }
    
    .edit-card h2 {
        font-size: 1.5em;
    }
}
