/* 基础样式设置 */
:root {
    --primary-color: #165DFF;
    --secondary-color: #36CFC9;
    --text-color: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --bg-color: #F5F7FA;
    --white: #FFFFFF;
    --border-color: #E5E6EB;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    font-size: 16px;
}

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #0E42D2;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* 头部样式 */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-list {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

/* 主内容区样式 */
.main {
    padding: 40px 0;
}

/* 首页布局 */
.home-layout {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 30px;
}

/* 轮播图样式 */
.carousel {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 30px;
    height: 415px;
}

.carousel-items {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.carousel-item {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: var(--white);
    padding: 20px;
}

.carousel-title {
    font-size: 22px;
    margin-bottom: 8px;
}

.carousel-desc {
    font-size: 14px;
    opacity: 0.9;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
}

.carousel-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    border: none;
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.carousel-btn:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.carousel-indicator.active {
    background-color: var(--white);
    width: 30px;
    border-radius: 5px;
}

/* 模块通用样式 */
.section {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 30px;
}

.section-title {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title a {
    font-size: 14px;
    font-weight: normal;
}

/* 文章列表通用样式 */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-item {
    display: flex;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.post-item:hover {
    transform: translateY(-5px);
}

.post-img {
    width: 160px;
    height: 120px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.post-item:hover .post-img img {
    transform: scale(1.05);
}

.post-content {
    flex-grow: 1;
}

.post-title {
    font-size: 18px;
    margin-bottom: 8px;
    transition: var(--transition);
}

.post-item:hover .post-title {
    color: var(--primary-color);
}

.post-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-lighter);
    margin-bottom: 8px;
}

.post-excerpt {
    font-size: 14px;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 分类文章样式 */
.category-posts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* 侧边栏样式 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.widget {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.widget-title {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--secondary-color);
}

/* 侧边栏文章列表 */
.sidebar-post-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-post-item {
    display: flex;
    gap: 10px;
    transition: var(--transition);
}

.sidebar-post-item:hover {
    transform: translateX(5px);
}

.sidebar-post-img {
    width: 80px;
    height: 60px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-post-content {
    flex-grow: 1;
}

.sidebar-post-title {
    font-size: 14px;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-post-meta {
    font-size: 12px;
    color: var(--text-lighter);
}

/* 评论样式 */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-item {
    display: flex;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.comment-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex-grow: 1;
}

.comment-author {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 3px;
}

.comment-text {
    font-size: 13px;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comment-time {
    font-size: 12px;
    color: var(--text-lighter);
    margin-top: 5px;
}

/* 标签云样式 */
.tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tagcloud a {
    display: inline-block;
    padding: 5px 12px;
    background-color: var(--bg-color);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-light);
    transition: var(--transition);
}

.tagcloud a:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
}

/* 列表页样式 */
.list-header {
    margin-bottom: 30px;
}

.list-title {
    font-size: 28px;
    margin-bottom: 10px;
}

.list-description {
    color: var(--text-light);
}

.list-posts {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.list-post-item {
    display: flex;
    gap: 25px;
    background-color: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.list-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.list-post-img {
    width: 300px;
    flex-shrink: 0;
}

.list-post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-post-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.list-post-title {
    font-size: 22px;
    margin-bottom: 15px;
}

.list-post-excerpt {
    color: var(--text-light);
    margin-bottom: 20px;
    flex-grow: 1;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.read-more::after {
    content: '→';
    transition: var(--transition);
}

.read-more:hover::after {
    transform: translateX(5px);
}

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

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--white);
    color: var(--text-color);
    transition: var(--transition);
}

.page-numbers.current {
    background-color: var(--primary-color);
    color: var(--white);
}

.page-numbers:hover:not(.current) {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

/* 详情页样式 */
.detail-post {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
}

.post-header {
    margin-bottom: 30px;
}

.detail-title {
    font-size: 32px;
    line-height: 1.3;
    margin-bottom: 20px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--text-lighter);
    font-size: 14px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.detail-featured-img {
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 30px;
}

.detail-content {
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 30px;
}

.detail-content p {
    margin-bottom: 20px;
}

.detail-content h2,
.detail-content h3 {
    margin: 30px 0 15px;
    color: var(--primary-color);
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.detail-tags span {
    color: var(--text-light);
}

/* 上下篇导航 */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.nav-previous,
.nav-next {
    width: 48%;
}

.nav-previous {
    text-align: left;
}

.nav-next {
    text-align: right;
}

.nav-label {
    font-size: 14px;
    color: var(--text-lighter);
    margin-bottom: 5px;
}

/* 相关文章 */
.related-posts {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
}

.related-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* 评论模块 */
.comments {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
}

.comments-title {
    font-size: 20px;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.comment-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 16px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    background-color: #0E42D2;
    transform: translateY(-2px);
}

/* 页脚样式 */
.footer {
    background-color: var(--text-color);
    color: var(--white);
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h3 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--secondary-color);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--white);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .home-layout {
        grid-template-columns: 1fr;
    }

    .related-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .carousel {
        height: 300px;
    }

    .category-posts {
        grid-template-columns: 1fr;
    }

    .list-post-item {
        flex-direction: column;
    }

    .list-post-img {
        width: 100%;
        height: 200px;
    }

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

    .post-navigation {
        flex-direction: column;
        gap: 20px;
    }

    .nav-previous,
    .nav-next {
        width: 100%;
        text-align: left;
    }
}

@media (max-width: 576px) {
    .carousel {
        height: 220px;
    }

    .carousel-title {
        font-size: 18px;
    }

    .post-item {
        flex-direction: column;
    }

    .post-img {
        width: 100%;
        height: 180px;
    }

    .detail-title {
        font-size: 24px;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .nav-list {
        gap: 15px;
    }
}
