/* AI 知识库 - 现代化样式 */

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --accent: #f6ad55;
    --bg: #f7fafc;
    --surface: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* 顶部导航 */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-brand {
    color: white;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-nav {
    display: flex;
    gap: 20px;
    list-style: none;
}

.navbar-nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    font-size: 14px;
}

.navbar-nav a:hover {
    background: rgba(255,255,255,0.15);
}

/* 移动端菜单 */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

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

/* 页面标题 */
.page-header {
    text-align: center;
    padding: 40px 20px;
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.page-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--text);
}

.page-header p {
    color: var(--text-light);
    font-size: 14px;
}

/* 搜索框 */
.search-box {
    max-width: 600px;
    margin: 20px auto 0;
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
}

.search-box button {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
}

.search-box button:hover {
    background: var(--primary-dark);
}

/* 文章卡片网格 */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.article-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.article-card-image {
    height: 160px;
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
}

.article-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-content {
    color: var(--text-light);
    font-size: 14px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 15px;
}

.article-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-light);
}

.article-card-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-card-author img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border);
}

.article-card-date {
    font-size: 12px;
}

/* 分类标签 */
.category-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 10px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

/* 页脚 */
.footer {
    background: var(--surface);
    padding: 30px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    margin-top: 60px;
    border-top: 1px solid var(--border);
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar-nav {
        display: none;
    }
    
    .navbar-toggle {
        display: block;
    }
    
    .navbar-mobile-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        padding: 10px;
    }
    
    .navbar-mobile-menu.active {
        display: block;
    }
    
    .navbar-mobile-menu a {
        display: block;
        color: white;
        padding: 12px 20px;
        text-decoration: none;
    }
    
    .article-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header h1 {
        font-size: 22px;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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