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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #667eea;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.stt-compare-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stt-compare-card,
.stt-history-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.stt-compare-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.stt-compare-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 240px;
}

.stt-compare-field-wide {
    flex: 3;
}

.stt-label {
    font-weight: 700;
    color: #4a5568;
    font-size: 14px;
}

.stt-input,
.stt-select,
.stt-file {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
}

.stt-file-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.stt-dropzone {
    position: relative;
    padding: 14px 16px;
    border: 2px dashed #cbd5e0;
    border-radius: 14px;
    background: #f7fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stt-dropzone:hover {
    border-color: #667eea;
    background: #edf2f7;
}

.stt-dropzone.is-dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.12);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.stt-dropzone-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: #4a5568;
}

.stt-dropzone-sub {
    margin-top: 6px;
    color: #718096;
    font-size: 13px;
    word-break: break-all;
}

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

.stt-hint {
    color: #718096;
    font-size: 13px;
}

.stt-compare-actions {
    display: flex;
    justify-content: flex-end;
    min-width: 180px;
}

.stt-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stt-history-title {
    font-weight: 800;
    color: #4a5568;
    font-size: 16px;
}

.stt-table-wrap {
    overflow-x: auto;
}

.stt-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.stt-detail-table {
    min-width: 1100px;
}

.stt-table tbody tr.is-clickable {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.stt-table tbody tr.is-clickable:hover {
    background: rgba(102, 126, 234, 0.06);
}

.stt-table tbody tr.is-selected {
    background: rgba(102, 126, 234, 0.12);
}

.stt-filter-group {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.stt-filter-btn {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 12px;
}

.stt-filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.stt-delete-btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: #fff;
}

.stt-cell-muted {
    color: #718096;
    font-size: 12px;
    font-weight: 700;
    margin-left: 6px;
}

.stt-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    margin-left: 8px;
    background: #edf2f7;
    color: #4a5568;
}

.stt-badge.unmatched {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid rgba(197, 48, 48, 0.25);
}

.stt-digit-mismatch {
    background: rgba(229, 62, 62, 0.18);
    color: #c53030;
    border-radius: 5px;
    padding: 0 2px;
    font-weight: 800;
}

.stt-audio-btn {
    margin-left: 10px;
    padding: 4px 10px; /* 更矮一些 */
    font-size: 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.10) 100%);
    color: #4a5568;
    border: 1px solid rgba(102, 126, 234, 0.25);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.12);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.stt-audio-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.18) 0%, rgba(118, 75, 162, 0.14) 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.18);
}

.stt-audio-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.stt-audio-btn i {
    font-size: 12px;
}

.stt-audio-btn span {
    font-weight: 700;
}

.stt-table th,
.stt-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    text-align: left;
    font-size: 13px;
    color: #2d3748;
}

.stt-table th {
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stt-detail-btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 10px;
}

.container {
    max-width: 98%;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.header h1 {
    font-size: 2.5rem;
    color: #4a5568;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    color: #718096;
    font-size: 1.1rem;
}

/* 发音人选择区域 */
.voice-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.voice-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.voice-tab {
    padding: 12px 24px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    background: white;
    color: #4a5568;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.voice-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.voice-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 生成区域 */
.generate-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.input-group {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.input-group textarea {
    flex: 1;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fff;
}

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

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

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

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 表格样式 - 重新设计为更灵活的布局 */
.table-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: none;
    overflow-x: auto; /* 允许水平滚动 */
}

.header-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 1000px;
}

.header-cell {
    font-weight: 700;
    color: #4a5568;
    text-align: center;
    padding: 10px;
    flex: 1;
    min-width: 120px;
}

/* ID列样式 */
.header-cell.id-cell {
    flex: 0.4;
    min-width: 60px;
    max-width: 80px;
    font-weight: 700;
    color: #667eea;
}

.record-cell.id-cell {
    flex: 0.4;
    min-width: 60px;
    max-width: 80px;
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
    text-align: center;
}

.header-cell.audio-cell {
    flex: 1.2;
    min-width: 180px;
}

.header-cell.text-cell {
    flex: 1.5;
    min-width: 200px;
}

.header-cell.action-cell {
    flex: 0.6;
    min-width: 80px;
}

/* 已移至上方重新定义，避免重复 */

.model-type {
    display: inline-block;
    background: #e2e8f0;
    color: #4a5568;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 500;
}

/* 记录列表 */
.records-list {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: none;
    overflow-x: auto; /* 允许水平滚动 */
    overflow-y: visible;
}

/* 统一横向滚动容器，并冻结表头 */
.tts-table-wrapper {
    position: relative;
    background: transparent;
}

.tts-table-wrapper .records-list {
    overflow-x: auto;
}

.tts-sticky-header {
    position: sticky;
    top: 0;
    z-index: 50; /* 高于列表行 */
}

/* 让表头跟随内容横向滚动：使用同一滚动容器，由 JS 同步 scrollLeft */
.tts-table-wrapper .table-header,
.tts-table-wrapper .records-list {
    /* 视觉上仍保留边框衔接 */
}

/* 禁止表头自身产生横向滚动条，避免与内容不同步 */
.tts-table-wrapper .table-header {
    overflow-x: auto; /* 允许自身滚动用于与内容同步 */
    scrollbar-width: none; /* Firefox 隐藏滚动条 */
}
.tts-table-wrapper .table-header::-webkit-scrollbar { /* WebKit 隐藏滚动条 */
    display: none;
}

/* 阻断横向 overscroll 链式滚动，避免触发浏览器历史前进/后退 */
.tts-table-wrapper,
.tts-table-wrapper .records-list {
    overscroll-behavior-x: contain;
}

/* 冻结列（仅 TTS 页面） */
.tts-table-wrapper {
    --id-col-width: 80px;
    --text-col-width: 260px;
    --h-gap: 15px;
}

.tts-table-wrapper .header-row,
.tts-table-wrapper .record-row {
    gap: var(--h-gap);
}

/* ID 列固定左侧 */
.tts-table-wrapper .header-cell.id-cell,
.tts-table-wrapper .record-cell.id-cell {
    position: sticky;
    left: 0;
    z-index: 40;
    flex: 0 0 var(--id-col-width);
    min-width: var(--id-col-width);
    max-width: var(--id-col-width);
    background: rgba(255, 255, 255, 0.98);
}

/* 文本列固定在 ID 列右侧（考虑列间 gap） */
.tts-table-wrapper .header-cell.text-cell,
.tts-table-wrapper .record-cell.text-cell {
    position: sticky;
    left: calc(var(--id-col-width) + var(--h-gap));
    z-index: 39;
    flex: 0 0 var(--text-col-width);
    min-width: var(--text-col-width);
    max-width: var(--text-col-width);
    background: rgba(255, 255, 255, 0.98);
}

/* 视觉分隔线 */
.tts-table-wrapper .header-cell.id-cell,
.tts-table-wrapper .record-cell.id-cell,
.tts-table-wrapper .header-cell.text-cell,
.tts-table-wrapper .record-cell.text-cell {
    box-shadow: 1px 0 0 rgba(226, 232, 240, 0.8);
}

/* 提高表头冻结列层级，避免被内容覆盖 */
.tts-sticky-header .header-cell.id-cell { z-index: 60; }
.tts-sticky-header .header-cell.text-cell { z-index: 59; }

/* 移动端禁用冻结列，按原有纵向布局显示 */
@media (max-width: 768px) {
    .tts-table-wrapper .header-cell.id-cell,
    .tts-table-wrapper .record-cell.id-cell,
    .tts-table-wrapper .header-cell.text-cell,
    .tts-table-wrapper .record-cell.text-cell {
        position: static;
        left: auto;
        z-index: auto;
        flex: none;
        min-width: auto;
        max-width: none;
        box-shadow: none;
    }
}

.record-row {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    flex-wrap: nowrap;
    min-height: 120px;
    min-width: 1000px; /* 确保STT页面有足够宽度显示所有列 */
}

.record-row:last-child {
    border-bottom: none;
}

.record-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-width: 120px;
    padding: 10px;
}

.record-cell.text-cell {
    text-align: left;
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    flex: 1.5;
    min-width: 200px;
}

.record-cell.audio-cell {
    text-align: center;
    flex: 1.2;
    min-width: 180px;
}

.record-cell.action-cell {
    text-align: center;
    flex: 0.6;
    min-width: 80px;
}

/* 音频控件 */
.audio-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.audio-player {
    width: 100%;
    max-width: 200px;
    height: 40px;
    transition: opacity 0.3s ease;
}

.audio-player[data-loading="true"] {
    opacity: 0.6;
    pointer-events: none;
}

.audio-placeholder {
    color: #a0aec0;
    font-size: 14px;
    padding: 15px 10px;
    background: #f7fafc;
    border-radius: 8px;
    border: 2px dashed #e2e8f0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 54px;
}

.audio-placeholder i {
    color: #cbd5e0;
    font-size: 16px;
}

.audio-btn-container {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.upload-btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-icon {
    padding: 8px;
    font-size: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.refresh-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.refresh-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.sample-rate {
    font-size: 11px;
    color: #718096;
    margin-top: 4px;
    font-weight: 500;
}

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

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #4a5568;
    font-size: 1.5rem;
    font-weight: 700;
}

.close {
    color: #a0aec0;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #4a5568;
}

.modal-body {
    padding: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* 加载更多 */
.load-more-section {
    text-align: center;
    margin-top: 30px;
}

/* 加载覆盖层 */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.loading-spinner i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 15px;
}

.loading-spinner p {
    color: #4a5568;
    font-size: 1.1rem;
    font-weight: 500;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    z-index: 3000;
    animation: toastSlideIn 0.3s ease;
}

.toast.success {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
}

.toast.error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.toast.info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.empty-icon {
    font-size: 3rem;
    color: #cbd5e0;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #4a5568;
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-state p {
    color: #718096;
    font-size: 1rem;
    margin: 0;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式设计 - 重新设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    /* 移动端：垂直堆叠布局 */
    .header-row,
    .record-row {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .record-row {
        min-height: auto;
        padding: 20px;
    }
    
    .header-cell,
    .record-cell {
        width: 100%;
        min-width: auto;
        text-align: left;
        padding: 10px;
        flex: none;
    }
    
    .header-cell.id-cell,
    .record-cell.id-cell {
        order: -2; /* ID显示在最前面 */
        min-width: 50px !important;
        max-width: 60px !important;
    }
    
    .header-cell.text-cell,
    .record-cell.text-cell {
        order: -1; /* 文本内容显示在第二位 */
    }
    
    .header-cell.action-cell,
    .record-cell.action-cell {
        order: 1; /* 操作按钮显示在最后面 */
        text-align: center;
    }
    
    .audio-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .audio-btn-container {
        flex-direction: row;
        justify-content: center;
        gap: 8px;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
}

/* 平板响应式 - 紧凑但仍然水平布局 */
@media (min-width: 769px) and (max-width: 1024px) {
    .header-row,
    .record-row {
        gap: 10px;
    }
    
    .header-cell,
    .record-cell {
        padding: 8px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .header-cell.id-cell,
    .record-cell.id-cell {
        min-width: 50px;
        max-width: 70px;
        flex: 0 0 50px;
    }
    
    .header-cell.text-cell,
    .record-cell.text-cell {
        min-width: 150px;
    }
    
    .header-cell.action-cell,
    .record-cell.action-cell {
        flex: 0 0 60px;
        min-width: 60px;
    }
    
    .audio-btn-container {
        flex-direction: column;
        gap: 4px;
    }
    
    .btn-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .upload-btn {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* 大屏幕优化 - 宽松舒适的布局 */
@media (min-width: 1200px) {
    .container {
        max-width: 95%;
        padding: 30px;
    }
    
    .header-row,
    .record-row {
        gap: 20px;
        min-width: 1200px; /* 大屏幕下增加最小宽度 */
    }
    
    .header-cell.text-cell,
    .record-cell.text-cell {
        min-width: 250px;
        flex: 2;
    }
    
    .header-cell.audio-cell,
    .record-cell.audio-cell {
        min-width: 200px;
        flex: 1.5;
    }
    
    .header-cell,
    .record-cell {
        min-width: 150px;
    }
    
    .header-cell.id-cell,
    .record-cell.id-cell {
        flex: 0.3;
        min-width: 60px;
        max-width: 80px;
    }
    
    .header-cell.action-cell,
    .record-cell.action-cell {
        flex: 0.8;
        min-width: 100px;
    }
}

/* 超窄屏幕处理 */
@media (max-width: 480px) {
    .record-row {
        padding: 15px 10px;
    }
    
    .audio-btn-container {
        flex-direction: column;
        gap: 6px;
    }
    
    .btn-icon {
        width: 32px;
        height: 32px;
    }
    
    .upload-btn {
        width: 100%;
        text-align: center;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* 头部导航区域 */
.header-nav {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.nav-switch-btn {
    background: linear-gradient(135deg, #e8edf7 0%, #eee8f4 100%);
    color: #4a5568;
    border: 2px solid #000000;
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-switch-btn:hover {
    background: #4a5568;
    color: white;
    border-color: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 85, 104, 0.3);
}

/* 头部用户信息样式 */
.header-main {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding-top: 20px;
}

.header-title {
    text-align: center;
}

.header-user {
    position: absolute;
    right: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4a5568;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 后台管理入口按钮（显示在用户名后） */
.admin-manage-btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 999px;
    line-height: 1;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.header .btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    font-size: 16px;
    padding: 0;
}

.header .btn-icon:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}



.model-name {
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 8px;
}

.model-actions {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.batch-generate-btn,
.batch-delete-btn {
    background: #e2e8f0;
    color: #4a5568;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
}

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

.batch-delete-btn:hover {
    background: #ff6b6b;
    color: white;
}

.audio-info {
    margin-top: 8px;
    text-align: center;
}

.audio-filename {
    font-size: 12px;
    color: #6c757d;
    word-break: break-all;
}


/* 响应式调整头部 */
@media (max-width: 768px) {
    .header-nav {
        position: static;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .nav-switch-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .header-main {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding-top: 0;
    }
    
    .header-user {
        position: static;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .upload-group {
        flex-direction: column;
    }
    
    .upload-label {
        width: 100%;
        min-width: auto;
    }
    
    .model-actions {
        flex-wrap: wrap;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .nav-switch-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .nav-switch-btn .fas {
        margin-right: 4px;
    }
}