﻿/* ============================================================
   轮岗排班 — 「清爽工作台」v27
   顶部分段：轮岗循环（默认） / AB 组排班
   ============================================================ */

/* ============ 头部：两行 grid ============ */
header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
  row-gap: 9px;
  align-items: center;
}
header h1 { font-size: 18px; }
header .head-actions {
  grid-column: 1 / 3;
  display: flex;
  gap: 7px;
  align-items: center;
}
header > div[style] { justify-self: end; }

.badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .03em;
}
.badge-on { background: rgba(34, 197, 94, .16); color: #86efac; border: 1px solid rgba(134, 239, 172, .35); }
.badge-off { background: rgba(251, 191, 36, .14); color: #fcd34d; border: 1px solid rgba(252, 211, 77, .35); }

/* 头部操作按钮（线性图标 + 文字） */
.head-actions .btn {
  flex: 1;
  justify-content: center;
  font-size: 13px;
  padding: 9px 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.head-actions .btn svg { width: 15px; height: 15px; flex: none; }
.head-actions .btn-light {
  background: rgba(255, 255, 255, .09);
  border-color: rgba(226, 232, 240, .26);
  color: #d7e2f4;
}
.head-actions .btn-light:active { background: rgba(255, 255, 255, .2); }
.head-actions .back-link {
  flex: 1;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(226, 232, 240, .26);
}
.head-actions .back-link svg { width: 15px; height: 15px; }

/* ============ 顶部分段切换 ============ */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px;
  gap: 2px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.seg button {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-2);
  padding: 10px 8px;
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background .15s, color .15s;
}
.seg button svg { width: 16px; height: 16px; }
.seg button.on {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 6px 14px rgba(12, 31, 66, .28);
}

/* ============ 轮岗卡 ============ */
.rot-card { position: relative; overflow: hidden; }
.rot-card::before {
  content: "";
  position: absolute; left: 0; top: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #1d4ed8, #0ea5e9 55%, rgba(14, 165, 233, 0));
}
.rot-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.rot-card h2 {
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
}
.sec-ic {
  width: 28px; height: 28px;
  border-radius: 10px;
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.sec-ic svg { width: 16px; height: 16px; }
.run-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: var(--ink-3);
  border: 1px solid var(--line);
  white-space: nowrap;
  flex: none;
}
.run-pill i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-3);
}
.run-pill.on {
  color: #16a34a;
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.run-pill.on i {
  background: #22c55e;
  animation: pulseDot 1.8s infinite;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); }
  70% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ---- 三岗位瓷砖 ---- */
.rot-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.rot-tile {
  border-radius: 13px;
  padding: 10px 9px 11px;
  border: 1px solid;
}
.rt-top {
  display: flex;
  align-items: center;
  gap: 5px;
}
.rt-ic {
  width: 23px; height: 23px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.rt-ic svg { width: 13px; height: 13px; }
.rt-label { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.rt-left {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rt-name {
  font-size: 17px;
  font-weight: 900;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.rt-swap {
  font-size: 11px;
  margin-top: 1px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rt-bar {
  height: 5px;
  border-radius: 99px;
  background: rgba(15, 23, 42, .08);
  margin-top: 7px;
  overflow: hidden;
}
.rt-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  transition: width .5s linear;
}
.rot-tile-blue  { background: var(--blue-soft); border-color: var(--blue-line); }
.rot-tile-blue .rt-ic { background: rgba(37,99,235,.12); color: #1d4ed8; }
.rot-tile-blue .rt-label { color: #1d4ed8; }
.rot-tile-blue .rt-left, .rot-tile-blue .rt-swap { color: #1e40af; }
.rot-tile-blue .rt-bar i { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.rot-tile-green { background: var(--green-soft); border-color: var(--green-line); }
.rot-tile-green .rt-ic { background: rgba(21,128,61,.12); color: var(--green); }
.rot-tile-green .rt-label { color: var(--green); }
.rot-tile-green .rt-left, .rot-tile-green .rt-swap { color: #065f46; }
.rot-tile-green .rt-bar i { background: linear-gradient(90deg, #22c55e, #4ade80); }
.rot-tile-red   { background: var(--red-soft); border-color: var(--red-line); }
.rot-tile-red .rt-ic { background: rgba(220,38,38,.1); color: #b91c1c; }
.rot-tile-red .rt-label { color: #b91c1c; }
.rot-tile-red .rt-left, .rot-tile-red .rt-swap { color: #991b1b; }
.rot-tile-red .rt-bar i { background: linear-gradient(90deg, #ef4444, #f87171); }

/* ---- 休息区 ---- */
.rot-rest-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-2);
}
.rest-label { font-weight: 800; flex: none; }
.rest-tip {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
}
.rest-person {
  display: inline-block !important;
  padding: 4px 12px !important;
  background: #f1f5f9 !important;
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  margin: 2px !important;
  cursor: pointer !important;
  font-size: 13px !important;
  color: var(--ink-2) !important;
  font-weight: 700;
}

/* ---- 换岗预告（紧凑两列，首屏可见未来 6 次） ---- */
.pv-title {
  font-size: 13.5px;
  font-weight: 800;
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.pv-title::before {
  content: "";
  width: 4px; height: 13px; border-radius: 2px;
  background: linear-gradient(180deg, #f59e0b, #f97316);
}
#rotPreview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
#rotPreview > div {
  background: #f8fafc !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  padding: 8px 11px !important;
  margin-bottom: 0 !important;
}
#rotPreview > div > div:first-child { font-size: 13px !important; line-height: 1.35; }
#rotPreview > div > div:last-child { font-size: 11.5px !important; margin-top: 2px !important; }
#rotPreview > div[style*="eff6ff"] {
  background: var(--blue-soft) !important;
  border-color: var(--blue-line) !important;
  box-shadow: inset 3px 0 0 var(--blue-2);
}
#rotPreview > div[style*="9ca3af"] {
  grid-column: 1 / 3;
  background: transparent !important;
  border: 0 !important;
  padding: 16px !important;
}
#rotPreview #rotToggleBtn {
  grid-column: 1 / 3;
  background: transparent !important;
  border: 0 !important;
  padding: 7px !important;
  font-size: 12.5px !important;
}

/* ---- 折叠设置盒 ---- */
.setup-details {
  margin-top: 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  background: #f8fafc;
  overflow: hidden;
}
.setup-details summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 7px;
  user-select: none;
}
.setup-details summary::-webkit-details-marker { display: none; }
.sd-arrow {
  color: var(--blue);
  font-size: 12px;
  transition: transform .15s;
  display: inline-block;
}
.setup-details[open] .sd-arrow { transform: rotate(90deg); }
.setup-sum {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.setup-body { padding: 0 14px 13px; }
.rot-setup {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 11px;
}
.rot-setup label { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 4px; }
.rot-setup #rotMin { width: 62px; padding: 7px 8px; }
.rot-setup .btn {
  margin-left: auto;
  padding: 9px 18px;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rot-setup .btn svg { width: 13px; height: 13px; }
.rot-pick-hint { font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; font-weight: 600; }
#rotPeople { display: flex; flex-wrap: wrap; gap: 6px; }

/* JS 内联色覆盖：未选/已选 */
.rot-pick {
  padding: 7px 13px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  transition: transform .05s !important;
}
.rot-pick:active { transform: scale(.95) !important; }
#rotPeople .rot-pick[style*="background:#fff"],
#rotPeople .rot-pick[style*="background: rgb(255"] {
  background: #f1f5f9 !important;
  color: var(--ink-2) !important;
  border: 1px solid var(--line) !important;
}
#rotPeople .rot-pick[style*="2563eb"] {
  background: var(--blue-2) !important;
  color: #fff !important;
  border: 1px solid var(--blue-2) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .3) !important;
}

/* ============ AB 组排班（卡片化表格 + 自定义下拉） ============ */
.sbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 13px;
}
.sfield {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.sfield:focus-within {
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.sfield input {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  outline: none;
  width: 52px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.sfield input[type="time"] { width: 92px; }
.sfield input[type="time"]::-webkit-datetime-edit { padding: 0; }
.sfield input[type="time"]::-webkit-calendar-picker-indicator {
  width: 15px; height: 15px; margin: 0 0 0 2px; cursor: pointer; opacity: .6;
}
.sfield input[type="number"]::-webkit-inner-spin-button,
.sfield input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sfield input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.sbar-apply {
  margin-left: auto;
  padding: 9px 22px;
  border-radius: 10px;
  font-size: 13.5px;
}

/* 行卡片化 */
.sched-table { width: 100%; border-collapse: separate; border-spacing: 0 7px; font-size: 13.5px; }
.sched-table th {
  text-align: left;
  color: var(--ink-3);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .1em;
  padding: 0 12px 2px;
  background: transparent;
}
.sched-table th:nth-child(2), .sched-table th:nth-child(3) { text-align: right; }
.sched-table td {
  padding: 10px 12px;
  background: #f8fafc;
  border-top: 1px solid #eef2f7;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}
.sched-table td:first-child {
  border-left: 1px solid #eef2f7;
  border-radius: 12px 0 0 12px;
  text-align: left;
}
.sched-table td:last-child {
  border-right: 1px solid #eef2f7;
  border-radius: 0 12px 12px 0;
  text-align: right;
}
.sched-table td:nth-child(2) { text-align: right; }
.sched-time { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sched-nowtag {
  display: inline-block;
  margin-left: 7px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: #16a34a;
  border-radius: 99px;
  padding: 1px 7px;
  vertical-align: 1px;
}
.sched-table tr.isnow td { background: var(--blue-soft); border-color: var(--blue-line); }
.sched-table tr.isnow td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.sched-table tr.isperson td { background: #fff7ed; border-color: #fed7aa; }
.sched-table tr.isperson td:first-child { box-shadow: inset 3px 0 0 #ea580c; }

/* 班组圆点 */
.grp2 { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; white-space: nowrap; flex-wrap: nowrap; }
.grp2 i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.grp2.a { color: #1d4ed8; }
.grp2.a i { background: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.grp2.b { color: #c2410c; }
.grp2.b i { background: #ea580c; box-shadow: 0 0 0 3px rgba(234, 88, 12, .15); }
.sched-table tr.isperson .grp2 { opacity: .4; }

/* 自定义下拉 */
.pselect { position: relative; display: inline-block; text-align: left; }
.ps-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
  background: #fff;
  border: 1px solid #d3dce8;
  border-radius: 9px;
  padding: 6px 9px 6px 10px;
  cursor: pointer;
  min-width: 96px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.ps-btn:hover { border-color: #94a3b8; }
.ps-btn .ps-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-btn .chev { margin-left: auto; color: var(--ink-3); transition: transform .18s; display: inline-flex; flex: none; }
.ps-autoico { width: 15px; height: 15px; border-radius: 50%; border: 2px dashed #cbd5e1; flex: none; }
.pselect.open .ps-btn { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); color: var(--ink); }
.pselect.open .chev { transform: rotate(180deg); }
.ps-btn.filled { background: #fffaf3; border-color: #fed7aa; color: #9a3412; font-weight: 800; }
.ps-btn.filled:hover { border-color: #fb923c; }
.ps-btn.filled .chev { color: #ea580c; }
.ps-x {
  width: 16px; height: 16px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fed7aa; color: #9a3412; font-size: 11px; line-height: 1;
  padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.ps-x:hover { background: #fb923c; color: #fff; }
.ps-ava {
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; flex: none;
}
.ps-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  min-width: 168px;
  background: #fff;
  border: 1px solid #e8edf4;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .06);
  padding: 5px;
  max-height: 352px;
  overflow-y: auto;
}
.pselect.open .ps-panel { display: block; animation: psIn .14s ease-out; }
.pselect.up .ps-panel { top: auto; bottom: calc(100% + 6px); }
@keyframes psIn {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.pselect.up.open .ps-panel { animation-name: psInUp; }
@keyframes psInUp {
  from { opacity: 0; transform: translateY(4px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.ps-sep { font-size: 10.5px; color: var(--ink-3); font-weight: 800; letter-spacing: .08em; padding: 6px 9px 3px; }
.ps-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 9px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.ps-opt:hover { background: var(--blue-soft); }
.ps-opt .tick { margin-left: auto; color: var(--blue); font-weight: 900; visibility: hidden; }
.ps-opt.sel .tick { visibility: visible; }
.ps-opt .ps-name { overflow: hidden; text-overflow: ellipsis; }
.ps-opt .ps-dashed { width: 20px; height: 20px; border-radius: 50%; border: 2px dashed #cbd5e1; flex: none; }

.sched-toggle {
  text-align: center;
  padding: 10px;
  cursor: pointer;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}
.sched-toggle:active { color: #1e40af; }
.cur-hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-2);
  text-align: center;
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 10px;
}
.cur-hint b { color: var(--blue); }

/* ============ 开始时间弹窗 ============ */
.rot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 42, .55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
}
.rot-overlay.show { display: flex; }
.rot-overlay-box {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  width: 100%;
  max-width: 330px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  margin: auto;
  box-shadow: var(--shadow-pop);
  animation: modalPop .16s ease-out;
}
@supports (height: 100dvh) {
  .rot-overlay-box { max-height: calc(100dvh - 36px); }
}
.rot-overlay-box h3 { font-size: 16px; font-weight: 800; margin-bottom: 15px; text-align: center; }
#rotStartInput {
  width: 100%;
  padding: 11px;
  font-size: 20px !important;
  font-weight: 800;
  text-align: center;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.rot-quick-grid { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; margin-bottom: 12px; align-items: center; }
.rot-shift {
  width: 44px; height: 44px;
  background: var(--blue-soft) !important;
  color: var(--blue) !important;
  border: 1px solid var(--blue-line) !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  line-height: 1;
  flex-shrink: 0;
}
.rot-shift:active { transform: scale(.94); }
.rot-overlay-actions { display: flex; gap: 8px; }
.rot-overlay-actions .btn { flex: 1; padding: 11px; }

/* ============================================================
   手机适配
   ============================================================ */
@media (max-width: 480px) {
  header > div:first-child { flex: 1 1 auto; min-width: 0; }
  header > div[style] { order: 2; }
  header .head-actions { order: 3; }
  header .head-actions .btn,
  header .head-actions .back-link { min-height: 38px; }

  .seg button { font-size: 13.5px; padding: 9px 6px; }

  /* 三岗瓷砖压窄，剩余时间放不下时落到第二行 */
  .rot-tiles { gap: 6px; }
  .rot-tile { padding: 8px 7px 9px; border-radius: 11px; }
  .rt-top { gap: 4px; flex-wrap: wrap; row-gap: 1px; }
  .rt-ic { width: 19px; height: 19px; border-radius: 7px; }
  .rt-ic svg { width: 11px; height: 11px; }
  .rt-label { font-size: 11px; }
  .rt-left { font-size: 10.5px; }
  .rt-name { font-size: 15px; margin: 3px 0 2px; }
  .rt-swap { font-size: 10.5px; }
  .rt-bar { height: 4px; margin-top: 6px; }

  /* AB 段 tab 手机端：允许换行，缩 padding */
  .ab-seg-tabs { gap: 5px; }
  .ab-seg { padding: 6px 9px; font-size: 12px; border-radius: 8px; }
  .ab-seg-no { font-size: 12px; }
  .ab-seg-info { font-size: 11px; }

  /* AB 设置条手机端：允许换行，删除段掉到第二行 */
  .sbar { flex-wrap: wrap; gap: 6px; row-gap: 6px; }
  .sbar .sfield { padding: 6px 8px; gap: 4px; font-size: 12px; min-width: 0; flex: 1 1 auto; }
  .sbar .sfield input { width: 42px; font-size: 12.5px; }
  .sbar .sfield input[type="time"] { width: 84px; }
  .sbar-apply { padding: 8px 14px; font-size: 13px; flex: 0 0 auto; }
  .sbar-del { flex: 1 1 100%; font-size: 12px; padding: 7px; }

  /* 统计按钮缩成紧凑样式 */
  .ab-stats-btn { padding: 4px 8px; font-size: 12px; }

  .sched-table { font-size: 12.5px; }
  .sched-table th { padding: 0 8px 2px; }
  .sched-table td { padding: 9px 8px; }
  .ps-btn { min-width: 84px; font-size: 12px; padding: 6px 8px; gap: 5px; }
  .ps-panel { min-width: 158px; }
  .rest-tip { flex-basis: 100%; margin-left: 0; }
}

@media (max-width: 360px) {
  .rt-ic { width: 20px; height: 20px; }
  .rt-label { font-size: 10.5px; }
  .rt-name { font-size: 14.5px; }
  .rt-swap, .rt-left { font-size: 10px; }
  .rot-tile { padding: 9px 7px 10px; }
  .rot-setup .btn { margin-left: 0; width: 100%; justify-content: center; }
  .sched-table { font-size: 12px; }
  .sched-table td { padding: 8px 6px; }
  .grp2 { font-size: 12px; gap: 5px; }
  .ps-btn { min-width: 0; padding: 6px 7px; gap: 4px; }
  .ps-btn.filled .ps-ava, .ps-btn.filled .chev { display: none; }
  .sbar .sfield { padding: 6px 7px; }
  .sbar .sfield .sf-start, .sbar .sfield .sf-each { display: none; }
  .sbar .sfield input { width: 40px; }
  .sbar .sfield input[type="time"] { width: 82px; }
  .sbar-apply { padding: 8px 12px; }
  .ab-seg-info { display: none; }
  .seg button { font-size: 12.5px; gap: 5px; }
}

/* 兼容：旧班组卡（如后续启用） */
.group-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; margin-bottom: 12px; background: #fff; }
.group-card.g-a { border-left: 4px solid var(--blue); }
.group-card.g-b { border-left: 4px solid var(--orange); }
.btn-a { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 3px 10px rgba(29, 78, 216, .25); }
.btn-b { background: var(--orange); color: #fff; border-color: var(--orange); box-shadow: 0 3px 10px rgba(234, 88, 12, .22); }
.btn-off { background: #e2e8f0; color: var(--ink-2); border-color: #cbd5e1; }

/* ============ 多段切换 ============ */
.ab-seg-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.ab-seg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: #374151;
  transition: all .15s;
}
.ab-seg:hover { border-color: #93c5fd; color: #1d4ed8; }
.ab-seg.sel {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}
.ab-seg-no { font-weight: 600; font-size: 13px; }
.ab-seg-info { font-size: 12px; color: inherit; opacity: .75; }
.ab-seg-add {
  border-style: dashed;
  color: #6b7280;
}
.ab-seg-add:hover { border-color: #3b82f6; color: #3b82f6; }
.sbar-del {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
  font-size: 13px;
}

/* ============ 间隙排班统计 ============ */
.ab-h2 { display: flex; align-items: center; gap: 8px; }
.ab-stats-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.ab-stats-btn:hover { background: #e5e7eb; color: #111; }
.ab-stats-box { max-width: 420px; max-height: 80vh; }
.ab-stats-box h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 16px 0;
}
.ab-stats-close[aria-label] {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
}
.ab-stats-close[aria-label]:hover { color: #111; }
.ab-stats-content { overflow-y: auto; max-height: 60vh; }
.ab-stat-person {
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}
.ab-stat-person:last-of-type { border-bottom: none; }
.ab-stat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.ab-stat-name { font-weight: 600; font-size: 14px; color: #111; }
.ab-stat-count {
  margin-left: auto;
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 10px;
}
.ab-stat-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0 26px;
}
.ab-stat-list li {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 13px;
  color: #4b5563;
}
.ab-stat-list li.ab-stat-date {
  justify-content: flex-start;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e5e7eb;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.ab-stat-seg {
  font-size: 11px;
  color: #3b82f6;
  background: #eff6ff;
  padding: 1px 7px;
  border-radius: 8px;
}
.ab-stat-del {
  background: transparent;
  border: none;
  color: #d1d5db;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 6px;
  margin-left: auto;
  transition: color .15s;
}
.ab-stat-del:hover { color: #dc2626; }
.ab-stat-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
}
