/* ========== Reset & Base ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f0f2f5;
  color: #202124;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  padding-bottom: 60px;
}
input, textarea { -webkit-user-select: text; user-select: text; }

/* ========== Views ========== */
.view { display: none; min-height: 100vh; }
.view.active { display: block; }

/* ========== Dashboard Header ========== */
.dash-header {
  background: #fff;
  padding: 12px 16px 8px;
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid #e8eaed;
}
.dash-date {
  font-size: 14px; color: #5f6368; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.stats-bar {
  display: flex; gap: 8px; margin-bottom: 10px;
}
.stat-item {
  flex: 1; text-align: center; padding: 10px 4px;
  border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; gap: 2px;
}
.stat-active { background: #e6f4ea; cursor: pointer; transition: transform 0.1s; }
.stat-active:active { transform: scale(0.96); }
.stat-rest { background: #f1f3f4; cursor: pointer; transition: transform 0.1s; }
.stat-rest:active { transform: scale(0.96); }
.stat-idle { background: #e8f0fe; cursor: pointer; transition: transform 0.1s; }
.stat-idle:active { transform: scale(0.96); }
.stat-item.filter-active {
  transform: scale(0.96);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.3);
}
.stat-active.filter-active { box-shadow: 0 0 0 3px rgba(52,168,83,0.4); }
.stat-rest.filter-active { box-shadow: 0 0 0 3px rgba(154,160,166,0.4); }
.stat-idle.filter-active { box-shadow: 0 0 0 3px rgba(26,115,232,0.4); }
.stat-num { font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat-active .stat-num { color: #34a853; }
.stat-rest .stat-num { color: #9aa0a6; }
.stat-idle .stat-num { color: #1a73e8; }
.stat-finished { background: #f1f3f4; cursor: pointer; transition: transform 0.1s; }
.stat-finished:active { transform: scale(0.96); }
.stat-finished.filter-active { box-shadow: 0 0 0 3px rgba(95,99,104,0.4); }
.stat-finished .stat-num { color: #5f6368; }
.stat-label { font-size: 12px; color: #5f6368; }

/* ========== Island Bar ========== */
.island-bar {
  display: flex; gap: 6px; margin-bottom: 8px;
}
.island-chip {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-align: center; padding: 6px 2px;
  border-radius: 8px; font-weight: 600;
  border: 2px solid transparent; cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}
.chip-name { font-size: 12px; }
.chip-status { font-size: 10px; font-weight: 500; }
.island-chip:active { transform: scale(0.96); }
.island-chip.open { background: #e6f4ea; color: #34a853; border-color: #34a853; }
.island-chip.closed { background: #fce8e6; color: #d93025; border-color: #d93025; }

/* ========== Search ========== */
.search-bar { margin-bottom: 4px; }
.search-bar input {
  width: 100%; padding: 10px 14px; font-size: 15px;
  border: 1px solid #dadce0; border-radius: 24px;
  outline: none; background: #f8f9fa;
}
.search-bar input:focus { border-color: #1a73e8; background: #fff; }

/* ========== Staff List ========== */
.staff-list { padding: 8px 12px; }
.staff-group-title {
  font-size: 13px; color: #5f6368; font-weight: 600;
  margin: 12px 4px 6px; display: flex; align-items: center; gap: 6px;
}
/* 方案2：分组标题做成粗色带，物理隔离各状态区块 */
.staff-group-title.gt-active   { background: #e6f4ea; color: #1e7e34; border-left: 4px solid #34a853; padding: 6px 10px; border-radius: 6px; }
.staff-group-title.gt-idle     { background: #e8f0fe; color: #1a56c4; border-left: 4px solid #1a73e8; padding: 6px 10px; border-radius: 6px; }
.staff-group-title.gt-rest     { background: #f1f3f4; color: #5f6368; border-left: 4px solid #9aa0a6; padding: 6px 10px; border-radius: 6px; }
.staff-group-title.gt-finished { background: #f1f3f4; color: #5f6368; border-left: 4px solid #9aa0a6; padding: 6px 10px; border-radius: 6px; }
.staff-card {
  background: #fff; border-radius: 10px; padding: 12px 14px;
  margin-bottom: 8px; border-left: 4px solid #dadce0;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  cursor: pointer; transition: transform 0.1s;
  position: relative; padding-right: 44px;
}
.staff-card:active { transform: scale(0.98); }
/* 待派岗卡片删除按钮 */
.staff-del {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 30px; height: 30px; border: none; border-radius: 50%;
  background: #fde8ea; color: #c8102e; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, transform 0.1s;
}
.staff-del:active { background: #f5c2c9; transform: translateY(-50%) scale(0.92); }
.staff-card.active { border-left-color: #34a853; }
.staff-card.rest { border-left-color: #9aa0a6; }
.staff-card.idle { border-left-color: #1a73e8; }
.staff-card.finished { border-left-color: #9aa0a6; background: #fafafa; }
.staff-card.finished .duration-num.finished-num { color: #9aa0a6; }
.staff-info { display: flex; flex-direction: column; gap: 2px; }
.staff-name { font-size: 17px; font-weight: 600; }
.staff-shift { font-size: 12px; color: #1a73e8; font-weight: 500; }
.staff-pos { font-size: 13px; color: #5f6368; }
.staff-duration { text-align: right; }
.duration-num { font-size: 18px; font-weight: 700; }
.duration-label { font-size: 11px; color: #5f6368; }
.staff-card.active .duration-num { color: #34a853; }
.staff-card.rest .duration-num { color: #9aa0a6; }
.staff-card.idle .duration-num { color: #1a73e8; }
/* 首页人员卡片：去掉整卡 44px 右侧留白（仅待派岗 idle 卡保留，因有删除按钮），使工时更靠右、左右对称协调 */
#view-dashboard .staff-card { padding-right: 14px; }
#view-dashboard .staff-card.idle { padding-right: 44px; }

/* ========== 工作时长预警色 ========== */
.duration-num.dur-green { color: #34a853 !important; }   /* < 1小时 */
.duration-num.dur-blue { color: #1a73e8 !important; }     /* 1-2小时 */
.duration-num.dur-orange { color: #f9ab00 !important; }   /* 2-3小时 */
.duration-num.dur-red { color: #d93025 !important; }       /* 3-4小时 */
.duration-num.dur-purple { color: #9334e6 !important; }    /* > 4小时 */

/* 通用预警色工具类（可用于平面图等任意元素） */
.dur-green { color: #34a853 !important; }
.dur-blue { color: #1a73e8 !important; }
.dur-orange { color: #f9ab00 !important; }
.dur-red { color: #d93025 !important; }
.dur-purple { color: #9334e6 !important; }

/* ========== Page Header ========== */
.page-header {
  background: #fff; padding: 16px; border-bottom: 1px solid #e8eaed;
}
.page-header h2 { font-size: 20px; margin-bottom: 4px; }
.page-sub { font-size: 14px; color: #5f6368; }

/* ========== Tab Bar ========== */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 60px;
  background: #fff; border-top: 1px solid #e8eaed;
  display: flex; z-index: 100;
  max-width: 100%;
}
.tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; color: #9aa0a6; transition: color 0.2s;
}
.tab.active { color: #1a73e8; }
.tab-icon { font-size: 20px; }
.tab-text { font-size: 11px; }

/* ========== Assign View ========== */
.assign-staff-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px; padding: 12px;
}
.assign-staff-card {
  background: #fff; border-radius: 10px; padding: 16px 8px;
  text-align: center; border: 2px solid #e8eaed;
  cursor: pointer; transition: all 0.15s;
}
.assign-staff-card:active { transform: scale(0.96); }
.assign-staff-card.idle { border-color: #1a73e8; background: #e8f0fe; }
.assign-staff-card.idle .as-status { font-size: 14px; font-weight: 700; color: #f57c00; }
.assign-staff-card.rest { border-color: #4db6ac; background: #e6f4f1; }
.assign-staff-card.rest .as-status { font-weight: 700; }
.assign-staff-card .as-name { font-size: 16px; font-weight: 600; }
.assign-staff-card .as-shift { font-size: 12px; color: #1a73e8; margin-top: 2px; }
.assign-staff-card .as-status { font-size: 12px; color: #5f6368; margin-top: 2px; }
.assign-empty { text-align: center; padding: 40px 20px; color: #9aa0a6; font-size: 15px; }

/* ========== Manage View ========== */
.manage-content { padding: 12px; }
.manage-card {
  background: #fff; border-radius: 12px; padding: 16px;
  margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.manage-card h3 { font-size: 17px; margin-bottom: 4px; }
.manage-desc { font-size: 13px; color: #5f6368; margin-bottom: 12px; }
.manage-card textarea {
  width: 100%; padding: 10px; font-size: 15px;
  border: 1px solid #dadce0; border-radius: 8px;
  resize: vertical; outline: none; font-family: inherit;
  margin-bottom: 10px;
}
.manage-btns { display: flex; gap: 8px; }
.btn-primary, .btn-secondary, .btn-danger {
  padding: 11px 20px; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  text-align: center; display: inline-block;
}
.btn-primary { background: #1a73e8; color: #fff; }
.btn-secondary { background: #e8f0fe; color: #1a73e8; }
.btn-danger { background: #fce8e6; color: #d93025; }
.btn-full { width: 100%; }
.import-result { margin-top: 8px; font-size: 14px; }
.import-result.success { color: #34a853; }
.import-result.error { color: #d93025; }

/* ========== Island List (Manage) ========== */
.island-list { display: flex; flex-direction: column; gap: 8px; }
.island-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; border-radius: 8px; background: #f8f9fa;
}
.island-row .ir-name { font-size: 16px; font-weight: 600; }
.island-row .ir-type { font-size: 12px; color: #5f6368; }
.toggle-btn {
  padding: 6px 16px; border-radius: 20px; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.toggle-btn.open { background: #34a853; color: #fff; }
.toggle-btn.closed { background: #dadce0; color: #5f6368; }

/* ========== Modal Overlay ========== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  align-items: flex-end; justify-content: center;
}
.modal-overlay.active { display: flex; }

/* ========== Bottom Modal (Staff Actions) ========== */
.modal-bottom {
  background: #fff; border-radius: 16px 16px 0 0;
  width: 100%; max-width: 500px; padding: 8px 0 24px;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-handle {
  width: 36px; height: 4px; background: #dadce0;
  border-radius: 2px; margin: 0 auto 12px;
}
.modal-staff-name {
  text-align: center; font-size: 20px; font-weight: 700;
  padding: 0 20px 4px;
}
.modal-staff-info {
  text-align: center; font-size: 14px; color: #5f6368;
  padding: 0 20px 10px;
}
/* 全天任务行（弹窗第二排） */
.modal-staff-shift {
  margin: 0 16px 14px;
  padding: 10px 12px;
  background: #e8f2fa;
  border: 1px solid #c5ddef;
  border-radius: 10px;
}
.shift-title {
  font-size: 12px; font-weight: 700; color: #005DAA;
  margin-bottom: 6px;
}
.shift-segs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 14px; color: #202124;
}
.shift-seg {
  background: #fff; border: 1px solid #d6e4f0;
  border-radius: 6px; padding: 2px 8px; font-weight: 600;
}
.shift-lbl { color: #5f6368; font-weight: 400; font-size: 12px; }
.shift-sep { color: #9aa0a6; }
.shift-off {
  margin-left: 4px; background: #005DAA; color: #fff;
  border-radius: 6px; padding: 2px 10px; font-weight: 700; font-size: 13px;
}
.modal-actions { padding: 0 16px; }
.modal-action-btn {
  display: block; width: 100%; padding: 14px;
  text-align: center; font-size: 16px; font-weight: 600;
  border: none; border-radius: 10px; margin-bottom: 8px;
  cursor: pointer;
}
.modal-action-btn.primary { background: #1a73e8; color: #fff; }
.modal-action-btn.green { background: #e6f4ea; color: #34a853; }
.modal-action-btn.gray { background: #f1f3f4; color: #5f6368; }
.modal-action-btn.danger { background: #fce8e6; color: #d93025; }
.modal-action-btn.cancel { background: transparent; color: #9aa0a6; }

/* ========== Full Modal (Counter / Timeline) ========== */
.modal-full {
  background: #fff; border-radius: 16px 16px 0 0;
  width: 100%; max-width: 500px; max-height: 85vh;
  overflow-y: auto; animation: slideUp 0.25s ease;
}
.modal-full-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #e8eaed;
  font-size: 18px; font-weight: 700; position: sticky; top: 0;
  background: #fff; z-index: 5;
}
.modal-close { font-size: 20px; cursor: pointer; color: #9aa0a6; padding: 4px 8px; }

/* ========== Position Tabs ========== */
.pos-tabs {
  display: flex; padding: 12px 16px; gap: 8px;
  border-bottom: 1px solid #e8eaed;
}
.pos-tab {
  flex: 1; text-align: center; padding: 8px;
  border-radius: 8px; font-size: 14px; font-weight: 600;
  background: #f1f3f4; color: #5f6368; cursor: pointer;
}
.pos-tab.active { background: #1a73e8; color: #fff; }

/* ========== Island Selector ========== */
.island-selector {
  display: flex; gap: 6px; padding: 12px 16px;
  overflow-x: auto;
}
.island-btn {
  padding: 8px 16px; border-radius: 8px; font-size: 14px;
  font-weight: 600; border: 2px solid #dadce0; background: #fff;
  color: #5f6368; cursor: pointer; white-space: nowrap;
}
.island-btn.active { border-color: #1a73e8; color: #1a73e8; background: #e8f0fe; }
.island-btn.disabled { opacity: 0.4; cursor: not-allowed; }

/* ========== Counter Grid ========== */
.counter-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; padding: 8px 16px 20px;
}
.counter-cell {
  border-radius: 10px; padding: 12px 8px;
  text-align: center; border: 2px solid #dadce0;
  background: #fff; cursor: pointer; transition: all 0.15s;
  min-height: 72px; display: flex; flex-direction: column;
  justify-content: center; gap: 2px;
}
.counter-cell:active { transform: scale(0.96); }
.counter-cell.assignable { border-color: #1a73e8; }
.counter-cell.occupied { border-color: #f9ab00; background: #fef7e0; }
.counter-cell.unavailable { background: #f1f3f4; opacity: 0.6; cursor: not-allowed; }
.counter-cell.current { border-color: #34a853; background: #e6f4ea; }
.counter-cell.occupied.replaceable {
  border: 2px dashed #f9ab00;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(249,171,0,0.18);
}
.counter-cell.occupied.replaceable:hover { background: #fdeccb; }
.counter-cell.occupied.replaceable .counter-occupant { color: #b06000; }
.counter-cell.occupied.replaceable .counter-occupant::after {
  content: ' · 点我替换';
  font-size: 10px; color: #b06000; opacity: 0.85;
}
.counter-code { font-size: 15px; font-weight: 700; }
.counter-name { font-size: 11px; color: #5f6368; }
.counter-occupant { font-size: 11px; color: #d93025; font-weight: 600; }
/* 特殊岗位格子：空位灰色、自己当前绿色（复用柜台网格视觉） */
.counter-cell.assignable .counter-occupant { color: #9aa0a6; font-weight: 500; }
.counter-cell.current .counter-occupant { color: #1e8e3e; }

/* ========== Independent Positions ========== */
.independent-list { padding: 0; }
.indep-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-radius: 10px; border: 2px solid #1a73e8;
  margin-bottom: 8px; cursor: pointer; background: #e8f0fe;
}
.indep-item:active { transform: scale(0.98); }
.indep-label { font-size: 17px; font-weight: 600; color: #1a73e8; }
.indep-arrow { font-size: 20px; color: #1a73e8; }
/* 被他人占用：置灰不可点 */
.indep-item.occupied {
  border-color: #dadce0; background: #f1f3f4; cursor: not-allowed;
}
.indep-item.occupied .indep-label { color: #9aa0a6; }
.indep-item.occupied:active { transform: none; }
.indep-occupant { font-size: 14px; color: #9aa0a6; font-weight: 500; }
.indep-item.current { border-color: #34a853; background: #e6f4ea; }
.indep-item.current .indep-label { color: #34a853; }
/* 特殊岗位分组标题 */
.indep-group-title {
  font-size: 15px; font-weight: 700; color: #3c4043;
  margin: 14px 0 6px; padding-left: 4px; border-left: 4px solid #1a73e8;
}
.indep-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
/* 分组头：与柜台区标题一致，无背景色条，深灰文字 */
.indep-group-head {
  display: flex; align-items: center; justify-content: space-between;
  color: #202124; font-size: 16px; font-weight: 700;
  padding: 8px 0; margin-bottom: 2px;
}
.indep-group-count {
  background: #e8eaed; color: #5f6368;
  font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 10px;
}
.indep-group .counter-grid { padding: 8px 0 4px; }
/* 机动岗：4 个一行铺满，窄卡片 */
.counter-grid.cols-4 { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.counter-grid.cols-4 .counter-cell { min-height: 56px; padding: 8px 4px; gap: 1px; }
.counter-grid.cols-4 .counter-code { font-size: 13px; }
.counter-grid.cols-4 .counter-occupant { font-size: 10px; }

/* ========== Timeline ========== */
.timeline-summary {
  display: flex; gap: 8px; padding: 16px;
}
.ts-card {
  flex: 1; text-align: center; padding: 12px; border-radius: 10px;
}
.ts-card.work { background: #e6f4ea; }
.ts-card.rest { background: #f1f3f4; }
.ts-card .ts-val { font-size: 22px; font-weight: 700; }
.ts-card .ts-label { font-size: 12px; color: #5f6368; }
.timeline-list { padding: 0 16px 20px; }
.tl-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid #f1f3f4;
}
.tl-dot {
  width: 10px; height: 10px; border-radius: 50%;
  margin-top: 5px; flex-shrink: 0;
}
.tl-dot.active { background: #34a853; }
.tl-dot.rest { background: #9aa0a6; }
.tl-dot.finished { background: #dadce0; }
.tl-content { flex: 1; }
.tl-pos { font-size: 15px; font-weight: 600; }
.tl-time { font-size: 13px; color: #5f6368; margin-top: 2px; }
.tl-dur { font-size: 14px; font-weight: 600; color: #202124; margin-top: 2px; }
.tl-op { font-size: 12px; color: #005DAA; margin-top: 3px; font-weight: 600; }
.tl-status {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  margin-left: 8px;
}
.tl-status.active { background: #e6f4ea; color: #34a853; }
.tl-status.rest { background: #f1f3f4; color: #9aa0a6; }
.tl-status.finished { background: #f1f3f4; color: #5f6368; }

/* ========== Toast ========== */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #323232; color: #fff; padding: 10px 24px;
  border-radius: 24px; font-size: 14px; z-index: 300;
  opacity: 0; transition: opacity 0.25s; pointer-events: none;
  max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; }

/* ========== 派岗图（柜台平面图） ========== */
/* 岗位图顶部：岛屿显示/隐藏切换条（个人视图，不影响他人） */
.map-island-toggle { display: flex; gap: 5px; padding: 7px 8px; flex-wrap: nowrap; }
.it-chip { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 9px; border: 1px solid #dadce0; background: #fff; cursor: pointer; overflow: hidden; }
.it-chip .it-name { font-size: 13px; font-weight: 600; color: #202124; white-space: nowrap; }
.it-chip .it-state { font-size: 10px; white-space: nowrap; }
.it-chip.vis { border-color: #1a73e8; background: #e8f0fe; }
.it-chip.vis .it-state { color: #1a73e8; }
.it-chip.hidden { border-color: #9aa0a6; background: #f1f3f4; }
.it-chip.hidden .it-state { color: #9aa0a6; }
.map-summary {
  display: flex; gap: 8px; padding: 12px 16px;
}
.ms-item {
  flex: 1; text-align: center; padding: 8px 4px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
}
.ms-item.active { background: #e6f4ea; color: #34a853; }
.ms-item.rest { background: #f1f3f4; color: #9aa0a6; }
.ms-item.idle { background: #e8f0fe; color: #1a73e8; }

.map-island {
  background: #fff; border-radius: 12px; margin: 0 12px 12px;
  padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.map-island-title {
  font-size: 17px; font-weight: 700; color: #202124; margin-bottom: 10px;
  display: flex; align-items: baseline; gap: 8px;
}
.map-island-sub { font-size: 12px; font-weight: 400; color: #9aa0a6; }

.map-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
}
.map-cell {
  aspect-ratio: 1 / 1; border-radius: 8px; padding: 4px;
  display: flex; flex-direction: column; justify-content: space-between;
  align-items: center; text-align: center; border: 2px solid transparent;
  overflow: hidden;
}
.mc-code { font-size: 12px; font-weight: 700; color: #5f6368; }
.mc-name {
  font-size: 12px; font-weight: 700; line-height: 1.1; cursor: pointer;
  word-break: break-all; width: 100%;
}
.mc-dur { font-size: 10px; color: #5f6368; }
.mc-free { font-size: 12px; color: #bdc1c6; }
.mc-blocked { font-size: 10px; color: #bdc1c6; line-height: 1.2; word-break: break-all; }

.map-cell.occupied {
  background: #e6f4ea; border-color: #34a853;
}
.map-cell.occupied .mc-name { color: #1e8e3e; }
.map-cell.free {
  background: #fafbfc; border: 2px dashed #dadce0;
}
.map-cell.blocked {
  background: #f1f3f4; border-color: #f1f3f4;
}
.map-cell.blocked .mc-code { color: #c0c4c9; }
/* 特殊岗位区：按组标题 + 分组网格（3列 + 非正方形，标签较长更易读） */
.map-island-title.sp-title { color: #202124; justify-content: space-between; }
.map-island-count {
  background: #e8eaed; color: #5f6368;
  font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 10px;
}
.map-grid.sp-grid { grid-template-columns: repeat(3, 1fr); }
.map-grid.sp-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.map-grid.sp-grid .map-cell { aspect-ratio: auto; min-height: 64px; }
.map-grid.sp-grid.cols-4 .map-cell { min-height: 58px; padding: 3px; }
.map-grid.sp-grid.cols-4 .mc-code { font-size: 11px; }
.map-grid.sp-grid.cols-4 .mc-name { font-size: 12px; }
.map-grid.sp-grid.cols-4 .mc-dur { font-size: 11px; }

/* 独立岗位区 */
.map-indep-row { display: flex; flex-wrap: wrap; gap: 8px; }
.map-indep-card {
  flex: 1 1 calc(50% - 8px); min-width: 120px;
  background: #e8f0fe; border: 2px solid #1a73e8; border-radius: 10px;
  padding: 10px 12px; cursor: pointer;
}
.mi-label { font-size: 13px; color: #1a73e8; font-weight: 600; }
.mi-name { font-size: 16px; font-weight: 700; color: #202124; margin-top: 2px; }
/* 空岗位（未占用）灰显 */
.map-indep-card.empty { background: #f8f9fa; border-color: #dadce0; cursor: default; }
.map-indep-card.empty .mi-label { color: #9aa0a6; }
.mi-name.empty { color: #bdc1c6; font-weight: 500; }

/* 休息区（派岗图底部「休息中」名单）：复用看板 .staff-card.rest 长条，一行一人 */
.map-island .staff-card { padding-right: 14px; }

/* ====== 确认弹窗 ====== */
.modal-center {
  background: #fff; border-radius: 16px; width: 86%; max-width: 340px;
  padding: 24px 20px 16px; text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  animation: popIn 0.18s ease;
}
@keyframes popIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confirm-icon { font-size: 40px; margin-bottom: 8px; }
.confirm-title { font-size: 18px; font-weight: 800; color: #202124; margin-bottom: 10px; }
.confirm-text { font-size: 14px; color: #5f6368; line-height: 1.6; margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 12px; }
.confirm-actions button { flex: 1; padding: 12px; border-radius: 10px; font-size: 15px; font-weight: 700; border: none; cursor: pointer; }
.btn-ghost { background: #f1f3f4; color: #5f6368; }
.btn-ghost:active { background: #e8eaed; }
.btn-danger { background: #d93025; color: #fff; }
.btn-danger:active { background: #b3261e; }

/* 顶部身份栏已隐藏，不再预留 46px 空白，避免页面顶部出现空隙 */

/* ========== 身份栏 ========== */
#me-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 46px;
  background: #005DAA; color: #fff; z-index: 160;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.me-info { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.me-name { font-size: 16px; font-weight: 700; }
.me-emp { font-size: 12px; opacity: 0.82; }
.me-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.role-badge {
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px;
  white-space: nowrap;
}
.role-badge.op { background: #ffd24d; color: #5a3d00; }
.role-badge.viewer { background: rgba(255,255,255,0.22); color: #fff; }
.role-badge.admin { background: linear-gradient(135deg, #d4a843, #c8102e); color: #fff; box-shadow: 0 1px 4px rgba(200,16,46,0.4); }
.admin-tag { font-size: 11px; font-weight: 600; color: #c8102e; background: #fde8ea; padding: 1px 8px; border-radius: 10px; margin-left: 6px; vertical-align: middle; }
.me-logout {
  background: rgba(255,255,255,0.18); color: #fff;
  border: none; font-size: 13px; font-weight: 600;
  padding: 5px 12px; border-radius: 14px; cursor: pointer;
}
.me-logout:active { background: rgba(255,255,255,0.32); }

/* ========== 登录视图 ========== */
#login-view {
  display: none; /* 默认隐藏，无 active 时彻底消失，避免滚动露出 */
  background: linear-gradient(160deg, #005DAA 0%, #003D7A 100%);
  min-height: 100vh; align-items: center; justify-content: center;
}
#login-view.active {
  display: flex; /* active 时显示并居中 */
}
.login-wrap { width: 100%; max-width: 360px; padding: 24px; text-align: center; color: #fff; }
.login-logo { font-size: 56px; margin-bottom: 8px; }
.login-title { font-size: 24px; font-weight: 800; line-height: 1.4; margin-bottom: 8px; }
.login-sub { font-size: 14px; opacity: 0.85; margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form input {
  padding: 14px 16px; font-size: 16px; border: none; border-radius: 10px;
  outline: none; background: #fff; color: #202124;
}
.login-form input::placeholder { color: #9aa0a6; }
.login-btn {
  margin-top: 6px; padding: 14px; font-size: 17px; font-weight: 700;
  border: none; border-radius: 10px; background: #ffd24d; color: #5a3d00;
  cursor: pointer; transition: transform 0.1s;
}
.login-btn:active { transform: scale(0.98); }
.login-err {
  display: none; color: #ffd9d9; font-size: 13px; margin-top: 4px;
  background: rgba(217,48,37,0.35); border-radius: 8px; padding: 8px;
}
.login-tip { margin-top: 26px; font-size: 12px; line-height: 1.7; opacity: 0.8; }

/* ========== 481 权限面板 ========== */
.perm-card { border-left: 4px solid #005DAA; }
.perm-list { display: flex; flex-direction: column; gap: 8px; }
.perm-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 10px; background: #f8f9fa;
  border: 2px solid #e8eaed;
}
.perm-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.perm-row.free { border-color: #34a853; background: #e6f4ea; }
.perm-row.mine { border-color: #005DAA; background: #e8f2fa; }
.perm-row.occupied { border-color: #f1f3f4; background: #f1f3f4; }
.perm-label { font-size: 16px; font-weight: 700; color: #202124; }
.perm-name-inline { font-size: 14px; font-weight: 700; color: #005DAA; margin-left: 8px; }
.perm-row.occupied .perm-name-inline { color: #c05621; }
.perm-row.free .perm-name-inline { color: #5f6368; font-weight: 600; }
.perm-occ { font-size: 13px; color: #9aa0a6; font-weight: 600; }
.perm-btn {
  padding: 8px 18px; border: none; border-radius: 20px;
  font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.perm-btn.claim { background: #34a853; color: #fff; }
.perm-btn.claim:active { background: #2b8a44; }
.perm-btn.release { background: #005DAA; color: #fff; }
.perm-btn.release:active { background: #004a8a; }
.perm-meta { font-size: 13px; color: #5f6368; font-weight: 600; margin-top: 2px; }
.perm-row.mine .perm-meta { color: #005DAA; }
.perm-row.occupied .perm-meta { color: #70757a; }
.perm-free-meta { color: #34a853; }
.perm-dur { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ========== 查看者提示 ========== */
.manage-viewer-note {
  background: #e8f2fa; border: 1px solid #c5ddef; color: #004a8a;
  border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.6;
  margin-bottom: 12px;
}
.manage-viewer-note b { color: #003D7A; }
.viewer-banner {
  background: #fff7e0; border: 1px solid #f3d98a; color: #8a6d00;
  border-radius: 8px; padding: 10px 12px; font-size: 13px; font-weight: 600;
  margin: 0 12px 8px;
}
.assign-staff-card.readonly { cursor: pointer; opacity: 0.96; }

/* ========== 桌面端：模拟手机比例（宽屏时主内容居中限宽，两侧留浅色背景） ========== */
@media (min-width: 600px) {
  /* 两侧柔和浅灰背景，突出中间手机屏（不用暗色，更清爽） */
  body { background: #e9edf2; }
  /* 主内容（身份栏 + 各视图）统一限宽居中 + 轻阴影，形成手机竖屏比例 */
  .me-bar,
  .view {
    max-width: 430px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 0 24px rgba(0,0,0,0.12);
  }
  /* 底部导航只出现在中间手机宽度内，固定居中（必须显式 width，否则 fixed 会塌缩成内容宽） */
  .tab-bar {
    width: 430px;
    max-width: 430px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  /* 弹窗遮罩全屏，内部内容限宽居中（底部弹窗 / 全屏弹窗 / 居中弹窗一致） */
  .modal-bottom,
  .modal-full,
  .modal-center { max-width: 430px; margin: 0 auto; }
}

