.dualese-generator-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.generator-card,
.output-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.input-section label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.chinese-input {
    width: 100%;
    padding: 15px;
    font-size: 1.3rem;
    font-family: 'Noto Sans CJK TC', 'Noto Sans CJK SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    resize: vertical;
    transition: all 0.3s ease;
}

.chinese-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.example-buttons {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.example-btn {
    background: #f0f0f0;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.example-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.control-group {
    flex: 1;
    min-width: 150px;
}

.control-group label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.control-group select,
.control-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
}

.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-end;
}

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

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

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.output-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

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

.dualese-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    overflow-x: auto;
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-placeholder {
    text-align: center;
    color: #999;
}

.loading-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.dualese-output {
    display: inline-block;
    white-space: nowrap;
}

.char-item {
    display: inline-block;
    margin: 0 8px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.char-item:hover {
    transform: scale(1.05);
}

.char-item-horizontal {
    display: inline-flex;
    align-items: center;
    margin: 0 10px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.char-item-horizontal:hover {
    transform: scale(1.02);
}

.char-img {
    display: block;
    margin: 0 auto;
}

.sound-img {
    display: block;
    margin: 5px auto 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.char-item:hover .sound-img,
.char-item-horizontal:hover .sound-img {
    opacity: 1;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 4px solid #c33;
}

.success-message {
    background: #efe;
    color: #3c3;
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 4px solid #3c3;
}

/* Loading state for generate button */
.generate-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.generate-btn.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
    display: inline-block;
    width: 20px;
    text-align: left;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .generator-card,
    .output-card {
        padding: 20px;
    }
    
    .chinese-input {
        font-size: 1.1rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .control-group {
        width: 100%;
    }
    
    .generate-btn {
        width: 100%;
    }
    
    .output-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dualese-output {
        white-space: normal;
    }
    
    .char-item,
    .char-item-horizontal {
        margin: 5px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .generator-card,
    .output-card {
        background: #1a1a2e;
    }
    
    .output-header h3,
    .input-section label {
        color: #eee;
    }
    
    .chinese-input {
        background: #2a2a3e;
        border-color: #3a3a4e;
        color: #eee;
    }
    
    .dualese-container {
        background: #0f0f1a;
    }
    
    .example-btn {
        background: #2a2a3e;
        color: #ddd;
    }
    
    .example-btn:hover {
        background: #3a3a4e;
    }
    
    .control-group select,
    .control-group input {
        background: #2a2a3e;
        border-color: #3a3a4e;
        color: #ddd;
    }
    
    .action-btn {
        background: #2a2a3e;
        border-color: #3a3a4e;
        color: #ddd;
    }
    
    .action-btn:hover {
        background: #667eea;
        color: white;
    }
}