
/* === 首页专用样式 - 通过外层容器完全隔离 === */
.homepage-template-wrapper {
    /* 定义仅在此容器内生效的变量 */
    --hp-accent: #1e73be;
    --hp-accent-dark: #1a5d9c;
    --hp-light-bg: #f9fafc;
    --hp-border: #eaeef5;
    --hp-white: #ffffff;
--hp-text-dark: #222222;
    --hp-text-medium: #575760;
}

/* 核心：强制首页内容区全宽，并隐藏侧边栏 */
.homepage-template-wrapper .site-content {
    display: block !important;
}
.homepage-template-wrapper .content-area {
    width: 100% !important;
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.homepage-template-wrapper .widget-area.is-right-sidebar {
    display: none !important;
}

/* 英雄区域 */
.homepage-template-wrapper .home-hero {
    background: linear-gradient(135deg, var(--hp-accent) 0%, var(--hp-accent-dark) 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
    border-radius: 0 0 20px 20px;
}
.homepage-template-wrapper .home-hero h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: 700;
}
.homepage-template-wrapper .home-hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}
.homepage-template-wrapper .hero-cta {
    display: inline-flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}
.homepage-template-wrapper .hero-btn {
    background: white;
    color: var(--hp-accent);
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
.homepage-template-wrapper .hero-btn.secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}
.homepage-template-wrapper .hero-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* === 分类区块：修改为稳定的2列，共3行 === */
.homepage-template-wrapper .stack-categories {
    display: grid;
    /* 关键修改：固定2列，确保6个盒子排成3行 */
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin: 50px 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.homepage-template-wrapper .category-card {
    background: var(--hp-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--hp-border);
}
.homepage-template-wrapper .category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}
.homepage-template-wrapper .category-header {
    background: var(--hp-light-bg);
    padding: 25px;
    border-bottom: 1px solid var(--hp-border);
}
.homepage-template-wrapper .category-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--hp-accent);
}
.homepage-template-wrapper .category-header h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--hp-text-dark);
}
.homepage-template-wrapper .category-header p {
    color: var(--hp-text-medium);
    line-height: 1.5;
    margin-bottom: 15px;
}
.homepage-template-wrapper .category-link {
    color: var(--hp-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.homepage-template-wrapper .category-link:hover {
    color: var(--hp-accent-dark);
}
.homepage-template-wrapper .category-articles {
    padding: 20px;
}
.homepage-template-wrapper .article-preview {
    padding: 15px 0;
    border-bottom: 1px solid var(--hp-border);
}
.homepage-template-wrapper .article-preview:last-child {
    border-bottom: none;
}
.homepage-template-wrapper .article-preview h4 {
    margin-bottom: 8px;
    font-size: 1.1rem;
    line-height: 1.4;
}
.homepage-template-wrapper .article-preview h4 a {
    color: var(--hp-text-dark);
    text-decoration: none;
}
.homepage-template-wrapper .article-preview h4 a:hover {
    color: var(--hp-accent);
}
.homepage-template-wrapper .article-meta {
    font-size: 0.85rem;
    color: var(--hp-text-medium);
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
}
.homepage-template-wrapper .article-excerpt {
    font-size: 0.95rem;
    color: var(--hp-text-medium);
    line-height: 1.5;
}

/* 其他区域样式（特色内容、CTA等）保持类似结构，前缀均为 .homepage-template-wrapper */
.homepage-template-wrapper .featured-section {
    margin: 60px 0;
    background: var(--hp-light-bg);
    padding: 40px;
    border-radius: 12px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.homepage-template-wrapper .section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
    color: var(--hp-text-dark);
}
.homepage-template-wrapper .featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}
.homepage-template-wrapper .featured-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}
.homepage-template-wrapper .featured-content {
    padding: 25px;
}
.homepage-template-wrapper .featured-badge {
    display: inline-block;
    background: var(--hp-accent);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}
.homepage-template-wrapper .cta-section {
    background: linear-gradient(135deg, var(--hp-accent) 0%, var(--hp-accent-dark) 100%);
    color: white;
    padding: 60px 20px;
    border-radius: 12px;
    text-align: center;
    margin: 60px 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.homepage-template-wrapper .cta-section h3 {
    font-size: 2rem;
    margin-bottom: 20px;
}
.homepage-template-wrapper .cta-section p {
    max-width: 600px;
    margin: 0 auto 30px;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* === 响应式设计 === */
@media (max-width: 1024px) {
    .homepage-template-wrapper .stack-categories {
        grid-template-columns: repeat(2, 1fr); /* 平板端保持2列 */
        gap: 20px;
        padding: 0 15px;
    }
}
@media (max-width: 768px) {
    .homepage-template-wrapper .home-hero h1 {
        font-size: 2rem;
    }
    .homepage-template-wrapper .stack-categories {
        grid-template-columns: 1fr; /* 移动端变为1列 */
    }
    .homepage-template-wrapper .featured-grid {
        grid-template-columns: 1fr;
    }
    .homepage-template-wrapper .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    .homepage-template-wrapper .hero-btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
    .homepage-template-wrapper .featured-section,
    .homepage-template-wrapper .cta-section {
        padding: 30px 20px;
        margin: 40px auto;
    }
}
