/* ==============================================================
   首页媒体查询
   ============================================================== */

/* 平板端 (Tablet) ≤ 1024px */
@media (max-width: 1024px) {

    /* 首页 VIP 表格：隐藏不重要列，保留 5 列 */
    .cms-job-list-card .cms-job-row {
        grid-template-columns: repeat(5, 1fr);
    }

    /* 隐藏标记了 cms-col-hide-md 的列（首页 + 列表页共用） */
    .cms-col-hide-md {
        display: none;
    }

    /* 投稿表单平板适配 */
    .grid-3-col {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 手机端 (Mobile) ≤ 640px */
@media (max-width: 640px) {

    /* 减小头部高度和间距 */
    .cms-header {
        padding: 8px 0 !important;
        position: relative;
        z-index: auto;
    }

    .cms-header .cms-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px !important;
    }

    .cms-logo-area {
        justify-content: space-between;
        gap: 8px !important;
    }

    .cms-logo-icon {
        font-size: 28px !important;
    }

    .cms-logo-text {
        font-size: 18px !important;
    }

    .cms-logo-sub {
        font-size: 10px !important;
    }

    .cms-location strong {
        font-size: 14px !important;
    }

    .cms-search-area {
        max-width: 100%;
        margin: 4px 0;
    }

    .cms-search-input,
    .cms-search-btn {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }

    .cms-header-actions {
        justify-content: space-between;
        margin-top: 4px;
        font-size: 13px !important;
    }

    .cms-nav-btn {
        display: block;
        padding: 8px 12px !important;
        font-size: 20px !important;
    }

    .cms-nav-list {
        display: none;
        /* 默认隐藏 */
        width: 100%;
        background-color: #333;
        padding: 8px !important;
        /* 四周留白 */
        position: absolute;
        /* 下拉覆盖内容 */
        top: 100%;
        /* 紧贴导航栏下方 */
        left: 0;
        z-index: 9;
        /* 确保在最上层 */
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    }

    /* 点击展开后：切换成 grid 3 列 */
    .cms-nav-toggle:checked~.cms-nav-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        /* 强制 3 列 */
        gap: 8px !important;
        /* 减小间距 */
    }

    /* 每个导航项在网格中的样式调整 */
    .cms-nav-list li {
        min-width: 0;
    }

    .cms-nav-list li a {
        padding: 8px 4px !important;
        /* 极简内边距 */
        font-size: 13px !important;
        /* 字号再小一点 */
        text-align: center;
        white-space: normal;
        border-bottom: none;
        border-radius: 4px;
        display: block;
        transition: background 0.2s;
    }

    .cms-nav-list li a:hover,
    .cms-nav-list li a.active {
        background-color: var(--cms-primary);
    }

    /* 徽章（热、新、抢 等）位置微调 - 紧凑化 */
    .cms-nav-list .cms-badge {
        margin-left: 4px;
        font-size: 10px !important;
        padding: 1px 4px !important;
    }

    /* 导航栏响应式折叠菜单，手机端：汉堡菜单 + 展开后 3 列网格 */
    /* 首页 VIP 表格转为卡片列表 - 紧凑化 */
    .cms-job-list-card .cms-job-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 10px 12px !important;
        text-align: left;
    }

    .cms-job-title {
        font-size: 14px !important;
    }

    .cms-job-row span,
    .cms-job-row div {
        font-size: 13px !important;
    }

    /* 手机端隐藏表头（首页 + 列表页共用） */
    /* 强制隐藏首页与列表页表头 */
    .cms-job-list-card .cms-job-header,
    .cms-list-card .cms-job-header {
        display: none !important;
    }

    /* 取消手机端下公司名称的裁剪 */
    .cms-col-company {
        white-space: normal;
        overflow: visible;
        max-width: none;
    }

    /* 手机端伪元素补充列名标签（首页 + 列表页共用） */
    .cms-col-company::before {
        content: '类型：';
        color: var(--cms-text-muted);
        font-weight: normal;
    }

    .cms-job-salary::before {
        content: '日薪：';
        color: var(--cms-text-muted);
        font-weight: normal;
    }

    .cms-col-phone::before {
        content: '联系：';
        color: var(--cms-text-muted);
        font-weight: normal;
    }

    .cms-col-location::before {
        content: '地点：';
        color: var(--cms-text-muted);
        font-weight: normal;
    }

    /* 新闻列表改为手机端单列 - 紧凑 */
    .cms-news-grid {
        grid-template-columns: 1fr;
        gap: 12px !important;
    }

    .cms-news-item {
        display: flex;
        /* 确保保持横排 */
        padding: 10px !important;
        gap: 10px !important;
    }

    .cms-news-content {
        min-width: 0 !important;
        /* 关键补丁：防止内容撑开 flex 容器 */
    }

    .cms-news-img {
        width: 110px !important;
        /* 手机端略微缩小图片宽度 */
        height: 82px !important;
        /* 保持 4:3 比例 */
    }

    .cms-news-title {
        font-size: 15px !important;
        margin-bottom: 4px !important;
    }

    .cms-news-title a {
        white-space: normal !important;
        /* 移动端允许标题换行，避免截断过多 */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .cms-news-desc {
        font-size: 12px !important;
        margin-bottom: 4px !important;
    }

    /* 简约资讯列表手机端单列 */
    .cms-simple-news-grid {
        grid-template-columns: 1fr;
        gap: 10px !important;
    }

    .cms-simple-news-item {
        padding: 10px !important;
        min-width: 0 !important;
        /* 补丁：防止撑开容器 */
    }

    /* 修正底部布局，确保城市关注和时间能分居两侧且可见 */
    .cms-news-meta,
    .cms-news-wutu {
        margin: 10px 0 0 0 !important;
        /* 清除左右 margin，防止挤压 */
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .cms-news-meta>span:last-child,
    .cms-news-wutu>span:last-child {
        flex-shrink: 0 !important;
        /* 防止时间被挤压 */
        margin-left: 10px !important;
    }

    .cms-simple-news-title {
        font-size: 14px !important;
        margin-bottom: 4px !important;
    }

    .cms-simple-news-title a {
        white-space: normal !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        word-break: break-all !important;
    }

    /* ----超级私人网站，手机端强制2列---- */
    .cms-banner-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px !important;
    }

    .cms-banner-item {
        padding: 10px !important;
        font-size: 13px !important;
    }

    /* 投稿表单手机端适配：强制单列 */
    .modern-submission-form {
        padding: 15px;
    }

    .grid-3-col {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .sub-group label {
        font-size: 13px;
    }

    /* 详情页手机端适配补丁 - 紧凑 */

    .cms-detail-title {
        font-size: 18px !important;
    }

    /* AI box styles moved to style.css */
}

/* ==============================================================
   招聘列表页 媒体查询
   ============================================================== */

/* 平板端 ≤ 1024px */
@media (max-width: 1024px) {
    .cms-main-layout {
        grid-template-columns: 2fr 1fr;
    }

    /* 列表页表格：隐藏住宿和时间列后保留 4 列 */
    .cms-list-card .cms-job-row {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }
}

/* 手机端 ≤ 640px */
@media (max-width: 640px) {

    /* 取消分栏，上下堆叠 */
    .cms-main-layout {
        grid-template-columns: 1fr;
    }

    /* 侧边栏移到底部 */
    .cms-sidebar-col {
        order: 2;
    }

    .cms-content-col {
        order: 1;
    }

    /* 筛选面板手机端调整内边距 */
    .cms-filter-panel {
        padding: var(--cms-spacing-md);
    }

    /* 列表页表格转为卡片流 - 紧凑化 */
    .cms-list-card .cms-job-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 10px 12px !important;
    }

    .cms-job-title {
        font-size: 14px !important;
    }



    /* 手机端释放文本截断，允许完整显示 */
    .cms-list-card .cms-job-title {
        white-space: normal;
        overflow: visible;
        max-width: none;
    }

    /* 城市切换面板手机端适配 */
    .cms-city-panel {
        padding: 16px 12px;
    }

    .cms-city-group {
        flex-direction: column;
        gap: 8px;
    }

    .cms-city-province {
        width: 100%;
        color: var(--cms-text-muted);
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 4px;
        margin-bottom: 4px;
    }

    .cms-city-mobile-hidden {
        display: none;
    }

    .cms-city-mobile-hidden.show {
        display: block;
    }

    .cms-city-toggle-btn {
        display: block;
    }

    .cms-city-toggle-btn.hide {
        display: none;
    }

    /* 更多城市下拉手机端适配 */
    .cms-more-dropdown {
        width: 100%;
        left: 0;
        right: 0;
        padding: 10px 4px;
        gap: 4px;
    }

    .cms-more-dropdown a {
        font-size: 12px;
    }
}

/* ==============================================================
   预定列表页 媒体查询
   ============================================================== */

/* 平板端 ≤ 1024px */
@media (max-width: 1024px) {

    /* 隐藏包厢类型和更新时间列，保留 4 列 */
    .cms-booking-row {
        grid-template-columns: 2.5fr 0.8fr 1fr 1fr;
    }
}

/* 手机端 ≤ 640px */
@media (max-width: 640px) {

    /* 表格转为卡片流 - 单列堆叠 */
    .cms-booking-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: var(--cms-spacing-md);
    }

    /* 隐藏表头 */
    .cms-booking-header {
        display: none;
    }

    /* 手机端释放名称截断，允许换行完整显示 */
    .cms-booking-name,
    .cms-booking-qiuzhi {
        white-space: normal;
        overflow: visible;
        max-width: none;
    }

    /* 手机端1234招聘列表伪元素补充列名标签 */
    .cms-booking-name::before {
        content: '公司名称：';
        color: var(--cms-text-muted);
        font-weight: normal;
    }

    .cms-booking-zhaopingangwei {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .cms-booking-zhaopingangwei::before {
        content: '招工职位：';
        color: var(--cms-text-muted);
        font-weight: normal;
        flex-shrink: 0;
        /* 防止标签被压缩 */
    }

    .cms-booking-xinzi::before {
        content: '日薪/月薪：';
        color: var(--cms-text-muted);
        font-weight: normal;
    }

    .cms-booking-type::before {
        content: '职位福利：';
        color: var(--cms-text-muted);
        font-weight: normal;
    }

    /* 手机端567预定列表伪元素补充列名标签 */
    .cms-booking-dazhe::before {
        content: '折扣福利：';
        color: var(--cms-text-muted);
        font-weight: normal;
    }

    .cms-booking-zengsong {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .cms-booking-zengsong::before {
        content: '赠送福利：';
        color: var(--cms-text-muted);
        font-weight: normal;
        flex-shrink: 0;
        /* 防止标签被压缩 */
    }

    .cms-booking-price::before {
        content: '人均消费：';
        color: var(--cms-text-muted);
        font-weight: normal;
    }

    /* 手机端8求职列表伪元素补充列名标签 */
    .cms-booking-jingyan::before {
        content: '从业经验：';
        color: var(--cms-text-muted);
        font-weight: normal;
    }

    .cms-booking-yixiangdidian::before {
        content: "性别/意向城市：";
        color: var(--cms-text-muted);
        font-weight: normal;
    }

    .cms-booking-leixinggangwei {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .cms-booking-leixinggangwei::before {
        content: "应聘岗位：";
        color: var(--cms-text-muted);
        font-weight: normal;
        flex-shrink: 0;
    }

    .cms-booking-qiwangxinzi::before {
        content: '期望日薪：';
        color: var(--cms-text-muted);
        font-weight: normal;
    }
}


/* ==============================================================
   详情页 + AI框 媒体查询
   ============================================================== */
@media screen and (max-width: 768px) {


    /* 适配左侧内边距 */
    .cms-detail-header,
    .cms-detail-body {
        padding: 15px;
    }

    .cms-detail-title {
        font-size: 22px;
    }

    .cms-meta-salary {
        font-size: 20px;
    }

    /* 移动端底部操作条激活 */
    .cms-mobile-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: #fff;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }

    .cms-mobile-bar-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        font-weight: bold;
        text-decoration: none;
        color: #fff;
        border: none;
        min-width: 0;
    }

    .cms-bar-wechat {
        background: #25b513;
        flex: 1.2;
    }

    .cms-bar-call {
        background: var(--cms-primary, #e60012);
        flex: 1.8;
    }

    /* 给 body 留出底部空间，防止被由于定条遮挡内容 */
    /* 移除通用底部间距，避免搜索等页面出现白边 */
    /* body {
        padding-bottom: 60px;
    } */

    /* 隐藏侧边栏的 Sticky，在手机端变为常规流 */
    .cms-sticky-card {
        position: static;
    }
}

@media screen and (max-width: 640px) {
    .cms-ai-box {
        padding: 15px !important;
        margin-left: -15px !important;
        margin-right: -15px !important;
        border-radius: 0 !important;
        border-left: 5px solid var(--cms-primary) !important;
    }

    .cms-ai-list li {
        padding-left: 0 !important;
        margin-bottom: 12px !important;
        display: block !important;
    }

    .cms-ai-list li strong:first-child {
        position: static !important;
        display: inline !important;
        color: #111 !important;
    }

    .cms-detail-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .cms-detail-gallery img {
        width: 100%;
    }

    .cms-safe-tip h4 {
        font-size: 14px;
    }

    .cms-safe-tip p {
        font-size: 10px;
    }
}