/*
Theme Name: My Custom Theme
Theme URI: https://example.com/my-theme
Author: Your Name
Author URI: https://your-website.com
Description: 我的自定义WordPress主题
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: my-custom-theme
*/

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 为使用WordPress固定header的页面添加顶部间距 */
body.wp-header-active {
    padding-top: 100px;
}

/* 确保独立页面模板不受影响 */
body:not(.wp-header-active) {
    padding-top: 0;
}

/* 为主要内容区域提供额外的顶部边距选项 */
.wp-content-wrapper {
    margin-top: 0; /* 默认为0，让body的padding-top处理 */
}

/* 响应式调整 */
@media (max-width: 768px) {
    body.wp-header-active {
        padding-top: 80px; /* 移动端header高度调整 */
    }
}

/* 固定header样式 */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: 9999;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 主要内容区域 */
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 首页横幅区域 */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 80px 20px;
    margin-bottom: 60px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #ff6b6b;
    color: white;
}

.btn-primary:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: #667eea;
}

/* 区域标题 */
.section-title {
    font-size: 2rem;
    text-align: center;
    margin: 60px 0 40px;
    color: #2c3e50;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #ff6b6b;
    border-radius: 2px;
}

/* 特色文章区域 */
.featured-posts {
    margin-bottom: 60px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.featured-post {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.featured-post:hover {
    transform: translateY(-5px);
}

.featured-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.featured-content {
    padding: 25px;
}

.featured-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

.featured-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.featured-title a {
    color: #2c3e50;
    text-decoration: none;
}

.featured-title a:hover {
    color: #ff6b6b;
}

.featured-excerpt {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.featured-read-more {
    color: #ff6b6b;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* 文章网格 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.post-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
}

.post-thumbnail img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.post-content {
    padding: 25px;
}

.entry-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.entry-title a {
    color: #2c3e50;
    text-decoration: none;
}

.entry-title a:hover {
    color: #ff6b6b;
}

.entry-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
    flex-wrap: wrap;
}

.entry-meta i {
    margin-right: 5px;
    color: #ff6b6b;
}

.entry-summary {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.read-more {
    color: #ff6b6b;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* 分类区域 */
.categories-section {
    margin-bottom: 60px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.category-card {
    background: white;
    padding: 30px 20px;
    text-align: center;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #333;
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-icon {
    font-size: 2rem;
    color: #ff6b6b;
    margin-bottom: 15px;
}

.category-card h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.post-count {
    color: #666;
    font-size: 0.9rem;
}

/* 分页导航 */
.pagination-wrapper {
    text-align: center;
    margin-top: 50px;
}

.pagination-wrapper .page-numbers {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.pagination-wrapper .page-numbers:hover,
.pagination-wrapper .current {
    background: #ff6b6b;
    color: white;
}

/* 无内容提示 */
.no-posts {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.no-posts-icon {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.no-posts h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.no-posts p {
    color: #666;
    margin-bottom: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .featured-grid,
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .site-main {
        padding: 15px;
    }
}

/* 侧边栏样式 */
.widget-area {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.widget {
    margin-bottom: 30px;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff6b6b;
}