/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 导航栏样式 */
.navbar {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.nav-item {
    margin: 0 15px;
}

.nav-link {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 4px;
}

.nav-link:hover,
.nav-link.active {
    color: #667eea;
    background-color: #f0f4ff;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-icon {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active .menu-icon:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-btn.active .menu-icon:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .menu-icon:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

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

.content-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

/* 文章卡片样式 */
.post-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.post-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.post-content {
    padding: 20px;
    flex: 1;
}

.post-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: #667eea;
}

.post-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

.post-excerpt {
    margin-bottom: 20px;
    color: #555;
}

.read-more {
    display: inline-block;
    padding: 8px 15px;
    background-color: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.read-more:hover {
    background-color: #5a67d8;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
}

.page-current {
    font-weight: bold;
    color: #667eea;
}

.page-next {
    padding: 8px 15px;
    background-color: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #667eea;
    transition: all 0.3s ease;
}

.page-next:hover {
    background-color: #667eea;
    color: white;
}

/* 侧边栏样式 */
.sidebar {
    width: 100%;
    max-width: 350px;
}

.widget {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.widget-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

/* 搜索框样式 */
.search-form {
    display: flex;
}

.search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 0.9rem;
}

.search-btn {
    padding: 10px 15px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: #5a67d8;
}

/* 作者信息样式 */
.author-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 15px;
    border: 3px solid #667eea;
}

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

.author-name {
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.author-bio {
    text-align: center;
    margin-bottom: 15px;
    color: #666;
}

.author-social {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.social-link {
    padding: 5px 10px;
    color: #667eea;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: #667eea;
    color: white;
}

/* 分类列表样式 */
.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 10px;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-list a:hover {
    color: #667eea;
}

.category-count {
    font-size: 0.8rem;
    color: #666;
}

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

.tag-cloud a {
    padding: 5px 10px;
    background-color: #f0f0f0;
    color: #666;
    text-decoration: none;
    border-radius: 15px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.tag-cloud a:hover {
    background-color: #667eea;
    color: white;
}

/* 热门文章列表样式 */
.hot-list {
    list-style: none;
}

.hot-list li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.hot-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.hot-list a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
    line-height: 1.4;
}

.hot-list a:hover {
    color: #667eea;
}

/* 页脚样式 */
.footer {
    background-color: #333;
    color: white;
    padding: 40px 0;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-info,
.footer-links,
.footer-contact {
    flex: 1;
    min-width: 200px;
}

.footer-info h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.footer-contact p {
    margin-bottom: 10px;
    color: #ddd;
}

.footer-copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    color: #888;
}

/* 返回顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #5a67d8;
    transform: translateY(-3px);
}

/* 响应式设计 - 桌面端 */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
    }
    
    .content-wrapper {
        gap: 20px;
    }
    
    .header {
        padding: 60px 0;
    }
    
    .logo {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
}

/* 响应式设计 - 平板端 */
@media (max-width: 992px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        position: static;
        max-width: 100%;
        margin-top: 40px;
    }
    
    .widget {
        margin-bottom: 20px;
    }
    
    .post-card {
        flex-direction: row;
    }
    
    .post-thumbnail {
        width: 30%;
        height: auto;
    }
    
    .post-content {
        width: 70%;
    }
    
    .footer-content {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 30px;
    }
    
    .header {
        padding: 50px 0;
    }
    
    .logo {
        font-size: 2.2rem;
    }
    
    .main {
        padding: 40px 0;
    }
}

/* 响应式设计 - 移动端横屏 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .navbar .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .nav-menu {
        display: none;
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background-color: white;
        flex-direction: column;
        text-align: center;
        padding: 20px 0;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        z-index: 999;
    }
    
    .nav-menu.active {
        display: flex;
        left: 0;
    }
    
    .nav-item {
        margin: 15px 0;
    }
    
    .nav-link {
        padding: 15px 20px;
        border-bottom: none;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .post-card {
        flex-direction: column;
    }
    
    .post-thumbnail {
        width: 100%;
        height: 180px;
    }
    
    .post-content {
        width: 100%;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .author-social {
        justify-content: center;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
        font-size: 1.2rem;
    }
}

/* 响应式设计 - 移动端竖屏 */
@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 30px 0;
    }
    
    .logo {
        font-size: 1.8rem;
    }
    
    .main {
        padding: 30px 0;
    }
    
    .post-content {
        padding: 20px;
    }
    
    .widget {
        padding: 20px;
    }
    
    .post-title {
        font-size: 1.3rem;
    }
    
    .nav-link {
        font-size: 1rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

/* 响应式设计 - 小屏幕手机 */
@media (max-width: 400px) {
    .header {
        padding: 25px 0;
    }
    
    .logo {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .main {
        padding: 25px 0;
    }
    
    .post-content {
        padding: 15px;
    }
    
    .post-title {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .read-more {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .widget {
        padding: 15px;
    }
    
    .widget-title {
        font-size: 1.1rem;
        padding-bottom: 8px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeIn 0.5s ease-out;
}

.widget {
    animation: fadeIn 0.5s ease-out 0.1s both;
}