* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.2);
}

/* 广告位样式 */
.ad-banner {
    background: white;
    padding: 1rem 0;
    margin: 1rem 0;
}

.ad-bottom {
    margin-top: 2rem;
}

.ad-placeholder {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border: 2px dashed #d63031;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: #2d3436;
    font-weight: bold;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-inline {
    margin: 2rem 0;
}

/* 主内容区 */
.main {
    padding: 2rem 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

.main-content {
    min-height: 500px;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 文章网格 */
.articles-grid {
    display: grid;
    gap: 2rem;
}

.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.article-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.article-content {
    padding: 1.5rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.article-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #2d3436;
}

.article-excerpt {
    color: #636e72;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.article-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: #e9ecef;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #495057;
}

/* 文章详情 */
#article-detail {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.article-header {
    margin-bottom: 2rem;
}

.article-detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2d3436;
}

.article-detail-meta {
    display: flex;
    gap: 2rem;
    color: #666;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
}

.article-detail-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin: 2rem 0;
}

.article-body {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #2d3436;
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: #2d3436;
}

.article-body h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.75rem;
    color: #2d3436;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #667eea;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 2rem;
    transition: background 0.3s;
}

.back-button:hover {
    background: #764ba2;
}

/* 侧边栏 */
.sidebar-widget {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2d3436;
}

.popular-post {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: color 0.3s;
}

.popular-post:last-child {
    border-bottom: none;
}

.popular-post:hover {
    color: #667eea;
}

.popular-post-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.popular-post-date {
    font-size: 0.85rem;
    color: #666;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.tag-item:hover {
    transform: scale(1.05);
}

/* 关于页面 */
.about-content {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.about-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #2d3436;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #636e72;
    margin-bottom: 1rem;
}

/* 页脚 */
.footer {
    background: #2d3436;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

.footer p {
    margin: 0.25rem 0;
}

/* 响应式设计 */
@media (max-width: 968px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
    
    #article-detail {
        padding: 2rem 1.5rem;
    }
    
    .article-detail-title {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .article-image {
        height: 200px;
    }
    
    .article-detail-image {
        height: 250px;
    }
    
    #article-detail {
        padding: 1.5rem 1rem;
    }
    
    .article-detail-title {
        font-size: 1.5rem;
    }
    
    .about-content {
        padding: 2rem 1.5rem;
    }
}

