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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    animation: slideIn 0.3s ease-out;
}

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

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
    font-weight: 300;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #d0d0d0;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
}

.upload-area.drag-over {
    border-color: #667eea;
    background: #e8ecff;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 15px;
    animation: bounce 0.6s infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-10px);
    }
}

.upload-area h2 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

.upload-area .description {
    color: #666;
    font-size: 1em;
    margin-bottom: 15px;
}

.upload-area .formats {
    color: #999;
    font-size: 0.9em;
    margin-top: 20px;
}

.realtime-panel {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid #e3e8ff;
    border-radius: 12px;
    background: linear-gradient(180deg, #fbfcff 0%, #f4f7ff 100%);
}

.realtime-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.realtime-header h2 {
    color: #333;
    font-size: 1.35em;
    margin-bottom: 6px;
}

.realtime-description,
.realtime-hint,
.realtime-status {
    color: #666;
    font-size: 0.95em;
    line-height: 1.6;
}

.realtime-actions,
.realtime-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.realtime-status {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 6px;
}

.realtime-transcript {
    min-height: 180px;
    max-height: 360px;
    overflow-y: auto;
    margin: 16px 0;
    padding: 16px;
    border-radius: 10px;
    background: white;
    border: 1px solid #dbe3ff;
}

.realtime-empty {
    color: #999;
    text-align: center;
    padding: 48px 12px;
}

.realtime-item {
    padding: 12px 14px;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    background: #f8faff;
}

.realtime-item + .realtime-item {
    margin-top: 10px;
}

.realtime-item .timestamp {
    display: inline-block;
    margin-bottom: 6px;
}

/* Progress Container */
.progress-container {
    margin: 30px 0;
}

.progress-label {
    color: #333;
    font-size: 0.95em;
    margin-bottom: 12px;
    font-weight: 500;
    word-break: break-all;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.2s ease;
}

.progress-text {
    color: #666;
    font-size: 0.95em;
    text-align: center;
}

/* Results Container */
.results-container {
    animation: slideIn 0.3s ease-out;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    gap: 20px;
    flex-wrap: wrap;
}

.results-header h2 {
    color: #333;
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 5px;
}

.language-info {
    color: #667eea;
    font-size: 0.95em;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

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

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #e8e8e8;
    border-color: #bbb;
}

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

/* 下载菜单 */
.download-menu {
    position: relative;
    display: inline-block;
}

.download-options {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 100;
    min-width: 200px;
    animation: slideDown 0.2s ease-out;
}

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

.download-option {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95em;
    color: #333;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

.download-option:hover {
    background: #f0f4ff;
}

.download-option:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.download-option:active {
    background: #e8ecff;
}

/* 时间估算 */
.time-estimate {
    color: #667eea;
    font-size: 0.9em;
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    font-weight: 500;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* AI 修正按钮样式 */
.btn-ai-correction {
    margin-right: 10px;
}

.transcription-results {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 25px;
    padding-right: 10px;
}

.transcription-results::-webkit-scrollbar {
    width: 8px;
}

.transcription-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.transcription-results::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.transcription-results::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 摘要部分样式 */
.summary-section {
    background: linear-gradient(135deg, #f0f4ff 0%, #f9f5ff 100%);
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e7ff;
}

.summary-header h3 {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.summary-stats {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

.summary-content {
    color: #333;
    font-size: 1em;
    line-height: 1.8;
    word-break: break-word;
    white-space: pre-wrap;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.summary-content.full-text {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
}

.summary-note {
    margin-top: 12px;
    color: #666;
    font-size: 0.9em;
    text-align: center;
}

.summary-note a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 1px solid #667eea;
    transition: all 0.2s ease;
}

.summary-note a:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

/* 详细转写部分 */
.detailed-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.detailed-section h3 {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
}

.segment {
    padding: 15px;
    margin-bottom: 12px;
    background: #f9f9f9;
    border-left: 4px solid #667eea;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.segment:hover {
    background: #f0f4ff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.timestamp {
    color: #999;
    font-size: 0.85em;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

.segment .text {
    color: #333;
    font-size: 1em;
    line-height: 1.6;
    word-break: break-word;
}

/* Error Container */
.error-container {
    padding: 20px;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    animation: slideIn 0.3s ease-out;
}

.error-container h3 {
    color: #e53e3e;
    font-size: 1.2em;
    margin-bottom: 10px;
    font-weight: 600;
}

.error-container p {
    color: #c53030;
    font-size: 0.95em;
    margin-bottom: 15px;
    word-break: break-word;
}

.error-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.error-actions .btn-secondary {
    flex: 1;
    min-width: 120px;
}

/* Button Group */
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

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

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 25px;
        border-radius: 12px;
    }

    .header h1 {
        font-size: 2em;
    }

    .upload-area {
        padding: 40px 15px;
    }

    .realtime-panel {
        padding: 18px;
    }

    .realtime-header {
        flex-direction: column;
    }

    .upload-icon {
        font-size: 2.5em;
    }

    .upload-area h2 {
        font-size: 1.2em;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .realtime-actions,
    .realtime-toolbar {
        width: 100%;
    }

    .error-actions {
        flex-direction: column;
    }

    .error-actions .btn-secondary {
        width: 100%;
    }

    .transcription-results {
        max-height: 400px;
    }

    .segment {
        padding: 12px;
    }

    .segment .text {
        font-size: 0.95em;
    }
}

@media (max-width: 400px) {
    .container {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.5em;
    }

    .header {
        margin-bottom: 30px;
    }

    .upload-area {
        padding: 30px 10px;
    }

    .upload-icon {
        font-size: 2em;
    }

    .upload-area h2 {
        font-size: 1em;
    }

    .upload-area .description,
    .upload-area .formats {
        font-size: 0.9em;
    }
}
