/* 步渡控制台 —— 蓝色主色 · 卡片式 · 单文件无框架 */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --line: #e7e8ec;
  --line-soft: #f0f1f3;
  --ink: #14161a;
  --ink-2: #55595f;
  --ink-3: #8b8f96;
  --primary: #14161a;
  --primary-hover: #000000;
  --primary-soft: #f1f2f4;
  --ok-bg: #e8f7ee;  --ok-fg: #147d4b;
  --err-bg: #fdeeee; --err-fg: #c0392b;
  --warn-bg: #fff6e6; --warn-fg: #a86400;
  --mute-bg: #f2f4f8; --mute-fg: #5a6478;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(24, 39, 75, 0.04), 0 6px 20px rgba(24, 39, 75, 0.05);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
code {
  font-family: var(--mono); font-size: .92em;
  background: #eef2f8; padding: 1px 5px; border-radius: 5px; color: var(--ink-2);
}

/* ---------- 顶栏 ---------- */

.top {
  position: sticky; top: 0; z-index: 9;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 1360px; margin: 0 auto; padding: 0 28px;
  height: 68px; display: flex; align-items: center; gap: 32px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.brand .name span { display: none; }

.nav { display: flex; gap: 4px; }
.nav a {
  height: 38px; display: flex; align-items: center; padding: 0 16px;
  border-radius: 9px; font-size: 14px; color: var(--ink-2);
}
.nav a:hover { color: var(--ink); background: #f3f4f6; }
.nav a.on { color: var(--ink); background: #f1f2f4; font-weight: 500; }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.top-right .quiet { font-size: 13.5px; color: var(--ink-2); }
.top-right .quiet:hover { color: var(--ink); }
.top-right form { margin: 0; }
.top-right button.quiet { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #f1f2f4; color: var(--ink);
  display: grid; place-items: center; font-size: 13px; font-weight: 600; flex: none;
}

/* ---------- 内容区 ---------- */

.wrap { max-width: 1360px; margin: 0 auto; padding: 26px 28px 84px; }

.head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.head h1 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.head p { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.head-actions { display: flex; gap: 8px; flex: none; }

/* ---------- 卡片 ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* 只在纵向堆叠时加间距，网格里的卡片必须严格对齐 */
.wrap > .card + .card,
.wrap > .card + .section,
.wrap > .section + .section,
.wrap > .section + .card { margin-top: 16px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 600; }
.card-head .sub { font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.card-body { padding: 20px; }
.card-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid var(--line-soft);
}

/* ---------- 统计 ---------- */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
}
.kpi .ico {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: #f3f4f6; color: var(--ink-2);
}
.kpi .k { font-size: 12.5px; color: var(--ink-3); }
.kpi .v { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.kpi .v small { font-size: 12px; font-weight: 400; color: var(--ink-3); }

/* 可点击的统计卡 */
a.kpi { color: inherit; transition: border-color .14s, box-shadow .14s, transform .14s; }
a.kpi:hover { border-color: #d3d5db; box-shadow: 0 2px 4px rgba(24,39,75,.05), 0 8px 24px rgba(24,39,75,.07); }
a.kpi:active { transform: translateY(1px); }
a.kpi .go {
  margin-left: auto; color: #c2c6cd; flex: none;
  display: inline-flex; transition: color .14s, transform .14s;
}
a.kpi:hover .go { color: var(--ink-2); transform: translateX(2px); }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { border-color: #d3d5da; color: var(--ink); background: #fafafa; }
.btn:focus-visible { outline: 2px solid #d4d6db; outline-offset: 1px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn.danger { color: var(--err-fg); border-color: #f6d5d2; background: #fff; }
.btn.danger:hover { background: var(--err-bg); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 表格 ---------- */

.table { width: 100%; border-collapse: collapse; }
.table th {
  font-size: 12.5px; font-weight: 500; color: var(--ink-3);
  text-align: left; padding: 10px 16px;
  background: #fafbfc; border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13px; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafafa; }
.table .right, .right { text-align: right; }
.table form { margin: 0; }

.mono { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.sub { font-size: 12px; color: var(--ink-3); }
.link { color: var(--ink); font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 徽章 ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px; border-radius: 6px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: #f3f4f6; color: #454a52;
}
/* 底色保持中性，只用一个 5px 圆点承载语义，整体仍是黑白 */
.badge::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: #9aa0a8; flex: none;
}
.b-ok::before { background: #1a9c5b; }
.b-err::before { background: #d64545; }
.b-warn::before { background: #d99100; }
.b-mute::before { background: #b3b8c0; }
.b-mute { color: var(--ink-3); }

/* ---------- 表单 ---------- */

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.panel-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft);
  font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.panel-body { padding: 20px; }
.panel-foot {
  padding: 14px 20px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field input, .field select, .inline input, .inline select {
  height: 36px; padding: 0 12px; width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px;
}
.field input:focus, .field select:focus, .inline input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px #eceef1;
}
.field input::placeholder { color: #a9b2c2; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); margin: 0; }

details.weekday { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
details.weekday summary { cursor: pointer; font-size: 13px; color: var(--ink-2); list-style: none; }
details.weekday summary::-webkit-details-marker { display: none; }
details.weekday summary::before { content: "▸ "; color: var(--ink-3); }
details.weekday[open] summary::before { content: "▾ "; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.week-grid .field { margin-bottom: 0; }

.inline { display: inline-flex; align-items: center; gap: 6px; }
.inline input { width: 11rem; height: 30px; font-size: 12.5px; }
.inline select { width: auto; height: 30px; font-size: 12.5px; }

/* ---------- 提示 ---------- */

.alert {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 14px;
}
.alert.ok { background: var(--ok-bg); color: var(--ok-fg); }
.alert.err { background: var(--err-bg); color: var(--err-fg); }
.alert.warn { background: var(--warn-bg); color: var(--warn-fg); }
.alert.info { background: #f2f3f5; color: var(--ink-2); }

/* ---------- 空状态 ---------- */

.empty { padding: 56px 24px; text-align: center; }
.empty svg { width: 36px; height: 36px; opacity: .28; margin-bottom: 12px; }
.empty .t { font-size: 14px; font-weight: 600; }
.empty .d { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.empty .a { margin-top: 16px; }

/* ---------- 分页 ---------- */

.pager { display: flex; align-items: center; gap: 8px; padding: 14px 20px; }
.pager .total { font-size: 13px; color: var(--ink-3); }
.pager .pages { display: flex; gap: 6px; margin-left: auto; }
.pager a, .pager span.pg {
  min-width: 32px; height: 32px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--ink-2); background: var(--surface);
}
.pager a:hover { border-color: #d3d5da; color: var(--ink); }
.pager .pg.on { background: #eceef1; border-color: #dfe1e6; color: var(--ink); font-weight: 500; }
.pager .pg.gap { border: none; background: none; color: var(--ink-3); }
.pager .nav { padding: 0 12px; }

/* ---------- 登录 ---------- */

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; }
.login-card .brand { justify-content: center; padding: 0 0 22px; }
.login-box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 28px; }
.login-box h1 { font-size: 17px; font-weight: 600; text-align: center; margin-bottom: 20px; }
.login-box .btn { width: 100%; height: 38px; margin-top: 6px; }
.login-tip { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 18px; line-height: 1.7; }

/* ---------- 错误页 ---------- */

.err-page { max-width: 400px; margin: 80px auto; text-align: center; }
.err-page .code { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-3); }
.err-page .msg { color: var(--ink-2); margin: 8px 0 20px; }

/* ---------- 响应式 ---------- */

@media (max-width: 1080px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .top-inner { gap: 12px; padding: 0 16px; height: 54px; }
  .brand .name span { display: none; }
  .top-right .quiet { display: none; }
  .wrap { padding: 16px 16px 48px; }
  .kpis, .grid-2 { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .head { flex-direction: column; align-items: stretch; }
  .table th, .table td { padding: 10px 12px; }
}

.nowrap { white-space: nowrap; }
.trunc { max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-1 { margin-left: 4px; }
.pager a.disabled { pointer-events: none; opacity: .4; }

/* ---------- 数据总览：一屏不滚动 ---------- */

.wrap-fill {
  height: calc(100vh - 69px - 59px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 24px;
}
/* 列表页：卡片撑满，表格区自己滚动 */
.page-fill { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fill-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fill-card .table-scroll { flex: 1; min-height: 0; overflow: auto; }
.fill-card .table td { padding: 10px 16px; overflow: hidden; }
/* 两页行高一致，文字基线才对得齐 */
.fill-card .table tbody td { height: 52px; }
.fill-card .table .sub { line-height: 1.35; }
.fill-card .table { table-layout: fixed; }
.fill-card .table th { position: sticky; top: 0; z-index: 1; }
.fill-card .card-foot {
  margin-top: auto; padding: 12px 20px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 12.5px; color: var(--ink-3);
}
.dash { display: flex; flex-direction: column; gap: 16px; flex: 1; min-height: 0; }
.dash-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; flex: none; }
.dash-charts {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.chart-card { display: flex; flex-direction: column; min-height: 0; }
.chart-card .card-head { flex: none; }
.chart { flex: 1; min-height: 0; width: 100%; }

@media (max-width: 1080px) {
  .dash-charts { grid-template-columns: 1fr; }
  .chart { min-height: 240px; }
  .wrap-dash { height: auto; overflow: visible; }
}

.chart-empty {
  height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 13px;
}

/* ---------- 固定版权条 ---------- */

.site-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
  height: 58px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2);
}
.site-foot .note { display: flex; align-items: center; gap: 8px; }
.site-foot .meta {
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-3);
  white-space: nowrap; display: flex; align-items: center; gap: 14px;
}
.site-foot .meta .sep { width: 1px; height: 12px; background: var(--line); }

@media (max-width: 720px) {
  .site-foot { padding: 0 16px; gap: 10px; height: 58px; }
  .site-foot, .site-foot .meta { font-size: 11.5px; }
  .site-foot .meta .sep { display: none; }
}

/* 固定列宽下需要省略号 */
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.card-foot .pages { display: flex; gap: 6px; }
.row-actions .btn { height: 28px; padding: 0 10px; font-size: 12.5px; }

/* ---------- 列表页工具栏 ---------- */

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid var(--line-soft);
}
.toolbar .search { position: relative; flex: 1 1 320px; min-width: 220px; }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.toolbar .search input {
  width: 100%; height: 38px; padding: 0 12px 0 36px;
  border: 1px solid var(--line); border-radius: 9px;
  font: inherit; font-size: 13.5px; background: var(--surface); color: var(--ink);
}
.toolbar .search input:focus { outline: none; border-color: #b9bec7; box-shadow: 0 0 0 3px #f0f1f3; }
.toolbar select {
  height: 38px; padding: 0 34px 0 12px;
  border: 1px solid var(--line); border-radius: 9px;
  font: inherit; font-size: 13.5px; color: var(--ink-2); background: var(--surface);
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%238b8f96' stroke-width='1.6'><path d='m4 6.5 4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.toolbar .btn { height: 38px; padding: 0 16px; font-size: 13.5px; }
.toolbar .btn.primary { border-color: var(--primary); }
.toolbar .toolbar-end { margin-left: auto; }

.subhead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 20px; border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--ink-3);
}
.subhead .btn { height: 30px; }

/* 卡片脚里的分页（与 .pager 同一套外观） */
.pages { display: flex; gap: 6px; align-items: center; }
.pages a, .pages span.pg {
  min-width: 32px; height: 32px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--ink-2); background: var(--surface);
}
.pages a:hover { border-color: #d3d5da; color: var(--ink); }
.pages .pg.on { background: #eceef1; border-color: #dfe1e6; color: var(--ink); font-weight: 500; }
.pages .pg.gap { border: none; background: none; color: var(--ink-3); }
.pages a.disabled { pointer-events: none; opacity: .4; }

.toolbar .search { flex: 1 1 320px; }

/* 冷却中的按钮：灰掉，靠 title 提示原因 */
.tip { display: inline-flex; }
.tip .btn:disabled { pointer-events: none; }

/* 状态徽章定宽，竖排才对齐 */
.badge-fix { min-width: 62px; justify-content: center; }
.gap-left { margin-left: 12px; }
.tabular { font-variant-numeric: tabular-nums; }
.task-clock { display: inline-block; min-width: 62px; color: var(--ink); }
.task-clock.muted { color: var(--ink-3); }

/* 行内「更多」菜单 */
.btn.icon { width: 30px; padding: 0; font-size: 16px; line-height: 1; letter-spacing: 1px; }
.menu-panel {
  position: fixed; z-index: 60; display: none; min-width: 132px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 28px rgba(24, 39, 75, 0.14);
}
.menu-panel.open { display: block; }
.menu-panel a, .menu-panel button {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; border-radius: 7px;
  background: none; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.menu-panel a:hover, .menu-panel button:hover { background: #f4f5f7; color: var(--ink); }
.menu-panel button.danger { color: var(--err-fg); }
.menu-panel button.danger:hover { background: var(--err-bg); }
.menu-panel form { margin: 0; }

/* 自定义下拉 */
.dd { position: relative; display: inline-flex; }
.dd-trigger { gap: 6px; }
.dd-trigger .caret {
  width: 0; height: 0; margin-left: 2px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; opacity: .5;
}
.dd-panel { min-width: 132px; width: max-content; white-space: nowrap; }
.dd-panel button.on { background: #f4f5f7; color: var(--ink); font-weight: 500; }

/* ---------- 模态框 ---------- */

.modal {
  /* 全局 *{margin:0} 会把原生 dialog 的居中干掉，这里必须显式写回 */
  margin: auto;
  width: min(620px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 64px));
  padding: 0; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.22);
  overflow: hidden;
}
.modal[open] { display: flex; flex-direction: column; }
.modal::backdrop { background: rgba(16, 24, 40, 0.32); backdrop-filter: blur(2px); }
.modal form { margin: 0; display: flex; flex-direction: column; min-height: 0; max-height: inherit; }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft); flex: none;
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.modal-x {
  width: 28px; height: 28px; border: 0; border-radius: 8px; background: none;
  font-size: 19px; line-height: 1; color: var(--ink-3); cursor: pointer;
}
.modal-x:hover { background: #f4f5f7; color: var(--ink); }

.modal-body {
  padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto; min-height: 0;
}
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 13px 20px; border-top: 1px solid var(--line-soft);
  background: #fbfbfc; flex: none;
}

.sect { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; margin-top: 2px; }
.sect:not(:first-child) { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line-soft); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.field input {
  height: 36px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 9px;
  font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface);
}
.field input:focus { outline: none; border-color: #b9bec7; box-shadow: 0 0 0 3px #f0f1f3; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.check input { width: 15px; height: 15px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 10px; }

.wd summary { font-size: 12.5px; color: var(--ink-3); cursor: pointer; }

/* ---------- 规则弹窗：时间段列表 ---------- */

.modal-wide { width: min(880px, calc(100vw - 32px)); }
.modal-sub { font-size: 12.5px; font-weight: 400; color: var(--ink-3); }
.hint { margin: 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }

.seg-head, .seg-row {
  display: grid;
  grid-template-columns: 84px 84px 1fr 1fr 1fr 1fr 32px;
  gap: 8px; align-items: center;
}
.seg-head {
  font-size: 12px; color: var(--ink-3);
  padding: 0 2px 2px; border-bottom: 1px solid var(--line-soft);
}
#seg-list { display: flex; flex-direction: column; gap: 8px; }
.seg-row input {
  height: 34px; width: 100%; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 13px; color: var(--ink); background: var(--surface);
}
.seg-row input:focus { outline: none; border-color: #b9bec7; box-shadow: 0 0 0 3px #f0f1f3; }
.seg-del {
  width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink-3); font-size: 16px; line-height: 1; cursor: pointer;
}
.seg-del:hover { background: var(--err-bg); color: var(--err-fg); border-color: #f3d6d2; }

.seg-actions { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 4px; }
.seg-actions .tz { width: 200px; }

.modal .field select {
  height: 36px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 9px;
  font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface);
}

/* ---------- 时间选择器 ---------- */

.timepick { width: 176px; padding: 8px; }
.tp-cols { display: flex; gap: 6px; height: 196px; }
.tp-col { flex: 1; overflow-y: auto; scrollbar-width: thin; }
.tp-cap {
  position: sticky; top: 0; z-index: 1; padding: 2px 0 6px;
  font-size: 11.5px; color: var(--ink-3); text-align: center; background: var(--surface);
}
.tp-col button {
  display: block; width: 100%; height: 30px; margin-bottom: 2px;
  border: 0; border-radius: 7px; background: none;
  font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.tp-col button:hover { background: #f4f5f7; color: var(--ink); }
.tp-foot { display: flex; gap: 6px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.tp-foot button {
  flex: 1; height: 28px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface); font: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.tp-foot button:hover { background: #f4f5f7; color: var(--ink); }

/* 选择器挂进 dialog 后要保持在最上层 */
.modal .timepick { z-index: 5; }

/* 角色徽章：系统管理员用深色点，和运营管理员区分开 */
.badge.b-err { color: var(--ink-2); }

/* ---------- 登录页：左品牌区 + 右表单 ---------- */

.auth-body { background: var(--surface); }

.auth { display: grid; grid-template-columns: 47% 53%; min-height: 100vh; }

.auth-left {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px 56px;
  color: #fff;
  background:
    radial-gradient(120% 90% at 78% 88%, rgba(255,255,255,.10) 0%, rgba(255,255,255,.02) 42%, transparent 68%),
    radial-gradient(80% 60% at 10% 0%, rgba(255,255,255,.07) 0%, transparent 55%),
    linear-gradient(155deg, #232830 0%, #171a1f 42%, #0b0c0e 100%);
}
/* 极细网格，给纯色一层质感 */
.auth-left::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(90% 70% at 30% 40%, #000 0%, transparent 85%);
  -webkit-mask-image: radial-gradient(90% 70% at 30% 40%, #000 0%, transparent 85%);
}
.auth-left > * { position: relative; z-index: 1; }

/* 圆点外的一团柔光，让曲线有个落点 */
.auth-left::after {
  content: ""; position: absolute; z-index: 0;
  right: 2%; bottom: 6%;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.065) 0%, transparent 68%);
  pointer-events: none;
}

.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }

.auth-hero { max-width: 460px; }
.auth-hero h1 { margin: 0; font-size: 40px; line-height: 1.28; font-weight: 600; letter-spacing: -0.02em; }
.auth-hero h1 span {
  display: block; margin-top: 14px;
  font-size: 26px; font-weight: 500;
  color: rgba(255,255,255,.74); letter-spacing: 0;
}
/* 标题下的短线，把品牌区与说明区分开 */
.auth-hero h1::after {
  content: ""; display: block;
  width: 52px; height: 1px; margin-top: 30px;
  background: rgba(255,255,255,.26);
}
.auth-hero .lede { margin: 30px 0 0; font-size: 15px; line-height: 1.85; color: rgba(255,255,255,.62); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0 0; padding: 0; list-style: none; }
.chips li {
  padding: 5px 12px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,.22);
  font-size: 12.5px; color: rgba(255,255,255,.78);
}

.auth-left-foot { margin: 0; font-size: 12.5px; color: rgba(255,255,255,.45); }

.auth-right {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 48px 24px; position: relative;
}
.auth-form { width: min(372px, 100%); }
.auth-form h2 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.auth-sub { margin: 12px 0 30px; font-size: 13.5px; color: var(--ink-3); }

.auth-form form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .field input { height: 44px; font-size: 14px; }
.auth-form .btn.block { height: 44px; width: 100%; margin-top: 6px; font-size: 14.5px; }

.auth-form .alert { margin-bottom: 18px; }

.auth-legal {
  position: absolute; left: 0; right: 0; bottom: 26px;
  text-align: center; font-size: 12px; color: var(--ink-3);
  padding: 0 24px;
}

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-left { padding: 28px 24px 34px; }
  .auth-hero h1 { font-size: 28px; }
  .auth-hero .lede, .chips { display: none; }
  .auth-left-foot { display: none; }
  .auth-right { justify-content: flex-start; padding: 40px 24px 90px; }
  .auth-legal { position: static; margin-top: 40px; }
}

/* ---------- 系统配置：状态页 ---------- */

.tabs {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px;
  background: #eceef1; border-radius: 11px;
}
.tab {
  padding: 7px 18px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink-2);
}
.tab.on { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(24,39,75,.06); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat-card { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }

.stat-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft);
}
.stat-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.stat-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-3); }
.stat-head .badge { margin-left: auto; }
.stat-ico {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  display: grid; place-items: center; background: #f3f4f6; color: var(--ink-2);
}

.stat-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 16px; }
.stat-big { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.stat-meta { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.stat-side { text-align: right; }
.stat-label { font-size: 12.5px; color: var(--ink-3); }
.stat-num { margin-top: 6px; font-size: 17px; font-weight: 500; }

.stat-rows { border-top: 1px solid var(--line-soft); }
.stat-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 20px; border-bottom: 1px solid var(--line-soft); }
.stat-row:last-child { border-bottom: 0; }
.stat-k { font-size: 12.5px; color: var(--ink-3); }
.stat-v { font-size: 13px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.stat-v b { font-weight: 600; }

.stat-actions { display: flex; gap: 10px; padding: 16px 20px; margin-top: auto; border-top: 1px solid var(--line-soft); }

.remote-card { margin-top: 16px; padding: 0; }
.remote-card .card-head { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: baseline; gap: 10px; }
.remote-card .card-head h2 { margin: 0; font-size: 14.5px; font-weight: 600; }
.remote-body { padding: 16px 20px; font-size: 13px; color: var(--ink-2); }
.remote-body p { margin: 0 0 8px; }
.remote-body p:last-child { margin-bottom: 0; }
.remote-msg { color: var(--ink); }

@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* ---------- 系统配置：二级分组标签 ---------- */

.group-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.gtab {
  padding: 6px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; color: var(--ink-2);
}
.gtab:hover { border-color: #d3d5da; color: var(--ink); }
.gtab.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.config-card { padding: 0; overflow: hidden; }
.config-list { flex: 1; min-height: 0; overflow-y: auto; }
.cfg-row {
  display: grid; grid-template-columns: 240px 1fr 300px;
  gap: 16px; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid var(--line-soft);
}
.cfg-row:last-child { border-bottom: 0; }
.cfg-label label { display: block; font-size: 13.5px; color: var(--ink); }
.cfg-label .mono { font-size: 11.5px; color: var(--ink-3); }
.cfg-control input {
  width: 100%; height: 36px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 9px;
  font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface);
}
.cfg-control input:focus { outline: none; border-color: #b9bec7; box-shadow: 0 0 0 3px #f0f1f3; }
.cfg-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.config-card .card-foot { margin-top: auto; border-top: 1px solid var(--line-soft); }

@media (max-width: 1160px) {
  .cfg-row { grid-template-columns: 1fr; gap: 6px; }
}

/* 规则弹窗：列头单位 + 输入框后缀 + 固定高度 */
.seg-head i { font-style: normal; color: var(--ink-3); margin-left: 4px; font-size: 11.5px; }
.seg-unit { position: relative; display: block; }
.seg-unit input { padding-right: 30px; }
.seg-unit em {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-style: normal; font-size: 11.5px; color: var(--ink-3); pointer-events: none;
}
.seg-actions .seg-count { font-size: 12.5px; color: var(--ink-3); margin-left: auto; margin-right: 8px; }

/* 固定高度：加行减行时模态框不跳动 */
#rule-dialog .modal-body { min-height: 336px; }
#seg-list { min-height: 0; }
.seg-del:disabled { opacity: .35; cursor: not-allowed; }
.seg-del:disabled:hover { background: var(--surface); color: var(--ink-3); border-color: var(--line); }
#seg-add:disabled { opacity: .45; cursor: not-allowed; }

.seg-total {
  font-size: 12.5px; color: var(--ink-2); font-family: var(--mono);
  padding: 4px 10px; border-radius: 7px; background: var(--primary-soft);
  margin-right: 12px;
}

/* 页码跳转 */
.card-foot .jump { display: flex; align-items: center; gap: 6px; margin-left: 6px; }
.card-foot .jump input {
  width: 64px; height: 32px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; font-size: 13px; text-align: center; color: var(--ink);
  background: var(--surface);
  -moz-appearance: textfield;
}
.card-foot .jump input::-webkit-outer-spin-button,
.card-foot .jump input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.card-foot .jump input:focus { outline: none; border-color: #b9bec7; box-shadow: 0 0 0 3px #f0f1f3; }
.card-foot .jump .btn { height: 32px; padding: 0 12px; font-size: 13px; }

/* ---------- 浮动提示 ---------- */

.toast {
  position: fixed; z-index: 80;
  right: 24px; bottom: 78px;
  display: flex; align-items: flex-start; gap: 10px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 12px 12px 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-3);
  border-radius: 11px;
  box-shadow: 0 10px 32px rgba(16, 24, 40, 0.14);
  font-size: 13px; line-height: 1.6; color: var(--ink);
  animation: toast-in .18s ease-out;
}
.toast.err { border-left-color: #d64545; }
.toast.ok { border-left-color: #1a9c5b; }
.toast.out { opacity: 0; transform: translateY(4px); transition: opacity .18s, transform .18s; }
.toast-x {
  flex: none; width: 22px; height: 22px; margin-left: auto;
  border: 0; border-radius: 6px; background: none;
  font-size: 16px; line-height: 1; color: var(--ink-3); cursor: pointer;
}
.toast-x:hover { background: #f4f5f7; color: var(--ink); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .toast { left: 16px; right: 16px; bottom: 74px; max-width: none; }
}

/* 规则弹窗底部：左侧加行，右侧总步数与操作 */
#rule-dialog .modal-foot { justify-content: space-between; }
.modal-foot .foot-left, .modal-foot .foot-right { display: flex; align-items: center; gap: 10px; }
.modal-foot .seg-count { font-size: 12.5px; color: var(--ink-3); }
.seg-actions { display: none; }

/* 页脚的 commit 号：点开跳到仓库对应提交 */
.site-foot .repo-link {
  font-family: var(--mono); color: var(--ink-3);
  border-bottom: 1px solid transparent;
  transition: color .12s, border-color .12s;
}
.site-foot .repo-link:hover { color: var(--ink); border-bottom-color: var(--line); }

/* 角色不是状态，不配颜色也不带圆点 */
.badge.plain::before { display: none; }
.badge.plain { color: var(--ink-2); }

/* ---------- 右上角用户菜单 ---------- */

.user-chip {
  display: flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 10px 0 4px;
  border: 1px solid transparent; border-radius: 999px;
  background: none; font: inherit; font-size: 13.5px; color: var(--ink-2);
  cursor: pointer;
}
.user-chip:hover { background: #f4f5f7; color: var(--ink); }
.user-chip .user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .caret {
  width: 0; height: 0; margin-left: 2px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; opacity: .45;
}

.user-panel { min-width: 148px; }
.user-panel button { display: block; width: 100%; text-align: left; }

/* ---------- 状态页：撑满一屏 ---------- */

.status-fill { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.status-fill .stat-grid { grid-template-columns: 1.25fr 1fr; flex: none; }
.status-fill .stat-card { display: flex; flex-direction: column; }

/* 最近执行：吃掉剩余高度，内容多就在内部滚动 */
.recent-card { flex: 1; min-height: 180px; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.recent-card .card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 13px 20px; border-bottom: 1px solid var(--line-soft); flex: none;
}
.recent-card .card-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.recent-list { flex: 1; min-height: 0; overflow-y: auto; }
.recent-list .table { table-layout: fixed; }
.recent-list .table td { height: 44px; padding: 0 20px; }
.recent-list .table th { padding: 9px 20px; }
.recent-empty { padding: 18px 20px; font-size: 13px; }

/* 远程更新：只保留最近一条，一行读完 */
.remote-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px; flex: none;
}
.remote-label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.remote-text { font-size: 13px; color: var(--ink-2); }
.remote-hint { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }

@media (max-width: 1080px) {
  .status-fill .stat-grid { grid-template-columns: 1fr; }
  .remote-bar { flex-wrap: wrap; }
  .remote-hint { margin-left: 0; }
}
