/* 百度语音识别系统样式 */

* {
    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;
    color: #333;
    line-height: 1.6;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header div {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.header h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 2.5rem;
    font-weight: 600;
}

.header h1 img {
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header p {
    color: #666;
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* 容器布局 */
.container-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
}

.my-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.my-container h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 600;
    border-bottom: 3px solid #e74c3c;
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* 上传方式选择 */
.upload-methods {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 0.5rem;
}

.method-tab {
    flex: 1;
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.method-tab:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.method-tab.active {
    background: #e74c3c;
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.method-icon {
    font-size: 1.5rem;
}

/* 上传区域 */
.upload-content {
    display: none;
}

.upload-content.active {
    display: block;
}

.upload-zone {
    border: 3px dashed #bdc3c7;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #7f8c8d;
}

.upload-text {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.upload-hint {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 文件预览 */
.file-preview {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #e74c3c;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.file-meta {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.remove-file {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-file:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

.audio-player-preview audio {
    width: 100%;
    border-radius: 8px;
}

/* 录音区域 */
.record-section {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.record-controls {
    margin-bottom: 2rem;
}

.record-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 150px;
}

.record-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
}

.record-btn.stop-btn {
    background: #95a5a6;
}

.record-btn.stop-btn:hover {
    background: #7f8c8d;
}

.record-icon {
    font-size: 1.3rem;
}

.record-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.record-time {
    font-size: 2rem;
    font-weight: 600;
    color: #e74c3c;
    font-family: monospace;
}

.record-wave {
    display: flex;
    gap: 4px;
    align-items: end;
    height: 40px;
}

.wave-bar {
    width: 4px;
    background: #e74c3c;
    border-radius: 2px;
    animation: wave 1.5s infinite ease-in-out;
}

.wave-bar:nth-child(2) { animation-delay: -1.4s; }
.wave-bar:nth-child(3) { animation-delay: -1.3s; }
.wave-bar:nth-child(4) { animation-delay: -1.2s; }
.wave-bar:nth-child(5) { animation-delay: -1.1s; }

@keyframes wave {
    0%, 40%, 100% { height: 8px; }
    20% { height: 40px; }
}

.record-result {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.result-info {
    margin-bottom: 1rem;
    font-weight: 500;
    color: #27ae60;
}

.record-tips {
    background: #e8f4f8;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    margin-top: 1rem;
}

.record-tips p {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.record-tips ul {
    list-style: none;
    padding-left: 0;
}

.record-tips li {
    margin-bottom: 0.25rem;
    color: #666;
    font-size: 0.9rem;
}

.record-tips li::before {
    content: "•";
    color: #e74c3c;
    margin-right: 0.5rem;
}

/* URL输入 */
.url-input-group {
    margin-bottom: 1rem;
}

.url-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.url-input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.url-input-group input:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.load-url-btn {
    margin-top: 0.5rem;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.load-url-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.url-preview audio {
    width: 100%;
    border-radius: 8px;
    margin-top: 1rem;
}

/* 识别配置 */
.recognition-config {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #e74c3c;
}

.recognition-config h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.config-grid {
    display: grid;
    gap: 2rem;
}

.config-section h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

/* 格式选择 */
.format-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.format-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-option:hover {
    border-color: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.1);
}

.format-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.format-option input[type="radio"]:checked + .format-info {
    color: #e74c3c;
}

.format-info strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.format-info small {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 模式选择 */
.model-options {
    display: grid;
    gap: 1rem;
}

.model-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.model-option:hover {
    border-color: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.1);
}

.model-option input[type="radio"]:checked + .model-info {
    color: #e74c3c;
}

.model-info strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.model-info small {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 高级选项 */
.advanced-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.option-item:hover {
    background: rgba(231, 76, 60, 0.1);
}

.option-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 认证配置 */
.credential-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.credential-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
}

.credential-header label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #7f8c8d;
    cursor: pointer;
}

.credential-inputs {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.credential-inputs label {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: block;
}

.credential-inputs input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: monospace;
}

.credential-inputs input:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.credential-inputs input:disabled {
    background: #f8f9fa;
    color: #7f8c8d;
}

.credential-tips {
    background: #e8f4f8;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    margin-bottom: 2rem;
}

.credential-tips p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #34495e;
}

.credential-tips a {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 500;
}

.credential-tips a:hover {
    text-decoration: underline;
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.clear-btn, .recognize-btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.clear-btn {
    background: #95a5a6;
    color: white;
}

.clear-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(127, 140, 141, 0.3);
}

.recognize-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.recognize-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

.recognize-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 加载动画 */
.loading {
    display: none;
    text-align: center;
    padding: 2rem;
    background: rgba(231, 76, 60, 0.05);
    border-radius: 12px;
    margin: 2rem 0;
    border: 2px dashed #e74c3c;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #e74c3c;
    font-weight: 500;
    font-size: 1.1rem;
}

/* 结果容器 */
.result-container {
    min-height: 200px;
}

/* 错误消息 */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* 识别统计 */
.recognition-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #e74c3c;
}

.stats-item {
    text-align: center;
}

.stats-label {
    display: block;
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.stats-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: #e74c3c;
}

/* 文本内容 */
.text-content {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.text-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
    flex-wrap: wrap;
}

.text-btn {
    padding: 0.5rem 1rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.text-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.recognized-content {
    padding: 1.5rem;
    background: white;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.content-header h4 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin: 0;
}

.confidence-info {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.text-display {
    position: relative;
}

#recognized-text {
    width: 100%;
    min-height: 200px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    font-size: 1.1rem;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    background: white;
}

#recognized-text:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* 原始响应 */
.raw-response {
    border-top: 2px solid #e9ecef;
    background: white;
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
}

.response-header h4 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin: 0;
}

.toggle-btn {
    padding: 0.25rem 0.5rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: #c0392b;
}

.response-content {
    padding: 1rem 1.5rem;
    display: none;
}

.response-content.show {
    display: block;
}

#response-json {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    overflow-x: auto;
    margin: 0;
}

/* 历史记录 */
.history-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.history-header h4 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin: 0;
}

.clear-history-btn {
    padding: 0.5rem 1rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.clear-history-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border-left: 4px solid #e74c3c;
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.history-text {
    flex: 1;
    margin-right: 1rem;
}

.history-preview {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.history-details {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
}

.history-action-btn {
    padding: 0.25rem 0.5rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.history-action-btn:hover {
    background: #c0392b;
}

/* 状态指示器 */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.waiting {
    background: #95a5a6;
}

.status-dot.ready {
    background: #f39c12;
}

.status-dot.processing {
    background: #e74c3c;
    animation: pulse 1.5s infinite;
}

.status-dot.success {
    background: #27ae60;
}

.status-dot.error {
    background: #e74c3c;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#status-text {
    color: #2c3e50;
    font-weight: 500;
}

/* 成功消息 */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    z-index: 1000;
    font-weight: 500;
}

/* 动画效果 */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in { animation: slideInRight 0.3s ease-out; }
.fade-in { animation: fadeIn 0.5s ease-out; }

/* 响应式设计 */
@media (max-width: 1200px) {
    .container-wrapper {
        grid-template-columns: 1fr;
        max-width: 800px;
    }
}

@media (max-width: 768px) {
    .container-wrapper {
        padding: 0 1rem 1rem;
        gap: 1rem;
    }
    
    .my-container {
        padding: 1.5rem;
    }
    
    .header {
        padding: 1rem 0;
    }
    
    .header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .header h1 img {
        width: 60px;
        height: 60px;
    }
    
    .upload-methods {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .method-tab {
        flex-direction: row;
        padding: 0.75rem;
    }
    
    .format-options {
        grid-template-columns: 1fr;
    }
    
    .advanced-options {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .recognition-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.5rem;
    }
    
    .text-actions {
        justify-content: center;
    }
    
    .content-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .history-actions {
        align-self: flex-end;
    }
}