/* 基础样式与变量 */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #f72585;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 动画基础 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 头部样式 */
.header {
    background-color: white;
    box-shadow: var(--shadow);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 40px 20px 40px;
}

.logo {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 搜索框样式 */
.search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin-bottom: 10px;
}

#search-input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

#search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

#search-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

#search-btn:hover {
    background-color: var(--secondary-color);
    transform: rotate(15deg);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 0 0 10px 10px;
    box-shadow: var(--shadow);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-suggestion-item {
    padding: 10px 20px;
    cursor: pointer;
    transition: var(--transition);
}

.search-suggestion-item:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* Hero区域 */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 40px;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 主体内容布局 */
.main-content {
    display: flex;
    padding: 30px 0;
    gap: 30px;
}

.sidebar {
    width: 300px;
    position: sticky;
    top: 120px;
    align-self: flex-start;
    height: calc(100vh - 120px);
    overflow-y: auto;
}

.content {
    flex: 1;
}

/* 侧边栏样式 */
.sidebar-section {
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 25px;
}

.sidebar-section h3 {
    margin-bottom: 20px;
    font-size: 1.3rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    display: inline-block;
    padding: 8px 15px;
    background-color: var(--light-color);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.tag:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.tag.active {
    background-color: var(--primary-color);
    color: white;
}

.popular-posts {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popular-post {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
}

.popular-post:hover {
    background-color: var(--light-color);
    transform: translateX(5px);
}

.popular-post img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.popular-post-title {
    font-size: 0.9rem;
    font-weight: 500;
}

/* 文章列表样式 */
.articles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.article-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

.article-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.2s; }
.article-card:nth-child(3) { animation-delay: 0.3s; }
.article-card:nth-child(4) { animation-delay: 0.4s; }
.article-card:nth-child(5) { animation-delay: 0.5s; }
.article-card:nth-child(6) { animation-delay: 0.6s; }

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.article-card:hover .article-image {
    transform: scale(1.05);
}

.article-content {
    padding: 20px;
}

.article-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--dark-color);
    transition: var(--transition);
}

.article-title a {
    color: inherit;
    text-decoration: none;
}

.article-title:hover {
    color: var(--primary-color);
}

.article-meta {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--gray-color);
    gap: 15px;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.article-summary {
    margin-bottom: 20px;
    color: var(--dark-color);
    line-height: 1.7;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 0.9rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.read-more:hover {
    background-color: var(--secondary-color);
    transform: translateX(5px);
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    gap: 10px;
}

.pagination-btn, .pagination-page {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background-color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.pagination-btn:hover, .pagination-page:hover {
    background-color: var(--primary-color);
    color: white;
}

.pagination-page.active {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--light-color);
}

/* 页脚样式 */
.footer {
    background-color: var(--dark-color);
    padding: 30px 0;
    text-align: center;
    color: white;
    margin-top: 60px;
}

/* 返回顶部按钮 */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
    z-index: 999;
}

.scroll-top.active {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background-color: var(--accent-color);
    transform: translateY(-5px);
}

/* 加载动画 */
.loader {
    display: flex;
    justify-content: center;
    padding: 30px;
}

.loader-circle {
    width: 15px;
    height: 15px;
    margin: 0 5px;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.5s infinite ease-in-out;
}

.loader-circle:nth-child(1) { animation-delay: 0s; }
.loader-circle:nth-child(2) { animation-delay: 0.2s; }
.loader-circle:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* 响应式设计 */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        height: auto;
    }
    
    .articles-container {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 60px 0;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .articles-container {
        grid-template-columns: 1fr;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}

.links-column h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 33%;
    width: 40px;
    height: 3px;
    background-color: var(--accent-color);
}