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

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

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

header {
    background: linear-gradient(135deg, #5e72e4 0%, #825ee4 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

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

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    padding: 30px;
}

.input-section {
    margin-bottom: 30px;
}

.textarea-wrapper {
    position: relative;
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #5e72e4;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

.char-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
}

.control-panel {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.voice-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group label {
    font-weight: 600;
    color: #555;
}

.setting-group select,
.setting-group input[type="range"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

.setting-group span {
    font-size: 14px;
    color: #666;
    text-align: right;
}

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

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn.primary {
    background: linear-gradient(135deg, #5e72e4 0%, #825ee4 100%);
    color: white;
    flex: 2;
}

.btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(94, 114, 228, 0.3);
}

.btn.secondary {
    background: #e9ecef;
    color: #495057;
    flex: 1;
}

.btn.secondary:hover:not(:disabled) {
    background: #dee2e6;
}

.btn.outline {
    background: transparent;
    border: 2px solid #5e72e4;
    color: #5e72e4;
    width: 100%;
}

.btn.outline:hover:not(:disabled) {
    background: #5e72e4;
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    display: inline-block;
}

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

.output-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.audio-player {
    margin-bottom: 20px;
}

.audio-player audio {
    width: 100%;
}

.download-section {
    margin-bottom: 30px;
}

.example-sentences h3 {
    margin-bottom: 15px;
    color: #555;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.example-btn {
    padding: 10px;
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.example-btn:hover {
    background: #5e72e4;
    color: white;
    border-color: #5e72e4;
}

.status-section {
    margin-top: 20px;
    min-height: 50px;
}

.status-message {
    padding: 10px;
    background: #d4edda;
    color: #155724;
    border-radius: 5px;
    display: none;
}

.error-message {
    padding: 10px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 5px;
    display: none;
}

.admin-link {
    margin-top: 20px;
    text-align: center;
}

.admin-link a {
    color: #5e72e4;
    text-decoration: none;
    font-size: 14px;
}

.admin-link a:hover {
    text-decoration: underline;
}

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
    border-top: 1px solid #dee2e6;
}

.footer-note {
    margin-top: 10px;
    font-size: 0.9em;
}

.footer-note a {
    color: #5e72e4;
    text-decoration: none;
}

.footer-note a:hover {
    text-decoration: underline;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideDown 0.3s ease-out;
}

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

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.modal-desc {
    margin: 15px 0;
    color: #666;
}

.modal-desc a {
    color: #5e72e4;
    text-decoration: none;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #5e72e4;
}

.form-actions {
    text-align: right;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .voice-settings {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .modal-content {
        margin: 30% auto;
        padding: 20px;
    }
}