
:root {
    --primary-color: #1890ff;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #ff4d4f;
    --text-primary: #333;
    --text-secondary: #666;
    --border-color: #e8e8e8;
    --bg-color: #f5f5f5;
    --sidebar-width: 280px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background-color: #f8f9fa;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航栏 */
.navbar {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.logo span {
    margin-left: 10px;
}

/* 搜索区域 */
.search-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 0;
    margin-bottom: 30px;
}

.search-container {
    text-align: center;
}

.search-title {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.search-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.search-box {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 18px 60px 18px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
}

/* 侧边栏筛选 */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

.filter-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.filter-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
}

.price-range {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.price-range input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.price-slider {
    width: 100%;
    height: 6px;
    margin: 15px 0;
    background: #ddd;
    border-radius: 3px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-option {
    padding: 6px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-option:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-option.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 文档列表区域 */
.documents-area {
    flex: 1;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.result-count {
    font-weight: 600;
    color: var(--text-primary);
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-btn {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    cursor: pointer;
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.clear-filters-btn {
    padding: 8px 16px;
    border: 1px solid var(--error-color);
    border-radius: 6px;
    background: white;
    color: var(--error-color);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.clear-filters-btn:hover {
    background: var(--error-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.3);
}

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

.sort-select {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
}

/* 文档网格布局 */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.documents-grid.list-view {
    grid-template-columns: 1fr;
}

.document-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.documents-grid.list-view .document-card {
    flex-direction: row;
    height: auto;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.document-preview {
    height: 150px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.documents-grid.list-view .document-preview {
    width: 200px;
    height: auto;
    flex-shrink: 0;
}

.document-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--success-color);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.document-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.documents-grid.list-view .document-info {
    padding: 25px;
}

.document-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.document-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 15px;
    flex: 1;
}

.document-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.document-tag {
    background: #f0f7ff;
    color: var(--primary-color);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.document-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.document-price {
    color: var(--error-color);
    font-size: 1.3rem;
    font-weight: 700;
}

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

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    border: 1px solid var(--border-color);
}

.btn-icon:hover {
    background: var(--bg-color);
}

.btn-add-cart {
    padding: 8px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-add-cart:hover {
    background: #40a9ff;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    cursor: pointer;
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 快速购买侧边栏 */
.quick-cart-sidebar {
    position: fixed;
    right: -400px;
    top: 0;
    width: 380px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.quick-cart-sidebar.open {
    right: 0;
}

/* 收藏对比功能 */
.compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 20px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateY(100%);
    transition: transform 0.3s;
    z-index: 999;
}

.compare-bar.active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .documents-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .filter-options {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .documents-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .search-input {
        padding: 15px 50px 15px 20px;
    }
}

@media (max-width: 576px) {
    .documents-grid {
        grid-template-columns: 1fr;
    }

    .documents-grid.list-view .document-card {
        flex-direction: column;
    }

    .documents-grid.list-view .document-preview {
        width: 100%;
        height: 150px;
    }
}
/* 加载状态样式 */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.loading .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 错误状态样式 */
.error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #ff4d4f;
}

.retry-btn {
    margin-top: 20px;
    padding: 8px 20px;
    background: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.retry-btn:hover {
    background: #40a9ff;
}

/* 无数据样式 */
.no-data {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.no-data p {
    margin-top: 10px;
    color: #666;
}

/* 分类标签样式 */
.document-badge.category-1 { background: #1890ff; }
.document-badge.category-2 { background: #52c41a; }
.document-badge.category-3 { background: #faad14; }
.document-badge.category-4 { background: #ff4d4f; }
.document-badge.category-5 { background: #722ed1; }

/* 指示器样式 */
.hot-indicator, .rec-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
}

/* 分页样式增强 */
.page-dots {
    padding: 8px 12px;
    color: #999;
}