/* LC-MS风险管理系统 - 样式表 */

body {
    font-family: 'Inter', sans-serif;
    background-color: #F0F4F8;
}

/* 标签页样式 */
.tab-button {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-bottom: 4px solid transparent;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #1565C0;
}

.tab-button.active {
    border-bottom-color: #0d47a1;
    color: #0d47a1;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 流程图样式 */
.flow-step {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    border-radius: 0.5rem;
    color: #ffffff;
    font-weight: 600;
    min-height: 80px;
}

.flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #0d47a1;
}

.pyramid-level {
    padding: 0.75rem 1.5rem;
    margin-bottom: 0.25rem;
    color: white;
    font-weight: bold;
    text-align: center;
    clip-path: polygon(10% 0%, 90% 0%, 100% 100%, 0% 100%);
    width: 100%;
}

/* 滑块样式 */
input[type="range"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background: #d1d5db !important;
    height: 8px !important;
    border-radius: 4px !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
}

input[type="range"]::-webkit-slider-track {
    background: #d1d5db !important;
    height: 8px !important;
    border-radius: 4px !important;
    border: none !important;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    background: #3b82f6 !important;
    height: 20px !important;
    width: 20px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    margin-top: -6px !important;
}

input[type="range"]::-moz-range-track {
    background: #d1d5db !important;
    height: 8px !important;
    border-radius: 4px !important;
    border: none !important;
}

input[type="range"]::-moz-range-thumb {
    background: #3b82f6 !important;
    height: 20px !important;
    width: 20px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    -moz-appearance: none !important;
}

/* 🌳 决策树可视化样式 - 经典树形图布局 */

/* 树布局容器 */
.tree-layout-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* 节点样式 - 优化高级配色和紧凑布局 */
.tree-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    cursor: pointer;
    background: white;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    min-width: 72px;
    min-height: 72px;
    margin: 6px;
    position: relative;
}

.tree-node:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18), 0 3px 6px rgba(0, 0, 0, 0.12);
    z-index: 10;
}

/* 分裂节点样式 - 深邃蓝紫渐变 */
.split-node {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2.5px solid #5a67d8;
    color: white;
}

.split-node:hover {
    border-color: #4c51bf;
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* 叶子节点样式 - 优雅金绿渐变 */
.leaf-node {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border: 2.5px solid #d97706;
    color: white;
}

.leaf-node:hover {
    border-color: #b45309;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* 节点图标 */
.node-icon {
    font-size: 18px;
    line-height: 1;
    margin-bottom: 1px;
}

/* 节点内容 */
.node-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    width: 100%;
}

.node-title {
    font-size: 11px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    max-width: 65px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.node-condition {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
}

.node-value {
    font-size: 12px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.node-stats {
    display: flex;
    gap: 3px;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 1px;
}

.node-stats span {
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 3px;
    border-radius: 2px;
}

/* 节点悬停提示 */
.node-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
    padding: 12px 16px;
    background: rgba(26, 32, 44, 0.95);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.tree-node:hover .node-tooltip {
    display: block;
}

.node-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(26, 32, 44, 0.95);
}

/* 子节点容器 - 紧凑水平布局 */
.tree-layout-children {
    display: flex;
    justify-content: center;
    gap: 30px;
    position: relative;
    margin-top: 8px;
}

.tree-layout-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* 分支标签 - 高级配色紧凑版 */
.branch-label-yes,
.branch-label-no {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.branch-label-yes {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: 2px solid #047857;
}

.branch-label-no {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: 2px solid #991b1b;
}

/* 垂直连接线 - 紧凑版 */
.branch-line-vertical {
    width: 2px;
    height: 15px;
    background: linear-gradient(180deg, #94a3b8, #cbd5e0);
    margin-bottom: 4px;
}

/* 为父节点添加连接线 */
.tree-layout-node > .tree-node::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 10px;
    background: linear-gradient(180deg, #A0AEC0, #CBD5E0);
}

/* 叶子节点不需要下方连接线 */
.tree-node.leaf-node::after {
    display: none;
}

/* 水平连接线（连接兄弟节点） */
.tree-layout-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 100px);
    height: 2px;
    background: linear-gradient(90deg, #CBD5E0, #A0AEC0, #CBD5E0);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .tree-node {
        min-width: 60px;
        min-height: 60px;
        padding: 6px 8px;
        font-size: 8px;
        margin: 5px;
    }
    
    .node-icon {
        font-size: 16px;
    }
    
    .tree-layout-children {
        gap: 10px;
    }
    
    .branch-line-vertical {
        height: 15px;
    }
}

/* 树结构容器滚动样式 */
#treeStructureView::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#treeStructureView::-webkit-scrollbar-track {
    background: #F7FAFC;
    border-radius: 4px;
}

#treeStructureView::-webkit-scrollbar-thumb {
    background: #CBD5E0;
    border-radius: 4px;
}

#treeStructureView::-webkit-scrollbar-thumb:hover {
    background: #A0AEC0;
}

/* 风险评估结果粘性定位 */
.sticky-result-container {
    position: sticky;
    top: 20px;
    align-self: flex-start;
    z-index: 10;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* 移动端取消粘性定位 */
@media (max-width: 1279px) {
    .sticky-result-container {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

