/* ===== 响应式设计样式文件 ===== */
/* 包含移动端、平板端等不同屏幕尺寸的适配样式 */

/* ===== 平板端适配（768px以下） ===== */
@media (max-width: 768px) {

    /* === 头部响应式调整 === */

    /* 头部容器调整为垂直布局 */
    .header-container {
        flex-direction: column;
        /* 改为垂直排列，避免水平空间不足 */
        gap: 0.8rem;
    }

    /* 导航链接容器调整 */
    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-container::before {
        inset-inline-end: 0;
        width: clamp(58px, 18vw, 145px);
        opacity: 0.7;
    }

    /* === 搜索区域响应式调整 === */

    /* 搜索框容器改为垂直布局 */
    .search-box-container {
        flex-direction: column;
    }

    /* 筛选器容器调整 */
    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }

    /* === 主要布局响应式调整 === */

    /* 左右分栏布局改为垂直布局 */
    .jobs-main-layout {
        flex-direction: column;
        height: auto;
        min-height: unset;
        gap: 1rem;
    }

    /* 职位列表面板调整 */
    .jobs-list-panel {
        flex: none;
        width: 100%;
        max-height: 50vh;
        min-height: 300px;
    }

    /* 职位详情面板调整 */
    .job-detail-panel {
        flex: 1;
        min-height: 400px;
    }

    /* 职位详情头部调整 */
    .job-detail-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    /* === 底部响应式调整 === */

    .footer-container {
        min-height: 88px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 0.3rem;
    }

    .footer-links { gap: 1.15rem; }
    .footer-link { font-size: 0.8rem; }

}

/* ===== 小屏手机端适配（480px以下） ===== */
@media (max-width: 480px) {

    /* === 基础间距调整 === */

    /* 头部内边距减小 */
    header {
        padding: 0.8rem 1rem;
    }

    /* 主内容区域内边距减小 */
    main {
        padding: 1rem;
    }

    /* === 字体大小调整 === */

    /* Logo尺寸单调递减：桌面40px，小屏36px */
    .logo svg {
        height: 36px;
    }

    /* === 布局优化 === */

    /* 头部操作按钮调整 */
    .header-actions {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* 筛选器组调整 */
    .filters {
        justify-content: center;
    }

    /* 清除筛选按钮调整 */
    .clear-filters-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }

    /* 申请按钮调整 */
    .apply-btn {
        padding: 0.25rem 0.6rem;
        font-size: 0.7rem;
        /* 徽章/小按钮下限，不再调小 */
    }

    /* 职位标签字体减小 */
    .job-tag {
        font-size: 0.7rem;
        padding: 0.15rem 0.5rem;
    }

    /* 职位时间字体减小 */
    .job-time {
        font-size: 0.7rem;
    }
}

/* ===== 超小屏幕适配（360px以下） ===== */
@media (max-width: 360px) {

    /* === 极限空间优化 === */

    /* 进一步减小各种间距 */
    .header-container {
        gap: 0.5rem;
    }

    .nav-links {
        gap: 0.8rem;
    }

    .header-actions {
        gap: 0.8rem;
    }

    .search-box-container {
        gap: 0.6rem;
    }

    .filters-container {
        gap: 0.6rem;
    }

    .filters {
        gap: 0.6rem;
    }

    /* 字体进一步减小 */
    .nav-link {
        font-size: 0.85rem;
    }

    .action-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .search-input {
        font-size: 0.85rem;
        padding: 0.7rem 0.7rem 0.7rem 2.2rem;
    }

    .search-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }
}

/* ===== 大屏幕优化（1200px以上） ===== */
@media (min-width: 1200px) {

    /* === 大屏幕布局优化 === */

    /* 主容器最大宽度扩大 */
    .main-container,
    .footer-container {
        max-width: 1400px;
    }

    /* 职位网格保持垂直排列，不再使用多列网格布局 */
    .jobs-grid {
        gap: 1.2rem;
    }

    /* Logo放大：桌面40px → 大屏54px */
    .logo svg {
        height: 54px;
    }
}

/* ===== 横屏模式优化 ===== */
@media (orientation: landscape) and (max-height: 600px) {

    /* === 横屏模式下的空间优化 === */

    /* 减小头部高度 */
    header {
        padding: 0.8rem 2rem;
    }

    /* 减小主内容区域间距 */
    main {
        padding: 1rem 1.5rem;
    }

    /* 职位网格间距减小 */
    .jobs-grid {
        gap: 0.8rem;
    }
}

/* ===== 打印样式优化 ===== */
@media print {

    /* === 打印时的样式调整 === */

    /* 隐藏不必要的元素 */
    .header-actions,
    .load-more-container {
        display: none;
    }

    /* 调整颜色为打印友好 */
    body {
        background: var(--white);
        color: black;
    }

    /* 确保重要信息可见 */
    .detail-title {
        color: #333;
    }
}

/* ===== Toast提示容器样式（全局唯一定义，showToast 生成 .toast .toast-{type}） ===== */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    background: #333;
    color: var(--white);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success { background: var(--emerald); }
.toast-error { background: var(--red-bright); }
.toast-warning { background: var(--amber); }
.toast-info { background: var(--blue); }

@media (max-width: 480px) {
    #toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    .toast {
        width: 100%;
    }
}

/* ===== 精选公司滚动容器适配 ===== */
@media (max-width: 768px) {
    .featured-companies-scroll {
        overflow-x: auto;
        scrollbar-width: thin;
        scrollbar-color: #ccc transparent;
    }

    .featured-companies-scroll::-webkit-scrollbar {
        height: 6px;
    }

    .featured-companies-scroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .featured-companies-scroll::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 3px;
    }
}
