/* 文档列表页面样式 */

/* 防止滚动条抖动 */
html {
    overflow-y: scroll; /* 始终显示垂直滚动条 */
}

/* 防止页面闪动的平滑过渡 */
body {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

body.loaded {
    opacity: 1;
}

/* 文档列表区域最小高度，防止布局跳动 */
#docsList {
    min-height: 500px;
    transition: opacity 0.3s ease-in-out;
}

/* 文档页面头部 */
.docs-header {
    background: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}

.docs-header h1 {
    font-size: 42px;
    margin-bottom: 16px;
    font-weight: 600;
}

.docs-header p {
    font-size: 18px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* 文档容器 */
.docs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 文档筛选器 */
.docs-filters {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.filters-row {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    min-width: 300px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.filter-group label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

/* 搜索和筛选区域 - 兼容旧结构 */
.search-filter-section {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-select {
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    min-width: 150px;
    outline: none;
    transition: all 0.3s;
}

.filter-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #3b82f6, #0ea5e9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

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

/* 文档列表 */
.docs-list {
    display: grid;
    gap: 20px;
}

/* 文档卡片样式 */
.doc-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s;
    cursor: pointer;
    border: 1px solid transparent;
}

/* docs.js 渲染的卡片样式 */
.card.doc-list-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.card.doc-list-item:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.doc-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    color: white;
}

.doc-info {
    flex: 1;
}

.doc-info .doc-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
}

.doc-info .doc-desc {
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
    font-size: 14px;
}

.doc-info .doc-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #999;
    flex-wrap: wrap;
}

.doc-info .doc-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.doc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #3b82f6;
}

.doc-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.3;
}

.doc-title:hover {
    color: #667eea;
}

.doc-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 16px;
}

.doc-category {
    background: #e8f2ff;
    color: #0066cc;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.doc-date {
    color: #999;
}

.doc-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
    font-size: 15px;
}

.doc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.doc-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #999;
}

.doc-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.read-count {
    font-size: 13px;
    color: #999;
}

.doc-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #3b82f6, #0ea5e9);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.doc-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

/* 加载和空状态 */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.loading::before {
    content: "⏳";
    font-size: 32px;
    display: block;
    margin-bottom: 16px;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
}

.empty-state::before {
    content: "📄";
    font-size: 48px;
    display: block;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination .btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.pagination .btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.pagination .btn.active {
    background: linear-gradient(135deg, #3b82f6, #0ea5e9);
    color: white;
    border-color: #3b82f6;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .search-filter-section {
        flex-direction: column;
        gap: 15px;
        padding: 16px;
    }
    
    .search-input,
    .filter-select {
        width: 100%;
    }
    
    .search-btn {
        width: 100%;
        margin-top: 10px;
    }
    
    .doc-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .doc-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .doc-stats {
        gap: 15px;
    }
}