* {
    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;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

main {
    padding: 30px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.controls {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

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

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

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

.btn-success {
    background: linear-gradient(135deg, #42e695 0%, #3bb2b8 100%);
    color: white;
}

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

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

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

.audio-visualization {
    margin: 30px 0;
}

#waveformCanvas {
    width: 100%;
    height: 150px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.recording-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 20px;
}

#status {
    font-weight: 600;
    color: #333;
}

#timer {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

.markdown-content {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    margin: 20px 0;
}

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 400px;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
}

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

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.history-table th,
.history-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.history-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.history-table tr:hover {
    background: #f8f9fa;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        border-radius: 10px;
    }

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8em;
    }

    nav {
        flex-direction: column;
        gap: 10px;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        min-width: 90%;
        padding: 20px;
    }
}

/* 查看页面特定样式 */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.history-table th,
.history-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.history-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.history-table tr:hover {
    background: #f8f9fa;
}

.history-table td:last-child {
    white-space: nowrap;
}

/* 详情模态框 */
#detailModal .modal-content {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.detail-section h4 {
    color: #764ba2;
    margin: 15px 0 8px 0;
    font-size: 1em;
}

.transcript {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.analysis-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.response {
    line-height: 1.6;
    margin-top: 10px;
    white-space: pre-wrap;
}

/* 按钮尺寸 */
.btn-sm {
    padding: 5px 10px;
    font-size: 0.9em;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    color: #667eea;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 10px 0;
    color: #333;
}

/* Markdown内容样式 */
.markdown-content h3 {
    color: #667eea;
    margin: 15px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #dee2e6;
}

.markdown-content h4 {
    color: #764ba2;
    margin: 12px 0 8px 0;
}

.markdown-content h5 {
    color: #333;
    margin: 10px 0 6px 0;
}

.markdown-content ul,
.markdown-content ol {
    margin: 10px 0 10px 20px;
}

.markdown-content li {
    margin: 5px 0;
}

.markdown-content strong {
    color: #333;
    font-weight: 600;
}

.markdown-content em {
    color: #666;
    font-style: italic;
}

.markdown-content code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* 录音状态指示器 */
.recording-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #ff6b6b;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* 文件上传区域 */
#audioFileInput {
    width: 100%;
    padding: 12px;
    border: 2px dashed #667eea;
    border-radius: 8px;
    margin: 15px 0;
    cursor: pointer;
}

#audioFileInput:hover {
    border-color: #764ba2;
    background: #f8f9fa;
}

/* Markdown渲染样式 */
.markdown-content {
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    padding: 30px;
    background: white;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    margin: 20px 0;
    transition: all 0.3s;
}

.markdown-content:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.markdown-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    word-wrap: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: #24292e;
}

.markdown-body h1 {
    padding-bottom: 0.3em;
    font-size: 2em;
    border-bottom: 1px solid #eaecef;
}

.markdown-body h2 {
    padding-bottom: 0.3em;
    font-size: 1.5em;
    border-bottom: 1px solid #eaecef;
}

.markdown-body h3 {
    font-size: 1.25em;
}

.markdown-body h4 {
    font-size: 1em;
}

.markdown-body p {
    margin-top: 0;
    margin-bottom: 16px;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 2em;
    margin-bottom: 16px;
}

.markdown-body li {
    margin-bottom: 0.25em;
}

.markdown-body blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    margin: 0 0 16px 0;
}

.markdown-body pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f6f8fa;
    border-radius: 6px;
    margin-bottom: 16px;
}

.markdown-body code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

.markdown-body pre code {
    padding: 0;
    margin: 0;
    font-size: 100%;
    word-break: normal;
    white-space: pre;
    background: transparent;
    border: 0;
}

.markdown-body table {
    display: block;
    width: 100%;
    overflow: auto;
    margin-bottom: 16px;
    border-spacing: 0;
    border-collapse: collapse;
}

.markdown-body table th {
    font-weight: 600;
}

.markdown-body table th,
.markdown-body table td {
    padding: 6px 13px;
    border: 1px solid #dfe2e5;
}

.markdown-body table tr {
    background-color: #fff;
    border-top: 1px solid #c6cbd1;
}

.markdown-body table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

.markdown-body img {
    max-width: 100%;
    box-sizing: content-box;
    background-color: #fff;
}

/* 加载状态 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: #666;
}

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

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

    100% {
        transform: rotate(360deg);
    }
}

/* 录音状态指示器 */
.status-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2em;
}

#recordingIndicator {
    color: #ff6b6b;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #667eea;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin: 20px 0;
    background: #f8f9fa;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #e9ecef;
}

.upload-area i {
    color: #667eea;
    margin-bottom: 15px;
}

.upload-hint {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
}

.file-info {
    background: #e9ecef;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.file-info p {
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-controls {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

/* 导出选项 */
.export-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.export-option {
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.export-option:hover {
    border-color: #667eea;
    background: #f8f9fa;
    transform: translateY(-2px);
}

.export-option i {
    color: #667eea;
    margin-bottom: 10px;
}

.export-option p {
    margin: 0;
    font-weight: 600;
    color: #333;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    color: #dee2e6;
    margin-bottom: 15px;
}

.empty-state p {
    margin: 0;
    font-size: 0.9em;
}

/* 复制按钮样式 */
.btn-success {
    background: linear-gradient(135deg, #42e695 0%, #3bb2b8 100%);
}

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

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

.markdown-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.markdown-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 20px;
    color: #666;
    border-top: 1px solid #dee2e6;
    margin-top: 40px;
    font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .markdown-content {
        padding: 15px;
        max-height: 400px;
    }

    .export-options {
        grid-template-columns: 1fr;
    }

    .recording-status {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .timer-info {
        font-size: 1.1em;
    }
}

/* 高亮代码块样式 */
.hljs {
    background: transparent !important;
    padding: 0 !important;
}

/* 数学公式样式 */
.mathjax-block {
    overflow-x: auto;
    overflow-y: hidden;
    margin: 1em 0;
}

/* 任务列表样式 */
.task-list-item {
    list-style-type: none;
}

.task-list-item-checkbox {
    margin: 0 0.2em 0.25em -1.6em;
    vertical-align: middle;
}

.hidden {
    display: none !important;
}