 * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif; line-height: 1.6; color: #333; background: #f5f5f5; } a { text-decoration: none; color: inherit; transition: color 0.3s; } img { max-width: 100%; height: auto; display: block; } .container { max-width: 1200px; margin: 0 auto; padding: 0 20px; } .header { background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 1000; } .header-content { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; } .logo { font-size: 28px; font-weight: 700; color: #2563eb; } .logo a { color: #2563eb; } .nav { display: flex; gap: 30px; } .nav-link { font-size: 16px; font-weight: 500; color: #666; transition: color 0.3s; } .nav-link:hover, .nav-link.active { color: #2563eb; } .ad-space { margin: 20px 0; } .ad-placeholder { background: #e5e7eb; border: 2px dashed #9ca3af; border-radius: 8px; padding: 40px 20px; text-align: center; color: #6b7280; font-size: 14px; } .ad-top .ad-placeholder { min-height: 90px; } .ad-mid .ad-placeholder { min-height: 90px; } .ad-sidebar .ad-placeholder { min-height: 250px; } .ad-article .ad-placeholder { min-height: 90px; margin: 30px 0; } .main-content { padding: 40px 0; } .content-wrapper { display: grid; grid-template-columns: 1fr 350px; gap: 40px; } .featured-section { margin-bottom: 40px; } .featured-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; } .article-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.1); transition: transform 0.3s, box-shadow 0.3s; } .article-card:hover { transform: translateY(-4px); box-shadow: 0 4px 16px rgba(0,0,0,0.15); } .article-card-image { width: 100%; height: 200px; overflow: hidden; } .article-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; } .article-card:hover .article-card-image img { transform: scale(1.05); } .article-card-content { padding: 20px; } .article-category { display: inline-block; padding: 4px 12px; background: #dbeafe; color: #2563eb; border-radius: 4px; font-size: 12px; font-weight: 600; margin-bottom: 10px; } .article-card-title { font-size: 18px; font-weight: 600; color: #1f2937; margin-bottom: 10px; line-height: 1.4; } .article-card-excerpt { font-size: 14px; color: #6b7280; line-height: 1.6; margin-bottom: 12px; } .article-card-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #9ca3af; } .section { margin-bottom: 50px; } .section-title { font-size: 24px; font-weight: 700; color: #1f2937; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 3px solid #2563eb; } .articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; } .sidebar { position: sticky; top: 100px; height: fit-content; } .widget { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); } .widget-title { font-size: 18px; font-weight: 700; color: #1f2937; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #e5e7eb; } .categories-list { display: flex; flex-direction: column; gap: 12px; } .category-item { padding: 12px 16px; background: #f9fafb; border-radius: 8px; font-size: 15px; font-weight: 500; color: #4b5563; transition: all 0.3s; } .category-item:hover { background: #dbeafe; color: #2563eb; } .popular-list { display: flex; flex-direction: column; gap: 16px; } .popular-item { display: flex; gap: 12px; } .popular-item-image { width: 80px; height: 80px; border-radius: 8px; overflow: hidden; flex-shrink: 0; } .popular-item-image img { width: 100%; height: 100%; object-fit: cover; } .popular-item-content { flex: 1; } .popular-item-title { font-size: 14px; font-weight: 600; color: #1f2937; line-height: 1.4; margin-bottom: 4px; } .popular-item-date { font-size: 12px; color: #9ca3af; } .load-more-wrapper { text-align: center; margin: 40px 0; } .load-more-btn { padding: 12px 32px; background: #2563eb; color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.3s; } .load-more-btn:hover { background: #1d4ed8; } .footer { background: #1f2937; color: #9ca3af; padding: 40px 0; text-align: center; } .article-detail { background: #fff; border-radius: 12px; padding: 40px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); } .breadcrumb { font-size: 14px; color: #6b7280; margin-bottom: 24px; } .breadcrumb a { color: #2563eb; } .breadcrumb .separator { margin: 0 8px; } .article-header { margin-bottom: 30px; } .article-title { font-size: 32px; font-weight: 700; color: #1f2937; line-height: 1.3; margin: 16px 0; } .article-meta { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #6b7280; } .article-meta .separator { margin: 0 4px; } .article-image { width: 100%; height: 400px; border-radius: 12px; overflow: hidden; margin-bottom: 30px; } .article-image img { width: 100%; height: 100%; object-fit: cover; } .article-summary { font-size: 18px; color: #4b5563; line-height: 1.8; padding: 20px; background: #f9fafb; border-left: 4px solid #2563eb; border-radius: 4px; margin-bottom: 30px; } .article-body { font-size: 16px; color: #374151; line-height: 1.8; } .article-body p { margin-bottom: 20px; } .article-body h2 { font-size: 24px; font-weight: 700; color: #1f2937; margin: 30px 0 16px; } .article-body h3 { font-size: 20px; font-weight: 600; color: #1f2937; margin: 24px 0 12px; } .article-body ul, .article-body ol { margin: 16px 0 16px 24px; } .article-body li { margin-bottom: 8px; } .article-footer { margin-top: 40px; padding-top: 20px; border-top: 2px solid #e5e7eb; } .article-tags { display: flex; flex-wrap: wrap; gap: 8px; } .article-tag { padding: 6px 14px; background: #f3f4f6; color: #6b7280; border-radius: 20px; font-size: 13px; } .related-articles { margin-top: 50px; padding-top: 30px; border-top: 2px solid #e5e7eb; } .category-header { text-align: center; margin-bottom: 40px; } .category-title { font-size: 36px; font-weight: 700; color: #1f2937; margin-bottom: 12px; } .category-description { font-size: 18px; color: #6b7280; } @media (max-width: 1024px) { .content-wrapper { grid-template-columns: 1fr; } .sidebar { position: static; } .featured-grid, .articles-grid { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 640px) { .header-content { flex-direction: column; gap: 16px; } .nav { gap: 16px; font-size: 14px; } .featured-grid, .articles-grid { grid-template-columns: 1fr; } .article-detail { padding: 24px; } .article-title { font-size: 24px; } .article-image { height: 250px; } } 

/* ============================================
   AD OPTIMIZATION STYLES - Mobile First
   ============================================ */

/* 响应式广告容器 */
.ad-responsive {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* 首屏广告 - Header下方 */
.ad-below-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.ad-below-header .ad-placeholder {
    min-height: 100px;
}

/* In-Feed广告 - 融入内容流 */
.ad-in-feed {
    margin: 30px 0;
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ad-in-feed .ad-placeholder {
    min-height: 250px;
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar广告 */
.ad-sidebar-top {
    margin-bottom: 24px;
    position: sticky;
    top: 100px;
}

/* 锚定广告 - 底部固定 */
.ad-sticky-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    display: none;
}

.ad-sticky-bottom.show {
    display: block;
    transform: translateY(0);
}

.ad-sticky-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    padding: 8px;
}

.ad-sticky-bottom .ad-placeholder {
    min-height: 50px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-close-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.ad-close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* 移动端优化 */
@media (max-width: 768px) {
    /* 移动端广告全宽 */
    .ad-space {
        margin: 15px -20px;
        padding: 0 20px;
    }
    
    .ad-below-header {
        margin: 0 0 15px 0;
        padding: 15px 0;
    }
    
    .ad-below-header .ad-placeholder {
        min-height: 100px;
        background: #f3f4f6;
        border: 2px dashed #d1d5db;
        border-radius: 8px;
    }
    
    /* In-Feed广告移动端样式 */
    .ad-in-feed {
        margin: 20px -20px;
        padding: 15px 20px;
        border-radius: 0;
        background: #fafafa;
    }
    
    .ad-in-feed .ad-placeholder {
        min-height: 280px;
    }
    
    /* 侧边栏在移动端变为内容区 */
    .sidebar {
        width: 100%;
        position: static;
        margin-top: 30px;
    }
    
    .ad-sidebar {
        margin: 20px 0;
    }
    
    .ad-sidebar .ad-placeholder {
        min-height: 250px;
        background: #f9fafb;
        border: 2px dashed #e5e7eb;
        border-radius: 8px;
    }
    
    /* 锚定广告移动端优化 */
    .ad-sticky-bottom {
        display: none;
    }
    
    .ad-sticky-bottom.show {
        display: block;
    }
    
    .ad-sticky-container {
        padding: 5px;
    }
    
    .ad-sticky-bottom .ad-placeholder {
        min-height: 60px;
        font-size: 12px;
    }
    
    /* 确保主内容不被锚定广告遮挡 */
    body {
        padding-bottom: 70px;
    }
    
    /* 调整文章卡片间距 */
    .articles-grid {
        gap: 20px;
    }
    
    .article-card {
        margin-bottom: 15px;
    }
}

/* 平板优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .ad-below-header .ad-placeholder {
        min-height: 90px;
    }
    
    .ad-in-feed .ad-placeholder {
        min-height: 200px;
    }
    
    /* 平板不显示锚定广告 */
    .ad-sticky-bottom {
        display: none !important;
    }
}

/* 桌面端优化 */
@media (min-width: 1025px) {
    /* 桌面端顶部广告 */
    .ad-below-header .ad-placeholder {
        min-height: 90px;
        max-width: 728px;
        margin: 0 auto;
    }
    
    /* In-Feed广告桌面样式 */
    .ad-in-feed .ad-placeholder {
        min-height: 200px;
        max-width: 728px;
        margin: 0 auto;
    }
    
    /* 桌面端不显示锚定广告 */
    .ad-sticky-bottom {
        display: none !important;
    }
    
    /* 侧边栏固定 */
    .ad-sidebar-top {
        position: sticky;
        top: 100px;
    }
}

/* 广告加载动画 */
@keyframes adPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.ad-placeholder {
    animation: adPulse 2s ease-in-out infinite;
}

/* 广告标签 */
.ad-placeholder p {
    color: #9ca3af;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* 确保广告不影响布局 */
.ad-space {
    clear: both;
    overflow: hidden;
}

/* 文章详情页广告间距 */
.article-detail .ad-space {
    margin: 40px 0;
}

/* 优化广告加载体验 */
.ad-placeholder:empty {
    min-height: 250px;
    background: linear-gradient(
        90deg,
        #f3f4f6 25%,
        #e5e7eb 50%,
        #f3f4f6 75%
    );
    background-size: 200% 100%;
    animation: adLoading 1.5s ease-in-out infinite;
}

@keyframes adLoading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
