* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #121212;
    color: #e0e0e0;
}

header {
    background-color: #1a1a2e;
    color: #e0e0e0;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* 返回首页按钮 */
.back-to-home {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #2a2a40;
    color: #d0d0d0;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.back-to-home:hover {
    background-color: #3a3a50;
    color: #ffffff;
}

/* 页面标签样式 */
.page-tabs {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    gap: 1rem;
}

.tab {
    color: #b0b0b0;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.tab:hover {
    background-color: #2a2a40;
    color: #ffffff;
}

.tab.active {
    background-color: #4a6bdf;
    color: white;
}

/* 常规页面容器布局（index页面使用） */
.container:not(.compare-container) {
    max-width: 1800px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 3fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
        "metrics-selector metrics-selector"
        "case-selector chart-container";
    gap: 2rem;
}

/* 常规页面图表容器（index页面使用） */
.container:not(.compare-container) .chart-container {
    grid-area: chart-container;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    background-color: #1e1e30;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden; /* 防止溢出 */
    height: auto;
}

/* 常规页面指标选择器（index页面使用） */
.container:not(.compare-container) .metrics-selector {
    grid-area: metrics-selector;
    width: 100%;
    min-width: auto;
    max-width: none;
    padding: 1.5rem;
    max-width: 1800px;
    margin: 0 auto;
}

/* 常规页面图表（index页面使用） */
.container:not(.compare-container) .chart {
    width: 100%;
    height: 700px;
    background-color: #1e1e30;
}

/* 添加宽度样式，增加chart-container的宽度 */
.container:not(.compare-container) .chart-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

/* 比较页面容器布局 */
.container.compare-container {
    display: grid;
    grid-template-areas: 
        "metrics-selector" 
        "chart-container";
    grid-template-columns: 1fr;  /* 全宽布局 */
    grid-template-rows: auto 1fr; /* 自动高度选择器，1fr图表容器 */
    max-width: 1600px; /* 设置最大宽度 */
    width: 100%;
    row-gap: 30px; /* 增加行间距 */
    margin: 0 auto;
    padding: 20px; /* 添加内边距 */
    height: auto; /* 允许容器随内容增长 */
    min-height: calc(100vh - 80px); /* 至少占满视口高度减去头部 */
    overflow: visible; /* 允许内容溢出 */
}

/* 合并相同的选择器面板基础样式 */

.metrics-selector,
.chart-container,
.case-selector {
    background-color: #1e1e30;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* 合并完全相同的按钮组样式 */
.process-buttons,
.metric-buttons,
.time-range-buttons,
.chart-type-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: flex-start;
}

/* 合并完全相同的按钮基础样式 */
.process-btn,
.metric-btn,
.time-range-btn,
.chart-type-btn {
    padding: 0.75rem 1.5rem;
    background-color: #2a2a40;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    color: #b0b0b0;
}

/* 合并完全相同的按钮悬停样式 */
.process-btn:hover,
.metric-btn:hover,
.time-range-btn:hover,
.chart-type-btn:hover {
    background-color: #3a3a50;
    color: #ffffff;
}

/* 合并完全相同的按钮激活样式 */
.process-btn.active,
.metric-btn.active,
.time-range-btn.active,
.chart-type-btn.active {
    background-color: #4a6bdf;
    color: white;
}

.metrics-selector {
    grid-area: metrics-selector;
}

.chart-container {
    grid-area: chart-container;
    display: block; /* 改为块级显示，不使用flex */
    width: 100%;
    max-width: none; /* 移除最大宽度限制 */
    box-sizing: border-box;
    padding: 20px; /* 添加内边距 */
    background: #1a1a2e; /* 添加背景色 */
    border-radius: 10px; /* 添加圆角 */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* 添加阴影 */
    overflow: visible; /* 允许内容溢出容器 */
    height: auto; /* 自动高度 */
    min-height: auto; /* 移除最小高度限制 */
}

.chart {
    width: 100%;
    height: 700px;
    background-color: #1e1e30;
}

/* 比较图表特定样式 */
#comparison-chart-container {
    padding: 0; /* 改回0内边距 */
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

#comparison-chart {
    min-height: 700px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.case-selector {
    grid-area: case-selector;
    display: flex;
    flex-direction: column;
}

.search-box {
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #2a2a40;
    color: #e0e0e0;
}

.search-box input::placeholder {
    color: #888;
}

.case-list {
    flex: 1;
    overflow-y: auto;
    max-height: 500px;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 0.5rem;
    background-color: #252540;
}

.case-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #333;
}

.case-item:last-child {
    border-bottom: none;
}

.case-item label {
    margin-left: 0.5rem;
    cursor: pointer;
    flex: 1;
    color: #d0d0d0;
}

.case-item input[type="checkbox"] {
    accent-color: #4a6bdf;
}

.case-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.case-actions button {
    flex: 1;
    padding: 0.75rem;
    background-color: #2a2a40;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    color: #d0d0d0;
}

.case-actions button:hover {
    background-color: #3a3a50;
    color: #ffffff;
}

h2 {
    margin-bottom: 1rem;
    color: #4a6bdf;
    font-size: 1.5rem;
}

/* 合并标题对齐样式 */
.process-selector h2,
.metrics-selector h2,
.time-range-selector h2,
.tag-selector h2,
.metric-selector h2,
.chart-type-selector h2,
.options-selector h2 {
    text-align: left;
    margin-left: 0;
}

.process-selector {
    grid-area: process-selector;
    margin-bottom: 2rem;
}

.metrics-selector {
    grid-area: metrics-selector;
}

.metric-buttons {
    margin-bottom: 2rem;
}

/* 比较页面样式 */
.tag-selector,
.metric-selector,
.chart-type-selector,
.options-selector {
    margin-bottom: 2rem;
}

.compare-metric-buttons {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid #333;
    border-radius: 4px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #ddd;
}

.form-group select, 
.form-group input {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    background-color: #2a2a40;
    color: white;
    border: 1px solid #444;
}

.options-container {
    margin-top: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.option-item input[type="checkbox"] {
    accent-color: #4a6bdf;
}

.action-buttons {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

#compare-btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
    background-color: #4a6bdf;
    color: white;
    width: 50%;
}

/* 添加按钮悬停样式 */
#compare-btn:hover {
    background-color: #3050c0;
}

/* 文件上传区域样式 */
.upload-cases-section {
    background-color: #1e1e30;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    margin-right: 0.5rem;
}

.upload-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.upload-group {
    margin-bottom: 0.5rem;
}

.custom-file-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.5rem;
}

.upload-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.upload-btn {
    background-color: #2a2a40;
    color: #e0e0e0;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 120px;
    flex: 0 0 auto;
}

.upload-btn:hover {
    background-color: #3a3a50;
}

.file-name {
    color: #b0b0b0;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    margin-top: 0;
    max-width: 200px;
}

.path-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #3a3a50;
    border-radius: 4px;
    background-color: #242435;
    color: #e0e0e0;
    font-size: 0.9rem;
    margin-top: 5px;
    transition: all 0.3s;
}

.path-input:focus {
    border-color: #4a6bdf;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 107, 223, 0.3);
}

.path-input::placeholder {
    color: #696979;
}

.progress-container {
    flex: 0 0 120px;
    height: 12px;
    margin: 0;
    background-color: #2a2a40;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    background-color: #4a6bdf;
    height: 100%;
    width: 0;
    transition: width 0.3s ease;
}

#upload-progress-text-1,
#upload-progress-text-2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 0.8rem;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.7);
    white-space: nowrap;
    font-weight: bold;
}

/* 比较表格样式 */
.comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    margin-bottom: 30px;
    color: #ddd;
    table-layout: auto; /* 自动布局以适应内容 */
}

/* 调整表格容器 */
.chart-type-table #comparison-chart {
    min-height: auto !important;
    overflow-x: auto;
    max-width: 100%;
}

/* 设置列宽自动计算 */
.comparison-table col {
    width: auto;
}

/* 首列（案例名称）样式 */
.comparison-table th:first-child,
.comparison-table td:first-child {
    min-width: 250px;
    text-align: left;
}

/* 其他列样式 */
.comparison-table th:not(:first-child),
.comparison-table td:not(:first-child) {
    min-width: 150px;
    text-align: right;
}

/* 表头通用样式 */
.comparison-table th {
    background: #272740;
    color: #e0e0e0;
    padding: 15px 45px 15px 20px; /* 上右下左，右侧为箭头预留空间 */
    position: relative;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: visible;
    transition: background-color 0.2s ease;
}

/* 表头内容区域 - 直接使用内联内容，不需要额外的内容div */
.comparison-table th {
    padding-right: 45px; /* 为箭头预留空间 */
    text-align: left;
    padding-left: 20px;
    transition: background-color 0.2s ease;
}

/* 表头悬停效果 */
.comparison-table th.sortable:hover {
    background: #32324d;
}

/* 添加箭头容器 */
.comparison-table th.sortable::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px; /* 箭头容器宽度 */
    background-color: rgba(0, 0, 0, 0.1);
    z-index: 1;
    box-sizing: border-box;
}

/* 上下箭头通用样式 */
.comparison-table th.sortable .sort-up-arrow,
.comparison-table th.sortable .sort-down-arrow {
    position: absolute;
    right: 15px; /* 距离右侧的距离 */
    width: 0; 
    height: 0; 
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    opacity: 0.6;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 2;
}

/* 上箭头位置 */
.comparison-table th.sortable .sort-up-arrow {
    top: calc(50% - 7px);
    border-bottom: 6px solid #a0a0d0;
}

/* 下箭头位置 */
.comparison-table th.sortable .sort-down-arrow {
    top: calc(50% + 7px);
    border-top: 6px solid #a0a0d0;
}

/* 悬停效果 */
.comparison-table th.sortable:hover .sort-up-arrow,
.comparison-table th.sortable:hover .sort-down-arrow {
    opacity: 0.9;
}

/* 升序状态 */
.comparison-table th.sort-asc .sort-up-arrow {
    border-bottom: 6px solid #4a6bdf;
    opacity: 1;
}

.comparison-table th.sort-asc .sort-down-arrow {
    opacity: 0.1;
}

/* 降序状态 */
.comparison-table th.sort-desc .sort-down-arrow {
    border-top: 6px solid #4a6bdf;
    opacity: 1;
}

.comparison-table th.sort-desc .sort-up-arrow {
    opacity: 0.1;
}

.comparison-table tr:nth-child(even) {
    background-color: #2a2a2a;
}

.comparison-table tr:nth-child(odd) {
    background-color: #222;
}

.time-range-selector {
    margin-top: 0;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #252540;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 确保标题栏全宽 */
.compare-container header {
    grid-column: 1 / -1;
}

/* 响应式布局 */
@media (max-width: 1200px) {
    .container.compare-container {
        grid-template-areas: 
            "metrics-selector"
            "chart-container";
        grid-template-columns: 1fr;
    }
    
    .container.compare-container .metrics-selector {
        width: 100%;
        max-width: none;
        min-width: 0;
    }
    
    .container.compare-container .chart-container {
        width: 100%;
        overflow: auto;
    }
}

@media (max-width: 1024px) {
    .container:not(.compare-container) {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "metrics-selector"
            "chart-container"
            "case-selector";
    }
    
    .page-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .back-to-home {
        position: static;
        display: block;
        margin: 10px auto;
        width: fit-content;
    }
}

/* 比较页面左侧选择器样式 */
.container.compare-container .metrics-selector {
    grid-area: metrics-selector;
    padding: 20px;
    background: #1a1a2e;
    border-radius: 10px;
    overflow: auto;
    height: fit-content; /* 适应内容高度 */
    width: 100%; /* 全宽 */
    max-width: 1600px; /* 最大宽度与容器一致 */
    min-width: auto; /* 自动最小宽度 */
    box-sizing: border-box;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* 添加阴影 */
    margin: 0 auto; /* 居中 */
    position: relative; /* 取消sticky定位 */
}

/* 比较页面图表容器样式 */
.container.compare-container .chart-container {
    grid-area: chart-container;
    display: flex; /* 改为flex以便垂直居中 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    width: 100%;
    max-width: 1600px; /* 设置最大宽度 */
    margin: 0 auto; /* 居中 */
    box-sizing: border-box;
    padding: 20px; /* 添加内边距 */
    background: #1a1a2e; /* 添加背景色 */
    border-radius: 10px; /* 添加圆角 */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* 添加阴影 */
    overflow: visible; /* 允许内容溢出容器 */
    height: auto; /* 自动高度 */
    min-height: 700px; /* 设置最小高度 */
}

/* 比较图表容器基础样式 */
#comparison-chart {
    width: 100% !important; /* 使用100%宽度 */
    overflow: visible; /* 确保内容不被裁剪 */
    box-sizing: border-box;
}

/* 柱状图特定样式 - 当父元素有特定类时应用 */
.chart-type-bar #comparison-chart {
    height: auto !important; /* 自动高度以适应内容 */
    display: block; /* 使用块级布局 */
}

/* 柱状图单个图表样式 */
.chart-type-bar #comparison-chart > div {
    display: flex; /* 子容器使用flex布局 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
}

/* 雷达图特定样式 */
.chart-type-radar #comparison-chart {
    height: auto !important; /* 自动高度 */
    display: block; /* 块级显示 */
    min-height: 0; /* 移除最小高度限制 */
}

/* 表格单元格通用样式 */
.comparison-table td {
    padding: 10px;
    border: 1px solid #444;
    white-space: nowrap;
    overflow: visible;
}

/* 表格边框 */
.comparison-table th,
.comparison-table td {
    border: 1px solid #444;
}

/* 针对compare页面的输入框和下拉框宽度调整 */
.compare-container .form-group select,
.compare-container .form-group input[type="text"],
.compare-container .select-container {
    width: 25%; /* 缩短为原来的1/4 */
    min-width: 120px; /* 设置最小宽度，避免过小 */
}

/* 工具选择下拉框宽度调整 */
#tool-select-1, 
#tool-select-1-path,
#tool-select-2,
#tool-select-2-path {
    width: 100%; /* 让下拉框填满其父容器 */
}

/* 对某些特定表单元素保持原样式 */
.compare-container .metric-buttons,
.compare-container .chart-type-buttons,
.compare-container .process-buttons,
.compare-container .custom-file-input,
.compare-container #compare-btn {
    width: 100%; /* 这些元素保持原宽度 */
}

/* 调整文件名显示区域宽度 */
.compare-container .file-name {
    width: auto;
}

/* ==================== Runtime Compare 页面样式 ==================== */

/* Runtime Compare 案例选择部分 */
.case-selector-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.case-selector-section h2 {
    color: #e0e0e0;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

/* Runtime Compare 表格头部控制区域 */
.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 全部展开按钮样式 */
.expand-all-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #4a4a6a;
    color: #e0e0e0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.expand-all-btn:hover {
    background: #5a5a7a;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.expand-all-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.expand-all-icon {
    font-size: 0.8rem;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.expand-all-btn:hover .expand-all-icon {
    transform: scale(1.1);
}

/* Runtime Compare 结果容器显示控制 */
.runtime-result-container {
    display: none; /* 初始隐藏 */
}

.runtime-result-container.show {
    display: flex; /* 显示时使用flex，与compare页面chart-container一致 */
}

.case-info {
    padding: 8px 12px;
    background-color: #252540;
    border-radius: 4px;
    text-align: center;
}

.case-info span {
    color: #4a6bdf;
    font-weight: bold;
}

/* 占位符消息 */
.placeholder-message {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: #888;
    font-size: 1.1rem;
    text-align: center;
    width: 100%;
}

.placeholder-message p {
    margin: 0;
}

.placeholder-message.error {
    color: #ff6b6b;
}

/* Runtime 表格包装器 */
.runtime-table-wrapper {
    width: 100%;
}

/* Runtime 表格容器（滚动区域） */
.runtime-table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
}

/* Runtime 表格头部 */
.runtime-table-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.runtime-table-header h2 {
    color: #e0e0e0;
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    text-align: center;
}

.tag-labels {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.tag-label {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
}

.tag-label.base {
    background-color: #2a4a7c;
    color: #a0c4ff;
}

.tag-label.compare {
    background-color: #3a5a3a;
    color: #a0ffa0;
}

/* Runtime 表格 */
.runtime-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    background-color: #1e1e30;
    border: 1px solid #444;
    border-radius: 4px;
    overflow: hidden;
}

.runtime-table thead {
    background-color: #252540;
    position: sticky;
    top: 0;
    z-index: 10;
}

.runtime-table thead .header-row th {
    padding: 14px 10px;
    text-align: center;
    color: #e0e0e0;
    font-weight: bold;
    border: 1px solid #444;
    border-top: none;
    background-color: #252540;
    font-size: 1rem;
}

.runtime-table thead .sub-header th {
    padding: 10px 8px;
    text-align: center;
    color: #b0b0b0;
    font-size: 0.85rem;
    border: 1px solid #444;
    background-color: #2a2a40;
    font-weight: 600;
}

/* 表格列宽度和背景色 */
.runtime-table .stage-col {
    width: 28%;
    text-align: left !important;
    background-color: #252540;
}

.runtime-table .base-col {
    background-color: #1e2a44;
}

.runtime-table .compare-col {
    background-color: #1e3a2e;
}

.runtime-table .diff-col {
    background-color: #3a2a2a;
    width: 180px;
    text-align: center !important;
}

/* 子表头列宽 */
.runtime-table .time-header {
    width: 10%;
}

.runtime-table .count-header {
    width: 8%;
}

.runtime-table .percent-header {
    width: 10%;
}

/* 表格主体 */
.runtime-table tbody tr {
    border-bottom: 1px solid #333;
    transition: background-color 0.2s;
}

.runtime-table tbody tr:hover {
    background-color: #252540;
}

/* 表格单元格 */
.runtime-table tbody td {
    padding: 12px 10px;
    border: 1px solid #444;
    text-align: center;
    vertical-align: middle;
    background-color: #1e1e30;
}

.runtime-table .stage-name {
    text-align: left !important;
    font-weight: 500;
    padding: 0 !important;
    background-color: transparent;
}

.stage-name-content {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 12px 10px;
}

.stage-text {
    flex: 1;
}

/* 层级样式 */
.runtime-table .level-0 .stage-name {
    font-weight: bold;
    font-size: 1.05rem;
    color: #ffffff;
}

.runtime-table .level-1 .stage-name {
    font-weight: bold;
    color: #e0e0e0;
}

.runtime-table .level-2 .stage-name {
    color: #d0d0d0;
}

.runtime-table .level-3 .stage-name {
    color: #a0a0a0;
    font-style: italic;
}

/* STA updateTiming 行样式 */
.runtime-table .sta-row {
    background-color: #1a1a28;
}

.runtime-table .sta-row td {
    color: #909090;
}

/* 展开/折叠图标 */
.expand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    cursor: pointer;
    user-select: none;
    color: #4a6bdf;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: color 0.2s, transform 0.2s;
}

.expand-icon:hover {
    color: #6a8bff;
    transform: scale(1.15);
}

.expand-placeholder {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    flex-shrink: 0;
}

/* 数值样式 */
.time-value,
.count-value,
.percent-value {
    font-family: 'Courier New', monospace;
    color: #c0c0c0;
}

.time-value {
    text-align: right !important;
}

.count-value {
    color: #a0a0a0;
}

.percent-value {
    color: #b0b0ff;
}

/* 差异值样式 */
.diff-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-align: center !important;
    padding: 8px !important;
}

.diff-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.diff-abs {
    font-size: 0.95rem;
}

.diff-percent {
    font-size: 0.8rem;
    opacity: 0.8;
}

.diff-value.positive {
    color: #4ade80;
}

.diff-value.positive .diff-abs {
    color: #4ade80;
}

.diff-value.negative {
    color: #ff6b6b;
}

.diff-value.negative .diff-abs {
    color: #ff6b6b;
}

.diff-value.neutral {
    color: #888;
}

/* 可展开行样式 */
.runtime-table .expandable:hover {
    background-color: rgba(74, 107, 223, 0.05);
}

/* 各层级背景色微调 */
.runtime-table tbody .level-0 td {
    background-color: #252540;
}

.runtime-table tbody .level-1 td {
    background-color: #222235;
}

.runtime-table tbody .level-2 td {
    background-color: #1e1e30;
}

.runtime-table tbody .level-3 td {
    background-color: #1a1a28;
}

/* Runtime Compare 响应式调整 - 复用 compare 页面样式 */
@media (max-width: 768px) {
    .runtime-table {
        font-size: 0.85rem;
    }
    
    /* 小屏幕下的表格头部控制 */
    .header-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .table-controls {
        justify-content: center;
    }
    
    .expand-all-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 900px) {
    .runtime-table-wrapper {
        padding: 1rem;
    }
    
    .runtime-table-container {
        overflow-x: auto;
    }
    
    .runtime-table {
        font-size: 0.8rem;
    }
    
    .runtime-table tbody td {
        padding: 8px 6px;
    }
}

/* 表格行渐变效果 */
.runtime-table tbody tr {
    transition: background-color 0.2s ease;
}

.runtime-table tbody tr:hover td {
    filter: brightness(1.15);
}