/* Doc页面样式 - 与records.css保持一致的设计风格 */

.doc-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 头部导航 */
.header-nav {
    display: flex;
    gap: 5px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #666;
}

.nav-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

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

.nav-item span {
    font-size: 1.2em;
    margin-right: 5px;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.95);
}

#search-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

#search-input:focus {
    outline: none;
    border-color: #667eea;
}

#sort-select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

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

.refresh-btn:hover {
    transform: scale(1.05);
}

/* 主内容区 */
.main-content {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 20px;
}

/* 侧边栏 */
.sidebar {
    width: 200px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sidebar h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
}

.agent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agent-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agent-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

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

.agent-name {
    font-weight: 600;
}

.agent-count {
    font-size: 0.9em;
    opacity: 0.8;
}

/* 文档面板 */
.doc-panel {
    width: 350px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.doc-panel h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.doc-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
}

.doc-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.doc-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.doc-name {
    font-weight: 600;
    color: #333;
    word-break: break-all;
}

.doc-agent {
    font-size: 0.85em;
    color: #667eea;
    background: #f0f4ff;
    padding: 2px 8px;
    border-radius: 4px;
}

.doc-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: #888;
}

/* 预览面板 */
.preview-panel {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

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

.preview-header h3 {
    color: #667eea;
    font-size: 1.2em;
    font-weight: 600;
    margin: 0;
}

.copy-btn {
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #5568d3;
}

.doc-content {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
    line-height: 1.8;
}

/* Markdown样式（复用records.css中的样式） */
.doc-content h1 {
    color: #667eea;
    margin: 20px 0 10px;
    font-size: 2em;
}

.doc-content h2 {
    color: #764ba2;
    margin: 18px 0 8px;
    font-size: 1.5em;
}

.doc-content h3 {
    color: #8e44ad;
    margin: 15px 0 6px;
    font-size: 1.3em;
}

.doc-content h4 {
    color: #9b59b6;
    margin: 12px 0 5px;
    font-size: 1.1em;
}

.doc-content p {
    margin: 10px 0;
    color: #333;
}

.doc-content ul, .doc-content ol {
    margin: 10px 0;
    padding-left: 20px;
}

.doc-content li {
    margin: 5px 0;
    color: #555;
}

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

.doc-content pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
}

.doc-content pre code {
    background: none;
    color: #ecf0f1;
    padding: 0;
}

.doc-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 15px;
    margin: 15px 0;
    color: #666;
    font-style: italic;
}

.doc-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.doc-content th, .doc-content td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

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

.doc-content tr:nth-child(even) {
    background: #f8f9fa;
}

.doc-content a {
    color: #667eea;
    text-decoration: none;
}

.doc-content a:hover {
    text-decoration: underline;
}

/* 状态提示 */
.loading {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.empty {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

.error {
    text-align: center;
    color: #e74c3c;
    font-weight: 600;
    padding: 20px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .doc-panel {
        width: 100%;
        max-height: 300px;
    }
    
    .preview-panel {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .search-bar {
        flex-direction: column;
    }
    
    #sort-select {
        width: 100%;
    }
    
    .refresh-btn {
        width: 100%;
    }
}
