/*
 * Theme Name: WebStack
 * Theme URI: https://www.iotheme.cn/
 * Description: 页面布局样式 - 用于AI资讯、AI项目、AI教程等页面
 */

/* ===== 页面容器布局 ===== */
.page-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
    background: #f9f9f9;
}

/* ===== 左侧导航栏 ===== */
.page-container .sidebar-menu {
    width: 250px;
    background: #ffffff;
    border-right: 1px solid #e4ecf3;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: width 0.3s ease;
}

.page-container .sidebar-menu.collapsed {
    width: 80px;
}

/* ===== 右侧主内容区 ===== */
.page-container .main-content {
    flex: 1;
    margin-left: 250px; /* 确保主内容区域不被侧边栏遮挡 */
    background: #f9f9f9;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative; /* 确保定位正确 */
    z-index: 1; /* 确保层级正确 */
}

.page-container .sidebar-menu.collapsed + .main-content {
    margin-left: 80px;
}

/* ===== 防止重复容器重叠 ===== */
.page-container + .page-container {
    display: none !important; /* 隐藏重复的page-container */
}

/* ===== 确保主内容区域正确显示 ===== */
.page-container .main-content.page {
    margin-left: 250px; /* 强制设置左边距 */
    width: calc(100% - 250px); /* 确保宽度正确 */
    position: relative;
    z-index: 1;
}

/* ===== 移动端布局修复 ===== */
@media (max-width: 768px) {
    .page-container {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .page-container .sidebar-menu {
        display: none !important;
        width: 0 !important;
    }
    
    .page-container .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }
    
    .page-container .main-content.page {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .page-container .main-content .container {
        padding: 15px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .page-container .main-content .header-banner {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }
    
    .page-container .main-content .banner-container {
        padding: 0 15px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .page-container .main-content .container {
        padding: 10px;
    }
    
    .page-container .main-content .banner-container {
        padding: 0 10px;
    }
}

/* ===== 顶部导航栏 ===== */
.page-container .main-content .header-banner {
    background: #cdaeff;
    box-shadow: none;
    position: relative;
    z-index: 999;
    width: 100%;
    display: block;
    clear: both;
    margin: 0;
    padding: 0;
    max-width: 100%; /* 确保最大宽度为100% */
    overflow: hidden; /* 防止内容溢出 */
}

.page-container .main-content .banner-container {
    width: 100%; /* 确保容器宽度为100% */
    max-width: 100%; /* 最大宽度为100% */
    margin: 0;
    padding: 0 20px;
    box-sizing: border-box; /* 确保盒模型正确 */
}

.page-container .main-content .banner-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 60px;
    width: 100%; /* 确保导航占满容器宽度 */
}

/* ===== 页面内容区域 ===== */
.page-container .main-content .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}

/* ===== 页面头部样式 ===== */
.ai-news-header,
.ai-projects-header,
.ai-tutorials-header {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 15px 0;
}

.page-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-meta .meta-item {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
    color: #666;
    font-size: 14px;
}

.page-meta .meta-item i {
    margin-right: 5px;
    color: #999;
}

.page-meta .stats {
    display: flex;
    gap: 15px;
}

.page-meta .stat-item {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 14px;
}

.page-meta .stat-item i {
    margin-right: 5px;
    color: #999;
}

/* ===== 面包屑导航 ===== */
.breadcrumb-nav {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.breadcrumb-nav a {
    color: #666;
    text-decoration: none;
}

.breadcrumb-nav a:hover {
    color: #007cba;
}

.breadcrumb-nav .separator {
    margin: 0 8px;
    color: #999;
}

.breadcrumb-nav .current {
    color: #333;
    font-weight: 500;
}

/* ===== 分类筛选按钮 ===== */
.category-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #f8f9fa;
    color: #666;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.filter-btn:hover {
    background: #e9ecef;
    color: #333;
    text-decoration: none;
}

.filter-btn.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

/* ===== 搜索框 ===== */
.search-box {
    display: flex;
    margin: 20px 0;
    max-width: 500px;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px 0 0 25px;
    font-size: 14px;
    outline: none;
}

.search-input:focus {
    border-color: #007cba;
}

.search-btn {
    padding: 12px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #005a87;
}

/* ===== 文章/项目/教程列表 ===== */
.ai-news-item,
.ai-project-item,
.ai-tutorial-item {
    background: white;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ai-news-item:hover,
.ai-project-item:hover,
.ai-tutorial-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.news-content,
.project-content,
.tutorial-content {
    display: flex;
    padding: 20px;
}

.news-icon,
.project-thumbnail,
.tutorial-thumbnail {
    margin-right: 15px;
    margin-top: 5px;
    flex-shrink: 0;
}

.news-icon i {
    color: #4285f4;
    font-size: 8px;
}

.project-thumbnail,
.tutorial-thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image,
.tutorial-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-placeholder,
.tutorial-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 24px;
}

.news-body,
.project-body,
.tutorial-body {
    flex: 1;
}

.news-title,
.project-title,
.tutorial-title {
    margin: 0 0 10px 0;
}

.news-title a,
.project-title a,
.tutorial-title a {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.news-title a:hover,
.project-title a:hover,
.tutorial-title a:hover {
    color: #007cba;
}

.news-excerpt,
.project-excerpt,
.tutorial-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 14px;
}

.news-meta,
.project-meta,
.tutorial-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 12px;
    color: #999;
    flex-wrap: wrap;
}

.news-meta span,
.project-meta span,
.tutorial-meta span {
    display: flex;
    align-items: center;
}

.news-meta i,
.project-meta i,
.tutorial-meta i {
    margin-right: 5px;
}

.news-footer,
.project-footer,
.tutorial-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.news-footer .read-more a,
.read-more-btn {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 12px;
    border: 1px solid #007cba;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.news-footer .read-more a:hover,
.read-more-btn:hover {
    background: #007cba;
    color: white;
    text-decoration: none;
}

/* ===== 侧边栏样式 ===== */
.sidebar {
    padding-left: 20px;
}

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

.widget-title {
    background: #f8f9fa;
    padding: 15px 20px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #eee;
}

.widget-title i {
    margin-right: 8px;
    color: #007cba;
}

/* ===== 热门工具网格 ===== */
.hot-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 15px;
}

.hot-tool-card {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
}

.hot-tool-card:hover {
    background: #e8e8e8;
    transform: translateY(-2px);
}

.tool-card-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.tool-card-icon {
    width: 28px;
    height: 28px;
    margin-right: 10px;
    flex-shrink: 0;
}

.tool-card-icon img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
}

.tool-card-title {
    font-size: 13px;
    font-weight: bold;
    color: #333;
    line-height: 1.3;
    flex: 1;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* ===== 最新收录网格 ===== */
.latest-sites-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 15px;
}

.latest-site-card {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
    text-align: center;
}

.latest-site-card:hover {
    background: #e8e8e8;
    transform: translateY(-2px);
}

.site-card-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.site-card-icon {
    width: 28px;
    height: 28px;
    margin-right: 10px;
    flex-shrink: 0;
}

.site-card-icon img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
}

.site-card-title {
    font-size: 13px;
    font-weight: bold;
    color: #333;
    line-height: 1.3;
    flex: 1;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* ===== 最新文章列表 ===== */
.latest-articles-list {
    padding: 15px;
}

.latest-article-item {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.latest-article-item:last-child {
    border-bottom: none;
}

.latest-article-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.article-link {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    text-decoration: none;
    color: inherit;
}

.article-thumbnail {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.article-icon {
    color: white;
    font-size: 18px;
}

.article-info {
    flex: 1;
    min-width: 0;
}

.article-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-link:hover .article-title {
    color: #007cba;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #888;
}

.article-date {
    color: #007cba;
    font-weight: 500;
}

.article-source {
    color: #666;
}

/* ===== 项目统计 ===== */
.stats-content {
    padding: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #007cba;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

/* ===== 标签云 ===== */
.tags-cloud {
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    display: inline-block;
    padding: 6px 12px;
    background: #f8f9fa;
    color: #666;
    text-decoration: none;
    border-radius: 15px;
    font-size: 12px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.tag-item:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
    text-decoration: none;
}

/* ===== 学习进度 ===== */
.progress-content {
    padding: 15px;
}

.progress-item {
    margin-bottom: 15px;
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007cba, #005a87);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-percent {
    font-size: 12px;
    color: #007cba;
    font-weight: 600;
}

/* ===== 推荐教程 ===== */
.recommended-list {
    padding: 15px;
}

.recommended-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.recommended-item:last-child {
    border-bottom: none;
}

.recommended-item:hover {
    color: #007cba;
    transform: translateX(5px);
}

.recommended-item i {
    margin-right: 10px;
    color: #007cba;
    font-size: 16px;
}

.recommended-item span {
    font-size: 14px;
    font-weight: 500;
}



/* ===== 分页导航 ===== */
.posts-nav {
    margin-top: 30px;
    text-align: center;
}

.posts-nav a,
.posts-nav span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
}

.posts-nav a:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.posts-nav .current {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.posts-nav .prev,
.posts-nav .next {
    font-weight: 500;
}

/* ===== 响应式设计 ===== */
@media (max-width: 991px) {
    .sidebar {
        padding-left: 0;
        margin-top: 30px;
    }
    
    .page-container .main-content .container {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .page-container {
        flex-direction: column;
    }
    
    .page-container .sidebar-menu {
        position: fixed;
        width: 100%;
        height: auto;
        top: 0;
        z-index: 999;
        border-right: none;
        border-bottom: 1px solid #e4ecf3;
    }
    
    .page-container .main-content {
        margin-left: 0;
        margin-top: 80px;
    }
    
    .ai-news-header,
    .ai-projects-header,
    .ai-tutorials-header {
        padding: 20px;
    }
    
    .ai-news-header .page-title,
    .ai-projects-header .page-title,
    .ai-tutorials-header .page-title {
        font-size: 24px;
    }
    
    .page-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .category-filters {
        justify-content: center;
    }
    
    .filter-btn {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .news-content,
    .project-content,
    .tutorial-content {
        padding: 15px;
        flex-direction: column;
    }
    
    .news-icon,
    .project-thumbnail,
    .tutorial-thumbnail {
        margin-right: 0;
        margin-bottom: 15px;
        margin-top: 0;
    }
    
    .project-thumbnail,
    .tutorial-thumbnail {
        width: 100%;
        height: 120px;
    }
    
    .hot-tools-grid,
    .latest-sites-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px;
    }
    
    .hot-tool-card,
    .latest-site-card {
        padding: 10px;
    }
    
    .tool-card-title,
    .site-card-title {
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .page-container .main-content .container {
        padding: 10px;
    }
    
    .ai-news-header,
    .ai-projects-header,
    .ai-tutorials-header {
        padding: 15px;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .category-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
    
    .search-box {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-input {
        border-radius: 25px;
    }
    
    .search-btn {
        border-radius: 25px;
        width: 100%;
    }
    
    .hot-tools-grid,
    .latest-sites-grid {
        grid-template-columns: 1fr;
    }
    
    .news-meta,
    .project-meta,
    .tutorial-meta {
        flex-direction: column;
        gap: 8px;
    }
} 