/* 登录 */
.login-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f2937, #111827);
}
.login-card {
  width: 340px; padding: 30px; background: #fff; border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.login-card h2 { text-align: center; margin: 0 0 22px; color: #303133; }

/* 无顶栏：侧栏与内容区都顶到最上方 */
.layui-layout-admin .layui-side {
  width: 200px; top: 0;
  display: flex; flex-direction: column;
}
.layui-layout-admin .layui-body { left: 200px; top: 0; overflow: auto; }
.view-container { padding: 14px; }

/* 侧栏品牌 + 底部退出 */
.side-brand {
  color: #16baaa; font-size: 16px; font-weight: 700;
  padding: 16px 18px; border-bottom: 1px solid #2d3645; white-space: nowrap;
}
.layui-side .layui-side-scroll { flex: 1; overflow: auto; }
.side-foot {
  border-top: 1px solid #2d3645; padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between;
  color: #cfd3dc; font-size: 13px;
}
.side-foot a { color: #ff9a76; cursor: pointer; }
.side-foot a:hover { color: #ff7a45; }

/* 顶部统计条 */
.summary-bar {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  padding: 8px 12px; background: #fff; border: 1px solid #e6e6e6; border-radius: 4px;
  font-weight: 700; color: #2e7d32;
}
.summary-bar .sp { flex: 1; }

/* 任务窗口栅格：align-items:stretch 让右列拉伸到与左侧分时表等高（底部对齐） */
.win-grid { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 10px; margin-top: 10px; align-items: stretch; }
.win-side { display: flex; flex-direction: column; min-height: 0; }
/* 日志面板占满右列剩余高度；relative 作为日志框的定位父级 */
.win-side .log-panel { flex: 1 1 0; min-height: 0; position: relative; }
/* 工作日志框【绝对定位】填满日志面板（标题下方→面板底部）并内部滚动：脱离文档流→日志再多也不撑高右列，
   于是右列高度由左侧分时表决定、底部与之对齐；日志超出则框内出滚动条。top:32px 让出标题，四周 8px 让出 panel 内边距。 */
.win-side .log-panel .log-box { position: absolute; left: 8px; right: 8px; top: 32px; bottom: 8px; height: auto; overflow-y: auto; }
.panel { background: #fff; border: 1px solid #e6e6e6; border-radius: 4px; padding: 8px; }
.panel-title { font-weight: 700; font-size: 13px; color: #555; margin-bottom: 6px; }
.panel-title .r { float: right; font-weight: 400; }
.hv-btn { cursor: pointer; color: #888; padding: 0 8px; font-weight: 400; border-left: 1px solid #eee; }
.hv-btn:first-child { border-left: none; }
.hv-btn.on { color: #16b777; font-weight: 700; }
tr.hour-row { cursor: pointer; }
tr.hour-row:hover td { background: #eafaf2; }
tr.ord-row { cursor: context-menu; }
tr.ord-row:hover td, tr.ord-row.ord-active td { background: #d7f0e4 !important; }

/* 订单右键菜单 */
.ord-menu { padding: 4px 0; }
.ord-menu-item { padding: 9px 16px; font-size: 14px; cursor: pointer; color: #333; white-space: nowrap; }
.ord-menu-item:hover { background: #16b777; color: #fff; }

/* 表格紧凑 */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th, .tbl td { border: 1px solid #cfd4dc; padding: 5px 6px; text-align: center; white-space: nowrap; }
.tbl th { background: #f0f2f5; color: #555; }
/* 预计结束着色：已过期=红、3小时内将结束=黄 */
.tbl td.end-over { color: #f53f3f; font-weight: 700; }
.tbl td.end-soon { color: #e68a00; font-weight: 700; background: #fff7e6; }
/* 当前时间行高亮 */
.tbl tr.cur td { background: #fff3cd; font-weight: 700; color: #8a6d3b; }
.tbl tr.cur td:first-child { box-shadow: inset 3px 0 0 #faad14; }
.tbl tr.hour-row.cur:hover td { background: #ffe9a8; }
/* 分时表：阶段成本(第3列)、单粉成本(第11列) 浅蓝底区分；当前行高亮优先 */
.fenshi-tbl th:nth-child(3), .fenshi-tbl th:nth-child(11) { background: #e6eefb; color: #3a5a8c; }
.fenshi-tbl tr:not(.cur) td:nth-child(3), .fenshi-tbl tr:not(.cur) td:nth-child(11) { background: #f3f7fd; }
/* 左侧任务树：任务下显示 近1h/今日 的 消耗/进粉/进粉成本 */
.ws-task { padding: 7px 8px 7px 12px; cursor: pointer; border-top: 1px solid #f3f4f6; transition: background .12s; }
.ws-task:hover { background: #d7f0e4; box-shadow: inset 3px 0 0 #16b777; }
.ws-task .wt-name { font-size: 13px; font-weight: 600; color: #1a1a1a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-task .wt-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
/* 数据用蓝灰冷色系；网格对齐：标签/耗/粉/单粉 四列上下对齐。越近的时段越深 */
.ws-task .wt-row { display: grid; grid-template-columns: 40px 1.3fr 0.8fr 1.1fr; gap: 0 4px; font-size: 11px; margin-top: 3px; padding-left: 13px; }
.ws-task .wt-row.m10 { color: #4a6b93; }
.ws-task .wt-row.h1 { color: #8195ad; }
.ws-task .wt-row.today { color: #b6c0cd; }
.ws-task .wt-c, .ws-task .wt-tag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-task .wt-c.cpf-over { color: #f53f3f; font-weight: 700; } /* 单粉成本超目标标红 */
.scroll-y { max-height: 360px; overflow: auto; }
/* 花费统计表 */
.sp-tbl td:first-child, .sp-tbl th:first-child { text-align: left; }
.sp-tbl .sp-total td { background: #eef2f7; font-weight: 700; }
.sp-tbl .sp-acc td { background: #eaf7f0; font-weight: 700; color: #16976c; }
.sp-tbl .sp-tname { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 18px; }
/* 历史趋势条 */
.tr-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
.tr-row .tr-date { width: 44px; color: #8a9099; flex-shrink: 0; }
.tr-row .tr-bar { flex: 1; height: 12px; background: #f0f2f5; border-radius: 3px; overflow: hidden; }
.tr-row .tr-bar > i { display: block; height: 100%; background: #16b777; }
.tr-row .tr-val { width: 80px; text-align: right; font-weight: 600; }
.tr-row .tr-sub { width: 150px; color: #8a9099; }
.scroll-x { overflow-x: auto; }

/* 活码行 */
.lc-row { display: grid; grid-template-columns: minmax(0,1fr) 64px 64px 58px 62px; gap: 0 6px; align-items: baseline; padding: 5px 6px; border-bottom: 1px dashed #eee; font-size: 12px; }
.lc-row .nm { color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-row .lc-c { color: #2e7d32; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 日志 */
.log-box { height: 320px; overflow: auto; background: #fafafa; border: 1px solid #ebeef5; padding: 6px; font-size: 12px; font-family: Consolas, monospace; }
.log-line.success { color: #2e7d32; }
.log-line.error { color: #d32f2f; }
.log-line.info { color: #1976d2; }

/* 操作栏 */
.order-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; padding: 8px; background: #fff; border: 1px solid #e6e6e6; border-radius: 4px; margin-top: 10px; }
.order-bar .lbl { color: #666; font-size: 13px; margin-left: 4px; }
.order-bar .layui-input, .order-bar .layui-select { display: inline-block; width: auto; height: 32px; line-height: 32px; padding: 0 6px; font-size: 13px; }
.order-bar .ob-select { height: 32px; border: 1px solid #dcdfe6; border-radius: 4px; padding: 0 6px; background: #fff; }
.order-bar .age-lb { font-size: 13px; margin-right: 4px; cursor: pointer; user-select: none; }
.order-bar .age-lb input { vertical-align: middle; margin-right: 2px; }
/* 数值微调器（金额/出价共用） */
.step-box { display: inline-flex; align-items: center; border: 1px solid #dcdfe6; border-radius: 4px; overflow: hidden; height: 32px; }
.step-box a { width: 26px; text-align: center; cursor: pointer; user-select: none; color: #16b777; font-weight: 700; line-height: 30px; background: #f5f7fa; font-size: 16px; }
.step-box a:hover { background: #e8f6f0; }
.step-box input { width: 64px; border: none; text-align: center; height: 30px; outline: none; font-size: 13px; }
/* 通知设置表单 */
.nt-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.nt-row > label { width: 160px; flex-shrink: 0; color: #555; text-align: right; padding-top: 6px; }
.nt-row .nt-num { width: 140px; }
.nt-row .muted { padding-top: 6px; }
.nt-ck { display: inline-block; margin-bottom: 4px; cursor: pointer; user-select: none; }
.nt-ck input { vertical-align: middle; margin-right: 4px; }
.nt-hint { margin: -8px 0 16px 172px; font-size: 12px; }

/* 工作台 */
.ws-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.muted { color: #999; }

/* 任务标签：选中 vs 未选中 区分加大 */
.layui-tab-card > .layui-tab-title li {
  color: #909399;
  background: #f2f3f5;
  margin-right: 4px;
  border-radius: 4px 4px 0 0;
  transition: all .15s;
}
.layui-tab-card > .layui-tab-title li:hover { color: #16b777; }
.layui-tab-card > .layui-tab-title .layui-this {
  color: #fff !important;
  background: #16b777 !important;
  font-weight: 700;
}
.layui-tab-card > .layui-tab-title .layui-this:after {
  border: none !important;
  border-radius: 4px 4px 0 0;
}
/* 选中标签的关闭叉改成白色 */
.layui-tab-card > .layui-tab-title .layui-this .layui-tab-close { color: #fff; }

/* 活码多选（可点击行） */
.lc-pick-box { max-height: 200px; overflow: auto; border: 1px solid #e6e6e6; border-radius: 4px; }
.lc-pick {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f2f2f2;
  user-select: none;
}
.lc-pick:last-child { border-bottom: none; }
.lc-pick:hover { background: #f5f7fa; }
.lc-pick .mk {
  width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid #c0c4cc; border-radius: 3px;
  position: relative; background: #fff;
}
.lc-pick.sel { background: #eafaf2; }
.lc-pick.sel .mk { background: #16b777; border-color: #16b777; }
.lc-pick.sel .mk::after {
  content: ''; position: absolute; left: 5px; top: 1px; width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.lc-pick-name { flex: 0 0 auto; color: #333; }
.lc-pick-url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
