/* ==========================================================
   金眸 Goldview —— macOS 系统设置风格
   与 Alpha 雷达控制台同一套设计系统：浅银白侧栏 + 毛玻璃顶栏 + 白色卡片。
   本文件是唯一的视觉来源：style.css 只保留页面骨架与图表几何，
   这里重新定义它的全部设计变量，让旧选择器自动继承新配色。
   ========================================================== */

/* ==========================================================
   1. 设计变量
   ========================================================== */
body.workspace-ui{
    color-scheme:light;

    /* —— Alpha 同名变量 —— */
    --bg:#f5f5f7;
    --bg-card:#ffffff;
    --bg-subtle:#f5f5f7;
    --bg-inset:#ebebed;
    --bg-sidebar:rgba(246,246,248,.82);
    --bg-topbar:rgba(255,255,255,.72);
    --text:#1d1d1f;
    --text-secondary:#6e6e73;
    --text-tertiary:#86868b;
    --text-quaternary:#a1a1a6;
    --hairline:rgba(0,0,0,.07);

    --accent-hover:#0077ed;
    --accent-pressed:#006edb;
    --accent-soft:rgba(0,113,227,.10);
    --green:#34c759;
    --green-deep:#248a3d;
    --green-soft:rgba(52,199,89,.12);
    --amber:#ff9500;
    --amber-deep:#c93400;
    --amber-soft:rgba(255,149,0,.12);
    --red:#ff3b30;
    --red-deep:#d70015;
    --red-soft:rgba(255,59,48,.10);
    --purple:#af52de;
    --purple-deep:#8944ab;
    --purple-soft:rgba(175,82,222,.10);
    --gray:#8e8e93;
    --gray-soft:rgba(142,142,147,.13);

    --radius-sm:7px;
    --radius-md:10px;
    --radius-lg:14px;
    --radius-xl:18px;

    --shadow-sm:0 1px 2px rgba(0,0,0,.04);
    --shadow-md:0 4px 16px rgba(0,0,0,.05),0 1px 3px rgba(0,0,0,.05);
    --shadow-lg:0 20px 50px rgba(0,0,0,.10),0 4px 12px rgba(0,0,0,.05);

    --sidebar-w:228px;
    --sidebar-w-collapsed:62px;

    /* —— 重新定义 style.css 的旧变量，旧规则直接换肤 —— */
    --bg-0:#f5f5f7;
    --bg-1:#ffffff;
    --bg-2:#f5f5f7;
    --bg-3:#f5f5f7;
    --border:rgba(0,0,0,.10);
    --border-strong:rgba(0,0,0,.16);
    --text-1:#1d1d1f;
    --text-2:#6e6e73;
    --text-3:#86868b;
    --accent:#0071e3;
    --accent-2:#0071e3;
    --ok:#248a3d;
    --warn:#c93400;
    --err:#d70015;
    --switch-off:rgba(120,120,128,.28);
    --switch-on:#34c759;
    --shadow:var(--shadow-sm);
    --mono:-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif;

    background:var(--bg);
    color:var(--text);
    font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif;
    font-size:14px;
    line-height:1.55;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
}

body.workspace-ui.theme-dark{
    color-scheme:dark;

    --bg:#131315;
    --bg-card:#1d1d20;
    --bg-subtle:#26262a;
    --bg-inset:#2e2e33;
    --bg-sidebar:rgba(24,24,27,.86);
    --bg-topbar:rgba(29,29,32,.72);
    --text:#f5f5f7;
    --text-secondary:#a1a1a6;
    --text-tertiary:#86868b;
    --text-quaternary:#636366;
    --hairline:rgba(255,255,255,.07);

    --accent-hover:#2492ff;
    --accent-pressed:#0071e3;
    --accent-soft:rgba(10,132,255,.16);
    --green:#30d158;
    --green-deep:#30d158;
    --green-soft:rgba(48,209,88,.16);
    --amber:#ff9f0a;
    --amber-deep:#ff9f0a;
    --amber-soft:rgba(255,159,10,.16);
    --red:#ff453a;
    --red-deep:#ff6961;
    --red-soft:rgba(255,69,58,.14);
    --purple:#bf5af2;
    --purple-deep:#da8fff;
    --purple-soft:rgba(191,90,242,.16);
    --gray:#98989d;
    --gray-soft:rgba(152,152,157,.16);

    --shadow-sm:0 1px 2px rgba(0,0,0,.35);
    --shadow-md:0 4px 16px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.4);
    --shadow-lg:0 20px 50px rgba(0,0,0,.55),0 4px 12px rgba(0,0,0,.35);

    --bg-0:#131315;
    --bg-1:#1d1d20;
    --bg-2:#26262a;
    --bg-3:#26262a;
    --border:rgba(255,255,255,.10);
    --border-strong:rgba(255,255,255,.17);
    --text-1:#f5f5f7;
    --text-2:#a1a1a6;
    --text-3:#86868b;
    --accent:#0a84ff;
    --accent-2:#0a84ff;
    --ok:#30d158;
    --warn:#ff9f0a;
    --err:#ff6961;
    --switch-off:rgba(120,120,128,.36);
    --switch-on:#30d158;
}

/* ==========================================================
   2. 基础
   ========================================================== */
body.workspace-ui [hidden]{display:none!important}
body.workspace-ui button{font:inherit;cursor:pointer;border:none;background:none;color:inherit}
body.workspace-ui button:disabled{cursor:not-allowed;opacity:.45}
body.workspace-ui input,body.workspace-ui select,body.workspace-ui textarea{font-family:inherit;color:inherit}
body.workspace-ui ::selection{background:var(--accent-soft)}
body.workspace-ui :is(button,a,input,select,textarea):focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.skip-link{position:fixed;top:-100px;left:250px;z-index:300;background:var(--bg-card);padding:12px 20px;color:var(--accent);border-radius:var(--radius-sm)}
.skip-link:focus{top:12px}

/* ==========================================================
   3. Shell：侧边栏 + 内容区
   ========================================================== */
body.workspace-ui .app-shell{
    display:grid;
    grid-template-columns:var(--sidebar-w) minmax(0,1fr);
    min-height:100vh;
    transition:grid-template-columns .2s ease;
}
body.workspace-ui.nav-collapsed .app-shell{grid-template-columns:var(--sidebar-w-collapsed) minmax(0,1fr)}

/* ===== 侧边栏 ===== */
body.workspace-ui .sidebar{
    position:sticky;top:0;height:100vh;
    display:flex;flex-direction:column;
    background:var(--bg-sidebar);
    backdrop-filter:saturate(180%) blur(24px);
    -webkit-backdrop-filter:saturate(180%) blur(24px);
    border:0;border-right:1px solid var(--hairline);
    box-shadow:none;
    padding:18px 12px 14px;
    overflow-y:auto;
    z-index:50;
}
body.workspace-ui .brand{display:flex;align-items:center;gap:10px;padding:4px 8px 16px}
body.workspace-ui .brand-mark{
    width:30px;height:30px;border-radius:8px;flex-shrink:0;
    background:linear-gradient(160deg,#3c3c40,#1d1d1f);
    box-shadow:none;
}
body.workspace-ui.theme-dark .brand-mark{background:linear-gradient(160deg,#4a4a4e,#29292c)}
body.workspace-ui .brand-title{
    color:var(--text);font-size:15px;font-weight:700;
    letter-spacing:-.01em;line-height:1.25;white-space:nowrap;
}
body.workspace-ui .brand-title>span{font-size:11px;color:var(--text-tertiary);margin-left:6px;letter-spacing:0;font-weight:500}
body.workspace-ui .brand-subtitle{
    font-family:inherit;font-size:11px;color:var(--text-tertiary);
    letter-spacing:0;margin-top:1px;
}

body.workspace-ui .nav-list{display:flex;flex-direction:column;gap:0}
body.workspace-ui .nav-group-label{
    border:0;padding:0 10px;margin:14px 0 4px;
    color:var(--text-tertiary);font-size:11px;font-weight:600;letter-spacing:.02em;
}
body.workspace-ui .nav-list>.nav-group-label:first-child{margin-top:0}
body.workspace-ui .nav-item{
    display:flex;align-items:center;gap:9px;width:100%;
    padding:7px 10px;margin:1px 0 0;
    border-radius:var(--radius-sm);
    font-size:13.5px;font-weight:500;
    color:var(--text);background:transparent;
    text-align:left;white-space:nowrap;
    transition:background .12s;transform:none;
    grid-template-columns:none;
}
body.workspace-ui .nav-item:before{display:none}
body.workspace-ui .nav-item:not(.active):hover{background:rgba(0,0,0,.05);color:var(--text);transform:none}
body.workspace-ui.theme-dark .nav-item:not(.active):hover{background:rgba(255,255,255,.07)}
body.workspace-ui .nav-item.active{background:var(--accent);color:#fff}

/* 彩色图标砖：Alpha 侧栏最显眼的识别点，每个模块一个固定颜色 */
body.workspace-ui .nav-icon{
    width:22px;height:22px;border:0;border-radius:6px;
    display:grid;place-items:center;
    color:#fff;flex-shrink:0;background:#8e8e93;
}
body.workspace-ui .nav-icon svg{width:13px;height:13px}
body.workspace-ui .nav-icon.blue{background:#0a84ff}
body.workspace-ui .nav-icon.green{background:#30d158}
body.workspace-ui .nav-icon.amber{background:#ff9f0a}
body.workspace-ui .nav-icon.red{background:#ff453a}
body.workspace-ui .nav-icon.purple{background:#bf5af2}
body.workspace-ui .nav-icon.teal{background:#40c8e0}
body.workspace-ui .nav-icon.indigo{background:#5e5ce6}
body.workspace-ui .nav-icon.pink{background:#ff375f}
body.workspace-ui .nav-icon.gray{background:#8e8e93}
body.workspace-ui .nav-item.active .nav-icon{background:rgba(255,255,255,.22)}
body.workspace-ui .nav-name{font-size:13.5px;font-weight:500}
body.workspace-ui .nav-active-mark{display:none}

/* 侧栏底部：只留一行运行状态，不再放宣传语 */
body.workspace-ui .sidebar-footer{
    margin:auto 0 0;padding:12px 10px 2px;
    border-top:1px solid var(--hairline);
    display:flex;align-items:center;gap:7px;
    font-size:11px;color:var(--text-tertiary);
}
body.workspace-ui .sidebar-footer .status-dot{width:6px;height:6px;flex-shrink:0;box-shadow:none}

/* ===== 侧边栏收起态（图标条） ===== */
body.workspace-ui.nav-collapsed .sidebar{padding:18px 8px 14px}
body.workspace-ui.nav-collapsed .brand{justify-content:center;padding:4px 0 16px}
body.workspace-ui.nav-collapsed .brand-text{display:none}
body.workspace-ui.nav-collapsed .nav-group-label{display:none}
body.workspace-ui.nav-collapsed .nav-item{justify-content:center;gap:0;padding:7px 0}
body.workspace-ui.nav-collapsed .nav-name{display:none}
body.workspace-ui.nav-collapsed .nav-icon{width:26px;height:26px;border-radius:7px}
body.workspace-ui.nav-collapsed .sidebar-footer{justify-content:center;padding:12px 0 2px}
body.workspace-ui.nav-collapsed .sidebar-footer-text{display:none}

/* ==========================================================
   4. 主列 + 毛玻璃顶栏
   ========================================================== */
body.workspace-ui .main{
    min-width:0;display:flex;flex-direction:column;
    padding:0;max-width:none;margin:0;
}
body.workspace-ui .top-header{
    position:sticky;top:0;z-index:40;
    display:flex;align-items:center;gap:12px;flex-wrap:wrap;
    min-height:54px;margin:0;padding:10px 28px;
    background:var(--bg-topbar);
    backdrop-filter:saturate(180%) blur(24px);
    -webkit-backdrop-filter:saturate(180%) blur(24px);
    border:0;border-bottom:1px solid var(--hairline);
}
body.workspace-ui .top-header-left{
    display:flex;align-items:center;gap:12px;
    margin-right:auto;min-width:0;
}
body.workspace-ui .page-eyebrow{display:none}
body.workspace-ui .page-title{
    font-size:17px;font-weight:700;letter-spacing:-.01em;
    line-height:1.3;color:var(--text);white-space:nowrap;
}
body.workspace-ui .page-subtitle{display:none}

/* 侧边栏收放按钮 */
.nav-toggle{
    display:inline-flex;align-items:center;justify-content:center;
    width:29px;height:29px;margin-left:-4px;flex-shrink:0;
    border-radius:var(--radius-sm);
    color:var(--text-tertiary);
    transition:background .13s,color .13s;
}
.nav-toggle:hover{background:var(--bg-subtle);color:var(--text)}

/* 运行状态胶囊 */
.status-pill{
    display:inline-flex;align-items:center;gap:7px;
    padding:5px 12px;border-radius:980px;
    font-size:12.5px;font-weight:600;white-space:nowrap;
    background:var(--gray-soft);color:var(--text-secondary);
}
.status-pill.running{background:var(--green-soft);color:var(--green-deep)}
.status-pill.stopped{background:var(--red-soft);color:var(--red-deep)}
.status-pill-dot{width:7px;height:7px;border-radius:50%;background:currentColor;flex-shrink:0}
.status-pill.running .status-pill-dot{animation:pillPulse 2s ease-in-out infinite}
@keyframes pillPulse{
    0%,100%{box-shadow:0 0 0 0 rgba(52,199,89,.35)}
    50%{box-shadow:0 0 0 4px rgba(52,199,89,.12)}
}

body.workspace-ui .header-actions{display:flex;align-items:center;gap:10px;flex-wrap:nowrap}
body.workspace-ui .header-search{
    width:200px;min-width:0;height:29px;
    display:flex;align-items:center;gap:6px;padding:0 10px;
    background:var(--bg-subtle);
    border:1px solid transparent;border-radius:var(--radius-sm);
    box-shadow:none;transition:background .15s,border-color .15s,box-shadow .15s;
}
body.workspace-ui .header-search:focus-within{
    background:var(--bg-card);border-color:var(--accent);
    box-shadow:0 0 0 3px var(--accent-soft);
}
body.workspace-ui .header-search-icon{font-size:14px;color:var(--text-tertiary)}
body.workspace-ui .header-search-input{
    flex:1;min-width:0;border:0;background:none;
    font-size:13px;color:var(--text);outline:none;
}
body.workspace-ui .header-search-kbd{
    font-size:10px;color:var(--text-tertiary);
    border:1px solid var(--hairline);border-radius:4px;
    padding:1px 4px;background:var(--bg-card);white-space:nowrap;
}
body.workspace-ui .header-search-pop{
    background:var(--bg-card);border:1px solid var(--hairline);
    border-radius:var(--radius-md);box-shadow:var(--shadow-lg);
    overflow:hidden;
}
body.workspace-ui .clock-chip,body.workspace-ui .live-chip{display:none}

body.workspace-ui :is(.alert-btn,.theme-toggle){
    display:inline-flex;align-items:center;justify-content:center;
    width:29px;height:29px;padding:0;flex-shrink:0;position:relative;
    border:1px solid var(--hairline);border-radius:var(--radius-sm);
    background:var(--bg-subtle);color:var(--text-secondary);
    box-shadow:none;font-size:13px;
    transition:background .13s,color .13s;
}
body.workspace-ui :is(.alert-btn,.theme-toggle):hover{background:var(--bg-inset);color:var(--text)}
body.workspace-ui .alert-count{
    position:absolute;right:-5px;top:-5px;
    min-width:15px;height:15px;padding:0 3px;
    border-radius:999px;background:var(--red);color:#fff;
    font-size:9px;font-weight:700;line-height:15px;text-align:center;
    box-shadow:none;
}

/* ==========================================================
   5. 页头控制栏（统计条 + 分段控件）
   ========================================================== */
body.workspace-ui .hub-bar{
    position:sticky;top:54px;z-index:35;
    display:flex;align-items:center;gap:10px;flex-wrap:wrap;
    margin:0;padding:7px 28px;
    background:var(--bg-topbar);
    backdrop-filter:saturate(180%) blur(24px);
    -webkit-backdrop-filter:saturate(180%) blur(24px);
    border:0;border-bottom:1px solid var(--hairline);
    border-radius:0;box-shadow:none;
}
body.workspace-ui .hub-tabs{
    display:inline-flex;gap:2px;padding:2px;
    background:var(--bg-inset);border-radius:9px;
}
body.workspace-ui .hub-tab{
    border:0;border-radius:7px;padding:6px 14px;
    background:none;color:var(--text-secondary);
    font-size:13px;font-weight:600;white-space:nowrap;
    transition:background .15s,color .15s;
}
body.workspace-ui .hub-tab:hover{color:var(--text)}
body.workspace-ui .hub-tab.active{
    background:var(--bg-card);color:var(--text);
    box-shadow:0 1px 3px rgba(0,0,0,.1),0 0 0 .5px rgba(0,0,0,.04);
}
body.workspace-ui .hub-tab .status-dot{display:none}
body.workspace-ui .hub-actions{display:flex;align-items:center;gap:8px;margin-left:auto}
body.workspace-ui .hub-btn{
    display:inline-flex;align-items:center;gap:6px;
    border:1px solid var(--hairline);border-radius:var(--radius-sm);
    background:var(--bg-subtle);color:var(--text);
    font-size:13px;font-weight:600;padding:6px 12px;
    transition:background .13s;
}
body.workspace-ui .hub-btn:hover{background:var(--bg-inset)}

/* 运行开关（iOS 风格） */
body.workspace-ui .hub-switch{
    display:inline-flex;align-items:center;gap:8px;
    border:0;background:none;padding:5px 0;
    font-size:13px;font-weight:500;color:var(--text-secondary);white-space:nowrap;
}
body.workspace-ui .hub-switch.on{color:var(--green-deep);background:none;border:0}
body.workspace-ui .hub-switch-track{
    width:42px;height:25px;border-radius:999px;
    background:var(--switch-off);position:relative;
    transition:background .2s;flex-shrink:0;
}
body.workspace-ui .hub-switch-knob{
    position:absolute;top:2px;left:2px;
    width:21px;height:21px;border-radius:50%;background:#fff;
    box-shadow:0 2px 5px rgba(0,0,0,.2),0 0 0 .5px rgba(0,0,0,.04);
    transition:transform .2s cubic-bezier(.3,.9,.4,1);
}
body.workspace-ui .hub-switch.on .hub-switch-track{background:var(--green)}
body.workspace-ui .hub-switch.on .hub-switch-knob{transform:translateX(17px)}

/* ==========================================================
   6. 页面容器
   ========================================================== */
body.workspace-ui .page{
    width:100%;max-width:1480px;margin:0 auto;
    padding:20px 28px 64px;
}
body.workspace-ui.nav-collapsed .page{max-width:1920px}

/* ==========================================================
   7. 卡片 / 分区 / 小节
   ========================================================== */
body.workspace-ui :is(.section,.panel,.spread-table-wrap,.arb-table-wrap,
    .surge-pane-v2,.surge-heatmap-card,.wl-coin-card,.arb-drawer,.spread-detail-card,
    .overview-modules-panel,.ovs-card){
    background:var(--bg-card);
    border:1px solid var(--hairline);
    border-radius:var(--radius-lg);
    box-shadow:var(--shadow-sm);
}
body.workspace-ui .panel{padding:22px}
body.workspace-ui .section{overflow:hidden}
/* 卡片里的分区标题贴着卡片边缘并带一条分隔线；单独用作页面小标题时
   （系统设置就是这样）不画框、不缩进，否则会多出一条悬空的线。 */
body.workspace-ui .section-header{
    display:flex;align-items:center;gap:10px;
    padding:0;margin:0 0 12px;
    font-size:16px;font-weight:700;letter-spacing:-.01em;color:var(--text);
    border:0;background:none;
}
body.workspace-ui .section>.section-header{
    padding:16px 20px;margin:0;
    border-bottom:1px solid var(--hairline);
}
body.workspace-ui .panel-title{
    color:var(--text);font-size:15px;font-weight:700;letter-spacing:-.01em;
}
.section-count{
    display:inline-grid;place-items:center;
    min-width:20px;height:20px;padding:0 6px;
    border-radius:5px;background:var(--gray-soft);
    color:var(--text-secondary);font-size:11px;font-weight:600;
}
.section-description{font-size:13px;color:var(--text-secondary);margin-top:4px;line-height:1.65}
.quiet-tag{
    padding:2.5px 7px;border-radius:5px;
    background:var(--gray-soft);color:var(--text-secondary);
    font-size:11px;font-weight:600;white-space:nowrap;border:0;
}

/* feature-block = Alpha 的 callout：卡片内的分组小节 */
body.workspace-ui .feature-block{
    margin-top:16px;padding:16px 18px;
    border:1px solid var(--hairline);border-radius:var(--radius-md);
    background:var(--bg-subtle);box-shadow:none;
}
body.workspace-ui .feature-block:first-child{margin-top:0}
/* 旧版给每种小节配了一个底色（绿/红/蓝/橙/青），抽屉里就成了一串彩色方块。
   统一成中性面板：颜色只留给行情涨跌和运行状态，分区靠标题和留白区分。 */
body.workspace-ui .feature-block:is(.above-block,.below-block,.cooldown-block,
    .funding-block,.alert-block,.default-block){
    background:var(--bg-subtle);border-color:var(--hairline);
}
body.workspace-ui :is(.status-indicator,.trigger-section){
    background:var(--bg-subtle);border:1px solid var(--hairline);
    border-radius:var(--radius-md);box-shadow:none;color:var(--text);
}
body.workspace-ui .simple-config-grid{border-color:var(--hairline)}

/* ==========================================================
   8. 指标卡：统一四套 KPI 写法
   ========================================================== */
body.workspace-ui .overview-stats{
    display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
    gap:14px;margin-bottom:20px;
}
/* 五套 KPI 栅格原本各写各的最小列宽（180/190px），5 张卡就被挤成 4+1。
   统一到同一个下限，指标条在任何页面都排成整齐的一行。 */
body.workspace-ui :is(.kpi-grid,.spread-kpi-grid,.surge-kpi-grid,.wl-kpi-grid,
    .kpi-grid-pro,.funding-kpi-grid){
    display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:14px;
}
/* OI 异动 / 跨所价差的指标条直接挂在 .page 下（不像别的页面裹在 flex 容器里），
   自己补上和 .section 一样的下外边距，跟下面的表格卡片拉开距离。 */
body.workspace-ui .kpi-grid{margin-bottom:16px}
body.workspace-ui :is(.metric-card,.sk-card,.kpi-card,.surge-kpi-card,.wl-kpi-card){
    display:block;text-align:left;position:relative;
    padding:16px 18px;min-height:0;
    background:var(--bg-card);
    border:1px solid var(--hairline);
    border-radius:var(--radius-lg);
    box-shadow:var(--shadow-sm);
    color:var(--text);
}
body.workspace-ui .metric-card:before,body.workspace-ui .metric-card:after{display:none}
body.workspace-ui .mc-clickable{transition:border-color .13s,background .13s}
body.workspace-ui .mc-clickable:hover{border-color:var(--accent);background:var(--accent-soft)}
body.workspace-ui :is(.metric-label,.sk-label,.kpi-label,.surge-kpi-label,.wl-kpi-label){
    display:flex;align-items:center;justify-content:space-between;gap:8px;
    font-size:12px;font-weight:500;color:var(--text-tertiary);
}
body.workspace-ui :is(.metric-value,.sk-value,.kpi-value,.surge-kpi-value,.wl-kpi-value){
    margin:6px 0 3px;
    font-family:inherit;font-size:26px;font-weight:700;
    letter-spacing:-.02em;line-height:1.25;color:var(--text);
    font-variant-numeric:tabular-nums;
}
body.workspace-ui :is(.metric-note,.sk-sub,.kpi-sub,.surge-kpi-sub,.wl-kpi-sub){
    font-size:12px;font-weight:400;color:var(--text-tertiary);line-height:1.5;
}
/* 指标卡右上角的小图标砖 */
.metric-symbol{
    display:grid;place-items:center;flex-shrink:0;
    width:22px;height:22px;border-radius:6px;
    background:var(--accent-soft);color:var(--accent);
    font-size:13px;font-weight:500;
}
body.workspace-ui :is(.sk-head,.kpi-head,.surge-kpi-head,.wl-kpi-head){
    display:flex;align-items:center;gap:8px;
}
body.workspace-ui :is(.sk-icon,.surge-kpi-icon,.wl-kpi-icon,.kpi-icon,.metric-icon){
    display:grid;place-items:center;flex-shrink:0;
    width:21px;height:21px;border-radius:6px;
    background:var(--gray-soft);color:var(--text-secondary);
    font-size:12px;
}
body.workspace-ui .sk-i-pos{background:var(--green-soft);color:var(--green-deep)}
body.workspace-ui .sk-i-neg{background:var(--red-soft);color:var(--red-deep)}
body.workspace-ui .metric-note .coin-chip{
    border:0;background:var(--bg-inset);color:var(--text-secondary);
    padding:1px 6px;border-radius:5px;font-size:11px;
}

/* 涨跌色只用于行情数值 */
body.workspace-ui :is(.pos,.sk-value.pos,.surge-kpi-value.pos){color:var(--green-deep)}
body.workspace-ui :is(.neg,.sk-value.neg,.surge-kpi-value.neg){color:var(--red-deep)}
body.workspace-ui :is(.warn,.sk-value.warn,.surge-kpi-value.warn){color:var(--amber-deep)}

/* ==========================================================
   9. 按钮
   ========================================================== */
body.workspace-ui .btn{
    display:inline-flex;align-items:center;justify-content:center;gap:7px;
    padding:6px 12px;min-height:0;
    font-size:13px;font-weight:600;
    border:1px solid transparent;border-radius:var(--radius-sm);
    box-shadow:none;white-space:nowrap;
    transition:background .13s,opacity .13s;
}
body.workspace-ui .btn:active{opacity:.75}
body.workspace-ui :is(.btn-start,.btn-add,.sd-add-watch,.btn-primary){
    background:var(--accent);color:#fff;border-color:transparent;
}
body.workspace-ui :is(.btn-start,.btn-add,.sd-add-watch,.btn-primary):hover{background:var(--accent-hover)}
body.workspace-ui .btn-secondary{
    background:var(--bg-subtle);color:var(--text);border-color:var(--hairline);
}
body.workspace-ui .btn-secondary:hover{background:var(--bg-inset)}
body.workspace-ui .btn-send{background:transparent;color:var(--accent);border-color:transparent}
body.workspace-ui .btn-send:hover{background:var(--accent-soft)}
body.workspace-ui .btn-stop{background:var(--red-soft);color:var(--red-deep);border-color:transparent}
body.workspace-ui .btn-stop:hover{background:rgba(255,59,48,.18)}
body.workspace-ui .wl-btn-ghost{
    background:transparent;color:var(--accent);border-color:transparent;
    font-size:13px;font-weight:600;
}
body.workspace-ui .wl-btn-ghost:hover{background:var(--accent-soft)}

/* ==========================================================
   10. 表单
   ========================================================== */
body.workspace-ui .form-label{
    display:block;font-size:13px;font-weight:600;
    color:var(--text);margin-bottom:6px;
}
body.workspace-ui :is(.form-input,.form-select){
    width:100%;padding:8px 11px;min-height:0;
    font-size:14px;
    background:var(--bg-card);
    border:1px solid var(--border-strong);
    border-radius:var(--radius-sm);
    color:var(--text);outline:none;box-shadow:none;
    transition:border-color .15s,box-shadow .15s;
}
body.workspace-ui :is(.form-input,.form-select):focus{
    border-color:var(--accent);box-shadow:0 0 0 3.5px var(--accent-soft);
}
body.workspace-ui .help-text{
    font-size:12px;line-height:1.55;color:var(--text-tertiary);margin-top:5px;
}
body.workspace-ui .inline-group{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
/* 工具条里的控件按内容取宽：表单里 width:100% 是对的，但放进一行筛选器就会
   各占一整行、把三个下拉拆成三行。 */
body.workspace-ui :is(.spread-toolbar,.spread-status-bar,.spread-filter-row,
    .arb-filter-row,.arb-filter-row-pro,.surge-toolbar-v2,.wl-toolbar,.inline-group)
    :is(.form-input,.form-select){
    width:auto;padding:6px 10px;font-size:13px;
}

/* ==========================================================
   11. 徽标 / 标签 / 状态点
   ========================================================== */
body.workspace-ui .status-dot{
    width:9px;height:9px;border-radius:50%;flex-shrink:0;
    background:var(--gray);box-shadow:0 0 0 4px var(--gray-soft);animation:none;
}
body.workspace-ui .status-dot.running{
    background:var(--green);box-shadow:0 0 0 4px var(--green-soft);
    animation:pulseSoft 2.2s ease-in-out infinite;
}
body.workspace-ui .status-dot.partial{background:var(--amber);box-shadow:0 0 0 4px var(--amber-soft)}
body.workspace-ui .status-dot.stopped{background:var(--gray);box-shadow:0 0 0 4px var(--gray-soft);animation:none}
@keyframes pulseSoft{
    0%,100%{box-shadow:0 0 0 4px var(--green-soft)}
    50%{box-shadow:0 0 0 7px rgba(52,199,89,.05)}
}
body.workspace-ui .status-text{font-size:12px;color:var(--text-secondary)}
body.workspace-ui .status-text.running{color:var(--green-deep)}
body.workspace-ui .status-text.partial{color:var(--amber-deep)}

body.workspace-ui :is(.surge-ex-chip,.wl-chip,.sp-page-btn){
    border:1px solid var(--hairline);border-radius:var(--radius-sm);
    background:var(--bg-subtle);color:var(--text-secondary);
    font-size:13px;font-weight:500;padding:5px 11px;box-shadow:none;
    transition:background .13s,color .13s;
}
body.workspace-ui :is(.surge-ex-chip,.wl-chip,.sp-page-btn):hover{background:var(--bg-inset);color:var(--text)}
body.workspace-ui :is(.surge-ex-chip.active,.wl-chip.active,.sp-page-btn.active){
    background:var(--accent);border-color:transparent;color:#fff;box-shadow:none;
}

/* ==========================================================
   12. 表格
   ========================================================== */
body.workspace-ui :is(.arb-table,.spread-table,.feed-table,.exchange-fee-table,.runtime-log-table){
    width:100%;border-collapse:collapse;
    background:var(--bg-card);color:var(--text);
    font-size:13px;
}
body.workspace-ui :is(.arb-table,.spread-table,.feed-table,.exchange-fee-table,.runtime-log-table) th{
    text-align:left;padding:9px 14px;
    background:var(--bg-subtle);color:var(--text-tertiary);
    font-size:11px;font-weight:600;white-space:nowrap;
    border:0;border-bottom:1px solid var(--hairline);
}
body.workspace-ui :is(.arb-table,.spread-table,.feed-table,.exchange-fee-table,.runtime-log-table) td{
    padding:10px 14px;
    border:0;border-bottom:1px solid var(--hairline);
    color:var(--text);vertical-align:middle;
}
body.workspace-ui :is(.arb-table,.spread-table,.feed-table,.runtime-log-table) tbody tr:last-child td{border-bottom:0}
body.workspace-ui :is(.arb-table,.spread-table,.feed-table,.runtime-log-table) tbody tr:hover td{background:var(--bg-subtle)}
body.workspace-ui .arb-table-wrap{overflow-x:auto}
/* 价差表：详情侧栏打开时主区只剩约 1100px，收紧间距，免得出现横向滚动条 */
body.workspace-ui .spread-table{min-width:0}
body.workspace-ui .spread-table th,body.workspace-ui .spread-table td{padding-left:10px;padding-right:10px}
body.workspace-ui .spread-table .spt-coin-icon{width:26px;height:26px;flex-basis:26px}
body.workspace-ui .spread-table .spt-source-cell{display:flex;align-items:center;gap:4px;font-family:inherit}
body.workspace-ui .spread-table .spt-source-cell .ex-logo,
body.workspace-ui .spread-table .spt-source-cell .ex-logo-fallback{width:13px;height:13px;border-radius:3px;font-size:7px}
body.workspace-ui .spread-table .spt-act-cell{gap:4px}
/* 表头与单元格对齐：数字列右对齐，序号居中，操作列按钮定宽，行与行之间不抖动 */
body.workspace-ui .spread-table :is(th,td).ra{text-align:right}
body.workspace-ui .spread-table :is(th,td).spt-col-idx{width:36px;text-align:center;color:var(--text-tertiary)}
body.workspace-ui .spread-table th.spt-col-coin{min-width:150px}
body.workspace-ui .spread-table .spt-col-act{width:1%}
body.workspace-ui .spread-table .spt-live-cell{justify-content:flex-end}
body.workspace-ui .spread-table .spt-spread{display:inline-block;min-width:62px;text-align:right;font-variant-numeric:tabular-nums}
body.workspace-ui .spread-table td.ra{font-variant-numeric:tabular-nums}
body.workspace-ui .spread-table .spt-fresh-cell{white-space:nowrap}
body.workspace-ui .spread-table .spt-act-cell{display:flex;align-items:center;justify-content:flex-start}
body.workspace-ui .spread-table .spt-act-cell .spt-detail-btn{min-width:48px;text-align:center}
body.workspace-ui .spread-table .spt-act-cell .spt-star{flex:0 0 24px}
body.workspace-ui .spread-table .spt-act-cell .bl-btn{margin-left:0;min-width:68px;text-align:center}
/* 推送记录：每次推送一行，时间 · 推送时现货 / 合约价 · 推送价差，三列对齐 */
body.workspace-ui .spt-push-list{display:flex;flex-direction:column;gap:3px}
body.workspace-ui .spt-push-line{display:grid;grid-template-columns:72px auto 62px;column-gap:8px;align-items:center;font-family:var(--mono);font-size:11.5px;line-height:1.35;font-variant-numeric:tabular-nums;white-space:nowrap}
body.workspace-ui .spt-push-line .spt-push-time{color:var(--text-tertiary)}
body.workspace-ui .spt-push-line .spt-push-px{text-align:right;color:var(--text-secondary)}
body.workspace-ui .spt-push-line .spt-spread{min-width:0;text-align:right}
body.workspace-ui .spt-push-list .spt-push-line:first-child .spt-push-px{color:var(--text)}
body.workspace-ui .spt-push-more{align-self:flex-start;margin-top:2px;padding:0;border:0;background:none;color:var(--accent,#2563eb);font-size:11.5px;cursor:pointer}
body.workspace-ui .spt-push-more:hover{text-decoration:underline}
body.workspace-ui .spread-table .spt-px-pair{display:flex;flex-direction:column;align-items:flex-end;gap:2px;font-variant-numeric:tabular-nums;line-height:1.35}
body.workspace-ui .spread-table .spt-px-pair span:last-child{color:var(--text-secondary)}
body.workspace-ui .spread-table td.spt-col-push{padding-top:8px;padding-bottom:8px}
/* 详情侧栏推送记录 */
body.workspace-ui .sd-push-list{display:flex;flex-direction:column;gap:4px;max-height:260px;overflow-y:auto;padding:8px 10px;border-radius:10px;background:var(--bg-subtle)}
body.workspace-ui .sd-push-list .spt-push-line{grid-template-columns:72px 1fr 62px;column-gap:8px;font-size:11.5px}
body.workspace-ui .sd-push-list .sd-push-head{font-family:inherit;font-size:11px;color:var(--text-tertiary)}
body.workspace-ui .sd-push-list .sd-push-head span:not(:first-child){text-align:right}
body.workspace-ui .sd-push-list .sd-push-now{padding-bottom:4px;margin-bottom:2px;border-bottom:1px dashed var(--hairline)}
body.workspace-ui .sd-push-list .sd-push-now .spt-push-time{color:var(--text);font-family:inherit}
body.workspace-ui .sd-push-list .sd-push-now .spt-push-px{color:var(--text)}
/* 详情侧栏打开且窗口不宽时，新鲜度列隐藏（侧栏里有「数据新鲜度」） */
@media (max-width:1680px){
    body.workspace-ui .page-with-side:not(.side-collapsed) .spread-table .spt-col-fresh{display:none}
}
body.workspace-ui .sd-push-empty{padding:18px 0;text-align:center;color:var(--text-tertiary);font-size:11.5px}

/* ==========================================================
   13. 工具条 / 分页 / 空状态
   ========================================================== */
body.workspace-ui :is(.spread-status-bar,.spread-toolbar,.surge-toolbar-v2,.wl-toolbar){
    display:flex;align-items:center;flex-wrap:wrap;gap:10px;
    background:var(--bg-card);border:1px solid var(--hairline);
    border-radius:var(--radius-md);box-shadow:none;padding:10px 14px;
}
/* 关注列表顶部指标条：一行小字版（原来是两张 108px 高的 KPI 卡） */
body.workspace-ui .wl-statbar{
    background:var(--bg-card);border:1px solid var(--hairline);
    border-radius:var(--radius-md);box-shadow:none;padding:8px 14px;gap:6px 16px;
}
body.workspace-ui .wl-stat-ico{background:var(--gray-soft);color:var(--text-secondary)}
body.workspace-ui .wl-stat-ico.mauve{background:var(--accent-soft);color:var(--accent)}
body.workspace-ui .wl-stat-ico.rose{background:var(--red-soft);color:var(--red-deep)}
body.workspace-ui .wl-stat-label{font-size:12px;font-weight:500;color:var(--text-tertiary)}
body.workspace-ui .wl-stat-value{font-family:inherit;font-size:16px;font-weight:700;color:var(--text)}
body.workspace-ui .wl-stat-sub{font-size:12px;color:var(--text-tertiary)}
body.workspace-ui .wl-stat-div{background:var(--hairline)}

body.workspace-ui :is(.surge-toolbar-lbl,.loadall-note){font-size:12px;color:var(--text-tertiary);white-space:nowrap}
body.workspace-ui .surge-toolbar-sel{
    padding:6px 10px;font-size:13px;
    background:var(--bg-subtle);border:1px solid transparent;
    border-radius:var(--radius-sm);color:var(--text);outline:none;cursor:pointer;
}

body.workspace-ui :is(.empty-state,.ovs-empty){
    text-align:center;padding:48px 20px;
    color:var(--text-tertiary);font-size:13.5px;
}
.workspace-empty{
    display:flex;flex-direction:column;align-items:center;gap:8px;
    padding:48px 22px;text-align:center;
}
.workspace-empty>span{
    display:grid;place-items:center;
    width:46px;height:46px;margin-bottom:4px;
    border:0;border-radius:50%;
    background:var(--bg-subtle);color:var(--text-quaternary);font-size:19px;
}
.workspace-empty strong{font-size:13.5px;font-weight:600;color:var(--text)}
.workspace-empty p{font-size:13px;color:var(--text-tertiary);line-height:1.6;max-width:260px}
.workspace-empty .btn{margin-top:8px}

body.workspace-ui .last-update{
    font-size:12px;color:var(--text-quaternary);text-align:center;
    margin-top:44px;padding-top:20px;border-top:1px solid var(--hairline);
}

/* ==========================================================
   14. 抽屉 / 弹层
   ========================================================== */
body.workspace-ui .arb-settings-panel{
    width:460px;max-width:100vw;padding:0;
    background:var(--bg-card);
    border:0;border-left:1px solid var(--hairline);
    box-shadow:var(--shadow-lg);
}
body.workspace-ui .arb-settings-backdrop{background:rgba(0,0,0,.32);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
body.workspace-ui .arb-settings-head{
    padding:18px 22px 12px;border:0;border-bottom:1px solid var(--hairline);
}
body.workspace-ui .arb-settings-title{font-size:16px;font-weight:700;color:var(--text);letter-spacing:-.01em}
body.workspace-ui .arb-settings-sub{font-size:12.5px;color:var(--text-tertiary);margin-top:3px;line-height:1.6}
body.workspace-ui .arb-settings-body{padding:18px 22px}
body.workspace-ui .arb-settings-hint{font-size:12px;color:var(--text-tertiary);line-height:1.6}
body.workspace-ui .arb-settings-actions{
    display:flex;align-items:center;gap:8px;
    padding:14px 22px;background:var(--bg-card);
    border:0;border-top:1px solid var(--hairline);
}

/* ==========================================================
   15. 总览页
   ========================================================== */
body.workspace-ui .overview-layout{
    display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:14px;align-items:start;
}
body.workspace-ui .overview-main{display:flex;flex-direction:column;gap:14px}
body.workspace-ui .overview-modules-panel{padding:0;overflow:hidden}
body.workspace-ui .overview-modules-head{
    display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
    margin:0;padding:18px 20px 14px;
}
body.workspace-ui .overview-section-title{
    display:flex;align-items:center;gap:9px;
    font-size:16px;font-weight:700;letter-spacing:-.01em;color:var(--text);
}
.monitor-filters{
    display:flex;align-items:center;gap:2px;
    padding:0 20px 12px;border:0;
}
.monitor-filters button{
    padding:6px 14px;border-radius:7px;border:0;background:none;
    font-size:13px;font-weight:600;color:var(--text-secondary);white-space:nowrap;
    transition:background .15s,color .15s;
}
.monitor-filters button:hover{color:var(--text)}
.monitor-filters button.active{
    background:var(--accent-soft);color:var(--accent);border:0;
}
#monitorFilterCount{margin-left:auto;font-size:12px;color:var(--text-tertiary)}
.monitor-list-head{
    display:grid;grid-template-columns:minmax(0,1fr) 90px 120px;
    padding:8px 20px;
    background:var(--bg-subtle);color:var(--text-tertiary);
    border-top:1px solid var(--hairline);border-bottom:1px solid var(--hairline);
    font-size:11px;font-weight:600;
}
.monitor-list-head span:nth-child(2){text-align:right;padding-right:20px}
.monitor-list-head span:last-child{text-align:center}
body.workspace-ui .tool-grid{display:block}
.monitor-row{
    display:grid;grid-template-columns:minmax(0,1fr) 90px 120px;
    align-items:center;gap:0;
    min-height:60px;padding:8px 20px;
    border-bottom:1px solid var(--hairline);
}
.monitor-row:last-child{border-bottom:0}
.monitor-row:hover{background:var(--bg-subtle)}
.monitor-open{
    display:flex;align-items:center;gap:11px;
    width:100%;min-width:0;padding:0;
    background:none;color:var(--text);text-align:left;
}
.monitor-icon{
    display:grid;place-items:center;flex-shrink:0;
    width:28px;height:28px;border:0;border-radius:8px;
    background:var(--gray);color:#fff;
}
.monitor-icon svg{width:15px;height:15px}
.monitor-icon.blue{background:#0a84ff}
.monitor-icon.green{background:#30d158}
.monitor-icon.amber{background:#ff9f0a}
.monitor-icon.red{background:#ff453a}
.monitor-icon.purple{background:#bf5af2}
.monitor-icon.teal{background:#40c8e0}
.monitor-icon.indigo{background:#5e5ce6}
.monitor-icon.pink{background:#ff375f}
.monitor-open>span:last-child{min-width:0}
.monitor-open strong{display:block;font-size:13.5px;font-weight:600;color:var(--text)}
.monitor-open small{
    display:block;margin-top:2px;
    font-size:12px;color:var(--text-tertiary);
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.monitor-count{
    text-align:right;padding-right:20px;
    font-size:13px;color:var(--text-secondary);
    font-variant-numeric:tabular-nums;
}

body.workspace-ui .overview-side{position:static;display:flex;flex-direction:column;gap:14px;min-width:0}
body.workspace-ui .ovs-card{padding:0;overflow:hidden}
body.workspace-ui .ovs-head{
    display:flex;align-items:center;justify-content:space-between;gap:10px;
    margin:0;padding:16px 18px;border-bottom:1px solid var(--hairline);
}
body.workspace-ui .ovs-head h3{
    display:flex;align-items:center;gap:8px;
    font-size:15px;font-weight:700;letter-spacing:-.01em;color:var(--text);
}
body.workspace-ui .ovs-link{
    padding:0;background:none;color:var(--accent);
    font-size:13px;font-weight:600;white-space:nowrap;
}
body.workspace-ui .ovs-watch-row{
    display:grid;grid-template-columns:1.1fr 1fr 1fr 1fr;gap:6px;
    padding:10px 18px;border-bottom:1px solid var(--hairline);
    font-size:12.5px;
}
body.workspace-ui .owr-head{
    background:var(--bg-subtle);color:var(--text-tertiary);
    padding:8px 18px;font-size:11px;font-weight:600;
}
body.workspace-ui .owr-coin{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:600}
body.workspace-ui .owr-coin-icon{width:20px;height:20px;border-radius:50%}
body.workspace-ui :is(.owr-price,.owr-chg,.owr-rate){
    font-size:12.5px;font-weight:500;font-variant-numeric:tabular-nums;
}
body.workspace-ui .ovs-alert-row{
    display:flex;align-items:flex-start;gap:10px;
    margin:0;padding:12px 18px;border:0;border-bottom:1px solid var(--hairline);
    background:none;border-radius:0;
}
body.workspace-ui .ovs-alert-icon{
    display:grid;place-items:center;flex-shrink:0;
    width:24px;height:24px;border-radius:7px;
    background:var(--amber-soft);color:var(--amber-deep);font-size:12px;
}
body.workspace-ui .ovs-alert-title{font-size:13px;font-weight:600;color:var(--text)}
body.workspace-ui .ovs-alert-detail{font-size:12px;color:var(--text-tertiary);margin-top:2px;line-height:1.5}
.rail-footer{
    padding:10px 18px;text-align:center;
    background:var(--bg-subtle);border-top:1px solid var(--hairline);
    font-size:11px;color:var(--text-tertiary);
}

.overview-tip{
    display:flex;align-items:center;gap:12px;
    padding:14px 18px;
    border:1px solid var(--hairline);border-radius:var(--radius-md);
    background:var(--bg-subtle);
}
.overview-tip>span{
    display:grid;place-items:center;flex-shrink:0;
    width:21px;height:21px;border-radius:6px;
    background:#0a84ff;color:#fff;font-size:12px;
}
.overview-tip strong{font-size:13.5px;font-weight:700;color:var(--text)}
.overview-tip p{font-size:12.5px;color:var(--text-tertiary);margin-top:3px;line-height:1.6}
.overview-tip button{
    margin-left:auto;background:none;color:var(--accent);
    font-size:13px;font-weight:600;white-space:nowrap;
}

/* ==========================================================
   16. 通知中心 / 系统设置
   ========================================================== */
.shared-notice{
    display:flex;align-items:center;gap:12px;
    padding:14px 18px;margin-bottom:16px;
    background:var(--bg-subtle);border:1px solid var(--hairline);
    border-radius:var(--radius-md);
}
.shared-notice-icon{
    display:grid;place-items:center;flex-shrink:0;
    width:21px;height:21px;border-radius:6px;
    background:#0a84ff;color:#fff;font-size:12px;
}
.shared-notice strong{font-size:13.5px;font-weight:700;color:var(--text)}
.shared-notice p{font-size:12.5px;color:var(--text-tertiary);margin-top:3px;line-height:1.6}
.shared-notice>.quiet-tag{margin-left:auto}

.settings-tabs{
    display:inline-flex;gap:2px;padding:2px;margin-bottom:18px;
    background:var(--bg-inset);border:0;border-radius:9px;
}
.settings-tabs button{
    padding:6px 14px;border:0;border-radius:7px;background:none;
    font-size:13px;font-weight:600;color:var(--text-secondary);
    transition:background .15s,color .15s;
}
.settings-tabs button:hover{color:var(--text)}
.settings-tabs button[aria-selected="true"]{
    background:var(--bg-card);color:var(--text);border:0;
    box-shadow:0 1px 3px rgba(0,0,0,.1),0 0 0 .5px rgba(0,0,0,.04);
}
body.workspace-ui #page-settings{max-width:1100px;margin:0 auto}
body.workspace-ui #page-settings .settings-pane{margin-bottom:16px}
body.workspace-ui #page-settings .panel{max-width:820px;padding:22px}
.settings-save-bar{
    position:sticky;bottom:12px;z-index:4;
    display:flex;align-items:center;justify-content:space-between;gap:14px;
    padding:12px 18px;
    background:var(--bg-card);border:1px solid var(--hairline);
    border-radius:var(--radius-md);box-shadow:var(--shadow-md);
}

/* ==========================================================
   17. 详情侧栏
   ========================================================== */
body.workspace-ui :is(.page.page-with-side.active,.spread-page-v2.page-with-side.active){
    display:grid;grid-template-columns:minmax(0,1fr);gap:14px;
}
body.workspace-ui .page.page-with-side .page-side{
    position:relative;top:auto;max-height:none;overflow:visible;
}
@media (min-width:1280px){
    body.workspace-ui :is(.page.page-with-side.active,.spread-page-v2.page-with-side.active){
        grid-template-columns:minmax(0,1fr) 340px;
    }
    body.workspace-ui .page.page-with-side .page-side{position:sticky;top:106px}
}

/* 未选中任何记录时收起详情侧栏，主区域占满整行 */
body.workspace-ui .page.page-with-side.side-collapsed > .page-side{display:none;}
@media (min-width:1280px){
    body.workspace-ui :is(.page.page-with-side.active.side-collapsed,.spread-page-v2.page-with-side.active.side-collapsed){
        grid-template-columns:minmax(0,1fr);
    }
}

/* ==========================================================
   18. 响应式
   ========================================================== */
@media (max-width:1100px){
    body.workspace-ui .overview-layout{grid-template-columns:minmax(0,1fr)}
    body.workspace-ui .overview-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
/* 底部标签栏、返回按钮默认不显示，只在手机宽度出现 */
.m-tabbar{display:none}
.m-back{display:none}

/* ==========================================================
   19. 手机端（≤900px）
   以前这里把侧栏改成顶部横条，但 style.css 同一断点又把侧栏 translateX(-110%)
   推出屏幕、还隐藏了汉堡按钮，两边叠加的结果是手机上没有任何导航入口，
   顶部只剩一块空白。现在按手机 App 的习惯重做：
   - 底部标签栏：总览 / 关注 / 日志 / 通知 / 更多，「更多」把侧栏当底部面板弹出
   - 顶栏压成一行：返回 + 标题 + 运行状态 + 铃铛 + 主题
   - 抽屉铺满全屏，输入框 16px 防止 iOS 聚焦时自动放大
   ========================================================== */
@media (max-width:900px){
    body.workspace-ui{--m-tabbar-h:56px;--m-header-h:50px}
    body.workspace-ui .app-shell,
    body.workspace-ui.nav-collapsed .app-shell{display:block}
    body.workspace-ui .main{padding-bottom:calc(var(--m-tabbar-h) + env(safe-area-inset-bottom))}

    /* ---- 侧栏 → 「更多」底部面板 ---- */
    body.workspace-ui .sidebar,
    body.workspace-ui.nav-collapsed .sidebar{
        position:fixed;left:0;right:0;top:auto;bottom:0;
        width:auto;height:auto;max-height:82vh;max-height:82dvh;
        flex-direction:column;align-items:stretch;gap:0;
        padding:8px 16px calc(var(--m-tabbar-h) + 14px + env(safe-area-inset-bottom));
        background:var(--bg-card);
        border:0;border-radius:18px 18px 0 0;
        box-shadow:0 -10px 40px rgba(0,0,0,.18);
        overflow-x:hidden;overflow-y:auto;
        transform:translateY(105%);visibility:hidden;
        transition:transform .26s cubic-bezier(.3,.9,.4,1),visibility 0s linear .26s;
        z-index:96;
    }
    body.workspace-ui.sidebar-open .sidebar{
        transform:none;visibility:visible;
        transition:transform .26s cubic-bezier(.3,.9,.4,1),visibility 0s;
    }
    body.workspace-ui .sidebar::before{
        content:"";display:block;flex-shrink:0;
        width:36px;height:5px;margin:0 auto 10px;border-radius:3px;
        background:var(--border-strong);
    }
    body.workspace-ui .sidebar-backdrop{
        display:block;position:fixed;inset:0;z-index:95;
        background:rgba(0,0,0,.32);
        opacity:0;pointer-events:none;transition:opacity .2s;
    }
    body.workspace-ui.sidebar-open .sidebar-backdrop{opacity:1;pointer-events:auto}
    body.workspace-ui .brand,
    body.workspace-ui.nav-collapsed .brand{justify-content:flex-start;padding:0 4px 6px}
    body.workspace-ui .brand-text,
    body.workspace-ui.nav-collapsed .brand-text{display:block}
    body.workspace-ui .nav-list{
        display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px 4px;
    }
    body.workspace-ui .nav-group-label,
    body.workspace-ui.nav-collapsed .nav-group-label{
        display:block;grid-column:1/-1;margin:12px 4px 2px;padding:0;
    }
    body.workspace-ui .nav-list>.nav-group-label:first-child{margin-top:4px}
    body.workspace-ui .nav-item,
    body.workspace-ui.nav-collapsed .nav-item{
        flex-direction:column;justify-content:flex-start;gap:6px;
        width:auto;margin:0;padding:10px 2px 8px;
        border-radius:12px;text-align:center;white-space:normal;
    }
    body.workspace-ui .nav-icon,
    body.workspace-ui.nav-collapsed .nav-icon{display:grid;width:42px;height:42px;border-radius:12px}
    body.workspace-ui .nav-icon svg{width:21px;height:21px}
    body.workspace-ui .nav-name,
    body.workspace-ui.nav-collapsed .nav-name{display:block;font-size:12px;line-height:1.3}
    body.workspace-ui .nav-item.active{background:var(--accent-soft);color:var(--accent)}
    body.workspace-ui .nav-item.active .nav-name{font-weight:700}
    body.workspace-ui .nav-item.active .nav-icon{background:var(--accent)}
    body.workspace-ui .sidebar-footer,
    body.workspace-ui.nav-collapsed .sidebar-footer{display:flex;justify-content:flex-start;margin-top:16px;padding:12px 4px 0}
    body.workspace-ui.nav-collapsed .sidebar-footer-text{display:inline}

    /* ---- 底部标签栏 ---- */
    body.workspace-ui .m-tabbar{
        display:grid;grid-template-columns:repeat(5,minmax(0,1fr));
        position:fixed;left:0;right:0;bottom:0;z-index:97;
        height:calc(var(--m-tabbar-h) + env(safe-area-inset-bottom));
        padding:0 4px env(safe-area-inset-bottom);
        background:var(--bg-topbar);
        backdrop-filter:saturate(180%) blur(24px);
        -webkit-backdrop-filter:saturate(180%) blur(24px);
        border-top:1px solid var(--hairline);
    }
    .m-tab{
        display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
        min-width:0;border:0;background:none;padding:6px 0 4px;
        color:var(--text-tertiary);font:inherit;cursor:pointer;
        -webkit-tap-highlight-color:transparent;
    }
    .m-tab.active{color:var(--accent)}
    .m-tab-icon{position:relative;display:grid;place-items:center;width:26px;height:24px}
    .m-tab-icon svg{width:23px;height:23px}
    .m-tab.active .m-tab-icon svg{stroke-width:2}
    .m-tab-name{max-width:100%;font-size:10.5px;font-weight:600;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .m-tab-badge{
        position:absolute;top:-4px;left:15px;
        min-width:17px;height:17px;padding:0 4px;border-radius:999px;
        background:var(--red);color:#fff;
        font-size:10px;font-weight:700;line-height:17px;text-align:center;
        box-shadow:0 0 0 2px var(--bg-card);
    }
    .m-tab-badge[hidden]{display:none}

    /* ---- 顶栏：一行 ---- */
    body.workspace-ui .top-header{
        flex-direction:row;flex-wrap:nowrap;align-items:center;gap:8px;
        min-height:0;height:calc(var(--m-header-h) + env(safe-area-inset-top));
        padding:env(safe-area-inset-top) 12px 0;
    }
    .nav-toggle{display:none}
    body.workspace-ui .m-back:not([hidden]){
        display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;
        width:34px;height:34px;margin-left:-6px;border:0;border-radius:10px;
        background:none;color:var(--accent);cursor:pointer;
    }
    body.workspace-ui .m-back:active{background:var(--bg-subtle)}
    body.workspace-ui .top-header-left{flex:1;min-width:0;margin-right:0}
    body.workspace-ui .page-title{font-size:17px;overflow:hidden;text-overflow:ellipsis}
    body.workspace-ui .status-pill{padding:4px 9px;font-size:11.5px;gap:5px;flex-shrink:0}
    body.workspace-ui .header-actions{width:auto;gap:6px;flex-wrap:nowrap;justify-content:flex-end}
    body.workspace-ui .header-search{display:none}
    body.workspace-ui :is(.alert-btn,.theme-toggle){width:34px;height:34px;border-radius:10px}

    /* ---- 页头控制栏：分段控件占满一行，开关和按钮在下一行；不再吸顶，免得顶部被占掉一大块 ---- */
    body.workspace-ui .hub-bar{
        position:static;flex-wrap:wrap;gap:8px 10px;padding:8px 12px;overflow:visible;
    }
    body.workspace-ui .hub-tabs{display:flex;flex:1 1 100%;min-width:0}
    body.workspace-ui .hub-tabs:empty{display:none}
    body.workspace-ui .hub-tab{flex:1 1 0;min-width:0;justify-content:center;padding:7px 4px;text-align:center;overflow:hidden;text-overflow:ellipsis}
    body.workspace-ui .hub-actions{flex:1 1 100%;margin-left:0;gap:8px}
    body.workspace-ui .hub-actions .hub-switch{margin-right:auto}
    body.workspace-ui .hub-btn{padding:7px 12px}

    /* ---- 抽屉铺满屏幕，底部按钮不被 Safari 工具栏挡住 ---- */
    body.workspace-ui .arb-settings-panel,
    body.workspace-ui .arb-settings-panel.arb-settings-panel-wide,
    body.workspace-ui #jrTradePanel{
        width:100%;max-width:100%;height:100vh;height:100dvh;
        border-left:0;overscroll-behavior:contain;
        padding-top:env(safe-area-inset-top);
    }
    /* 抽屉和弹窗要盖住底部标签栏 */
    body.workspace-ui .arb-settings-backdrop,body.workspace-ui .sd-kline-backdrop{z-index:98}
    body.workspace-ui .arb-settings-panel,body.workspace-ui .sd-kline-modal{z-index:99}
    body.workspace-ui .jr-panel{padding:calc(14px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom))}
    body.workspace-ui .arb-settings-head{padding:14px 16px 10px}
    body.workspace-ui .arb-settings-body{padding:14px 16px}
    body.workspace-ui .arb-settings-actions{padding:12px 16px calc(12px + env(safe-area-inset-bottom))}
    body.workspace-ui .wl-rule-close{min-width:34px;min-height:34px}

    /* 系统设置的保存条贴在标签栏上面 */
    .settings-save-bar{bottom:calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 8px)}
    /* 详情侧栏排在列表下面，滚过去时别被顶栏盖住 */
    body.workspace-ui .page.page-with-side .page-side{scroll-margin-top:calc(var(--m-header-h) + env(safe-area-inset-top) + 8px)}

    /* iOS Safari 输入框字号小于 16px 时，一点输入框整页就被放大，退出后也不缩回 */
    body.workspace-ui :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=range]){font-size:16px}
}
@media (max-width:760px){
    body.workspace-ui .page{padding:12px 12px 24px}
    body.workspace-ui .panel{padding:16px 14px}
    body.workspace-ui .overview-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
    body.workspace-ui .monitor-list-head{display:none}
    .monitor-row{grid-template-columns:minmax(0,1fr) auto;row-gap:8px;padding:12px 16px}
    .monitor-count{grid-column:1;text-align:left;padding-right:0}
}

/* ==========================================================
   20. 手机端（≤760px）：指标卡变紧凑，窄表格改成卡片
   ========================================================== */
@media (max-width:760px){
    /* 指标卡：以前一张卡 100px+ 高，五六张卡就占满一屏，真正的列表要滑很久才看到 */
    body.workspace-ui :is(.kpi-grid,.spread-kpi-grid,.surge-kpi-grid,.wl-kpi-grid,.kpi-grid-pro,.funding-kpi-grid,.overview-stats){
        grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;
    }
    body.workspace-ui :is(.metric-card,.sk-card,.kpi-card,.surge-kpi-card,.wl-kpi-card){padding:10px 12px;border-radius:var(--radius-md)}
    body.workspace-ui :is(.metric-value,.sk-value,.kpi-value,.surge-kpi-value,.wl-kpi-value){margin:3px 0 1px;font-size:20px}
    body.workspace-ui :is(.metric-label,.sk-label,.kpi-label,.surge-kpi-label,.wl-kpi-label){font-size:11.5px}
    body.workspace-ui :is(.metric-note,.sk-sub,.kpi-sub,.surge-kpi-sub,.wl-kpi-sub){font-size:11px;line-height:1.4}
    body.workspace-ui :is(.sk-icon,.surge-kpi-icon,.wl-kpi-icon,.kpi-icon,.metric-icon,.metric-symbol){width:18px;height:18px;font-size:11px}

    /* 区块标题里的筛选条换到下一行，按钮不再被挤成竖排 */
    body.workspace-ui .section-header{flex-wrap:wrap;gap:8px}
    body.workspace-ui .runtime-toolbar{display:flex;flex-wrap:wrap;gap:8px;width:100%}
    body.workspace-ui .runtime-toolbar .form-select{flex:1 1 40%;max-width:none !important;width:auto}
    body.workspace-ui .btn{white-space:nowrap}

    /* 价差页筛选条：下拉两两一行，搜索框占满，视图按钮平分 */
    body.workspace-ui .spread-toolbar{flex-direction:column;align-items:stretch;padding:10px}
    body.workspace-ui .spread-filter-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%}
    body.workspace-ui .spread-filter-row>*{width:100%;min-width:0 !important;max-width:none !important;margin:0}
    body.workspace-ui .spread-filter-row>#spreadFilterBase{grid-column:1/-1;order:9}
    body.workspace-ui .spread-view-actions{display:flex;gap:8px;margin:0}
    body.workspace-ui .spread-view-actions>*{flex:1 1 0;min-width:0}
    body.workspace-ui .spread-view-actions .btn{width:100%}

    /* 资金费率页：标题右侧的统计 / 搜索换行铺满；筛选下拉两两一行 */
    body.workspace-ui .section-header-pro .sh-status-inline{flex:1 1 100%}
    body.workspace-ui .section-header-pro .sh-tools{flex:1 1 100%;width:100%}
    body.workspace-ui .section-header-pro .sh-search{flex:1;min-width:0}
    body.workspace-ui .section-header-pro .sh-btn-ghost{white-space:nowrap;flex-shrink:0}
    body.workspace-ui .arb-filter-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
    body.workspace-ui .arb-filter-row .form-select{width:100%;min-width:0;max-width:none}

    /* 市场异动筛选：左边标签、右边控件一一对齐（原来 flex 换行后标签会跑到上一个下拉的右边） */
    body.workspace-ui .surge-toolbar-row{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px 12px;padding:12px}
    body.workspace-ui .surge-toolbar-row .surge-toolbar-sel{width:100%;min-width:0;max-width:none}
    body.workspace-ui .surge-toolbar-row .surge-toolbar-search{grid-column:1/-1;width:100%;min-width:0;max-width:none}
    body.workspace-ui .surge-toolbar-row>.btn{grid-column:1/-1}

    /* 系统设置：外层卡片 + 内层分组两层内边距叠起来，输入框被挤得很窄 */
    body.workspace-ui #page-settings .panel{padding:14px 12px}

    /* ---- 预警记录：一条一张卡（币种 + 模块 + 时间，下面是详情） ---- */
    body.workspace-ui .alert-history-table{min-width:0;width:100%}
    body.workspace-ui .alert-history-table thead{display:none}
    body.workspace-ui .alert-history-table tbody{display:block}
    body.workspace-ui .alert-history-table tr{
        display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:6px 8px;
        padding:12px 2px;border-bottom:1px solid var(--hairline);
    }
    body.workspace-ui .arb-table-wrap:has(>.alert-history-table){overflow:visible}
    body.workspace-ui .alert-history-table tr:last-child{border-bottom:0}
    body.workspace-ui .alert-history-table td{display:block;padding:0 10px;border:0;background:none;min-width:0;white-space:normal;overflow-wrap:anywhere}
    body.workspace-ui .alert-history-table td:nth-child(3){grid-row:1;grid-column:1}
    body.workspace-ui .alert-history-table td:nth-child(2){grid-row:1;grid-column:2}
    body.workspace-ui .alert-history-table td:nth-child(1){grid-row:1;grid-column:3;font-size:11.5px;color:var(--text-tertiary);white-space:nowrap}
    body.workspace-ui .alert-history-table td:nth-child(4){grid-row:2;grid-column:1/-1;font-size:13px;line-height:1.55}
    body.workspace-ui .alert-history-table td.empty-state{grid-column:1/-1;grid-row:1}

    /* ---- 运行事件：同上 ---- */
    body.workspace-ui .runtime-log-table{min-width:0;width:100%}
    body.workspace-ui .runtime-log-table thead{display:none}
    body.workspace-ui .runtime-log-table tbody{display:block}
    body.workspace-ui .runtime-log-table tr{
        display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;
        padding:10px 2px;border-bottom:1px solid var(--hairline);
    }
    body.workspace-ui .runtime-log-table td{display:block;padding:0;border:0;background:none;min-width:0;width:auto !important;white-space:normal;overflow-wrap:anywhere}
    body.workspace-ui .runtime-log-table td:nth-child(2){grid-row:1;grid-column:1}
    body.workspace-ui .runtime-log-table td:nth-child(1){grid-row:1;grid-column:2;font-size:11.5px;color:var(--text-tertiary);white-space:nowrap}
    body.workspace-ui .runtime-log-table td:nth-child(3){grid-row:2;grid-column:1/-1;font-size:13px}
    body.workspace-ui .runtime-log-table td:nth-child(4){grid-row:3;grid-column:1/-1;font-size:12px;color:var(--text-tertiary)}
    body.workspace-ui .runtime-log-table td:nth-child(4):empty{display:none}
    body.workspace-ui .runtime-log-table td.empty-state{grid-column:1/-1;grid-row:1}
}
