/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

a {
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

a:hover {
    color: #007bff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.icon {
    margin-right: 5px;
}

/* 头部样式 */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header.fixed {
    animation: slideDown 0.3s ease;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.nav {
    display: flex;
    list-style: none;
}

.nav li {
    margin: 0 15px;
}

.nav a {
    display: block;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 16px;
}

.nav a:hover {
    background: #f0f0f0;
    color: #007bff;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    width: 30px;
    cursor: pointer;
}

.menu-toggle span {
    height: 3px;
    background: #333;
    margin: 2px 0;
    transition: all 0.3s ease;
}

/* 主要内容区域 */
.main {
    padding: 30px 0;
}

.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* 文章列表样式 */
.article-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.section-title {
    font-size: 20px;
    color: #333;
    display: flex;
    align-items: center;
}

.more-link {
    color: #666;
    font-size: 14px;
}

/* 文本列表样式 */
.text-list {
    list-style: none;
}

.text-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.text-item:hover {
    background: #f8f9fa;
}

.text-item .title {
    flex: 1;
    margin-right: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-item .date,
.text-item .views {
    color: #999;
    font-size: 14px;
}

/* 图文列表样式 */
.image-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.image-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.image-card:hover {
    transform: translateY(-5px);
}

.image-wrapper {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
}

.image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-card:hover img {
    transform: scale(1.05);
}

.card-content {
    padding: 15px;
}

.card-title {
    font-size: 16px;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 14px;
}

/* 侧边栏样式 */
.sidebar {
    position: sticky;
    top: 80px;
}

.widget {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.widget-title {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
}

/* 热门排行样式 */
.hot-list {
    list-style: none;
}

.hot-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.hot-item:last-child {
    border-bottom: none;
}

.hot-item .rank {
    width: 24px;
    height: 24px;
    background: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-weight: bold;
    color: #666;
}

.hot-item:nth-child(1) .rank {
    background: #ff6b6b;
    color: #fff;
}

.hot-item:nth-child(2) .rank {
    background: #ff922b;
    color: #fff;
}

.hot-item:nth-child(3) .rank {
    background: #ffd43b;
    color: #fff;
}

/* 推荐阅读样式 */
.recommend-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.recommend-item .image-wrapper {
    width: 80px;
    height: 60px;
    margin-right: 10px;
    flex-shrink: 0;
}

.recommend-item .title {
    font-size: 14px;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.recommend-item .meta {
    color: #999;
    font-size: 12px;
}

/* 页脚样式 */
.footer {
    background: #fff;
    padding: 40px 0;
    margin-top: 40px;
    border-top: 1px solid #eee;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 15px;
}

.copyright {
    text-align: center;
    color: #666;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* 文章页样式 */
.breadcrumb {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.article-container {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.article-header {
    margin-bottom: 30px;
}

.article-title {
    font-size: 28px;
    margin-bottom: 15px;
}

.article-meta {
    color: #666;
    font-size: 14px;
}

.article-meta span {
    margin-right: 20px;
}

.article-content {
    line-height: 1.8;
    margin-bottom: 30px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    cursor: zoom-in;
}

.article-footer {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tags a {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    margin-right: 10px;
    font-size: 14px;
}

.share-btn {
    display: inline-block;
    padding: 6px 15px;
    background: #f0f0f0;
    border-radius: 20px;
    margin-left: 10px;
    font-size: 14px;
}

/* 相关推荐样式 */
.related-articles,
.hot-articles {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.related-card {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.related-card:hover {
    transform: translateY(-5px);
}

/* 图片放大遮罩 */
.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: zoom-out;
}

.image-overlay img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

/* 动画效果 */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .image-list,
    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 10px 0;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .nav.active {
        display: flex;
    }

    .nav li {
        margin: 0;
    }

    .nav a {
        padding: 12px 20px;
        border-radius: 0;
    }

    .article-title {
        font-size: 24px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .article-container {
        padding: 20px;
    }

    .article-footer {
        flex-direction: column;
        gap: 15px;
    }

    .share {
        width: 100%;
        text-align: center;
    }
} 