.section-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.time-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.time-btn {
    padding: 8px 16px;
    border: 2px solid var(--accent-color);
    background: var(--bg-secondary);
    color: var(--accent-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
    outline: none;
    font-family: 'Cascadia Code', monospace;
}

.time-btn:hover {
    background: var(--time-btn-hover);
    transform: translateY(-2px);
}

.time-btn.active {
    background: var(--accent-color);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.delete-btn {
    padding: 4px 12px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.delete-btn:hover {
    background: #a02020;
}

.section-card h2 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h2 {
    margin: 0;
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-input {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    width: 280px;
    font-family: 'Cascadia Code', monospace;
}

.search-input::placeholder {
    color: var(--text-tertiary);
    font-family: 'Microsoft YaHei', sans-serif;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.search-btn {
    padding: 8px 16px;
    font-size: 13px;
    background: var(--accent-color);
    min-width: 60px;
}

.search-btn:hover {
    background: var(--accent-hover);
}

.clear-search-btn {
    padding: 8px 16px;
    font-size: 13px;
    background: var(--badge-off);
    min-width: 60px;
}

.clear-search-btn:hover {
    background: #666;
}

.clear-cache-btn {
    padding: 8px 16px;
    font-size: 13px;
    background: var(--accent-color);
}

.clear-cache-btn:hover {
    background: var(--accent-hover);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

.pagination-btn {
    padding: 8px 16px;
    font-size: 14px;
    min-width: 80px;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 15px;
    font-family: 'Cascadia Code', monospace;
}

.page-jump {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-input {
    width: 60px;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    text-align: center;
    font-family: 'Cascadia Code', monospace;
}

.page-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.go-btn {
    padding: 6px 12px;
    font-size: 13px;
    min-width: 50px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-tertiary);
}

.duration-cell {
    font-family: 'Cascadia Code', monospace;
    font-weight: 600;
}

#processingTable {
    table-layout: fixed;
}

#processingTable th:nth-child(1),
#processingTable td:nth-child(1) {
    width: 80px;
}

#processingTable th:nth-child(2),
#processingTable td:nth-child(2) {
    width: 100px;
}

#processingTable th:nth-child(3),
#processingTable td:nth-child(3) {
    width: 60px;
}

#processingTable th:nth-child(4),
#processingTable td:nth-child(4) {
    width: auto;
}

#processingTable td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#historyTable {
    table-layout: fixed;
}

#historyTable th:nth-child(1),
#historyTable td:nth-child(1) {
    width: 140px;
}

#historyTable th:nth-child(2),
#historyTable td:nth-child(2) {
    width: 80px;
}

#historyTable th:nth-child(3),
#historyTable td:nth-child(3) {
    width: 80px;
}

#historyTable th:nth-child(4),
#historyTable td:nth-child(4) {
    width: 90px;
}

#historyTable th:nth-child(5),
#historyTable td:nth-child(5) {
    width: auto;
}

#historyTable td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.three-column-layout {
    display: grid;
    grid-template-columns: 280px 1fr 1fr;
    gap: 20px;
    height: calc(80vh - 100px);
}

.column-left,
.column-middle,
.column-right {
    display: flex;
    flex-direction: column;
}

.column-left {
    min-width: 280px;
}

.detail-section.full-height {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.detail-section.full-height h3 {
    flex-shrink: 0;
}

.detail-section.full-height .content,
.detail-section.full-height .streaming-content {
    flex: 1;
    min-height: 0;
}

.scrollable {
    overflow-y: auto !important;
    max-height: none !important;
}

.detail-section .content h1,
.detail-section .content h2,
.detail-section .content h3,
.detail-section .content h4,
.detail-section .content h5,
.detail-section .content h6 {
    margin: 16px 0 8px 0;
    color: var(--text-primary);
    line-height: 1.4;
}

.detail-section .content h1 { font-size: 24px; }
.detail-section .content h2 { font-size: 20px; }
.detail-section .content h3 { font-size: 18px; }
.detail-section .content h4 { font-size: 16px; }
.detail-section .content h5 { font-size: 14px; }
.detail-section .content h6 { font-size: 13px; }

.detail-section .content p {
    margin: 8px 0;
    line-height: 1.6;
}

.detail-section .content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Cascadia Code', monospace;
    font-size: 13px;
    color: var(--accent-color);
}

.detail-section .content pre {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid var(--border-color);
}

.detail-section .content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
}

.detail-section .content ul,
.detail-section .content ol {
    margin: 8px 0;
    padding-left: 24px;
}

.detail-section .content li {
    margin: 4px 0;
    line-height: 1.6;
}

.detail-section .content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.detail-section .content em {
    font-style: italic;
}

.detail-section .content a {
    color: var(--accent-color);
    text-decoration: none;
}

.detail-section .content a:hover {
    text-decoration: underline;
}

.streaming-content {
    background: var(--bg-primary);
    padding: 15px;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-primary);
    border: 1px solid var(--info-color);
    animation: pulse 2s infinite;
    transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

.streaming-content.completed {
    border-color: var(--success-color);
    box-shadow: 0 0 10px rgba(46, 125, 50, 0.3);
    animation: none;
}

@keyframes pulse {
    0%, 100% { border-color: var(--info-color); }
    50% { border-color: var(--accent-color); }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

.modal-content.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.streaming-content h1,
.streaming-content h2,
.streaming-content h3,
.streaming-content h4,
.streaming-content h5,
.streaming-content h6 {
    margin: 16px 0 8px 0;
    color: var(--text-primary);
    line-height: 1.4;
}

.streaming-content h1 { font-size: 24px; }
.streaming-content h2 { font-size: 20px; }
.streaming-content h3 { font-size: 18px; }
.streaming-content h4 { font-size: 16px; }
.streaming-content h5 { font-size: 14px; }
.streaming-content h6 { font-size: 13px; }

.streaming-content p {
    margin: 8px 0;
    line-height: 1.6;
}

.streaming-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Cascadia Code', monospace;
    font-size: 13px;
    color: var(--accent-color);
}

.streaming-content pre {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid var(--border-color);
}

.streaming-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
}

.streaming-content ul,
.streaming-content ol {
    margin: 8px 0;
    padding-left: 24px;
}

.streaming-content li {
    margin: 4px 0;
    line-height: 1.6;
}

.streaming-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.streaming-content em {
    font-style: italic;
}

.streaming-content a {
    color: var(--accent-color);
    text-decoration: none;
}

.streaming-content a:hover {
    text-decoration: underline;
}

@media (max-width: 1400px) {
    .three-column-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .detail-section.full-height .content,
    .detail-section.full-height .streaming-content {
        max-height: 400px;
    }
    
    .search-input {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-input {
        flex: 1;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}

#dialoguesTable {
    table-layout: fixed;
}

#dialoguesTable th:nth-child(1),
#dialoguesTable td:nth-child(1) {
    width: 200px;
}

#dialoguesTable th:nth-child(2),
#dialoguesTable td:nth-child(2) {
    width: 140px;
}

#dialoguesTable th:nth-child(3),
#dialoguesTable td:nth-child(3) {
    width: 120px;
}

#dialoguesTable th:nth-child(4),
#dialoguesTable td:nth-child(4) {
    width: 120px;
}

#dialoguesTable th:nth-child(5),
#dialoguesTable td:nth-child(5) {
    width: 100px;
}

#dialoguesTable td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dialogue-detail-modal {
    width: 90%;
    max-width: 1400px;
}

.dialogue-detail-layout {
    display: flex;
    gap: 20px;
    padding: 20px;
    height: 600px;
}

.exchange-list-panel {
    width: 300px;
    border-right: 1px solid var(--border-color);
    padding-right: 15px;
    display: flex;
    flex-direction: column;
}

.exchange-list-panel h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

.exchange-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.exchange-item {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-secondary);
}

.exchange-item:hover {
    border-color: #2196F3;
    transform: translateX(3px);
}

.exchange-item.active {
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
}

.exchange-item.processing {
    border-left: 3px solid #FF9800;
}

.exchange-item.completed {
    border-left: 3px solid #4CAF50;
}

.exchange-index {
    font-weight: bold;
    color: #2196F3;
    margin-bottom: 5px;
    font-size: 13px;
}

.exchange-preview {
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exchange-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
}

.exchange-detail-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.message-content {
    max-height: 250px;
    overflow-y: auto;
}

.empty-selection {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-style: italic;
}

.empty-exchange {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-style: italic;
}

.processing-message {
    color: #FF9800;
    font-style: italic;
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-done {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.status-processing {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.status-failed {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.status-overloaded {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

/* 对话ID样式 */
.conversation-id {
    font-family: 'Cascadia Code', monospace;
    font-size: 12px;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
}

/* 预览单元格 */
.preview-cell {
    color: var(--text-secondary);
    font-size: 13px;
}

/* 按钮样式 */
.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    background: var(--accent-color);
    color: white;
}

.btn:hover {
    background: #1976D2;
}

.btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-view {
    background: var(--accent-color);
    color: white;
    padding: 4px 10px;
    font-size: 12px;
}

.btn-view:hover {
    background: #1976D2;
}
