/* ============================================================
   岗位看板专属样式 — 方案 AC（极简骨架 + 班组温度）v29
   深蓝英雄条 · 状态色条卡片 · 头像 · 堆叠时长条 · 手机4列
   ============================================================ */

.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* 岗位看板比普通页更宽（桌面 4 列台位） */
.wrap { max-width: 960px; }

/* ============ 英雄条 ============ */
.kb-hero {
  position: relative;
  padding: 14px 16px 13px;
  background: linear-gradient(120deg, #0b2a6b 0%, #16399c 55%, #1d4fd8 100%);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 4px 0 14px;
  box-shadow: var(--shadow-pop);
}
.kb-hero::before { display: none; }
.kb-hero::after {
  content: "";
  position: absolute;
  right: -46px; top: -70px;
  width: 190px; height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  pointer-events: none;
}
.h-row1 { position: relative; display: flex; align-items: center; gap: 9px; padding-right: 104px; }
.h-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255, 255, 255, .16);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.h-mark svg { width: 16px; height: 16px; }
.h-title { font-size: 18px; font-weight: 800; color: #fff; letter-spacing: .01em; }
.h-title::before { display: none; }

/* auth.js 注入的用户条：固定英雄条右上 */
.kb-hero > div[style] {
  position: absolute !important;
  top: 13px; right: 14px;
  margin: 0 !important;
  font-size: 12px !important;
  z-index: 2;
}
.kb-hero > div[style] > span {
  color: #dbe7ff !important;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(226, 232, 240, .22);
}
.kb-hero #logoutBtn { color: #fecdd3 !important; }

.h-row2 {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  margin-top: 10px;
  font-size: 12px; font-weight: 600;
  color: #cfe0ff;
  flex-wrap: wrap;
}
.live { display: inline-flex; align-items: center; gap: 6px; color: #bbf7d0; }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: liveBlink 1.6s infinite;
}
@keyframes liveBlink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.h-date { color: #cfe0ff; }
.h-count b { color: #fff; font-weight: 800; }
.h-actions { margin-left: auto; display: flex; gap: 6px; }
.hbtn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700;
  padding: 7px 11px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .12);
  color: #fff; text-decoration: none;
  cursor: pointer; white-space: nowrap;
}
.hbtn svg { width: 13px; height: 13px; flex: none; }
.hbtn-white { background: #fff; border-color: #fff; color: #1d4ed8; }
.hbtn-red { color: #fecdd3; }
.hbtn .ico-only { display: none; }

/* ============ 区块标题 ============ */
.sec-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 2px 2px 9px;
}
.sec-title {
  font-size: 14px; font-weight: 800; color: var(--ink);
  letter-spacing: .01em;
}
.sec-title::before { display: none; }
.sec-sub { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.legend {
  margin-left: auto;
  display: flex; gap: 11px;
  font-size: 11px; color: var(--ink-3); font-weight: 600;
}
.legend i {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; margin-right: 4px; vertical-align: 1px;
}

/* ============ 台位卡 ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.sc {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px 10px 9px;
  min-height: 112px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex; flex-direction: column;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.sc:hover { border-color: var(--line-strong); }
.sc:active { transform: scale(.97); }
.sc::before {
  content: "";
  position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: transparent;
}
.sc.on::before { background: #059669; }
.sc.near::before { background: #d97706; }
.sc.over::before { background: var(--red); }
.sc-top { display: flex; align-items: center; gap: 6px; }
.st-ic {
  width: 21px; height: 21px; border-radius: 7px;
  background: var(--blue-soft); color: #1d4ed8;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; flex: none;
}
.sc-name {
  font-size: 11.5px; font-weight: 800; color: var(--ink-3);
  letter-spacing: .04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.sc-mid { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.ava {
  width: 26px; height: 26px; border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 800; flex: none;
  box-shadow: 0 2px 5px rgba(15, 23, 42, .18);
}
.sc-person {
  font-size: 13.5px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.sc-time {
  font-size: 23px; font-weight: 800;
  margin-top: 3px; line-height: 1.1;
}
.sc.near .sc-time { color: #b45309; }
.sc.over .sc-time { color: var(--red); }
.plan-note {
  display: flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700;
  color: var(--amber); background: var(--amber-soft);
  border-radius: 6px; padding: 3px 6px; margin-top: 6px;
  line-height: 1.3;
}
.plan-note svg { width: 11px; height: 11px; flex: none; }
.bar {
  height: 4px; background: #eef0f4;
  border-radius: 99px; margin-top: 8px;
  overflow: hidden;
}
.bar .progress-bar {
  display: block; height: 100%; border-radius: 99px;
  transition: width .6s linear;
}
@keyframes scOverPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .32); }
  50%      { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); }
}
.sc.over { animation: scOverPulse 1.4s ease-in-out infinite; }

/* 空闲 */
.sc.empty {
  border: 1.5px dashed var(--line-strong);
  background: #fafbfc;
  box-shadow: none;
}
.sc.empty .sc-top { margin-bottom: 2px; }
.sc.empty .st-ic { background: #f1f3f7; color: #a3abb9; }
.empty-body { display: flex; align-items: center; gap: 8px; margin: auto 0; }
.plus {
  width: 26px; height: 26px; border-radius: 8px;
  border: 1.5px dashed #b6bcc7;
  display: flex; align-items: center; justify-content: center;
  color: #9aa2b0; font-size: 16px; flex: none;
}
.empty-tx { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.empty-tx small { display: block; font-size: 10.5px; font-weight: 500; color: #aab1bd; margin-top: 1px; }

/* 预约 */
.sc.planned {
  border: 1.5px dashed #e3b341;
  background: var(--amber-soft);
  box-shadow: none;
}
.sc.planned::before { background: #d97706; }
.sc.planned .st-ic { background: #fef3c7; color: #b45309; }
.book-mid { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.book-person {
  font-size: 13px; font-weight: 800; color: #92600a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.book-time { font-size: 21px; font-weight: 800; color: var(--amber); margin-top: 3px; line-height: 1.1; }
.book-cd {
  font-size: 10.5px; font-weight: 700; color: #b07c1a;
  margin-top: auto; padding-top: 6px;
}

/* ============ 今日时长 ============ */
.stats {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.st-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
  font-size: 11px; font-weight: 600; color: var(--ink-3);
}
.st-legend span { display: inline-flex; align-items: center; gap: 5px; }
.st-legend i { width: 8px; height: 8px; border-radius: 3px; }
.srow {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f3f6;
}
.srow:last-child { border-bottom: 0; }
.medal {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  background: #f1f3f8; color: var(--ink-3);
}
.medal.n1 { background: linear-gradient(135deg, #fde047, #f59e0b); color: #7c2d12; }
.medal.n2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #374151; }
.medal.n3 { background: linear-gradient(135deg, #fdba74, #c2410c); color: #fff; }
.s-main { flex: 1; min-width: 0; }
.s-top { display: flex; align-items: center; gap: 7px; }
.s-name { font-size: 13.5px; font-weight: 800; }
.tag {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px; white-space: nowrap;
}
.tag.a { background: var(--blue-soft); color: #1e40af; }
.tag.b { background: #ffedd5; color: #9a3412; }
.tag.j { background: #dcfce7; color: #166534; }
.tag.meal { background: #fef3c7; color: #92400e; cursor: pointer; }
.tag-add {
  font-size: 10px; font-weight: 700; color: var(--ink-3);
  background: #f1f3f7; border: 0; border-radius: 99px;
  padding: 2px 8px; cursor: pointer;
}
.s-total {
  font-size: 16px; font-weight: 800;
  white-space: nowrap; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.s-total:hover { color: #1d4ed8; }
.s-total svg { width: 11px; height: 11px; opacity: 0; color: var(--ink-3); transition: .15s; }
.s-total:hover svg { opacity: 1; }
.sbar {
  display: flex; height: 5px;
  border-radius: 99px; overflow: hidden;
  margin: 6px 0 4px; background: #f1f3f6;
}
.sbar i { height: 100%; }
.s-detail {
  font-size: 11px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.s-detail b { color: var(--ink-2); font-weight: 600; }
.stats-empty { color: #9ca3af; font-size: 13px; text-align: center; padding: 22px; }

.foot-note { text-align: center; font-size: 11px; color: #aab1bd; margin-top: 16px; font-weight: 600; }

/* ============ 弹窗（覆盖 style.css，手机底部抽屉） ============ */
.modal-mask.show { padding: 18px; }
.modal {
  padding: 0;
  border-radius: 15px;
  max-width: 345px;
}
.m-grab { display: none; }
.m-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 15px 17px 5px;
}
.m-title { font-size: 15px; font-weight: 800; margin: 0; }
.m-x {
  width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); cursor: pointer; font-size: 13px; flex: none;
}
.m-x:hover { background: #f1f3f7; color: var(--ink); }
.m-body { padding: 6px 17px 17px; }
.m-clock {
  text-align: center;
  padding: 12px 0 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fafbfd;
}
.m-person {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13.5px; font-weight: 700; color: var(--ink-2);
  margin-bottom: 6px;
}
.m-time { font-size: 44px; font-weight: 800; line-height: 1; }
.m-actions { display: flex; gap: 8px; margin-top: 12px; }
.m-actions:only-child { margin-top: 4px; }
.m-btn { flex: 1; padding: 11px; border-radius: 10px; font-size: 13.5px; font-weight: 800; }
.m-planline {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  margin-bottom: 9px;
}
.m-planline input { padding: 7px 9px; font-size: 13px; }
.m-btn-mini { width: auto; flex: none; padding: 7px 11px; font-size: 12px; }
.m-desc { font-size: 11.5px; color: var(--ink-3); margin: 0 0 8px; font-weight: 600; }

/* 选人行（style.css 已有基础，微调去外框感） */
#personList .person-row {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f3f6;
  border: 0;
  border-radius: 0;
  margin-bottom: 0;
  background: transparent;
}
#personList .person-row:first-child { border-radius: 11px 11px 0 0; }
#personList .person-row:last-child { border-radius: 0 0 11px 11px; }
#personList .person-row:hover { background: #fafbfd; }
#personList .person-row > span:first-child {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px;
}

/* 标签弹窗按钮组 */
.tag-grid { display: flex; flex-direction: column; gap: 9px; }
.tag-grid .btn { width: 100%; min-height: 40px; }
.tag-btn-a { background: var(--blue-soft) !important; color: #1e40af !important; border-color: var(--blue-line) !important; }
.tag-btn-b { background: #ffedd5 !important; color: #9a3412 !important; border-color: #fed7aa !important; }
.tag-btn-j { background: #dcfce7 !important; color: #166534 !important; border-color: var(--green-line) !important; }
.tag-btn-none { background: #f1f5f9 !important; color: var(--ink-2) !important; border-color: var(--line) !important; }

/* 日志列表 */
.log-list { max-height: 400px; overflow-y: auto; font-size: 12px; color: #374151; line-height: 1.8; }
.log-row { padding: 6px 0; border-bottom: 1px solid #f3f4f6; }
.log-row .lt { color: var(--ink-3); font-size: 11px; margin-right: 5px; }

/* 修改时长弹窗（方案B：单行列表，头尾固定、中间滚动） */
#editTimeModal .modal { max-width: 480px; display: flex; flex-direction: column; }
#editTimeModal .m-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#editTimeList {
  flex: 1; min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.et-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid #f1f3f6;
}
.et-row:last-child { border-bottom: 0; }
.et-name {
  width: 74px; flex: none;
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.et-val {
  width: 60px; flex: none; text-align: right;
  font-size: 15px; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.et-val small { font-size: 10.5px; color: var(--ink-3); font-weight: 600; margin-left: 2px; }
.et-btns { flex: 1; display: flex; gap: 6px; min-width: 0; }
.et-btn {
  flex: 1; min-width: 0;
  min-height: 34px;
  padding: 0 !important;
  font-size: 12px !important; font-weight: 700;
  border: 0 !important; border-radius: 8px;
}

/* ============================================================
   手机适配：台位卡保持 4 列，压缩字号与间距
   ============================================================ */
@media (max-width: 480px) {
  .kb-hero { padding: 12px 12px 11px; }
  .h-row1 { padding-right: 92px; }
  .h-title { font-size: 16px; }
  .h-mark { width: 25px; height: 25px; }
  .h-row2 { gap: 9px; font-size: 11px; }
  .h-actions { gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
  .hbtn { padding: 6px 8px; font-size: 11px; gap: 0; border-radius: 7px; }
  .hbtn svg { display: none; }
  .hbtn .lbl { display: inline; }
  .hbtn .ico-only { display: none; }

  .grid { gap: 5px; margin-bottom: 16px; }
  .sc { min-height: 0; padding: 7px 7px 8px; border-radius: 11px; }
  .sc::before { top: 7px; bottom: 7px; }
  .st-ic { width: 17px; height: 17px; font-size: 9px; border-radius: 6px; }
  .sc-name { font-size: 9.5px; letter-spacing: 0; }
  .sc-mid { gap: 4px; margin-top: 6px; }
  .ava { width: 20px; height: 20px; font-size: 10px; }
  .sc-person { font-size: 11.5px; }
  .sc-time { font-size: 17px; margin-top: 3px; }
  .bar { height: 3px; margin-top: 6px; }
  .plan-note {
    font-size: 8px; padding: 2px 3px; margin-top: 5px; gap: 3px;
    border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .plan-note svg { width: 9px; height: 9px; }
  .book-mid { gap: 4px; margin-top: 5px; }
  .book-person { font-size: 11px; }
  .book-time { font-size: 16px; margin-top: 2px; }
  .book-cd { font-size: 9px; padding-top: 4px; }
  .empty-body { gap: 5px; }
  .plus { width: 20px; height: 20px; font-size: 13px; border-radius: 7px; }
  .empty-tx { font-size: 10px; }
  .empty-tx small { display: none; }

  .sec-head { flex-wrap: wrap; }
  .legend { display: none; }
  .srow { padding: 9px 10px; gap: 8px; }
  .medal { width: 20px; height: 20px; font-size: 10px; }
  .s-name { font-size: 12.5px; }
  .s-total { font-size: 14.5px; }
  .s-detail { font-size: 7.5px; letter-spacing: -0.3px; }

  /* 弹窗：居中卡片（同轮岗值班页：遮罩 flex 居中，超高时遮罩可滚、弹窗内部自滚） */
  .modal-mask.show {
    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    overflow-y: auto;
  }
  .modal {
    max-width: 400px;
    border-radius: 16px;
    max-height: 88vh;
    margin: auto;
    /* 部分安卓内核位移动画结束后 transform 残留导致偏移，手机端只用淡入 */
    animation: modalFadeIn .14s ease-out;
  }
  @keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  .m-grab { display: none; }
  .m-head { padding: 9px 14px 2px; }
  .m-title { font-size: 14px; }
  .m-x { width: 24px; height: 24px; font-size: 12px; }
  .m-body { padding: 4px 14px 13px; }

  /* 在岗操作弹窗：缩小时钟 */
  .m-clock { padding: 9px 0 10px; border-radius: 10px; }
  .m-person { font-size: 12.5px; margin-bottom: 4px; gap: 6px; }
  .m-time { font-size: 30px; }
  .m-actions { gap: 7px; margin-top: 10px; }
  .m-btn { padding: 9px; font-size: 13px; border-radius: 9px; min-height: 38px; }

  /* 选上岗人员弹窗 */
  .m-planline { font-size: 11.5px; margin-bottom: 7px; flex-wrap: nowrap; }
  .m-planline > span { white-space: nowrap; flex: none; }
  .m-planline input {
    padding: 6px 8px; font-size: 13px;
    flex: 1 1 auto; min-width: 0;
    width: auto; min-height: 30px;
    color: var(--ink);
  }
  .m-btn-mini { flex: none; padding: 6px 10px !important; font-size: 11.5px !important; min-height: 30px !important; }
  .m-desc { font-size: 11px; margin-bottom: 6px; }
  #personList .person-row { padding: 8px 10px; }
  #personList .person-row > span:first-child { font-size: 13px; gap: 7px; }
  #personList .ava { width: 22px; height: 22px; font-size: 10.5px; }
  .person-row-btn { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

  /* 标签弹窗 */
  .tag-grid { gap: 7px; }
  .tag-grid .btn { min-height: 38px; font-size: 13px; }

  /* 日志弹窗 */
  .log-list { max-height: 52vh; font-size: 11.5px; line-height: 1.7; }

  /* 修改时长弹窗：单行紧凑列表，8 行一屏放下 */
  #editTimeModal .modal { max-height: 86vh; }
  .et-row { gap: 8px; padding: 7px 0; }
  .et-name { width: 58px; font-size: 12px; }
  .et-val { width: 44px; font-size: 14px; }
  .et-btns { gap: 5px; }
  .et-btn { min-height: 30px; font-size: 11px !important; border-radius: 7px; }
}

@media (max-width: 360px) {
  .wrap { padding-left: 8px; padding-right: 8px; }
  .grid { gap: 4px; }
  .sc { padding: 6px 5px 7px; }
  .st-ic { width: 15px; height: 15px; font-size: 8.5px; }
  .sc-name { font-size: 9px; }
  .ava { width: 18px; height: 18px; font-size: 9.5px; }
  .sc-person { font-size: 10.5px; }
  .sc-time { font-size: 15px; }
  /* 预约换人提示窄屏也要保留，只缩小不隐藏 */
  .plan-note { font-size: 7.5px; padding: 2px 3px; }
  .book-time { font-size: 14px; }
  .h-date { display: none; }
  .hbtn { padding: 5px 7px; font-size: 10.5px; }
  .h-actions { gap: 4px; }

  /* 小屏弹窗再压一档 */
  .m-head { padding-left: 12px; padding-right: 12px; }
  .m-body { padding-left: 12px; padding-right: 12px; }
  .m-time { font-size: 26px; }
  .m-btn { padding: 8px; font-size: 12.5px; }
  .et-row { gap: 6px; }
  .et-name { width: 50px; font-size: 11.5px; }
  .et-val { width: 38px; font-size: 13px; }
  .et-btns { gap: 4px; }
  .et-btn { min-height: 28px; font-size: 10.5px !important; }
}

@media (max-width: 330px) {
  .sbar { display: none; }
}
