/* 签到控制台 — 工业控制台风格（深色 / 琥珀信号色 / 等宽数字） */

:root {
  --bg: #0a0d0f;
  --bg-2: #0e1315;
  --panel: #12181b;
  --panel-2: #161d21;
  --line: #222c31;
  --line-2: #2c383e;
  --text: #e4ecef;
  --muted: #7f8f97;
  --dim: #5b6a72;

  --amber: #ffb020;
  --amber-dim: #8a6215;
  --lime: #5fd38d;
  --red: #ff6a58;
  --cyan: #58c8d8;
  --violet: #a98cf0;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Monaco, "Courier New", monospace;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;

  --rail-w: 232px;
  --dock-h: 260px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;           /* 固定窗口高度，整体页面不滚动，滚动交给 .view */
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  background-image:
    linear-gradient(rgba(255, 255, 255, .014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .014) 1px, transparent 1px),
    radial-gradient(120% 80% at 80% -10%, rgba(255, 176, 32, .07), transparent 60%),
    radial-gradient(90% 70% at 0% 110%, rgba(88, 200, 216, .06), transparent 60%);
  background-size: 44px 44px, 44px 44px, 100% 100%, 100% 100%;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  opacity: .22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='.5'/></svg>");
}

::selection { background: rgba(255, 176, 32, .3); }

/* 滚动条 */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #243036; border: 3px solid var(--bg); border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: #33454c; }

/* ------------------------------------------------------------------ 侧栏 */
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 24, 27, .92), rgba(10, 13, 15, .92));
  backdrop-filter: blur(4px);
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-weight: 700; font-size: 13px; letter-spacing: .5px;
  color: #14100a;
  background: linear-gradient(140deg, var(--amber), #ff8a3d);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
  box-shadow: 0 0 22px rgba(255, 176, 32, .28);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 14px; letter-spacing: .4px; }
.brand-text span { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }

.nav { display: flex; flex-direction: column; padding: 12px 10px; gap: 4px; }

.nav a {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--muted);
  text-decoration: none;
  transition: background .16s, color .16s, border-color .16s;
}

.nav a .ico { grid-row: 1 / span 2; font-style: normal; font-size: 15px; opacity: .75; }
.nav a span { font-size: 13.5px; letter-spacing: .3px; }
.nav a em {
  grid-column: 2;
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  color: var(--dim);
}

.nav a:hover { background: var(--panel-2); color: var(--text); border-color: var(--line); }

.nav a.active {
  background: linear-gradient(90deg, rgba(255, 176, 32, .14), rgba(255, 176, 32, .02));
  border-color: rgba(255, 176, 32, .34);
  color: #ffd27a;
}
.nav a.active::before {
  content: "";
  position: absolute; left: -10px; top: 8px; bottom: 8px;
  width: 2px; background: var(--amber); box-shadow: 0 0 10px var(--amber);
}
.nav a.active .ico { opacity: 1; }
.nav a.active em { color: #a5834a; }

.rail-foot {
  margin-top: auto;
  padding: 14px 12px 16px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}

.svc {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
  line-height: 1.7;
  padding-top: 4px;
}
.svc b { color: var(--muted); font-weight: 500; }

/* ------------------------------------------------------------------ 主区 */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;   /* 固定整列高度，配合 .view 内滚 */
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  flex: 0 0 auto;   /* 高度固定，不被内容挤压、不随 .view 滚动 */
  display: flex; align-items: center; gap: 18px;
  padding: 13px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 15, .86);
  backdrop-filter: blur(8px);
}
.topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 176, 32, .5), transparent);
  opacity: .5;
}

.crumbs { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.crumbs span {
  font-size: 16px; letter-spacing: 2px; font-weight: 600;
  text-transform: none;
}
.crumbs em {
  font-family: var(--mono); font-style: normal;
  font-size: 11px; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.spacer { flex: 1; }

.lamps { display: flex; gap: 14px; margin-left: auto; }
.lamp { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.lamp i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #3a474d; box-shadow: 0 0 0 1px rgba(255, 255, 255, .05) inset;
}
.lamp.on i { background: var(--lime); box-shadow: 0 0 9px var(--lime); }
.lamp.warn i { background: var(--amber); box-shadow: 0 0 9px var(--amber); }
.lamp.bad i { background: var(--red); box-shadow: 0 0 9px var(--red); }
.lamp.busy i { animation: blink 1s steps(2, end) infinite; }

@keyframes blink { 50% { opacity: .25; } }

.clock {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--amber);
  padding: 4px 10px;
  border: 1px solid rgba(255, 176, 32, .25);
  border-radius: 2px;
  background: rgba(255, 176, 32, .06);
  font-variant-numeric: tabular-nums;
}

.view {
  flex: 1 1 auto;
  min-height: 0;      /* 允许在 flex 列中收缩，超出部分交给滚动条 */
  overflow-y: auto;   /* 整体高度固定，仅内容区滚动 */
  padding: 20px 22px 40px;
  display: flex; flex-direction: column; gap: 18px;
}
body.dock-open .view { padding-bottom: calc(var(--dock-h) + 30px); }

/* ------------------------------------------------------------------ 面板 */
.panel {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border-radius: 3px;
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 7px; height: 7px; pointer-events: none;
  border-color: var(--line-2); border-style: solid;
}
.panel::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.panel::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-title {
  margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 1.6px;
  display: flex; align-items: center; gap: 8px;
}
.panel-title::before {
  content: ""; width: 3px; height: 13px; background: var(--amber);
  box-shadow: 0 0 8px rgba(255, 176, 32, .6);
}
.panel-sub { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.panel-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 16px; }
.panel-body.tight { padding: 0; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

/* ------------------------------------------------------------------ KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

.kpi {
  position: relative; overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--panel-2), var(--bg-2));
  border-radius: 3px;
  padding: 14px 16px 13px;
}
.kpi::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 176, 32, .1), transparent 70%);
}
.kpi-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.2px;
  color: var(--dim); text-transform: uppercase;
}
.kpi-value {
  margin-top: 7px;
  font-family: var(--mono); font-size: 30px; font-weight: 600;
  letter-spacing: -.5px; line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.kpi.accent .kpi-value { color: var(--amber); text-shadow: 0 0 24px rgba(255, 176, 32, .35); }
.kpi.good .kpi-value { color: var(--lime); }
.kpi.info .kpi-value { color: var(--cyan); }
.kpi-unit { font-size: 13px; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.kpi-foot { margin-top: 8px; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

/* ------------------------------------------------------------------ 日历 */
.cal-head { display: flex; align-items: center; gap: 10px; }
.cal-title { font-family: var(--mono); font-size: 14px; letter-spacing: 1px; color: var(--text); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-dow {
  font-family: var(--mono); font-size: 10.5px; color: var(--dim);
  text-align: center; padding-bottom: 6px; letter-spacing: 1px;
}

.cal-cell {
  position: relative;
  min-height: 66px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .012);
  border-radius: 2px;
  padding: 6px 7px;
  cursor: default;
  transition: border-color .15s, background .15s, transform .15s;
  display: flex; flex-direction: column; gap: 4px;
}
.cal-cell.out { opacity: .28; }
.cal-cell.hit { cursor: pointer; }
.cal-cell.hit:hover { border-color: var(--line-2); background: rgba(255, 176, 32, .06); transform: translateY(-1px); }
.cal-cell.today { border-color: rgba(255, 176, 32, .55); box-shadow: 0 0 0 1px rgba(255, 176, 32, .18) inset; }
.cal-cell.sel { border-color: var(--cyan); background: rgba(88, 200, 216, .09); }
.cal-cell.ok { background: linear-gradient(180deg, rgba(95, 211, 141, .13), rgba(95, 211, 141, .03)); border-color: rgba(95, 211, 141, .3); }
.cal-cell.fail { background: linear-gradient(180deg, rgba(255, 106, 88, .12), rgba(255, 106, 88, .02)); border-color: rgba(255, 106, 88, .32); }

.cal-day { font-family: var(--mono); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-cell.today .cal-day { color: var(--amber); font-weight: 700; }
.cal-earned { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--lime); font-variant-numeric: tabular-nums; }
.cal-meta { margin-top: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--lime); }
.cal-dot.bad { background: var(--red); }
.cal-count { font-family: var(--mono); font-size: 9.5px; color: var(--dim); }

.cal-legend { display: flex; gap: 16px; font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.cal-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 1px; margin-right: 5px; vertical-align: -1px; }

/* ------------------------------------------------------------------ 柱图 */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar {
  width: 100%; max-width: 20px;
  background: linear-gradient(180deg, var(--amber), rgba(255, 176, 32, .28));
  border-radius: 1px 1px 0 0;
  min-height: 2px;
  position: relative;
  transition: filter .15s;
}
.bar.zero { background: #232e33; }
.bar-col:hover .bar { filter: brightness(1.35); }
.bar-val { font-family: var(--mono); font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-lab { font-family: var(--mono); font-size: 9px; color: var(--dim); white-space: nowrap; }

/* ------------------------------------------------------------------ 折线 */
.chart { width: 100%; height: 168px; display: block; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .grid-l { stroke: rgba(255, 255, 255, .045); stroke-width: 1; }
.chart text { font-family: var(--mono); font-size: 9px; fill: var(--dim); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.legend span { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.legend i { width: 14px; height: 2px; display: inline-block; }

/* 折线图悬停查看数据 */
.chart-wrap { position: relative; }
.chart .guide { stroke: var(--dim); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; pointer-events: none; }
.chart-tip {
  position: absolute; z-index: 6; pointer-events: none;
  min-width: 130px; padding: 7px 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .5);
  font-family: var(--mono); font-size: 11px; color: var(--text);
}
.chart-tip .tip-title { color: var(--dim); font-weight: 600; margin-bottom: 5px; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 7px; line-height: 1.6; }
.chart-tip .tip-row i { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.chart-tip .tip-row span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.chart-tip .tip-row b { margin-left: auto; padding-left: 10px; font-weight: 600; }

/* ------------------------------------------------------------------ 表格 */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: left; font-family: var(--mono); font-weight: 500;
  font-size: 10px; letter-spacing: 1px; color: var(--dim);
  padding: 9px 12px; border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .015);
  white-space: nowrap;
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid rgba(34, 44, 49, .55); vertical-align: middle; }
.tbl tbody tr:hover { background: rgba(255, 176, 32, .045); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.tbl .mono { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.tbl-wrap { max-height: 340px; overflow: auto; }

/* ------------------------------------------------------------------ 标签 */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .6px;
  padding: 2px 7px; border-radius: 2px;
  border: 1px solid var(--line-2); color: var(--muted);
  background: rgba(255, 255, 255, .02);
  white-space: nowrap;
}
.pill.ok { color: var(--lime); border-color: rgba(95, 211, 141, .4); background: rgba(95, 211, 141, .1); }
.pill.bad { color: var(--red); border-color: rgba(255, 106, 88, .4); background: rgba(255, 106, 88, .1); }
.pill.warn { color: var(--amber); border-color: rgba(255, 176, 32, .4); background: rgba(255, 176, 32, .1); }
.pill.info { color: var(--cyan); border-color: rgba(88, 200, 216, .4); background: rgba(88, 200, 216, .1); }

.badge {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 1px;
  padding: 2px 6px; border-radius: 2px; text-transform: uppercase;
}
.badge.trae { color: #9fd8ff; background: rgba(88, 200, 216, .14); border: 1px solid rgba(88, 200, 216, .35); }
.badge.workbuddy { color: #ffd27a; background: rgba(255, 176, 32, .12); border: 1px solid rgba(255, 176, 32, .32); }
.badge.modelscope { color: #c4b0ff; background: rgba(169, 140, 240, .14); border: 1px solid rgba(169, 140, 240, .35); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px;
  padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 2px;
  background: var(--panel-2); color: var(--muted);
}
.chip.time { color: var(--amber); border-color: rgba(255, 176, 32, .35); background: rgba(255, 176, 32, .08); letter-spacing: .8px; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 12px; line-height: 1; padding: 0; opacity: .6; }
.chip button:hover { opacity: 1; color: var(--red); }

/* ------------------------------------------------------------------ 按钮 */
.btn {
  font-family: var(--mono);
  font-size: 11.5px; letter-spacing: .8px;
  padding: 7px 13px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { border-color: #3d4d55; background: #1c2529; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.block { width: 100%; text-align: center; }
.btn.sm { padding: 4px 9px; font-size: 10.5px; }
.btn.primary {
  background: linear-gradient(180deg, var(--amber), #e08d10);
  border-color: #ffc65c; color: #1a1206; font-weight: 700;
  box-shadow: 0 0 18px rgba(255, 176, 32, .22);
}
.btn.primary:hover { filter: brightness(1.08); background: linear-gradient(180deg, #ffc041, #e89512); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.danger { color: var(--red); border-color: rgba(255, 106, 88, .4); background: rgba(255, 106, 88, .08); }
.btn.danger:hover { background: rgba(255, 106, 88, .16); }

.switch { position: relative; display: inline-block; width: 38px; height: 19px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0;
  border: 1px solid var(--line-2); background: #131a1d; border-radius: 2px;
  transition: background .18s, border-color .18s;
}
.switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; background: #4a5a62; border-radius: 1px;
  transition: transform .18s, background .18s;
}
.switch input:checked + i { background: rgba(95, 211, 141, .16); border-color: rgba(95, 211, 141, .5); }
.switch input:checked + i::after { transform: translateX(19px); background: var(--lime); box-shadow: 0 0 8px var(--lime); }

/* ------------------------------------------------------------------ 卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }

.card {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, var(--panel-2), var(--bg-2));
  border-radius: 3px;
  padding: 14px 15px 13px;
  transition: border-color .18s, transform .18s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.card.gone { opacity: .58; border-style: dashed; }
.card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.card-name { font-size: 14px; font-weight: 600; letter-spacing: .3px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-id { font-family: var(--mono); font-size: 10px; color: var(--dim); margin-left: auto; }

.card-balance {
  display: flex; align-items: baseline; gap: 8px;
  padding: 9px 0 10px;
  border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line);
  margin-bottom: 10px;
}
.card-balance b {
  font-family: var(--mono); font-size: 26px; font-weight: 600;
  color: var(--amber); font-variant-numeric: tabular-nums; letter-spacing: -.5px;
}
.card-balance span { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 11.5px; }
.kv dt { font-family: var(--mono); color: var(--dim); font-size: 10.5px; letter-spacing: .5px; }
.kv dd { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv dd.good { color: var(--lime); }
.kv dd.warn { color: var(--amber); }
.kv dd.bad { color: var(--red); }

.card-actions { display: flex; gap: 7px; margin-top: 12px; flex-wrap: wrap; }

.led { width: 7px; height: 7px; border-radius: 50%; background: #3a474d; display: inline-block; }
.led.on { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.led.warn { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.led.bad { background: var(--red); box-shadow: 0 0 8px var(--red); }

/* ------------------------------------------------------------------ 任务行 */
.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) minmax(0, 1.2fr) auto;
  gap: 14px; align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(34, 44, 49, .6);
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: rgba(255, 255, 255, .014); }
.task-row.off { opacity: .55; }
.task-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.task-meta { font-family: var(--mono); font-size: 10.5px; color: var(--dim); margin-top: 4px; line-height: 1.6; }
.task-times { display: flex; gap: 5px; flex-wrap: wrap; }
.task-actions { display: flex; gap: 6px; align-items: center; }

/* ------------------------------------------------------------------ 弹窗 */
.backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 6, 7, .72);
  backdrop-filter: blur(3px);
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 8vh 20px 20px;
  overflow: auto;
}
.backdrop.open { display: flex; }

.modal {
  width: 100%; max-width: 560px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #151c20, #0d1214);
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 176, 32, .08);
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.985); } }

.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 13.5px; letter-spacing: 1.4px; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field[hidden] { display: none; }
.field > label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1px; color: var(--dim); }
.field .hint { font-size: 11px; color: var(--dim); }

.cmdline {
  font-family: var(--mono); font-size: 12px;
  padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 2px;
  background: #0c1113; color: var(--lime);
  overflow-x: auto; white-space: nowrap;
}
.steps { margin: 0; padding-left: 18px; font-size: 12px; color: var(--muted); line-height: 1.8; }

.input, select.input, textarea.input {
  font-family: var(--mono); font-size: 12.5px;
  padding: 8px 10px;
  border: 1px solid var(--line-2); border-radius: 2px;
  background: #0c1113; color: var(--text);
  width: 100%;
}
.input:focus { outline: none; border-color: rgba(255, 176, 32, .55); box-shadow: 0 0 0 2px rgba(255, 176, 32, .1); }

.checks { display: flex; flex-wrap: wrap; gap: 7px; }
.check {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-2); border-radius: 2px;
  padding: 5px 9px; cursor: pointer; background: #0d1214;
  font-size: 11.5px; color: var(--muted);
  font-family: var(--mono);
}
.check input { accent-color: var(--amber); }
.check:hover { border-color: #3d4d55; color: var(--text); }
.check.on { border-color: rgba(255, 176, 32, .45); color: #ffd27a; background: rgba(255, 176, 32, .07); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* cron 可视化配置行 */
.cron-row { display: grid; grid-template-columns: 46px 138px minmax(120px, 1fr) 128px; gap: 8px; align-items: center; margin-bottom: 8px; }
.cron-lbl { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.cron-row .cr-mode, .cron-row .cr-val { font-size: 12px; padding: 5px 8px; }
.cron-row .cr-val:disabled { opacity: .35; }
.cron-row .cr-note { font-size: 10.5px; text-align: right; }
#f-preview .chip { margin: 2px 2px 0 0; font-size: 11px; }
#tl-detail .log { max-height: 320px; border: 1px solid var(--line); border-radius: 2px; background: rgba(8, 11, 13, .6); }
@media (max-width: 760px) {
  .cron-row { grid-template-columns: 46px 128px 1fr; }
  .cron-row .cr-note { display: none; }
}

/* ------------------------------------------------------------------ 日志坞 */
.dock {
  position: fixed; left: var(--rail-w); right: 0; bottom: 0; z-index: 40;
  height: var(--dock-h);
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line-2);
  background: rgba(8, 11, 13, .97);
  backdrop-filter: blur(6px);
  transform: translateY(100%);
  transition: transform .22s ease;
}
.dock.open { transform: translateY(0); }
.dock-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.dock-title { font-family: var(--mono); font-size: 11px; letter-spacing: 1.2px; color: var(--amber); }
.dock-status { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }

.log {
  margin: 0; flex: 1; overflow: auto;
  padding: 10px 14px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.75;
  color: #b9c7cd; white-space: pre-wrap; word-break: break-all;
}
.log:empty::before { content: "暂无日志输出"; color: var(--dim); }
.log .l-ok { color: var(--lime); }
.log .l-bad { color: var(--red); }
.log .l-warn { color: var(--amber); }
.log .l-dim { color: var(--dim); }

/* ------------------------------------------------------------------ 提示 */
.toasts { position: fixed; right: 18px; top: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 220px; max-width: 380px;
  border: 1px solid var(--line-2); border-left: 3px solid var(--cyan);
  background: rgba(18, 24, 27, .97);
  padding: 10px 13px; border-radius: 2px;
  font-size: 12.5px; color: var(--text);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
  animation: slide .2s ease-out;
}
@keyframes slide { from { opacity: 0; transform: translateX(14px); } }
.toast.ok { border-left-color: var(--lime); }
.toast.err { border-left-color: var(--red); }
.toast small { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--dim); margin-top: 3px; }

/* ------------------------------------------------------------------ 杂项 */
.empty { padding: 34px 16px; text-align: center; color: var(--dim); font-family: var(--mono); font-size: 12px; }
.empty b { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; font-family: var(--sans); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); }
.good { color: var(--lime); }
.warn { color: var(--amber); }
.bad { color: var(--red); }
.right { margin-left: auto; }
.skel { color: var(--dim); font-family: var(--mono); font-size: 12px; padding: 20px; text-align: center; }
.fade-in { animation: fade .26s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } }

/* ------------------------------------------------------------------ 响应式 */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .task-row { grid-template-columns: minmax(0, 1fr) auto; }
  .task-row > .task-scope, .task-row > .task-next { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  body { display: flex; flex-direction: column; grid-template-columns: unset; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; flex: 0 0 auto; }
  .main { flex: 1 1 auto; min-height: 0; height: auto; overflow: hidden; }  /* 仍固定窗口：主区占剩余高度，.view 内滚 */
  .brand { border-bottom: 0; padding: 12px; }
  .nav { flex-direction: row; padding: 8px; }
  .nav a { grid-template-columns: auto; grid-template-rows: auto; }
  .nav a em { display: none; }
  .nav a .ico { grid-row: auto; }
  .rail-foot { margin: 0 10px 0 auto; flex-direction: row; align-items: center; border-top: 0; }
  .rail-foot .svc { display: none; }
  .dock { left: 0; }
  .view { padding: 16px 14px 30px; }
  .cal-cell { min-height: 52px; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
