/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* 导航栏 */
.navbar {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
    background: rgba(52, 152, 219, 0.1);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-box button {
    padding: 8px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-box button:hover {
    background: #2980b9;
}

/* 头部横幅 */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 100px 20px;
    text-align: center;
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 16px;
    font-weight: 700;
}

.hero-content p {
    font-size: 20px;
    opacity: 0.95;
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* 特色功能区 */
.features {
    background: white;
    padding: 60px 20px;
    margin-bottom: 40px;
}

.feature-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    text-align: center;
    padding: 30px;
    background: var(--bg-color);
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.feature-card h3 {
    margin-bottom: 12px;
    color: var(--text-color);
}

.feature-card p {
    color: var(--text-light);
    font-size: 14px;
}

/* 精选推荐区 */
.featured-section {
    padding: 40px 0;
}

.section-title {
    font-size: 28px;
    margin-bottom: 24px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.featured-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.featured-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.featured-card.featured-large {
    grid-row: span 2;
}

.featured-image {
    height: 180px;
    width: 100%;
}

.featured-large .featured-image {
    height: 360px;
}

.featured-content {
    padding: 20px;
    position: relative;
}

.featured-tag {
    position: absolute;
    top: -10px;
    right: 20px;
    background: #e74c3c;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.featured-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-color);
}

.featured-large .featured-content h3 {
    font-size: 22px;
}

.featured-desc {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 12px;
}

.featured-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-light);
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* 文章列表 */
.articles {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.articles .section-title {
    margin-bottom: 30px;
}

.article-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.article-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.article-image {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.article-content {
    padding: 24px;
}

.article-tag {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    margin-bottom: 12px;
}

.article-content h2 {
    font-size: 22px;
    margin-bottom: 12px;
    color: var(--text-color);
}

.article-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-light);
}

.article-content p {
    color: var(--text-light);
    margin-bottom: 16px;
    line-height: 1.8;
    font-size: 14px;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #2980b9;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.page-link {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-ellipsis {
    padding: 8px 12px;
    color: var(--text-light);
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.widget {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.widget h3 {
    font-size: 18px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
}

.widget p {
    color: var(--text-light);
    line-height: 1.8;
}

.widget ul {
    list-style: none;
}

.widget li {
    margin-bottom: 0;
}

.widget a {
    color: var(--text-color);
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.3s ease;
    font-size: 14px;
}

.widget a:hover {
    color: var(--primary-color);
}

/* 个人简介卡片 */
.profile-widget {
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 16px;
}

.profile-widget h3 {
    border-bottom: none;
    margin-bottom: 12px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.social-links a {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 13px;
    border-bottom: none;
    transition: background-color 0.3s ease;
}

.social-links a:hover {
    background: #2980b9;
    color: white;
}

/* 热门文章排行 */
.widget .rank {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: #ddd;
    color: white;
    border-radius: 4px;
    margin-right: 8px;
    font-size: 12px;
    font-weight: bold;
}

.widget .rank-1 {
    background: #e74c3c;
}

.widget .rank-2 {
    background: #f39c12;
}

.widget .rank-3 {
    background: #3498db;
}

.widget li a {
    display: inline-flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

/* 计数标签 */
.widget .count {
    float: right;
    background: var(--bg-color);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-light);
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud a {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-color);
    border-radius: 16px;
    font-size: 13px;
    color: var(--text-light);
    border-bottom: none;
    transition: all 0.3s ease;
}

.tag-cloud a:hover {
    background: var(--primary-color);
    color: white;
}

/* 订阅表单 */
.subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.subscribe-form input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.subscribe-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.subscribe-form button {
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.subscribe-form button:hover {
    background: #2980b9;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-hover);
    transition: all 0.3s ease;
    display: none;
    z-index: 100;
}

.back-to-top:hover {
    background: #2980b9;
    transform: translateY(-3px);
}

/* 底部 */
.footer {
    background: var(--text-color);
    color: white;
    padding: 60px 20px 30px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: white;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    font-size: 14px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    border-bottom: none;
}

.footer-section a:hover {
    color: white;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social a {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.footer-social a:hover {
    background: var(--primary-color);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.footer .beian a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.footer .beian a:hover {
    color: white;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }

    .featured-card.featured-large {
        grid-row: span 1;
    }

    .featured-large .featured-image {
        height: 180px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        gap: 15px;
    }

    .nav-menu a {
        padding: 6px 8px;
        font-size: 14px;
    }

    .search-box {
        display: none;
    }

    .hero {
        padding: 60px 20px;
    }

    .hero-content h1 {
        font-size: 32px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }

    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .feature-container {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}
