/* 就业管家知识树页面样式 */ .career-tree-page { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; position: relative; min-height: 100vh; overflow-x: hidden; /* 与整体设计系统保持一致的色彩变量 */ --primary-color: #3b82f6; --primary-light: #dbeafe; --primary-lighter: #eff6ff; --text-primary: #111827; --text-secondary: #6b7280; --card-bg: #ffffff; --border-color: #e5e7eb; --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); } /* 全局强制垂直布局规则 - 最高优先级 */ .career-tree-page .section-content { display: flex !important; flex-direction: column !important; align-items: stretch !important; justify-content: flex-start !important; flex-wrap: nowrap !important; } .career-tree-page .center-item { display: block !important; width: 100% !important; flex-shrink: 0 !important; float: none !important; position: relative !important; } .career-tree-page.tall-screen { scroll-behavior: auto; } .career-tree-page.tall-screen .top-content-wrapper { height: 1080px !important; overflow-y: auto; position: relative; padding-top: 80px; background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); background-size: cover; scrollbar-width: none; -ms-overflow-style: none; } .career-tree-page.tall-screen .top-content-wrapper::-webkit-scrollbar { display: none; } .career-tree-page.tall-screen .top-content { min-height: 100%; position: relative; } .top-content-wrapper { background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); background-size: cover; min-height: 100vh; position: relative; } .top-content { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 40px 20px; } .canvas-container { position: relative; width: 1400px; max-width: 100%; margin: 0 auto; } .tree-layout { display: flex; justify-content: center; align-items: flex-start; gap: 20px; position: relative; z-index: 10; margin-top: 20px; } /* 顶部菜单容器样式 */ .top-menu-container { width: 100%; margin-bottom: 30px; padding: 0 20px; } .menu-panel { background: var(--card-bg); padding: 12px; border-radius: 12px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); border: 1px solid var(--border-color); display: flex; justify-content: center; gap: 12px; max-width: 800px; margin: 0 auto; } /* 移除menu-header相关样式,不再需要标题 */ .menu-item { background: #f8fafc; padding: 10px 20px; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; font-size: 14px; font-weight: 500; text-align: center; border: 1px solid var(--border-color); white-space: nowrap; flex: 0 0 auto; } .menu-item:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } .menu-item.selected { background: var(--primary-color); color: white; border-color: var(--primary-color); transform: scale(1.02); box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3); position: relative; } .menu-item.selected::after { content: ''; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); width: 80%; height: 3px; background: white; border-radius: 2px; } /* 左栏样式 */ .left-column { width: 20%; min-width: 240px; } .left-panel { background: var(--card-bg); padding: 16px; border-radius: 16px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); border: 1px solid var(--border-color); position: absolute; left: 20px; z-index: 66; width: 240px; min-width: 240px; max-width: fit-content; } .left-item { background: var(--primary-lighter); padding: 8px 12px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); margin-bottom: 24px; } .left-item:last-child { margin-bottom: 0; } .panel-item { display: flex; justify-content: space-between; align-items: center; padding: 4px 16px; background: white; border-radius: 9999px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); font-size: 14px; white-space: nowrap; transition: all 0.2s ease; } .panel-item.clickable { cursor: pointer; } .panel-item.clickable:hover { background: #f8fafc; transform: translateY(-1px); box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); } .panel-header { text-align: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--primary-color); } .panel-header h3 { margin: 0; font-size: 16px; font-weight: bold; color: var(--primary-color); } .resource-info { display: flex; align-items: center; gap: 8px; } .resource-icon { color: var(--primary-color); flex-shrink: 0; } .resource-name { color: var(--text-primary); font-size: 14px; } .arrow-icon { color: var(--text-secondary); flex-shrink: 0; } .course-info { display: flex; align-items: center; gap: 8px; } .ai-badge { background: var(--primary-color); color: white; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: bold; } .course-name { color: var(--text-primary); } .view-detail-button { color: var(--primary-color); font-weight: bold; font-size: 12px; text-decoration: underline; background: none; border: none; cursor: pointer; margin-left: 16px; } .view-detail-button:hover { color: #1d4ed8; } /* 中栏样式 */ .center-column { width: 36%; display: flex; justify-content: center; } .center-panel { background: var(--card-bg); padding: 32px 24px; border-radius: 16px; width: 360px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); border: 1px solid var(--border-color); /* 确保center-panel自身布局稳定 */ display: flex; flex-direction: column; gap: 16px; } .center-section { background: white; padding: 16px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); border: 1px solid var(--border-color); /* margin-bottom已移除,使用parent的gap代替 */ } /* 项目将按照DOM顺序显示,在JSX中已经通过.sort()方法保证了正确的排序 */ .section-header { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-radius: 9999px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); cursor: pointer; border: 2px solid #efefef; color: #333; transition: all 0.2s ease; } .section-header:hover { border-color: var(--primary-color); color: var(--primary-color); } .section-header.checked-course { border-color: var(--primary-color); color: var(--primary-color); background: var(--primary-lighter); } .section-title-area { display: flex; align-items: center; gap: 8px; } .section-icon { display: flex; align-items: center; width: 24px; height: 24px; } .section-title { font-weight: 600; font-size: 16px; } .expand-icon { transition: transform 0.2s ease; cursor: pointer; } .expand-icon.expanded { transform: rotate(180deg); } .section-content { margin-top: 16px; display: flex !important; flex-direction: column !important; gap: 8px; /* 确保在所有屏幕尺寸下都保持垂直排列 */ align-items: stretch !important; width: 100%; /* 防止flex容器收缩或任何异常布局 */ flex-wrap: nowrap !important; justify-content: flex-start !important; } .center-item { background: var(--primary-lighter); padding: 12px 48px; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; position: relative; /* 移除可能引起布局问题的order属性,改用自然文档流排序 */ /* order: var(--item-order, 0); */ /* 确保item始终占满容器宽度 */ width: 100% !important; box-sizing: border-box; /* 确保flex item不会收缩 */ flex-shrink: 0 !important; /* 强制块级显示,防止内联或其他异常显示模式 */ display: block !important; /* 确保没有浮动 */ float: none !important; /* 防止绝对定位 */ position: relative !important; /* 确保垂直排列时的底部间距 */ margin-bottom: 0 !important; } .center-item:hover { background: var(--primary-light); } .center-item.checked-course-item { background: var(--primary-color); color: white; } .item-content { background: white; padding: 8px; border-radius: 9999px; font-size: 14px; font-weight: bold; text-align: center; line-height: 1; border: 1px solid var(--border-color); } .center-item.checked-course-item .item-content { background: rgba(255, 255, 255, 0.2); color: white; border-color: rgba(255, 255, 255, 0.3); } /* 右栏样式 */ .right-column { width: 20%; min-width: 240px; } .right-panel { background: var(--card-bg); padding: 16px; border-radius: 16px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); border: 1px solid var(--border-color); position: absolute; right: 20px; z-index: 66; width: 240px; } .right-item { background: var(--primary-lighter); border-radius: 8px; padding: 8px 12px; margin-bottom: 24px; } .right-item:last-child { margin-bottom: 0; } /* SVG 连接线样式 */ .connection-canvas { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 1; } .connection-line { stroke: rgba(59, 130, 246, 0.3); stroke-width: 55px; stroke-linecap: round; fill: none; } /* 所有屏幕尺寸确保布局稳定性 */ @media (min-width: 1201px) { .section-content { /* 强制垂直布局,防止任何意外的flex布局变化 */ display: flex !important; flex-direction: column !important; align-items: stretch !important; flex-wrap: nowrap !important; justify-content: flex-start !important; } .center-item { /* 确保item的布局稳定 */ display: block !important; width: 100% !important; margin-bottom: 0 !important; flex-shrink: 0 !important; flex-grow: 0 !important; flex-basis: auto !important; } } /* 超大屏幕额外保障 */ @media (min-width: 1601px) { .section-content { /* 在超大屏幕上再次强制垂直布局 */ flex-direction: column !important; align-items: stretch !important; flex-wrap: nowrap !important; } .center-item { /* 在超大屏幕上确保item的布局稳定 */ display: block !important; width: 100% !important; margin-bottom: 0 !important; } } /* 响应式样式 */ @media (max-width: 1600px) { .canvas-container { width: 1200px; } .left-panel { width: 220px; min-width: 220px; left: 20px; } .right-panel { width: 220px; min-width: 220px; right: 20px; } .top-menu-container { padding: 12px 20px; } .menu-panel { gap: 6px; } .menu-item { padding: 8px 16px; font-size: 13px; } .center-panel { width: 320px; padding: 24px 16px; } } @media (max-width: 1400px) { .canvas-container { width: 1000px; } .tree-layout { gap: 10px; } .center-panel { width: 300px; padding: 24px 16px; } .left-panel { width: 200px; min-width: 200px; left: 10px; } .right-panel { width: 200px; min-width: 200px; right: 10px; } .menu-item { font-size: 12px; padding: 6px 12px; } } @media (max-width: 1200px) { .top-menu-container { padding: 10px; } .menu-panel { overflow-x: auto; gap: 4px; padding: 6px; scrollbar-width: thin; } .menu-item { font-size: 11px; padding: 6px 10px; } .tree-layout { flex-direction: column; align-items: center; gap: 30px; } .left-column, .center-column, .right-column { width: 100%; max-width: 500px; } .left-panel, .right-panel { position: relative; width: 100%; min-width: auto; left: auto; right: auto; } .connection-canvas { display: none; } /* 确保小屏幕下也保持垂直布局 */ .section-content { display: flex !important; flex-direction: column !important; align-items: stretch !important; flex-wrap: nowrap !important; } .center-item { display: block !important; width: 100% !important; margin-bottom: 0 !important; } } @media (max-width: 768px) { .top-menu-container { padding: 8px; } .menu-panel { flex-wrap: wrap; gap: 4px; padding: 4px; } .menu-item { font-size: 10px; padding: 5px 8px; flex: 0 0 calc(33.333% - 4px); } .top-content { padding: 20px 10px; } .center-panel { width: 100%; padding: 24px 16px; } /* 确保移动端也保持垂直布局 */ .section-content { display: flex !important; flex-direction: column !important; align-items: stretch !important; flex-wrap: nowrap !important; } .center-item { display: block !important; width: 100% !important; margin-bottom: 0 !important; } }