/* 基础样式设置 */
:root {
    --primary-color: #165DFF;
    --secondary-color: #36BFFA;
    --text-dark: #1D2129;
    --text-medium: #4E5969;
    --text-light: #86909C;
    --bg-light: #F2F3F5;
    --bg-white: #FFFFFF;
    --border-color: #E5E6EB;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --radius: 6px;
}

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

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

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

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

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 2rem;
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.search-box {
    position: relative;
}

.search-input {
    padding: 8px 15px 8px 35px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    outline: none;
    transition: all 0.3s ease;
    width: 180px;
}

.search-input:focus {
    width: 220px;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* 轮播图样式 */
.carousel {
    margin: 20px 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    height: 450px;
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-item.active {
    opacity: 1;
    z-index: 1;
}

.carousel-item 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: white;
    padding: 20px;
    z-index: 2;
}

.carousel-caption h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

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

.carousel-control {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-control:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}

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

.carousel-indicator.active {
    background-color: white;
    width: 25px;
    border-radius: 5px;
}

/* 内容区域通用样式 */
.section {
    margin: 40px 0;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

/* 文章卡片样式 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.article-card {
    background-color: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.article-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.article-content {
    padding: 20px;
}

.article-category {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--primary-color);
    background-color: rgba(22, 93, 255, 0.1);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.article-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.article-title a {
    text-decoration: none;
    color: var(--text-dark);
}

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

.article-excerpt {
    color: var(--text-medium);
    font-size: 0.95rem;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* 友情链接样式 */
.friend-links {
    background-color: var(--bg-white);
    padding: 30px 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 40px 0;
}

.links-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.link-item {
    text-decoration: none;
    color: var(--text-medium);
    padding: 5px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.link-item:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: rgba(22, 93, 255, 0.05);
}

/* 列表页样式 */
.list-page {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

/* 文章列表样式 */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.article-list-item {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    background-color: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.article-list-item:hover {
    transform: translateX(5px);
}

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

.list-item-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin: 40px 0;
    gap: 10px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-decoration: none;
    color: var(--text-medium);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.page-link:hover, .page-link.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

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

.widget-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

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

.sidebar-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.sidebar-item:last-child {
    border-bottom: none;
}

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

.sidebar-link {
    text-decoration: none;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.sidebar-link:hover {
    color: var(--primary-color);
}

/* 详情页样式 */
.detail-page {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.article-detail {
    background-color: var(--bg-white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

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

.detail-meta {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.detail-content {
    margin-bottom: 30px;
    line-height: 1.8;
    font-size: 1.05rem;
}

.detail-content p {
    margin-bottom: 1.5rem;
}

.detail-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: var(--radius);
}

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

.nav-prev, .nav-next {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
}

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

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

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

.footer-column h3 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

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

.footer-link {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

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

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

    .list-item-img {
        height: 200px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .carousel {
        height: 300px;
    }

    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .detail-title {
        font-size: 1.6rem;
    }
}

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

    .articles-grid {
        grid-template-columns: 1fr;
    }

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

    .article-navigation {
        flex-direction: column;
        gap: 15px;
    }
}