/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    margin: 0;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 确保容器背景为半透明白色 */
body .container {
    background-color: rgba(255, 255, 255, 0.95) !important;
    background-image: none !important;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 导航标签样式 */
.nav-tabs {
    display: flex;
    background: #e9ecef;
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: #007bff;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.tab-btn:hover:not(.active) {
    background: rgba(0, 123, 255, 0.1);
}

/* 内容区域样式 */
.main-content {
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

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

.content-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.content-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4facfe;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Range输入框样式 */
.form-group input[type="range"] {
    width: calc(100% - 60px);
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
    padding: 0;
    height: 8px;
    background: linear-gradient(135deg, #d5f4e6 0%, #c8f2dc 100%);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.form-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: 2px solid white;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(46, 204, 113, 0.3);
    transition: all 0.3s ease;
}

.form-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.form-group input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: 2px solid white;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(46, 204, 113, 0.3);
}

/* 滑块样式 */
.slider-container {
    margin: 1rem 0;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e9ecef;
    outline: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.slider:hover {
    opacity: 1;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.form-group span {
    display: inline-block;
    min-width: 40px;
    font-weight: 500;
    color: #495057;
    vertical-align: middle;
}

/* 语音合成控件样式 */
.synthesis-controls,
.pinyin-controls {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

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

/* 卡片样式 */
.card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* 结果显示区域 */
.result-area {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #333;
}

.result-area.has-content {
    border-style: solid;
    border-color: #2ecc71;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.08) 0%, rgba(39, 174, 96, 0.05) 100%);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.1);
}

.result-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4facfe;
}

/* 复选框样式 */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    accent-color: #2ecc71;
    cursor: pointer;
}

/* 选择框样式 */
select.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 14px;
    background: #f8f9fa;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

select.form-control:focus {
    outline: none;
    border-color: #4facfe;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

/* 卡片标题样式 */
.card h3 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* 按钮组样式 */
.form-group .btn + .btn {
    margin-left: 10px;
}

/* 标签内复选框样式 */
label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

label input[type="checkbox"] {
    margin-right: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .card {
        padding: 15px;
        margin: 10px 0;
    }
    
    .form-group .btn + .btn {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

.result-display {
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    min-height: 60px;
}

/* 音色训练提示样式 */
.training-notice {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    border-radius: 12px;
    color: #2d3436;
}

.notice-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.training-notice h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #e17055;
}

/* 模态框样式 */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(168, 237, 234, 0.3);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: linear-gradient(145deg, #ffffff 0%, #f8fffe 100%);
    margin: auto;
    border-radius: 20px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(168, 237, 234, 0.4), 0 10px 20px rgba(254, 214, 227, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 1.5rem 2rem 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #2c3e50;
    font-size: 1.3rem;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 1.5rem 2rem 2rem;
}

.modal-footer {
    padding: 1rem 2rem 1.5rem;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

/* 页脚样式 */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem 2rem;
    margin-top: auto;
}

.footer-content p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* 加载指示器 */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 拼音控制区域 */
.pinyin-controls {
    display: grid;
    gap: 1.5rem;
}

/* 滑块值显示样式 */
#speedValue, #pitchValue, #volumeValue {
    color: #4CAF50;
    font-weight: bold;
    font-size: 0.9em;
    margin-left: 5px;
}

/* 音频播放器样式 */
audio {
    width: 100%;
    margin-top: 1rem;
}

/* 文件上传样式 */
input[type="file"] {
    padding: 8px;
    border: 2px dashed #e9ecef;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: #6c757d;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.file-upload {
    border: 2px dashed #e1e5e9;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* 成功/错误消息样式 */
.message {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}