/* ================= 期货数据工具页 ================= */

/* 内容区容器：侧边栏为独立浮层，不占内容空间 */
.tool_container {
    min-height: 640px;
    position: relative;          /* 组合排名浮层的定位基准（页尾上方） */
}

/* 抽屉拉手按钮：固定在屏幕左缘，点击收起/展开侧边栏 */
.tool_sidebar_toggle {
    position: fixed;
    top: 73px;
    left: 0;
    width: 22px;
    height: 64px;
    border: none;
    border-radius: 0 10px 10px 0;
    background: linear-gradient(180deg, #2a2a2e 0%, #45454b 100%);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    z-index: 31;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25);
    transition: all 0.25s ease;
}

.tool_sidebar_toggle:hover {
    width: 26px;
    background: linear-gradient(180deg, #3498db 0%, #1a5276 100%);
}

/* 拉手可拖拽 */
.tool_sidebar_toggle {
    cursor: grab;
    user-select: none;
}

.tool_sidebar_toggle:active {
    cursor: grabbing;
}

/* 拖动中禁用过渡，保证跟手 */
.tool_sidebar_toggle.dragging,
.tool_sidebar.dragging {
    transition: none !important;
}

/* 停靠左侧：图标在侧边栏右侧（朝向内容区） */
.tool_sidebar_toggle {
    left: 452px;                 /* 栏left10 + 栏宽440 + 2px */
}

.tool_sidebar_toggle.at-right {
    left: auto;
    right: 452px;                /* 栏right10 + 栏宽440 + 2px，图标在栏左侧 */
    border-radius: 10px 0 0 10px;
}

.tool_sidebar.at-right {
    left: auto;
    right: 10px;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
}

/* 收起状态：图标脱离侧边栏，贴合浏览器边缘 */
.tool_sidebar_toggle.docked {
    left: 0;
    right: auto;
}

.tool_sidebar_toggle.at-right.docked {
    left: auto;
    right: 0;
}

/* 右侧停靠时收起：向右滑出 */
.tool_sidebar.at-right.collapsed {
    transform: translateX(500px);
}

/* 左侧边栏：独立浮层（fixed），收起时滑出屏幕 */
.tool_sidebar {
    position: fixed;
    top: 73px;
    left: 10px;                  /* 贴左侧展开 */
    width: 440px;
    z-index: 25;
    background: linear-gradient(180deg, #2a2a2e 0%, #38383d 55%, #45454b 100%);
    border-radius: 12px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    padding: 21px 14px;
    box-sizing: border-box;
    text-align: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 面板内容整体缩小10%（字与模块），栏宽与拖拽逻辑不受影响 */
.tool_sidebar > * {
    zoom: 0.9;
}

/* 收起状态：滑出屏幕左侧 */
.tool_sidebar.collapsed {
    transform: translateX(-500px);
    opacity: 0;
    pointer-events: none;
}

/* 侧边栏细滚动条（深色） */
.tool_sidebar::-webkit-scrollbar {
    width: 6px;
}

.tool_sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 3px;
}

.tool_sidebar_title {
    color: #fff;
    font-size: 16px;
    letter-spacing: 2px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* ---------- 侧边栏功能区块 ---------- */
.tool_sec {
    margin-top: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.tool_sec:last-child {
    border-bottom: none;
}

.tool_sec_title {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* 上传组件（紧凑横排） */
.tool_upload {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1.5px dashed rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.03);
}

.tool_upload:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.12);
}

.tool_upload_icon {
    width: 26px;
    height: 26px;
    line-height: 25px;
    flex: none;
    text-align: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db 0%, #1a5276 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 300;
}

.tool_upload_text {
    color: #fff;
    font-size: 13px;
}

.tool_upload_hint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    margin-left: auto;
}

.tool_file_name {
    margin-top: 10px;
    font-size: 12px;
    color: #5dade2;
    word-break: break-all;
    display: none;
}

.tool_file_name.show {
    display: block;
}

/* 参考数据搜索框 */
.tool_ref_box {
    position: relative;
}

.tool_ref_input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.25s ease;
}

.tool_ref_input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.tool_ref_input:focus {
    border-color: #3498db;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.tool_ref_tips {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #34495e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
    z-index: 40;
    overflow: hidden;
}

.tool_ref_tips.show {
    display: block;
}

.tool_ref_item {
    padding: 9px 14px;
    font-size: 13px;
    color: #d6dee6;
    cursor: pointer;
    transition: background 0.15s ease;
}

.tool_ref_item:hover {
    background: rgba(52, 152, 219, 0.25);
    color: #fff;
}

.tool_ref_item_path {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
}

.tool_ref_item:hover .tool_ref_item_path {
    color: rgba(255, 255, 255, 0.65);
}

.tool_ref_empty {
    padding: 10px 14px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    cursor: default;
}

/* 已选标签（多选） */
.tool_ref_chips {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tool_ref_chips.show {
    display: flex;
}

/* 行情异动分析：行情数据小标题（国内数据/国外数据） */
.tool_move_data_label {
    margin: 10px 0 6px;
    color: #aab4c0;
    font-size: 12px;
}

/* ---------- 行情异动分析：主区两层布局（上层驱动指标 / 下层异动行情） ---------- */
.move_layout {
    padding: 16px 16px 12px;
}

.move_sec {
    width: 1246px;
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
}

.move_sec_title {
    position: absolute;             /* 骑线标题：卡在卡片上边框中间 */
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 0 18px;
    background: #fff;               /* 遮住卡片顶缘，形成图例卡口效果 */
    font-size: 22px;
    font-weight: 700;
    color: #1f3a5f;
    letter-spacing: 3px;
    line-height: 1.2;
    white-space: nowrap;
    z-index: 1;
}

/* 驱动指标层：外盘实时行情小方块（原油+贵金属，一行6列自动换行） */
.move_foreign_title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: #5a6f85;
}
.move_foreign_grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}
.move_foreign_cell {
    border: 1px solid #e3ecf5;
    border-radius: 8px;
    padding: 7px 9px;
    background: #f8faff;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.move_foreign_name { font-size: 11px; color: #5a6f85; font-weight: 700; }
.move_foreign_price { font-size: 16px; font-weight: 700; color: #1f3a5f; line-height: 1.2; }
.move_foreign_chg { font-size: 11px; font-weight: 700; }
.move_foreign_cell.up .move_foreign_chg { color: #e05252; }
.move_foreign_cell.down .move_foreign_chg { color: #2e9e5b; }
.move_foreign_cell.flat .move_foreign_chg { color: #8a99a8; }

.move_chart_card {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(31, 58, 95, 0.08);
    padding: 16px 16px 8px;
    box-sizing: border-box;
}

.move_chart_box {
    width: 100%;
    height: 420px;
    display: none;
}

.move_chart_box.show {
    display: block;
}

.move_chart_empty {
    display: none;
    height: 396px;
    align-items: center;
    justify-content: center;
    color: #9aa7b2;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.move_chart_empty.show {
    display: flex;
}

/* 异动行情层：列表已承担空态提示，图表空态收成一行细提示，避免大片空白 */
.move_chart_empty.slim {
    height: 52px;
    font-size: 13px;
}

.move_divider {
    width: 1246px;
    max-width: 100%;
    height: 1px;
    margin: 16px auto;
    background: #dfe6ee;
}

/* 异动三类列表（价格/量仓/结构，三列，位于异动行情卡片内置顶） */
.move_lists {
    width: 100%;
    margin: 0 0 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

/* 扫描进度（遍历记忆状态提示） */
.move_scan_progress {
    font-size: 11px;
    color: #9fb2c4;
    margin: -6px 0 8px;
    min-height: 14px;
}

/* 异动小卡片：一品种一卡，两列排布，不占整行 */
.move_anom_grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.move_anom_card {
    background: #fff;
    border: 1px solid #e3ecf5;
    border-left: 3px solid #f0a30a;
    border-radius: 7px;
    padding: 5px 7px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.move_anom_card.high {
    border-left-color: #e05252;
    background: #fff5f5;
}
.move_anom_top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.move_anom_name {
    font-weight: 700;
    color: #1f3a5f;
    font-size: 10px;
}
.move_anom_lv {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 6px;
    background: #fdf3e0;
    color: #d68910;
}
.move_anom_card.high .move_anom_lv {
    background: #fdeaea;
    color: #d9534f;
}
.move_anom_score {
    font-size: 13px;
    font-weight: 700;
    color: #2c5f8a;
    line-height: 1.2;
}
.move_anom_tag {
    font-size: 9px;
    color: #6a7f95;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.move_anom_time {
    font-size: 8px;
    color: #9fb2c4;
}

.move_list_card {
    min-width: 0;
    background: #f8faff;
    border: 1px solid #e4ebf3;
    border-radius: 12px;
    padding: 12px 12px 8px;
    box-sizing: border-box;
}

.move_list_title {
    margin: 0 0 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #1f3a5f;
    letter-spacing: 1px;
}

.move_list_body {
    min-height: 180px;
    max-height: 320px;
    overflow-y: auto;
}

.move_list_empty {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa7b2;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.tool_ref_chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(52, 152, 219, 0.25);
    border: 1px solid rgba(52, 152, 219, 0.5);
    color: #d6eaf8;
    font-size: 12px;
}

.tool_ref_chip_del {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    line-height: 1;
    transition: color 0.15s ease;
}

.tool_ref_chip_del:hover {
    color: #fff;
}

/* 面板切换占位提示 */
.tool_panel_empty {
    padding: 26px 12px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

/* 模型下拉框 */
.tool_model_select {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23ffffff' fill-opacity='0.55'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: #fff;
    font-size: 13px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.25s ease;
}

.tool_model_select:hover {
    border-color: rgba(52, 152, 219, 0.6);
}

.tool_model_select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.tool_model_select option {
    background: #34495e;
    color: #d6dee6;
}

.tool_model_select option:checked {
    background: #3498db;
    color: #fff;
}

/* ---------- 图表区：单张全宽大图，多序列对比 ---------- */
.chart_grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.chart_card {
    flex: 0 1 1030px;            /* 固定宽度并水平居中，屏幕窄时自动收缩 */
    min-width: 0;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 16px 16px 8px;
    box-sizing: border-box;
    transition: box-shadow 0.25s ease;
}

.chart_card:hover {
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.1);
}

.chart_card_title {
    font-size: 15px;
    font-weight: 700;
    color: #2c3e50;
    padding-left: 10px;
    border-left: 3px solid #3498db;
    line-height: 1.3;
}

.chart_card_path {
    font-size: 11px;
    color: #95a5a6;
    margin: 4px 0 8px 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart_box {
    width: 100%;
    height: 440px;
}

.chart_card_loading,
.chart_card_error {
    height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #95a5a6;
}

.chart_card_error {
    color: #e67e88;
}

.chart_grid_empty {
    width: 100%;
    padding: 60px 20px;
    text-align: center;
    color: #95a5a6;
    font-size: 14px;
    border: 1.5px dashed #dfe4e9;
    border-radius: 16px;
    box-sizing: border-box;
}

/* 时间窗口：起止日期（日历选择） */
.tool_date_row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

/* 条件单：止盈/止损比例输入（并排一行） */
.tool_tp_row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.tool_tp_row .tool_date_label {
    flex: none;
    white-space: nowrap;
}
.tool_tp_input {
    flex: 1;
    min-width: 0;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #dfe6ec;
    border-radius: 6px;
    font-size: 13px;
    color: #2c3e50;
    outline: none;
    background: #fff;
    text-align: center;
}
.tool_tp_input:focus {
    border-color: #3498db;
}
.tool_tp_hint {
    font-size: 11px;
    color: #95a5a6;
    line-height: 1.5;
}

.tool_date_row:last-child {
    margin-bottom: 0;
}

.tool_date_label {
    flex: 0 0 auto;
    color: #aab4c0;
    font-size: 12px;
}

.tool_date_input {
    flex: 1;
    min-width: 0;
    padding: 6px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #e8edf2;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    color-scheme: dark;
}

.tool_date_input:hover {
    background: rgba(255, 255, 255, 0.12);
}

.tool_date_input:focus {
    border-color: #3498db;
    background: rgba(255, 255, 255, 0.14);
}

/* 选择模型：下拉多选（外观同 tool_model_select，点开勾选） */
.tool_mselect {
    position: relative;
    margin-bottom: 3px;          /* 选完后的内容（气泡/日期行）与下拉框保持3px间距 */
}

.tool_mselect_box {
    width: 100%;
    height: 38px;
    padding: 0 30px 0 12px;
    border-radius: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23ffffff' fill-opacity='0.55'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: #fff;
    font-size: 13px;
    line-height: 34px;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.25s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool_mselect_box:hover {
    border-color: rgba(52, 152, 219, 0.6);
}

.tool_mselect.open .tool_mselect_box {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.tool_mselect_opts {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #34495e;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 5px;
    z-index: 40;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.tool_mselect.open .tool_mselect_opts {
    display: block;
    max-height: 232px;
    overflow-y: auto;
}

.tool_mselect_opt {
    padding: 8px 10px;
    border-radius: 7px;
    color: #d6dee6;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.tool_mselect_opt:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tool_mselect_opt.active {
    background: #3498db;
    color: #fff;
    font-weight: 600;
}

/* 已选模型气泡小卡片（下拉框底部展示，× 可删除） */
.tool_model_chips {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tool_model_chips.show {
    display: flex;
}

.tool_model_chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(52, 152, 219, 0.25);
    border: 1px solid rgba(52, 152, 219, 0.5);
    color: #d6eaf8;
    font-size: 12px;
    user-select: none;
}

.tool_model_chip_del {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    line-height: 1;    transition: color 0.15s ease;
}

.tool_model_chip_del:hover {
    color: #fff;
}

/* 时间周期：气泡单选（1/3/5/10/30分钟、1h、1天） */
/* hidden 属性对 flex 容器默认无效，显式隐藏（分时/日频切换联动） */
.tool_cycle_tags[hidden],
.tool_date_row[hidden] {
    display: none !important;
}

.tool_cycle_tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.tool_cycle_tag {
    padding: 5px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #cfd6dd;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.tool_cycle_tag:hover {
    background: rgba(93, 173, 226, 0.18);
    border-color: rgba(93, 173, 226, 0.45);
    color: #eaf5fc;
}

.tool_cycle_tag.active {
    background: linear-gradient(135deg, #3498db, #2e86c1);
    border-color: #5dade2;
    color: #fff;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

/* 技术面数据获取状态行（选品种+日频周期后触发获取） */
.tool_tech_status {
    display: none;
    margin-top: 8px;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    color: #cfd6dd;
}

.tool_tech_status.show {
    display: block;
}

.tool_tech_status.ok { color: #7dcea0; }

.tool_tech_status.warn { color: #f5b041; }

.tool_tech_status.err { color: #e67e88; }

.tool_tech_status.loading { color: #5dade2; }

/* ---------- 技术面K线图卡片（白底，宽度与基础分析图表卡片一致：1030px 居中，窄屏收缩） ---------- */
.tech_chart_card {
    width: 1030px;
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(31, 58, 95, 0.08);
    padding: 16px 16px 8px;
    box-sizing: border-box;
    transition: box-shadow 0.25s ease;
}

.tech_chart_card:hover {
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.1);
}

.tech_chart_box {
    width: 100%;
    height: 560px;
    display: none;
}

.tech_chart_box.show {
    display: block;
}

.tech_chart_empty {
    display: none;
    height: 524px;
    align-items: center;
    justify-content: center;
    color: #9aa7b2;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.tech_chart_empty.show {
    display: flex;
}

.tech_chart_load {
    display: none;
    height: 524px;
    align-items: center;
    justify-content: center;
    color: #5dade2;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.tech_chart_load.show {
    display: flex;
}

/* ---------- 量化/定量分析（多序列定量体检） ----------
   卡片宽度与基础分析、技术面保持一致（1030px 居中，窄屏收缩）；
   hidden 对 flex 容器默认无效，必须显式堵掉（否则算完前引导卡下方会露一排空框） */
.quant_grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.quant_grid[hidden] {
    display: none !important;
}

.quant_card {
    width: 1030px;
    max-width: 100%;
    min-width: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(31, 58, 95, 0.08);
    padding: 16px 16px 12px;
    box-sizing: border-box;
    transition: box-shadow 0.25s ease;
}

.quant_card:hover {
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.1);
}

.quant_card_title {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: 1px;
    margin-bottom: 10px;
    padding-left: 9px;
    border-left: 3px solid #3498db;
    text-align: left;
}

.quant_chart_box {
    width: 100%;
    height: 360px;
}

/* 引导卡：未计算时只展示这一张，文字左对齐（页面整体居中会打断阅读） */
.quant_guide {
    text-align: left;
    font-size: 12px;
    color: #5d6d7e;
    line-height: 1.9;
}

.quant_guide_line strong { color: #2c3e50; }

.quant_guide_list {
    list-style: none;
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quant_guide_list li b {
    display: inline-block;
    min-width: 96px;
    color: #2980b9;
    font-weight: 600;
}

.quant_guide_tip {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff8ec;
    border: 1px solid #f7e2bd;
    color: #a06a1c;
}

/* 统计表：列多，允许横向滚动而不是压成一团；表头粘顶方便长表滚动 */
.quant_table_wrap {
    overflow-x: auto;
}

.quant_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
}

.quant_table th,
.quant_table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f0f3f6;
    text-align: right;
}

.quant_table th {
    position: sticky;
    top: 0;
    background: #f7fafc;
    color: #7f8c8d;
    font-weight: 600;
    cursor: default;
}

.quant_table td.quant_name {
    text-align: left;
    color: #2c3e50;
    font-weight: 600;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quant_table tr.base_row td.quant_name { color: #2980b9; }

/* 非价格型序列整行灰显：数字算得出来，但不该被当成投资结论 */
.quant_table tr.not_price td,
.quant_table tr.not_price td.quant_name {
    color: #b2bec8;
    background: #fbfcfd;
}

.quant_pos { color: #3498db; }
.quant_neg { color: #e67e22; }
.quant_na { color: #b2bec8; }

/* 每列最优值打个轻标记（不整列变色，免得看成人造重点） */
.quant_best {
    background: rgba(52, 152, 219, 0.10);
    border-radius: 4px;
    padding: 1px 4px;
}

.quant_meta {
    font-size: 12px;
    color: #7f8c8d;
    line-height: 1.8;
    text-align: left;
}

.quant_warn {
    font-size: 12px;
    color: #a06a1c;
    line-height: 1.8;
    text-align: left;
}

.quant_warn:empty {
    display: none;
}

/* 侧边面板：量化按钮与说明文字 */
.tool_quant_run {
    width: 100%;
    padding: 9px 0;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #3498db, #2e86c1);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tool_quant_run:hover {
    box-shadow: 0 4px 14px rgba(52, 152, 219, 0.35);
    transform: translateY(-1px);
}

.tool_quant_run:disabled {
    background: rgba(255, 255, 255, 0.08);
    color: #93a5b5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.tool_quant_run.stale {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.tool_quant_hint {
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.7;
    color: #8a99a8;
    text-align: left;
}

/* ---------- 右侧分析结果侧边栏：贴合图表右侧，白底适配图表卡片 ---------- */
.result_sidebar {
    position: fixed;
    top: 73px;
    right: 10px;                 /* JS 会动态计算为图表右缘外侧 */
    width: max-content;          /* 栏宽随内容（两列结果卡）自适应 */
    min-width: 320px;
    max-width: 60vw;
    z-index: 25;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 20px 16px;
    box-sizing: border-box;
    text-align: center;
    transition: right 0.25s ease;
}

.result_title {
    color: #2c3e50;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 12px;
    padding-left: 10px;
    border-left: 3px solid #3498db;
    text-align: left;
}

.result_hint {
    color: #95a5a6;
    font-size: 12px;
    line-height: 1.7;
    padding: 14px 6px;
    border: 1.5px dashed #dfe4e9;
    border-radius: 10px;
    max-width: 300px;            /* 空状态提示限宽，避免撑开自适应栏 */
    margin: 0 auto;
}

/* 结果卡片：两列布局，多个模型自动换行，卡宽随内容 */
.result_cards {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 10px;
    justify-content: center;
}

.result_card {
    background: #f7f9fb;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 12px;
    text-align: left;
}

.result_card_title {
    color: #2c3e50;
    font-size: 13px;
    font-weight: 700;
    padding-left: 8px;
    border-left: 3px solid #3498db;
}

/* 滚动相关性结果卡：内嵌迷你折线图 */
.result_mini_chart {
    width: 100%;
    height: 150px;
    margin-top: 6px;
}

.result_card_sub {
    color: #95a5a6;
    font-size: 11px;
    margin: 6px 0 4px 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result_row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 2px;
    border-top: 1px solid #eef0f3;
}

.result_row:first-of-type {
    border-top: none;
}

.result_name {
    flex: 1;
    color: #5d6d7e;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result_strength {
    color: #95a5a6;
    font-size: 10px;
    white-space: nowrap;
}

.result_value {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 700;
    min-width: 42px;
    text-align: right;
}

.result_value.pos {
    color: #3498db;
}

.result_value.neg {
    color: #e67e22;
}

.result_value.none {
    color: #95a5a6;
    font-size: 11px;
    font-weight: 400;
}

.result_loading {
    color: #95a5a6;
    font-size: 12px;
    text-align: center;
    padding: 10px 0 4px;
}

/* 右侧主区 */
.tool_main {
    flex: 1;
    min-width: 0;
}

/* 二级菜单栏：居中、紧贴导航栏下横线，淡蓝底区分父子层级 */
.tool_nav {
    margin: 0 auto 24px;         /* 无间距紧贴导航栏，水平居中 */
    padding: 10px 22px;
    width: fit-content;          /* 宽度随标签自适应 */
    background: linear-gradient(135deg, #eaf3fc 0%, #f5f9ff 100%);
    border-radius: 0 0 22px 22px; /* 上边直角连导航，下边大圆角显柔和 */
    box-shadow: 0 12px 28px rgba(52, 152, 219, 0.14);
    position: sticky;
    top: 71px;                   /* 导航栏70px + 1px下横线 */
    z-index: 30;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 页面下滑时二级菜单向上收回（滑入主导航栏背后），回到顶部重新出现 */
.tool_nav.nav_hidden {
    transform: translateY(-130%);
    opacity: 0;
    pointer-events: none;
}

.tool_nav_list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;     /* 标签居中排列 */
    gap: 8px;
    list-style: none;
}

.tool_nav_list li {
    padding: 10px 24px;
    border-radius: 999px;
    font-size: 15px;
    color: #555;
    cursor: pointer;
    user-select: none;
    transition: all 0.25s ease;
}

.tool_nav_list li:hover {
    background: rgba(52, 152, 219, 0.12);   /* 淡蓝色反馈，替代白色块 */
    color: #1a5276;
}
.tool_nav_list li.active {
    background: linear-gradient(135deg, #3498db 0%, #1a5276 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(52, 152, 219, 0.35);
}

/* 各分析面板（内容待填充） */
.tool_panel {
    display: none;
    min-height: 520px;
    margin: 0 10px 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}

.tool_panel.show {
    display: block;
}

/* ---------- 技术指标评分卡（技术面，归属结果栏2列布局） ---------- */
.result_score_total {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 10px 0 12px;
}

.result_score_num {
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1px;
}

.result_score_label {
    font-size: 12px;
    color: #7f8c9b;
}

/* 组合评分行内的方向信号标签与大数字的基线对齐微调 */
.result_score_total .result_ind_dir {
    align-self: center;
}

.result_dim {
    margin-bottom: 9px;
}

.result_dim_head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
    color: #34495e;
    margin-bottom: 4px;
}

.result_dim_head em {
    font-style: normal;
    color: #95a5a6;
    font-size: 11px;
    margin-left: 4px;
}

.result_dim_head span:last-child {
    font-weight: 600;
    color: #2c3e50;
}

.result_dim_bar {
    height: 6px;
    border-radius: 3px;
    background: #edf1f5;
    overflow: hidden;
}

.result_dim_fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #5dade2, #2e86c1);
    transition: width 0.35s ease;
}

.result_dim_desc {
    font-size: 11px;
    color: #95a5a6;
    margin-top: 3px;
    line-height: 1.4;
}

/* 组合评分区块：与下方单项评分用虚线分隔 */
.result_score_combo {
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px dashed #e3eaf0;
}

/* 单项评分紧凑列表：一行一个 = 指标名 + 方向标签 + 总分 */
.result_ind_title {
    font-size: 12px;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
}

.result_ind_list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px 14px;
}

.result_ind_item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12px;
    min-width: 0;
}

.result_ind_name {
    color: #34495e;
    font-weight: 600;
    min-width: 40px;
}

.result_ind_dir {
    font-size: 10px;
    line-height: 1;
    padding: 2px 7px;
    border-radius: 9px;
}

.result_ind_dir.up {
    color: #14b143;
    background: rgba(20, 177, 67, .1);
}

.result_ind_dir.down {
    color: #ef232a;
    background: rgba(239, 35, 42, .08);
}

.result_ind_dir.flat {
    color: #95a5a6;
    background: #f0f3f6;
}

.result_ind_score {
    margin-left: auto;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.3px;
}

/* ---------- 智能指标组合排名下拉 ---------- */
/* 复用 .tool_mselect_opts 的定位，这里覆盖为浅色面板（行内深色文字需要浅底） */
.tool_rank_opts {
    max-height: 232px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e3eaf0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.tool_rank_item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.tool_rank_item:hover {
    background: #f2f7fb;
}

.tool_rank_no {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #eef2f6;
    color: #7f8c9b;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.tool_rank_no.medal {
    color: #fff;
}

/* 排名次数：组合在历次排名中上榜Top10的累计次数 */
.tool_rank_cnt {
    flex: none;
    min-width: 26px;
    padding: 1px 5px;
    border-radius: 8px;
    background: #eef4fb;
    color: #2f6fb3;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    line-height: 14px;
}

.tool_rank_names {
    flex: 1;
    min-width: 0;
    color: #34495e;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool_rank_dir {
    flex: none;
    font-size: 10px;
    color: #95a5a6;
}

.tool_rank_dir.up {
    color: #14b143;
}

.tool_rank_dir.down {
    color: #ef232a;
}

.tool_rank_score {
    flex: none;
    min-width: 32px;
    text-align: right;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: -0.3px;
}

.tool_rank_empty {
    padding: 10px;
    font-size: 11px;
    color: #95a5a6;
}

.tool_rank_note {
    padding: 8px 10px;
    font-size: 11px;
    color: #95a5a6;
    line-height: 1.4;
}

/* 智能指标组合排名浮层：停在内容区末尾（页尾上方），随页面滚动，不再贴视口底边 */
.bt_rank_float {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 360px;
    max-width: calc(100vw - 24px);
    z-index: 26;
    background: #fff;
    border: 1px solid #e3eaf0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    overflow: hidden;
}

.bt_rank_head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    cursor: pointer;
    background: linear-gradient(90deg, #f4f8fc 0%, #ffffff 100%);
    border-bottom: 1px solid #e3eaf0;
    user-select: none;
}

.bt_rank_title {
    font-size: 13px;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: 1px;
}

.bt_rank_arrow {
    font-size: 12px;
    color: #7f8c9b;
    transition: transform 0.2s ease;
}

/* 排序切换：综合评分 / 胜率 */
.bt_rank_sort {
    display: inline-flex;
    gap: 2px;
    margin-left: 8px;
    padding: 2px;
    background: #eef2f6;
    border-radius: 8px;
}

.bt_rank_sort button {
    border: none;
    background: transparent;
    padding: 2px 8px;
    font-size: 10px;
    color: #7f8c9b;
    border-radius: 6px;
    cursor: pointer;
    line-height: 14px;
}

.bt_rank_sort button.active {
    background: #fff;
    color: #2f6fb3;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* 风控未通过：整行标红提示（强制沉底） */
.tool_rank_item.bt_risk_fail {
    background: #fdf0ef;
    border-left: 3px solid #ef232a;
}

.tool_rank_item.bt_risk_fail:hover {
    background: #fbe4e2;
}

.bt_rank_float.collapsed .bt_rank_arrow {
    transform: rotate(-90deg);
}

.bt_rank_float.collapsed .bt_rank_body {
    display: none;
}

.bt_rank_float .tool_rank_opts {
    max-height: 300px;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* 排名行“明细”入口 */
.tool_rank_trades {
    flex: none;
    padding: 1px 6px;
    border-radius: 7px;
    border: 1px solid #cfe0f0;
    background: #f6fafd;
    color: #2f6fb3;
    font-size: 10px;
    cursor: pointer;
    line-height: 14px;
    transition: all 0.15s ease;
}

.tool_rank_trades:hover {
    background: #2f6fb3;
    border-color: #2f6fb3;
    color: #fff;
}

/* ===== 组合交易明细弹窗 ===== */
/* 交易明细：独立浮窗（无遮罩、可拖拽，主页面可继续操作） */
.bt_modal {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 90;
    pointer-events: none;      /* 浮窗以外区域不拦截主页面点击 */
}

.bt_modal_card {
    pointer-events: auto;
    position: relative;
    width: min(960px, calc(100vw - 40px));
    height: min(640px, calc(100vh - 60px));
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dfe7ee;
}

.bt_modal_head {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e3eaf0;
    background: linear-gradient(90deg, #f4f8fc 0%, #ffffff 100%);
    cursor: move;
    user-select: none;
}

body.bt_dragging {
    cursor: move;
    user-select: none;
}

.bt_modal_title {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
}

.bt_modal_sub {
    margin-left: 8px;
    font-size: 11px;
    color: #7f8c9b;
}

.bt_modal_close {
    flex: none;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #eef2f6;
    color: #7f8c9b;
    font-size: 16px;
    line-height: 26px;
    cursor: pointer;
}

.bt_modal_close:hover {
    background: #ef232a;
    color: #fff;
}

.bt_modal_summary {
    flex: none;
    padding: 8px 16px;
    font-size: 12px;
    color: #55606b;
    border-bottom: 1px solid #eef2f6;
}

.bt_modal_summary b {
    color: #2c3e50;
}

.bt_modal_body {
    flex: 1;
    overflow: auto;
    padding: 0;
}

.bt_modal_loading {
    padding: 40px;
    text-align: center;
    color: #95a5a6;
    font-size: 13px;
}

/* 明细表：表头吸顶 + 斑马纹 */
.bt_trades_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.bt_trades_table th {
    position: sticky;
    top: 0;
    background: #34495e;
    color: #fff;
    font-weight: 600;
    padding: 7px 8px;
    white-space: nowrap;
    z-index: 1;
}

.bt_trades_table td {
    padding: 5px 8px;
    border-bottom: 1px solid #f0f3f6;
    color: #34495e;
    white-space: nowrap;
    text-align: center;
}

.bt_trades_table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.bt_trades_table tbody tr:hover {
    background: #eef4fb;
}

.bt_long {
    color: #14b143 !important;
    font-weight: 700;
}

.bt_short {
    color: #ef232a !important;
    font-weight: 700;
}

.bt_up {
    color: #14b143;
}

.bt_dn {
    color: #ef232a;
}

.bt_w {
    color: #14b143;
    font-weight: 700;
}

.bt_l {
    color: #ef232a;
    font-weight: 700;
}
