/**
 * Label Vibe v1.4.1 - 首页布局优化（强制版）
 * 修复帖子展示区域宽度，确保与上方完全对齐
 */

/* ===== 页面主容器 ===== */
body .container,
body #forum.page,
body #forum.page.active {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 20px auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
}

/* ===== Banner、导航头部 ===== */
body .banner,
body .page-header {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

/* ===== 快速导航 ===== */
body .quick-nav {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ===== 积分卡片 - 去除左右边距 ===== */
body .lv-points-card,
.container .lv-points-card,
#page .lv-points-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 20px 0 !important;
    box-sizing: border-box !important;
}

/* ===== 主内容区 - 桌面端双栏，移动端单列 ===== */
body .main-content {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

@media (max-width: 1024px) {
    body .main-content {
        flex-direction: column !important;
    }
}

/* ===== 帖子区域 ===== */
body .posts-section,
.main-content .posts-section,
#forum .posts-section {
    flex: 1 !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

/* ===== 广告位侧边栏 ===== */
body .sidebar-ads {
    width: 320px !important;
    flex-shrink: 0 !important;
    display: block !important;
}

@media (max-width: 1024px) {
    body .sidebar-ads {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 12px !important;
    }
    body .sidebar-ads .ad-section-title,
    body .sidebar-ads .ad-footer {
        grid-column: 1 / -1 !important;
    }
    body .sidebar-ads .ad-item {
        margin-bottom: 0 !important;
    }
}

@media (max-width: 480px) {
    body .sidebar-ads {
        grid-template-columns: 1fr !important;
    }
}

/* ===== 帖子列表 ===== */
body #postsContainer {
    width: 100% !important;
    max-width: 100% !important;
}

/* ===== 单个帖子 ===== */
body .post-item {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* ===== 帖子标题 ===== */
body .post-title {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* ===== 帖子元信息 ===== */
body .post-meta-compact {
    width: 100% !important;
    max-width: 100% !important;
}

/* ===== 隐藏可能存在的侧边栏（除了广告位）=====
 * 修改：排除 .sidebar-ads 广告位
 */
body .revision-sidebar,
body aside:not(.sidebar-ads),
body .sidebar:not(.sidebar-ads),
.main-content .revision-sidebar {
    display: none !important;
}

/* ===== Tab 栏 ===== */
body .tabs {
    width: 100% !important;
    max-width: 100% !important;
}

/* ===== 分区标题 ===== */
body .section-title {
    width: 100% !important;
    max-width: 100% !important;
}

/* ===== 响应式 - 平板 ===== */
@media (max-width: 768px) {
    body .container,
    body #forum.page,
    body #forum.page.active {
        padding-left: 12px !important;
        padding-right: 12px !important;
        margin: 15px auto !important;
    }
    
    body .posts-section,
    .main-content .posts-section {
        padding: 15px !important;
    }
    
    body .banner,
    body .page-header {
        padding: 25px 15px !important;
    }
}

/* ===== 响应式 - 手机 ===== */
@media (max-width: 480px) {
    body .container,
    body #forum.page,
    body #forum.page.active {
        padding-left: 10px !important;
        padding-right: 10px !important;
        margin: 10px auto !important;
    }
    
    body .posts-section,
    .main-content .posts-section {
        padding: 12px !important;
        border-radius: 8px !important;
    }
}
