/* style.css - 优化版本 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --accent: #f72585;
    --success: #4cc9f0;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
    --border-radius-sm: 8px;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* 头部样式优化 */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 0;
    border-radius: 0 0 30px 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(67, 97, 238, 0.3);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="white" opacity="0.05"/></svg>');
    background-size: cover;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
    position: relative;
    z-index: 1;
}

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

.logo-icon {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.logo-icon i {
    font-size: 24px;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.logo-text p {
    font-size: 15px;
    opacity: 0.9;
    font-weight: 400;
}

/* 搜索框样式优化 */
.search-section {
    padding: 0 40px 40px;
    position: relative;
    z-index: 1;
}

.search-container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    overflow: hidden;
    transform: translateY(20px);
    transition: var(--transition);
}

.search-container:focus-within {
    transform: translateY(15px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.search-container form {
    display: flex;
    height: 70px;
}

.search-container input {
    flex-grow: 1;
    padding: 0 30px;
    border: none;
    font-size: 16px;
    outline: none;
    background: white;
    color: var(--dark);
    font-weight: 500;
}

.search-container input::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

.search-container button {
    background: linear-gradient(135deg, var(--accent), #ff2d9e);
    color: white;
    border: none;
    padding: 0 40px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

.search-container button:hover {
    background: linear-gradient(135deg, #ff2d9e, #e00076);
    padding-right: 45px;
}

/* 主内容区优化 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    margin-bottom: 60px;
}

/* 文章列表优化 */
.articles-section h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--dark);
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.articles-section h2 i {
    color: var(--primary);
}

.articles-list {
    display: grid;
    gap: 25px;
}

.article-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--hover-shadow);
    border-color: rgba(67, 97, 238, 0.1);
}

.article-image-container {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.article-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-image {
    transform: scale(1.05);
}

.article-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 50px;
}

.article-content {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--dark);
    line-height: 1.4;
    transition: var(--transition);
}

.article-card:hover .article-title {
    color: var(--primary);
}

.article-excerpt {
    color: var(--gray);
    margin-bottom: 20px;
    line-height: 1.7;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #adb5bd;
    font-size: 14px;
    padding-top: 20px;
    border-top: 1px solid var(--light-gray);
    margin-top: auto;
}

.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background: var(--light);
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 侧边栏优化 */
.sidebar {
    position: sticky;
    top: 30px;
}

.sidebar-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--card-shadow);
    margin-bottom: 25px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--dark);
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-post {
    display: block;
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.btn-post:hover {
    background: linear-gradient(135deg, var(--primary-dark), #2a3fb8);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.3);
}

.topics-list {
    list-style: none;
}

.topics-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.topics-list li:hover {
    padding-left: 10px;
    color: var(--primary);
}

.topics-list li:last-child {
    border-bottom: none;
}

.topic-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
}

.topic-1 { background: linear-gradient(135deg, #4cc9f0, #4895ef); }
.topic-2 { background: linear-gradient(135deg, #f72585, #b5179e); }
.topic-3 { background: linear-gradient(135deg, #4cc9f0, #4361ee); }
.topic-4 { background: linear-gradient(135deg, #f8961e, #f3722c); }
.topic-5 { background: linear-gradient(135deg, #7209b7, #560bad); }

.topic-name {
    flex-grow: 1;
    margin-left: 15px;
    font-weight: 500;
}

.topic-count {
    background: var(--light);
    color: var(--gray);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: var(--light);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    background: linear-gradient(135deg, var(--light), white);
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--gray);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 搜索结果显示 */
.search-results {
    background: white;
    padding: 20px 30px;
    border-radius: var(--border-radius);
    margin: 40px 0 30px;
    box-shadow: var(--card-shadow);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-results i {
    color: var(--primary);
    font-size: 20px;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.no-results i {
    font-size: 60px;
    margin-bottom: 20px;
    color: var(--light-gray);
}

.no-results h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--dark);
}

.no-results p {
    font-size: 16px;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* 页脚优化 */
footer {
    background: white;
    padding: 40px 0;
    margin-top: 60px;
    border-top: 1px solid var(--light-gray);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-links a {
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-copyright {
    color: var(--gray);
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 30px 20px;
    }
    
    .search-section {
        padding: 0 20px 30px;
    }
    
    .search-container form {
        height: 60px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card {
    animation: fadeIn 0.6s ease forwards;
}

.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.2s; }
.article-card:nth-child(4) { animation-delay: 0.3s; }
.article-card:nth-child(5) { animation-delay: 0.4s; }