/*
 * 招聘系统主样式文件
 * @version 1.0.0
 * @author Development Team
 * @date 2024-01-20
 */

/* ========== 全局样式 ========== */
:root {
    --primary-color: #2c5aa0;
    --secondary-color: #f8f9fa;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --white-color: #ffffff;
    --border-color: #dee2e6;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1280px;
}

/* ========== 页面加载器 ========== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-spinner {
    text-align: center;
}

/* ========== 导航栏 ========== */
.recruitment-navbar {
    background: var(--primary-color);
    box-shadow: var(--box-shadow);
    padding: 0.5rem 0; /* 减小内边距以降低导航栏高度 */
    min-height: 45px; /* 设置最小高度确保触摸目标不小于44px */
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--white-color) !important;
    text-decoration: none;
    flex-shrink: 0; /* 防止品牌名称被压缩 */
}

.navbar-logo {
    height: 32px; /* 减小logo高度以适应更紧凑的导航栏 */
    margin-right: 0.5rem;
}

.brand-text {
    color: var(--primary-color);
}

/* 确保品牌名称和导航菜单在同一水平线上 */
.navbar .container-fluid {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    padding: 0.5rem 1rem; /* 减小内边距以适应更紧凑的导航栏 */
}

.navbar .navbar-brand {
    margin-right: auto;
    flex-shrink: 0; /* 防止品牌名称被压缩 */
}

.navbar .navbar-collapse {
    flex-grow: 1;
}

.navbar-toggler {
    border: none;
    outline: none;
    padding: 0;
    position: relative;
    width: 30px;
    height: 30px;
    margin-left: auto; /* 确保在所有设备上都在最右侧 */
    flex-shrink: 0; /* 防止按钮被压缩 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 4px; /* 添加轻微圆角 */
    transition: background-color 0.3s ease; /* 添加背景过渡效果 */
    box-sizing: border-box; /* 确保边框计算在内 */
}

.navbar-toggler:hover {
    background-color: rgba(255, 255, 255, 0.2); /* 添加悬停效果 */
    border-radius: 4px;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background: none;
    position: relative;
    width: 1.25em; /* 减小图标大小以适应更紧凑的按钮 */
    height: 1.25em;
    display: inline-block;
    box-sizing: border-box;
}

/* 使用三个独立的线条来构建汉堡菜单 */
.navbar-toggler-icon::before,
.navbar-toggler-icon::after,
.navbar-toggler-icon {
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--white-color);
    transition: all 0.3s ease;
    left: 0;
    right: 0;
    box-sizing: border-box;
    transform-origin: center;
}

.navbar-toggler[aria-expanded="false"] .navbar-toggler-icon::before,
.navbar-toggler[aria-expanded="false"] .navbar-toggler-icon::after,
.navbar-toggler[aria-expanded="false"] .navbar-toggler-icon {
    background-color: var(--white-color);
}

.navbar-toggler-icon::before {
    top: 0.25em;
    content: '';
}

.navbar-toggler-icon {
    top: 50%;
    margin-top: -1px;
    content: '';
}

.navbar-toggler-icon::after {
    bottom: 0.25em;
    content: '';
}

/* 激活状态下的汉堡菜单图标（X形） */
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before {
    transform: rotate(45deg);
    top: 50%;
    margin-top: -1px;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    background-color: transparent;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after {
    transform: rotate(-45deg);
    top: 50%;
    margin-top: -1px;
}

/* 添加调试样式，确保选择器能匹配 */
.navbar-toggler[aria-expanded="false"] .navbar-toggler-icon::before,
.navbar-toggler[aria-expanded="false"] .navbar-toggler-icon::after,
.navbar-toggler[aria-expanded="false"] .navbar-toggler-icon {
    background-color: var(--white-color);
}

/* 激活状态下的按钮背景 */
.navbar-toggler[aria-expanded="true"] {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

/* 响应式设计 - 桌面端 */
@media (min-width: 992px) {
    /* 桌面端隐藏 navbar-toggler 按钮 */
    .navbar-toggler,
    .d-lg-none {
        display: none !important;
    }
    
    /* 桌面端导航菜单始终显示 */
    .navbar-collapse {
        display: flex !important;
        position: static !important;
        flex-basis: auto;
        flex-grow: 1;
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
    }
    
    .navbar-nav {
        margin-left: auto !important;
    }
    
    .navbar-nav.ml-auto {
        margin-left: auto !important;
        
    }
    
    .dropdown:hover .dropdown-menu {
        display: block;
    }
    
    /* 桌面端用户相关链接样式 */
    .navbar-nav .nav-item.user-guest .nav-link {
        background-color: var(--light-color);
        border: 1px solid var(--border-color);
    }
    
    .navbar-nav .nav-item.user-guest .nav-link:hover {
        background-color: var(--primary-color);
        color: var(--white-color) !important;
        border-color: var(--primary-color);
    }
    
    .navbar-toggler {
        margin-left: auto; /* 确保在桌面端也在最右侧 */
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
    
    .navbar-toggler:hover {
        background-color: rgba(255, 255, 255, 0.2);
        border-radius: 4px;
    }
    .container-fluid{
        max-width: 1280px;
    }
}

/* 响应式设计 - 移动端 */
@media (max-width: 991.98px) {
    /* 移动端显示 navbar-toggler 按钮 */
    .navbar-toggler,
    .d-lg-none {
        display: flex !important;
    }
    
    .navbar .container-fluid {
        padding: 0.5rem 1rem; /* 减小内边距以适应更紧凑的导航栏 */
    }
    
    .navbar-brand {
        margin-right: auto; /* 将品牌推到最左侧 */
        font-size: 1.25rem; /* 减小字体大小以适应更紧凑的导航栏 */
    }
    
    .navbar-toggler {
        margin-left: auto; /* 确保在移动端也在最右侧 */
        width: 36px; /* 增加宽度以确保触摸目标不小于44px */
        height: 36px; /* 增加高度以确保触摸目标不小于44px */
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }
    
    /* 当导航菜单展开时，防止页面滚动 */
    .navbar-collapse {
        position: fixed;
        top: 45px; /* 默认标准移动端导航栏高度，会被JavaScript动态覆盖 */
        right: 0;
        bottom: 0;
        left: auto;
        width: 280px; /* 侧边栏宽度 */
        background: linear-gradient(to bottom, var(--white-color), #f8f9fa);
        box-shadow: -2px 0 12px rgba(0, 0, 0, 0.2);
        padding: 1.25rem 0; /* 调整内边距 */
        z-index: 1000;
        border-top: none;
        border-left: 1px solid var(--border-color);
        /* 改善过渡动画 */
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, box-shadow 0.3s ease;
        /* 初始状态隐藏 */
        display: none !important;
        transform: translateX(100%);
        opacity: 0;
        overflow-y: auto;
        max-height: none;
    }
    
    .navbar-collapse.show {
        display: block !important;
        transform: translateX(0);
        opacity: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .navbar-nav {
        flex-direction: column;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100%;
        padding: 0 1.25rem; /* 添加左右内边距 */
    }
    
    .navbar-nav .nav-item {
        margin-bottom: 0.5rem; /* 调整菜单项间距 */
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05); /* 添加底部边框 */
    }
    
    .navbar-nav .nav-item:last-child {
        border-bottom: none; /* 最后一项不显示边框 */
    }
    
    .navbar-nav .nav-link {
        padding: 0.875rem 1.25rem; /* 调整内边距 */
        color: var(--text-primary) !important;
        border-radius: 8px; /* 增加圆角 */
        /* 改善移动端悬停效果 */
        transition: all 0.3s ease;
        position: relative;
        margin-bottom: 0.25rem;
        font-weight: 500;
        font-size: 1rem; /* 调整字体大小 */
        border-left: 3px solid transparent;
        width: 100%;
        text-align: left;
        display: block;
        /* 添加图标对齐 */
        display: flex;
        align-items: center;
        background-color: transparent; /* 移除背景色，保持透明 */
    }
    
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        color: var(--primary-color) !important; /* 保持文字颜色不变或略微加深 */
        background-color: rgba(0, 0, 0, 0.05); /* 添加极轻微的背景色变化 */
        transform: none;
        box-shadow: none; /* 移除阴影效果 */
        border-left-color: var(--primary-color); /* 保持左边框颜色 */
    }
    
    /* 移动端特殊样式 */
    @media (max-width: 991.98px) {
        .navbar-nav .nav-link:hover {
            color: var(--primary-color) !important; /* 移动端悬停时使用主色调 */
            background-color: rgba(0, 0, 0, 0.05); /* 移动端悬停时添加极轻微背景色 */
        }
    }
    
    /* 用户相关链接的特殊样式 */
    .navbar-nav .nav-item.user-guest .nav-link {
        background-color: transparent; /* 移除特殊背景色 */
        color: var(--text-primary) !important; /* 使用默认文字颜色 */
        border: none; /* 移除边框 */
        text-align: left; /* 左对齐 */
        font-weight: 500; /* 与其它导航项保持一致 */
        border-radius: 8px; /* 保持圆角 */
        margin-top: 1rem; /* 调整顶部间距 */
        padding: 0.875rem 1.25rem !important; /* 与其它导航项保持一致 */
        font-size: 1rem; /* 与其它导航项保持一致 */
        box-shadow: none; /* 移除阴影 */
    }
    
    .navbar-nav .nav-item.user-guest .nav-link:hover {
        background-color: rgba(0, 0, 0, 0.05); /* 悬停时添加极轻微背景色 */
        color: var(--primary-color) !important; /* 悬停时使用主色调 */
        border: none; /* 悬停时移除边框 */
        transform: none; /* 移除位移效果 */
    }
    
    /* 为移动端下拉菜单添加指示箭头 */
    .navbar-nav .dropdown-toggle {
        font-weight: 500;
    }
    
    /* 修复移动端下拉菜单展开时，用户名文字颜色变白的问题 */
    .navbar-nav .dropdown.show .dropdown-toggle {
        color: var(--primary-color) !important;
    }
    
    .navbar-nav .dropdown-toggle::after {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        transition: transform 0.3s ease;
    }
    
    .navbar-nav .dropdown.show .dropdown-toggle::after {
        transform: translateY(-50%) rotate(180deg);
    }
    
    .navbar-nav .dropdown-menu {
        position: static;
        box-shadow: none; /* 移除阴影以保持一致 */
        margin: 0;
        margin-top: 0.25rem;
        margin-left: 0; /* 移除左边距，使其占满宽度 */
        background: rgba(0, 0, 0, 0.02); /* 使用极淡的背景色区分层级 */
        border: none; /* 移除边框 */
        border-left: 2px solid rgba(0, 0, 0, 0.05); /* 添加微弱的左边框指示层级 */
        border-radius: 0; /* 移除圆角以与侧边栏对齐 */
        min-width: auto;
        display: none;
        z-index: 1001;
        /* 改善下拉菜单动画 */
        opacity: 0;
        transform: translateY(-5px);
        transition: opacity 0.3s ease, transform 0.3s ease;
        width: 100%; /* 占满全宽 */
    }
    
    /* 移动端下拉菜单显示时的定位 */
    .navbar-nav .dropdown.show .dropdown-menu {
        display: block;
        opacity: 1;
        transform: translateY(0);
        padding: 0.25rem 0;
    }
    
    .navbar-nav .dropdown-menu .dropdown-item {
        color: var(--text-primary) !important;
        padding: 0.875rem 1.25rem 0.875rem 2.5rem; /* 增加左侧内边距以体现缩进 */
        transition: all 0.3s ease;
        font-size: 0.95rem; /* 略小于主菜单项 */
        border-radius: 0; /* 移除圆角 */
        margin-bottom: 0;
        font-weight: 500;
        border-left: 3px solid transparent; /* 与主菜单项一致的边框样式 */
        display: block;
        width: 100%;
        background-color: transparent;
    }
    
    .navbar-nav .dropdown-menu .dropdown-item:hover,
    .navbar-nav .dropdown-menu .dropdown-item.active {
        background-color: rgba(0, 0, 0, 0.05); /* 与主菜单项一致的悬停背景 */
        color: var(--primary-color) !important;
        transform: none; /* 移除位移 */
        border-left-color: var(--primary-color); /* 悬停时显示主色左边框 */
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
    
    .navbar-toggler:hover {
        background-color: rgba(255, 255, 255, 0.2);
        border-radius: 4px;
    }
    
    /* 移动端下拉菜单 */
    .dropdown:hover .dropdown-menu {
        display: none;
    }
    
    /* 移动端菜单打开时的遮罩 */
    body.navbar-open {
        overflow: hidden;
    }
    .navbar-nav.ml-auto {
        display: block;
    }
}

/* 响应式设计 - 小屏幕设备 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .search-input-group .input-group {
        flex-direction: column;
    }
    
    .search-input {
        margin-bottom: 0.5rem;
    }
    
    .job-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .job-actions {
        width: 100%;
    }
    
    .job-actions .btn {
        flex: 1;
    }
    
    .stat-item {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .stats-section .stat-item h3 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .hero-banner h1 {
        font-size: 2rem;
    }
    
    .search-box .input-group {
        max-width: 100% !important;
    }
     .navbar-nav.ml-auto {
        display: block;
    }
    
    /* 优化小屏幕设备上的侧边栏 */
    .navbar-collapse {
        width: 260px; /* 减小宽度以适应小屏幕 */
    }
}

/* 针对超小屏幕设备 (320px-480px) 的优化 */
@media (max-width: 480px) {
    .recruitment-navbar {
        padding: 0.4rem 0; /* 进一步减小内边距 */
        min-height: 42px; /* 保持最小高度 */
    }
    
    .navbar .container-fluid {
        padding: 0.4rem 0.75rem; /* 调整内边距以适应更窄的屏幕 */
    }
    
    .navbar-brand {
        font-size: 1.15rem; /* 进一步减小字体大小 */
    }
    
    .navbar-logo {
        height: 28px; /* 进一步减小logo高度 */
    }
    
    .navbar-toggler {
        width: 34px; /* 调整按钮大小 */
        height: 34px;
    }
    
    /* 调整侧边栏位置 */
    .navbar-collapse {
        top: 42px; /* 默认超小屏幕导航栏高度，会被JavaScript动态覆盖 */
        width: 100%; /* 在超小屏幕上使用全宽 */
        padding: 0.75rem 0; /* 调整内边距 */
    }
    
    .navbar-nav {
        padding: 0 1rem; /* 调整内边距 */
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem; /* 调整内边距 */
        font-size: 0.95rem; /* 调整字体大小 */
        background-color: transparent; /* 保持背景透明 */
    }
    
    .navbar-nav .nav-item.user-guest .nav-link {
        padding: 0.75rem 1rem !important; /* 调整内边距 */
        font-size: 0.95rem; /* 调整字体大小 */
        margin-top: 0.75rem; /* 调整顶部间距 */
        background-color: transparent; /* 保持背景透明 */
        color: var(--text-primary) !important; /* 使用默认文字颜色 */
        border: none; /* 移除边框 */
        text-align: left; /* 左对齐 */
        font-weight: 500; /* 与其它导航项保持一致 */
        border-radius: 8px; /* 保持圆角 */
        box-shadow: none; /* 移除阴影 */
    }
}

/* 主内容区域 ========== */
.main-content {
    min-height: calc(100vh - 160px);
    padding-bottom: 2rem;
}

/* ========== 面包屑导航 ========== */
.breadcrumb-section {
    background: var(--white-color);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

/* ========== 卡片样式 ========== */
.job-detail-card,
.sidebar-card {
    background: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

/* ========== 首页样式 ========== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3c72 100%);
    color: var(--white-color);
    padding: 4rem 0;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-search {
    max-width: 800px;
}





/* ========== 页脚 ========== */
.footer {
    background: var(--dark-color);
    color: var(--white-color);
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-widget {
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--white-color);
}

.widget-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-links li {
    margin-bottom: 0.5rem;
}

.widget-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
}

.widget-links a:hover {
    color: var(--white-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    margin-top: 2rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1rem;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

/* ========== 返回顶部按钮 ========== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white-color);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--dark-color);
    transform: translateY(-2px);
}

/* ========== 按钮样式 ========== */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: #1e3c72;
    border-color: #1e3c72;
    transform: translateY(-1px);
}

/* ========== 企业卡片 ========== */
.company-card {
    transition: transform 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.company-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* ========== 使用指南样式 ========== */
.guide-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.section-header {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.guide-step {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    background: white;
    color: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.step-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.step-description {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .search-input-group .input-group {
        flex-direction: column;
    }
    
    .search-input {
        margin-bottom: 0.5rem;
    }
    
    .job-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .job-actions {
        width: 100%;
    }
    
    .job-actions .btn {
        flex: 1;
    }
    
    .stat-item {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .stats-section .stat-item h3 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .hero-banner h1 {
        font-size: 2rem;
    }
    
    .search-box .input-group {
        max-width: 100% !important;
    }
}

/* ========== 搜索建议样式 ========== */
.search-suggestions {
    position: absolute;
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    z-index: 1000;
    margin-top: 2px;
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid #f8f9fa;
    color: var(--text-primary);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #f0f4f8;
    color: var(--primary-color);
}