.job-portal { min-height: 100vh; background-color: #f5f5f5; // 主要内容区域 .main-content { max-width: 1200px; margin: 0 auto; padding: 0 20px; margin-top: 20px; .ant-row { margin: 0 !important; } .ant-col { padding: 0 8px !important; // 减少列间距 } // 左侧行业面板 .industry-panel { height: 600px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); .industry-list { padding: 16px 0; height: calc(100% - 60px); .industry-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; cursor: pointer; transition: all 0.3s; border-left: 3px solid transparent; &:hover, &.active { background-color: #f0f8ff; border-left-color: #1890ff; color: #1890ff; } .anticon { color: #999; font-size: 12px; } &:hover .anticon, &.active .anticon { color: #1890ff; } } } .pagination { display: flex; justify-content: center; align-items: center; padding: 16px; border-top: 1px solid #f0f0f0; height: 60px; .ant-btn { border: none; box-shadow: none; } span { margin: 0 16px; color: #666; } } } // 职业展示面板 .profession-panel { height: 600px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); overflow-y: auto; // 允许纵向滚动 overflow-x: hidden; // 防止横向滚动 // 自定义滚动条样式 &::-webkit-scrollbar { width: 6px; } &::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; } &::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; &:hover { background: #a8a8a8; } } .profession-title { margin-bottom: 20px; color: #1890ff; text-align: center; } .profession-content { height: auto; // 让内容自然撑开 overflow-y: visible; // 不再单独滚动 overflow-x: hidden; // 水平不滚动 padding-right: 0; // 滚动条由父级处理 width: 100%; // 确保宽度 box-sizing: border-box; .profession-category { margin-bottom: 16px; // 减少间距 .category-title { margin-bottom: 8px; // 减少标题间距 color: #333; font-weight: 600; font-size: 14px; // 稍微减小字体 } .profession-tags { display: flex; flex-wrap: wrap; // 允许换行,实现纵向布局 gap: 6px; // 标签间距 width: 100%; // 确保容器占满宽度 box-sizing: border-box; overflow-x: hidden; // 不再水平滚动 overflow-y: visible; // 不再单独滚动 padding-bottom: 0; // 滚动条由父级处理 // 移除自定义滚动条样式,由父级处理 &::-webkit-scrollbar { display: none; // 隐藏子元素的滚动条 } .profession-tag { background: #f6f8fa; border: 1px solid #e1e4e8; color: #24292e; border-radius: 4px; padding: 3px 6px; cursor: pointer; transition: all 0.3s; font-size: 11px; white-space: nowrap; // 标签本身不换行 flex: 0 0 auto; // 不允许伸缩 max-width: calc(33.333% - 4px); // 限制为三分之一宽度,留出间距 min-width: 0; // 允许收缩到0 overflow: hidden; // 超出部分隐藏 text-overflow: ellipsis; // 超出时显示省略号 box-sizing: border-box; word-break: break-all; // 允许在任意字符间换行 position: relative; z-index: 1; &:hover { max-width: none; // 悬停时显示完整内容 white-space: normal; // 允许换行 overflow: visible; text-overflow: clip; word-break: break-word; background: #1890ff; color: white; border-color: #1890ff; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); z-index: 10; } } } } } } // 右侧内容区域 .right-content-wrapper { position: relative; .content-row { position: relative; } .ad-col { transition: all 0.3s ease; } // 当有浮动层时,广告区域右移 &.has-profession { .ad-col { position: relative; // 添加左侧padding避免内容重叠 padding-left: calc(50% + 8px); } } } // 职业展示区域 - 浮动层 .profession-panel-float { position: absolute; left: 0; top: 0; width: calc(50% - 8px); z-index: 10; animation: slideIn 0.3s ease-out; pointer-events: auto; .close-btn { position: absolute; top: -10px; right: -10px; z-index: 11; background: #fff; border-radius: 50%; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; &:hover { background: #ff4d4f; color: #fff; transform: rotate(90deg); transition: all 0.3s; } } .profession-panel { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); } } @keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } } // 广告区域 .advertisement-area { height: 600px; overflow-y: auto; transition: all 0.3s ease; .ad-card { margin-bottom: 16px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: all 0.3s; &:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); } // 横幅广告 &.banner { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; height: 120px; .banner-ad { display: flex; justify-content: space-between; align-items: center; height: 100%; .banner-content { flex: 1; .banner-title { color: white; margin-bottom: 8px; font-size: 18px; } .banner-subtitle { color: rgba(255, 255, 255, 0.8); font-size: 12px; } } .banner-logo { background: rgba(255, 255, 255, 0.2); padding: 8px 12px; border-radius: 4px; font-size: 12px; font-weight: bold; } } } // 卡片广告 &.card { height: 100px; position: relative; &.purple { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); } &.blue { background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%); } &.orange { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); } .card-ad { height: 100%; display: flex; flex-direction: column; justify-content: center; position: relative; .card-title { margin-bottom: 4px; font-size: 16px; color: #333; } .card-subtitle { color: #666; font-size: 12px; } .card-description { color: #999; font-size: 10px; margin-top: 4px; } .ad-label { position: absolute; bottom: 8px; right: 8px; background: rgba(0, 0, 0, 0.1); color: #666; padding: 2px 6px; border-radius: 4px; font-size: 10px; } } } } } } // 职位列表区域 .jobs-section { background-color: #f5f5f5; padding: 40px 20px; .jobs-container { max-width: 1200px; margin: 0 auto; .jobs-title { text-align: center; margin-bottom: 30px; color: #1890ff; font-weight: 600; } .job-card { height: 100%; border-radius: 8px; transition: all 0.3s; background: white; cursor: pointer; &:hover { transform: translateY(-4px); box-shadow: 0 6px 16px rgba(24, 144, 255, 0.2); } .job-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; .job-title { margin: 0; font-size: 16px; color: #333; font-weight: 600; flex: 1; } .job-salary { color: #ff4d4f; font-size: 16px; font-weight: 600; white-space: nowrap; margin-left: 12px; flex-shrink: 0; } } .job-company { display: block; color: #666; font-size: 14px; margin-bottom: 12px; } .job-info { display: flex; gap: 12px; margin-bottom: 12px; .job-location, .job-experience, .job-education { color: #999; font-size: 12px; white-space: nowrap; } } .job-tags { display: flex; flex-wrap: wrap; gap: 6px; .job-tag { background: #f6f8fa; border: 1px solid #e1e4e8; color: #666; border-radius: 4px; padding: 2px 8px; font-size: 12px; margin: 0; } } } } } } // 响应式设计 @media (max-width: 1200px) { .job-portal { .main-content { .ant-col { margin-bottom: 16px; } .profession-panel { .profession-content { .profession-tags { .profession-tag { max-width: calc(50% - 4px); // 中等屏幕下占一半宽度 font-size: 10px; // 进一步减小字体 padding: 2px 4px; } } } } } } } @media (max-width: 768px) { .job-portal { .main-content { .ant-col { margin-bottom: 16px; } .industry-panel, .profession-panel, .advertisement-area { height: auto; min-height: 300px; } .profession-panel { .profession-content { .profession-category { margin-bottom: 16px; } .profession-tags { gap: 4px; .profession-tag { font-size: 10px; // 小屏幕下减小字体 padding: 3px 5px; } } } } } .jobs-section { padding: 20px 10px; .jobs-container { .jobs-title { font-size: 20px; margin-bottom: 20px; } } } } }