/* ============= 基础重置 ============= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: #2c3e50;
  background: #f4f6f8;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ============= 顶部条 ============= */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: 44px; padding: 0 12px;
  display: flex; align-items: center; justify-content: space-between;
  background: #ffffff;
  border-bottom: 1px solid #ececec;
}
.topbar-left { width: 40px; display: flex; align-items: center; }
.topbar-right { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding-right: 10px; }
.close-x { font-size: 22px; color: #555; line-height: 1; }
.more-dots { font-size: 20px; color: #555; letter-spacing: 1px; }
.topbar-center { flex: 1; text-align: center; line-height: 1.2; }
.topbar-title { font-size: 15px; font-weight: 600; color: #1a1a1a; }

/* 离线同步状态徽标 */
.sync-badge { font-size: 12px; padding: 3px 9px; border-radius: 12px; cursor: pointer; white-space: nowrap; user-select: none; transition: background .2s; }
.sync-badge.online { background: #e8f5e9; color: #2e7d32; }
.sync-badge.offline { background: #ffebee; color: #c62828; }
.sync-badge.pending { background: #fff3e0; color: #e65100; }
.sync-badge.syncing { background: #e3f2fd; color: #1565c0; }

/* 离线模式横幅 */
.offline-banner {
  background: #fff3e0; color: #e65100;
  font-size: 13px; text-align: center; padding: 7px 12px;
  border-bottom: 1px solid #ffe0b2; position: sticky; top: 0; z-index: 50;
}

/* ============= 布局 ============= */
.layout {
  display: flex; min-height: calc(100vh - 44px);
}

/* 侧边栏 */
.sidebar {
  width: 200px; background: #ffffff;
  border-right: 1px solid #ececec;
  display: flex; flex-direction: column;
  position: sticky; top: 44px; align-self: flex-start;
  height: calc(100vh - 44px); overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px; border-bottom: 1px solid #f0f0f0;
}
.brand-logo {
  width: 40px; height: 40px; border-radius: 8px;
  background: linear-gradient(135deg, #2c3e50, #4a6580);
  color: #fff; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0.5px;
}
.brand-text .brand-title { font-size: 15px; font-weight: 700; color: #1a1a1a; }
.brand-text .brand-sub { font-size: 11px; color: #888; margin-top: 2px; }

.nav { padding: 8px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: #555; font-size: 14px; margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: #f4f6f8; color: #1a1a1a; }
.nav-item.active {
  background: linear-gradient(90deg, #e8f4ff, #f5fbff);
  color: #1e88e5; font-weight: 600;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer { padding: 12px; border-top: 1px solid #f0f0f0; }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px; margin-bottom: 8px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #1e88e5; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.user-name { font-size: 13px; font-weight: 600; color: #1a1a1a; }
.user-role { font-size: 11px; color: #888; margin-top: 2px; }
.link-btn {
  display: block; width: 100%; text-align: left;
  padding: 6px 8px; font-size: 12px; color: #1e88e5;
  border-radius: 6px;
}
.link-btn:hover { background: #f4f6f8; }
.link-btn.danger { color: #e53935; }

/* 移动端汉堡 */
.hamburger {
  display: none; position: fixed; bottom: 20px; left: 20px;
  width: 50px; height: 50px; border-radius: 50%;
  background: #1e88e5; color: #fff; font-size: 22px;
  box-shadow: 0 6px 16px rgba(30, 136, 229, 0.4);
  z-index: 60;
}

/* 主区域 */
.main { flex: 1; padding: 20px 24px; min-width: 0; }
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 页面头 */
.page-head { margin-bottom: 16px; }
.page-head-title { font-size: 22px; font-weight: 700; color: #1a1a1a; }
.page-head-sub { font-size: 12px; color: #888; letter-spacing: 1px; margin-top: 4px; }

/* 卡片 */
.card {
  background: #ffffff; border-radius: 12px;
  padding: 16px 18px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600; color: #1a1a1a;
  margin-bottom: 12px;
}
.muted { color: #5c6675; font-size: 12px; font-weight: 400; }

/* ============= 工作台 Hero ============= */
.hero {
  position: relative; border-radius: 16px; overflow: hidden;
  margin-bottom: 20px; color: #fff;
  background: #2c3e50;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(135deg, rgba(44,62,80,0.92), rgba(74,101,128,0.88)),
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.15), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.1), transparent 50%);
}
.hero-content { position: relative; padding: 24px; }
.hero-title { font-size: 12px; letter-spacing: 2px; opacity: 0.7; }
.hero-line { font-size: 18px; font-weight: 600; margin-top: 6px; }
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-top: 20px;
}
.stat {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; padding: 12px;
}
.stat-num { font-size: 22px; font-weight: 700; }
.stat-label { font-size: 12px; opacity: 0.75; margin-top: 4px; }

/* 快速入口 */
.quick-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.quick-card {
  background: #ffffff; border-radius: 12px; padding: 16px;
  text-align: left; transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.quick-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.qc-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 10px;
}
.qc-title { font-size: 14px; font-weight: 600; color: #1a1a1a; }
.qc-sub { font-size: 12px; color: #888; margin-top: 2px; }

/* 待办 */
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  background: #f8fafc; border: 1px solid #eef2f6;
}
.todo-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: #fff4e6; color: #fb8c00; font-weight: 600;
}
.todo-tag.green { background: #e8f5e9; color: #2e7d32; }
.todo-tag.red { background: #ffebee; color: #c62828; }
.todo-tag.overdue { background: #c62828; color: #fff; animation: pulse-overdue 1.5s ease-in-out infinite; }
.todo-tag.orange { background: #fff4e6; color: #e65100; }
@keyframes pulse-overdue {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.03); }
}
.todo-item.todo-overdue {
  background: linear-gradient(135deg, #fff8f6 0%, #ffebee 100%);
  border-color: #ef9a9a;
  border-left: 3px solid #c62828;
}
.todo-item.todo-overdue .todo-text { font-weight: 600; color: #b71c1c; }
.todo-item.todo-overdue .todo-time { color: #c62828; font-weight: 500; }
.todo-text { flex: 1; font-size: 13px; color: #1a1a1a; }
.todo-time { font-size: 11px; color: #888; }

/* ============= 工具栏（chips）============ */
.toolbar {
  background: #ffffff; border-radius: 12px; padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.toolbar-row {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 10px;
}
.toolbar-row:last-child { margin-bottom: 0; }
.toolbar-label {
  font-size: 12px; color: #888; padding: 6px 0; min-width: 32px;
}
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.chip {
  padding: 6px 12px; border-radius: 16px;
  background: #f1f3f5; color: #555; font-size: 12px;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.chip:hover { background: #e8eaed; }
.chip.active {
  background: #e3f2fd; color: #1e88e5;
  border-color: #90caf9; font-weight: 600;
}

/* 班次条 */
.shift-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: #fff;
  border-radius: 8px; font-size: 12px; color: #888;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.shift-mod { color: #1e88e5; font-weight: 600; }
.shift-mod.on-duty {
  color: #fff; background: #16a34a; padding: 2px 10px; border-radius: 12px;
  box-shadow: 0 1px 4px rgba(22,163,74,0.35);
}
.shift-range { color: #555; }

/* 打卡条 */
.checkin-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: 12px; padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.checkin-title { font-size: 14px; font-weight: 600; color: #1a1a1a; }
.checkin-sub { font-size: 12px; color: #888; margin-top: 4px; }
.checkin-progress { text-align: right; }
.progress-num { font-size: 20px; font-weight: 700; color: #1e88e5; }
.progress-label { font-size: 11px; color: #888; }

/* 巡查点列表 */
.point-list { display: flex; flex-direction: column; gap: 10px; }
.point-item {
  border: 1px solid #eef2f6; border-radius: 10px;
  padding: 12px 14px; background: #fff;
  transition: border-color 0.15s;
}
.point-item:hover { border-color: #cfd8dc; }
.point-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.point-name { font-size: 14px; font-weight: 600; color: #1a1a1a; }
.point-status {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: #f1f3f5; color: #777;
}
.point-status.checked { background: #e8f5e9; color: #2e7d32; }
.point-status.abnormal { background: #ffebee; color: #c62828; }
.point-content { font-size: 13px; color: #555; line-height: 1.5; margin-bottom: 4px; }
.point-meta { font-size: 11px; color: #999; display: flex; gap: 12px; margin-bottom: 8px; }
.point-meta span { display: inline-flex; align-items: center; gap: 3px; }
.point-actions { display: flex; gap: 8px; }

/* 客房房间号可编辑 */
.room-editable {
  display: inline-flex; align-items: center; gap: 4px;
}
.room-editable .room-label-text {
  font-size: 14px; font-weight: 600; color: #1a73e8;
  cursor: default;
}
.room-editable .room-label-input {
  padding: 2px 6px; border: 1.5px solid #1a73e8;
  border-radius: 4px; font-size: 13px; font-weight: 600;
  color: #1a73e8; outline: none; background: #f0f6ff;
  box-shadow: 0 0 0 2px rgba(26,115,232,0.15);
}
.room-edit-btn {
  font-size: 13px !important; padding: 1px 5px !important;
  line-height: 1; opacity: 0.5; transition: opacity 0.15s;
  cursor: pointer; background: transparent !important;
  border: none !important; box-shadow: none !important;
}
.room-edit-btn:hover { opacity: 1; }

/* 按钮 */
.btn {
  padding: 7px 14px; border-radius: 6px;
  font-size: 13px; transition: all 0.15s;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 4px; font-weight: 500;
}
.btn-primary { background: #5ec4d4; color: #fff; }
.btn-primary:hover { background: #4cb5c5; }
.btn-ghost { background: #fff; color: #555; border: 1px solid #d0d7de; }
.btn-ghost:hover { background: #f6f8fa; }
.btn-danger { background: #e53935; color: #fff; }
.btn-success { background: #2e7d32; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }

/* 整改追踪 */
.meta-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  background: #fff; border-radius: 8px; padding: 8px 14px;
  font-size: 12px; color: #555;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.meta-strong { color: #1a1a1a; font-weight: 600; }
.meta-divider { color: #cfd8dc; }
.meta-link { color: #1e88e5; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2e7d32; }
.dot-green { background: #2e7d32; }
.dot-red { background: #e53935; }
.dot-orange { background: #fb8c00; }
.meta-time { font-size: 12px; color: #888; margin: 0 4px 12px 4px; }

.rectify-list { display: flex; flex-direction: column; gap: 12px; }
.rectify-group {
  background: #fafbfc; border-radius: 8px; padding: 10px 12px;
}
.rectify-group-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; color: #1a1a1a;
  padding-bottom: 8px; border-bottom: 1px dashed #e0e0e0;
  margin-bottom: 8px;
}
.rectify-item {
  background: #fff; border-radius: 8px; padding: 12px;
  border: 1px solid #eef2f6; margin-bottom: 8px; cursor: pointer;
  transition: all 0.15s;
}
.rectify-item:hover { border-color: #90caf9; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.rectify-item-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.rectify-id { font-weight: 700; color: #1a1a1a; font-size: 14px; }
.rectify-status {
  font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600;
}
.rectify-status.assign { background: #fff4e6; color: #fb8c00; }
.rectify-status.fixing { background: #e3f2fd; color: #1e88e5; }
.rectify-status.return { background: #ffebee; color: #c62828; }
.rectify-status.review { background: #f3e5f5; color: #7b1fa2; }
.rectify-status.closed { background: #e8f5e9; color: #2e7d32; }
.rectify-status.overdue { background: #ffcdd2; color: #b71c1c; }
.priority { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #f1f3f5; color: #555; }
.priority.high { background: #ffebee; color: #c62828; }
.priority.mid { background: #fff4e6; color: #fb8c00; }
.priority.low { background: #e8f5e9; color: #2e7d32; }
.rectify-meta { font-size: 12px; color: #888; margin-bottom: 4px; }
.rectify-content { font-size: 13px; color: #555; line-height: 1.5; }
.rectify-content b { color: #1a1a1a; }

/* 排班表 */
.schedule-table-wrap { overflow-x: auto; }
.schedule-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.schedule-table th, .schedule-table td {
  text-align: left; padding: 10px 8px;
  border-bottom: 1px solid #eef2f6;
}
.schedule-table th {
  font-size: 12px; color: #888; font-weight: 600;
  background: #fafbfc;
}
.schedule-table td { color: #1a1a1a; }
.schedule-table tr:hover td { background: #fafbfc; }
.shift-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
}
.shift-badge.weekday { background: #e3f2fd; color: #1e88e5; }
.shift-badge.weekend { background: #ede7f6; color: #5e35b1; }

/* 看板 */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 16px;
}
.kpi-card {
  background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.kpi-label { font-size: 12px; color: #888; }
.kpi-num { font-size: 26px; font-weight: 700; color: #1a1a1a; margin: 6px 0; }
.kpi-trend { font-size: 11px; color: #888; }
.kpi-trend.up { color: #2e7d32; }
.kpi-trend.down { color: #c62828; }

.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px;
}
.rank-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: #f1f3f5; color: #555;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.rank-num.top1 { background: #ff8f00; color: #fff; }
.rank-num.top2 { background: #90a4ae; color: #fff; }
.rank-num.top3 { background: #a1887f; color: #fff; }
.rank-name { flex: 1; font-size: 13px; }
.rank-bar-wrap {
  flex: 2; height: 8px; background: #f1f3f5;
  border-radius: 4px; overflow: hidden;
}
.rank-bar { height: 100%; background: linear-gradient(90deg, #5ec4d4, #1e88e5); }
.rank-val { font-size: 12px; color: #555; min-width: 30px; text-align: right; }

/* ============= 系统管理 ============= */
.sub-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  border-bottom: 1px solid #eef2f6; flex-wrap: wrap;
}
.sub-tab {
  padding: 8px 16px; font-size: 14px; color: #888;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all 0.15s;
}
.sub-tab:hover { color: #1a1a1a; }
.sub-tab.active {
  color: #1e88e5; font-weight: 600; border-bottom-color: #1e88e5;
}
.sub-tab-content { display: none; }
.sub-tab-content.active { display: block; animation: fadeIn 0.2s; }

.tag-edit { display: flex; flex-direction: column; gap: 12px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 16px;
  background: #f1f3f5; color: #555; font-size: 13px;
}
.tag-item .tag-del {
  cursor: pointer; color: #c0392b; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(192,57,43,0.12); font-size: 11px;
}
.tag-item .tag-del:hover { background: rgba(192,57,43,0.25); }
.tag-add { display: flex; gap: 8px; align-items: center; max-width: 360px; }
.tag-add .form-input { flex: 1; }
.tag-add-row { max-width: 100%; }
.tag-add-row .form-input { flex: 1 1 40%; }

.backup-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.backup-hint {
  margin-top: 12px; font-size: 12px; color: #888; min-height: 18px;
}
.backup-hint.ok { color: #2e7d32; }
.backup-hint.err { color: #c62828; }

/* ============= 弹层 ============= */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-mask.show { display: flex; animation: fadeIn 0.2s; }
.modal {
  background: #fff; border-radius: 12px;
  width: 100%; max-width: 420px;
  max-height: 90vh; overflow-y: auto;
  display: flex; flex-direction: column;
  animation: slideUp 0.25s ease;
}
.modal-lg { max-width: 560px; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-title {
  font-size: 16px; font-weight: 700; color: #1a1a1a;
  padding: 16px 20px; border-bottom: 1px solid #eef2f6;
}
.modal-body { padding: 16px 20px; flex: 1; }
.modal-footer {
  padding: 12px 20px; border-top: 1px solid #eef2f6;
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ============= 拍照验证弹窗 ============= */
.modal-camera { max-width: 420px; }
.camera-hint {
  text-align: center; font-size: 13px; color: #666;
  margin-bottom: 10px; padding: 8px; background: #f5f7fa; border-radius: 8px;
}
.viewfinder-wrap {
  position: relative; width: 100%; aspect-ratio: 3/4;
  max-height: 380px; background: #000; border-radius: 10px;
  overflow: hidden; margin-bottom: 10px;
}
.viewfinder-wrap video {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.viewfinder-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
}
.cam-switch-btn {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(0,0,0,0.45); color: #fff;
  font-size: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px); transition: background 0.2s;
}
.cam-switch-btn:hover { background: rgba(0,0,0,0.65); }
.cam-switch-btn:active { transform: scale(0.92); }
.vf-corner {
  position: absolute; width: 36px; height: 36px;
  border-color: #4fc3f7; border-style: solid;
}
.vf-tl { top: 25%; left: 15%; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.vf-tr { top: 25%; right: 15%; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.vf-bl { bottom: 30%; left: 15%; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.vf-br { bottom: 30%; right: 15%; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }
.vf-face-guide {
  position: absolute; top: 23%; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.7); font-size: 12px;
  width: 70%; text-align: center;
  /* 居中在取景框内 */
  margin-top: 0;
  white-space: nowrap;
}
.camera-info-bar {
  display: flex; gap: 16px; justify-content: center;
  margin-bottom: 12px; padding: 8px 12px;
  background: #f8f9fb; border-radius: 8px;
}
.cam-info-item {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: #444;
}
.cam-info-item .cam-icon { font-size: 14px; flex-shrink: 0; }
.cam-info-item.ok { color: #2e7d32; font-weight: 600; }
.cam-info-item.err { color: #c62828; font-weight: 600; }
.cam-info-item.warn { color: #e65100; font-weight: 600; }
.camera-actions {
  display: flex; gap: 10px; justify-content: center;
}
.btn-lg { padding: 10px 28px; font-size: 15px; border-radius: 10px; }

/* 预览阶段 */
.preview-wrap {
  width: 100%; aspect-ratio: 3/4; max-height: 380px;
  background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 10px;
}
.preview-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 12px; color: #555; margin-bottom: 4px; font-weight: 600; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d0d7de;
  border-radius: 6px; font-size: 13px; background: #fff;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: #1e88e5; box-shadow: 0 0 0 3px rgba(30,136,229,0.1);
}
.form-textarea { min-height: 80px; resize: vertical; }
.date-input-wrap { position: relative; display: inline-block; width: auto; vertical-align: middle; }
.date-input-wrap input[type="date"],
.date-input-wrap input[type="datetime-local"] { width: 100%; }
.custom-date-placeholder { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #888; pointer-events: none; font-size: 13px; display: none; white-space: nowrap; background: #fff; padding: 0 2px; max-width: calc(100% - 34px); overflow: hidden; text-overflow: ellipsis; }
.date-input-wrap.show-placeholder input { color: transparent; }
.date-input-wrap.show-placeholder .custom-date-placeholder { display: block; }
.custom-file-wrap { display: flex; align-items: center; gap: 10px; }
.custom-file-wrap .btn { padding: 6px 12px; font-size: 13px; }
.custom-file-label { font-size: 13px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }

/* Toast */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.8); color: #fff; padding: 10px 18px;
  border-radius: 22px; font-size: 13px; z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* 详情字段 */
.detail-row {
  display: flex; padding: 6px 0; font-size: 13px;
  border-bottom: 1px dashed #eef2f6;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { width: 90px; color: #888; }
.detail-value { flex: 1; color: #1a1a1a; }

/* ============= 响应式 ============= */
@media (max-width: 900px) {
  .layout { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0;
    height: 100vh; z-index: 70;
    transform: translateX(-100%);
    transition: transform 0.25s;
    width: 220px;
    box-shadow: 2px 0 12px rgba(0,0,0,0.1);
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: flex; align-items: center; justify-content: center; }
  .main { padding: 12px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .toolbar-row { flex-direction: column; align-items: stretch; }
  .toolbar-label { padding: 0; }
  .modal { max-width: 100%; }
  .modal-title, .modal-body, .modal-footer { padding-left: 14px; padding-right: 14px; }
  .viewfinder-wrap { max-height: 50vh; }
  .preview-wrap { max-height: 50vh; }
}

/* ============= 报表中心 ============= */
.report-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 14px 16px; background: #fff; border-radius: 12px;
  margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.report-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-range label { font-size: 13px; color: #555; }
.report-range .form-input { width: auto; }
.report-presets { display: flex; gap: 6px; }
.report-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.report-content {
  background: #fff; border-radius: 12px; padding: 28px 32px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04); color: #1a1a1a;
}
.report-doc-title { text-align: center; font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.report-doc-sub { text-align: center; color: #888; font-size: 13px; margin-bottom: 18px; }
.report-meta { display: flex; flex-wrap: wrap; gap: 6px 28px; font-size: 13px; color: #444;
  border-bottom: 2px solid #2c3e50; padding-bottom: 12px; margin-bottom: 18px; }
.report-meta b { color: #1a1a1a; }
.report-section { margin-bottom: 22px; }
.report-section h3 { font-size: 15px; margin: 0 0 10px; padding-left: 10px; border-left: 4px solid #2c3e50; }
.report-kpi-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.report-kpi { flex: 1; min-width: 120px; background: #f7f9fb; border-radius: 10px; padding: 12px 14px; text-align: center; }
.report-kpi .num { font-size: 22px; font-weight: 700; color: #2c3e50; }
.report-kpi .lbl { font-size: 12px; color: #777; margin-top: 2px; }

.report-content table.rpt { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-content table.rpt th, .report-content table.rpt td {
  border: 1px solid #e0e6ec; padding: 7px 9px; text-align: left; vertical-align: top;
}
.report-content table.rpt th { background: #f0f4f8; font-weight: 600; }
.report-content table.rpt tr:nth-child(even) td { background: #fafbfc; }

.rpt-status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; }

/* ---------- 未完成整改筛选视图 ---------- */
.unfinished-filter {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  padding: 14px 16px; background: #f7f9fb; border: 1px solid #eef2f6;
  border-radius: 10px; margin-bottom: 16px;
}
.unfinished-filter .uf-field { display: flex; flex-direction: column; gap: 4px; }
.unfinished-filter .uf-field label { font-size: 12px; color: #666; }
.unfinished-filter .form-select, .unfinished-filter .form-input { min-width: 130px; }
.unfinished-filter .uf-search .form-input { min-width: 180px; }
.unfinished-filter .btn { align-self: flex-end; }
#unfinishedTableWrap table.rpt tr { cursor: pointer; }
#unfinishedTableWrap table.rpt tbody tr:hover td { background: #eef6ff; }
.uf-empty { text-align: center; color: #888; padding: 40px; font-size: 14px; }
.uf-count-badge { background: #c62828; color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 12px; margin-left: 4px; }
.rpt-status.closed { background: #e6f4ea; color: #1b7f37; }
.rpt-status.overdue, .rpt-status.return { background: #fdecea; color: #c0392b; }
.rpt-status.fixing, .rpt-status.review, .rpt-status.assign { background: #fff4e6; color: #d97706; }

.rpt-trend { display: flex; flex-wrap: wrap; gap: 10px; }
.rpt-trend .tbar { flex: 1; min-width: 70px; text-align: center; }
.rpt-trend .tbar .bwrap { height: 80px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.rpt-trend .tbar .b { width: 14px; border-radius: 3px 3px 0 0; }
.rpt-trend .tbar .b.c { background: #5ec4d4; }
.rpt-trend .tbar .b.a { background: #fb8c00; }
.rpt-trend .tbar .tlabel { font-size: 11px; color: #666; margin-top: 4px; }

/* 打印样式 */
@media print {
  @page { margin: 12mm; }
  .topbar, .sidebar, .hamburger, .toast, .modal-mask, .no-print { display: none !important; }
  body { background: #fff; }
  .layout { display: block; }
  .main { margin: 0; padding: 0; }
  .page { display: none; }
  .page.active { display: block; }
  .report-content { box-shadow: none; border-radius: 0; padding: 0; }
  .report-section { break-inside: avoid; }
  .report-content table.rpt { font-size: 11px; }
  .report-content table.rpt th, .report-content table.rpt td { padding: 4px 6px; }
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d7de; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0a8b0; }

/* ============= 运营看板视觉优化 ============= */
.dashboard-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid #ececec;
}
.dashboard-head .page-head { margin-bottom: 0; }
.dashboard-meta { text-align: right; color: #555; font-size: 13px; line-height: 1.6; }
.dashboard-meta .mod-name { color: #1e88e5; font-weight: 600; }

/* 核心指标 */
.metrics-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 20px;
}
.metric-card {
  background: #fff; border-radius: 14px; padding: 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  border: 1px solid #f0f0f0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.metric-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.metric-card.primary .metric-icon { background: #e8f4ff; }
.metric-card.warning .metric-icon { background: #fff4e6; }
.metric-card.danger .metric-icon { background: #ffebee; }
.metric-card.success .metric-icon { background: #e8f5e9; }
.metric-body { flex: 1; min-width: 0; }
.metric-value {
  font-size: 26px; font-weight: 700; color: #1a1a1a;
  line-height: 1.1; margin-bottom: 4px;
}
.metric-label { font-size: 13px; color: #666; }

/* 快捷入口 */
.quick-actions {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.qa-card {
  background: #fff; border-radius: 12px; padding: 14px;
  text-align: center; transition: all 0.15s;
  border: 1px solid #f0f0f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.qa-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  border-color: #dbeafe;
}
.qa-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin: 0 auto 10px;
}
.qa-title { font-size: 14px; font-weight: 600; color: #1a1a1a; }
.qa-sub { font-size: 12px; color: #888; margin-top: 2px; }

/* 洞察区：图表 + 排行 */
.insights-row {
  display: grid; grid-template-columns: 2fr 1fr;
  gap: 16px; margin-bottom: 20px;
}
.chart-card, .rank-card { margin-bottom: 0; }
.chart-card canvas { width: 100%; height: 280px; display: block; }

/* 今日待办面板 */
.todo-panel { margin-bottom: 20px; }
.todo-panel .card-title { margin-bottom: 12px; }
.todo-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 32px 20px; color: #2e7d32;
}
.todo-empty .emoji { font-size: 36px; margin-bottom: 8px; }
.todo-empty .txt { font-size: 14px; font-weight: 500; }

/* 响应式 */
@media (max-width: 1100px) {
  .insights-row { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .dashboard-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .dashboard-meta { text-align: left; }
}

/* ============= 登录页 ============= */
body.logged-out .topbar,
body.logged-out .layout { display: none; }
.login-screen {
  display: none;
  position: fixed; inset: 0; z-index: 300;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2c3e50, #4a6580);
  padding: 20px;
}
body.logged-out .login-screen { display: flex; }
.login-card {
  width: 100%; max-width: 380px;
  background: #fff; border-radius: 20px; padding: 36px 32px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: fadeInUp 0.4s ease;
  position: relative;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* 品牌行：●MOD● + 右上角 F 徽章 */
.login-card-header {
  display: flex; align-items: center; justify-content: center;
  position: relative; margin-bottom: 6px;
}
.login-brand {
  font-size: 32px; font-weight: 900; color: #2c3e50;
  letter-spacing: 3px; line-height: 1;
}
.login-f-badge {
  position: absolute; right: -4px; top: -8px;
  width: 40px; height: 40px; border-radius: 50%;
  border: 2.5px solid #2c3e50; color: #2c3e50;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 19px;
  font-family: Georgia, 'Times New Roman', serif;
  background: #fff; box-shadow: 0 2px 8px rgba(44,62,80,0.15);
}
.login-title { text-align: center; font-size: 20px; font-weight: 700; color: #1a1a1a; }
.login-sub { text-align: center; font-size: 12px; color: #aaa; margin-top: 6px; margin-bottom: 26px; }
.login-form .form-group { margin-bottom: 14px; }
.login-form .form-input { padding: 11px 12px; font-size: 14px; }
#btnLogin { margin-top: 6px; padding: 11px; font-size: 15px; font-weight: 600; }
.login-err { color: #c62828; font-size: 13px; min-height: 18px; margin-top: 10px; text-align: center; }
.login-hint {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid #eef2f6;
  font-size: 12px; color: #888; text-align: center; line-height: 1.6;
}
.login-hint b { color: #1e88e5; }

/* 角色徽标 */
.role-badge {
  display: inline-block; padding: 2px 10px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
}
.role-badge.admin { background: #ede7f6; color: #5e35b1; }
.role-badge.mod { background: #e3f2fd; color: #1e88e5; }
.role-badge.supervisor { background: #e8f5e9; color: #2e7d32; }

/* ── 多问题异常登记 UI ── */
.issue-list-label {
  font-size: 13px; font-weight: 600; color: #333;
  margin: 14px 0 8px; padding-bottom: 6px;
  border-bottom: 1px dashed #ccc;
}
.issue-card {
  border: 1px solid #d4e3f0; border-radius: 10px;
  background: linear-gradient(135deg, #f7fbff, #fff);
  padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.issue-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.issue-card-title {
  font-size: 13px; font-weight: 700; color: #1565c0;
}
.ab-photo-grid {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.ab-preview-wrap {
  position: relative; display: inline-block;
}
.ab-preview-del {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #e53935; color: #fff; border: none;
  font-size: 11px; line-height: 18px; text-align: center;
  cursor: pointer; z-index: 1;
}
.ab-preview-del:hover { background: #c62828; }

/* ── 整改详情多问题展示 ── */
.issue-detail-card {
  border: 1px solid #fce4ec; border-radius: 8px;
  background: #fff; padding: 10px 12px;
}
.issue-detail-header {
  display: flex; align-items: center;
  font-size: 13px; font-weight: 700; margin-bottom: 4px;
}
.issue-detail-photos {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}

/* ── 登录页：标题区 ── */
.login-title-block { text-align: center; margin: 10px 0 4px; }
.login-title-cn {
  font-size: 19px; font-weight: 800; color: #2c3e50;
  letter-spacing: 2px; line-height: 1.3;
}
.login-title-en {
  font-size: 13px; font-weight: 600; color: #7a8a9a;
  margin-top: 3px; letter-spacing: .8px;
}

/* ── 值班记录（安全隐患 / 发生事故 / 客人投诉）── */
.duty-notes { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.dn-field { display: flex; flex-direction: column; gap: 6px; }
.dn-field .form-label { font-weight: 700; color: #2c3e50; }
.dn-input { min-height: 64px; resize: vertical; }

/* ── 落实跟进分隔线（弹窗内复用）── */
.fu-divider {
  text-align: center; margin-bottom: 14px;
  position: relative;
}
.fu-divider span {
  background: #fff; padding: 0 12px;
  font-size: 15px; font-weight: 800; color: #2c3e50;
  letter-spacing: 1px; position: relative; z-index: 1;
}
.fu-divider::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0;
  border-top: 2px dashed #c8d6e5;
}

/* ── 值班记录：结构化隐患/事故/投诉（可点击卡片）── */
.duty-records { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.dr-card {
  border: 1.5px solid #e1e8f0; border-radius: 12px;
  padding: 12px 14px; cursor: pointer; background: #fafcff;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.dr-card:hover {
  border-color: #2c3e50; background: #f0f4f9;
  box-shadow: 0 2px 8px rgba(44,62,80,.08);
}
.dr-card:active { transform: scale(.995); }
.dr-card-head { display: flex; align-items: center; gap: 8px; }
.dr-icon { font-size: 18px; line-height: 1; }
.dr-title { font-weight: 800; color: #2c3e50; font-size: 15px; }
.dr-badge {
  margin-left: auto; font-size: 11px; padding: 2px 9px;
  border-radius: 10px; white-space: nowrap;
}
.dr-badge.empty { background: #eef2f6; color: #9aa7b4; }
.dr-badge.filled { background: #e8f5e9; color: #2e7d32; }
.dr-card-summary { font-size: 12px; color: #98a6b3; margin-top: 5px; line-height: 1.4; }
.dr-report-section .dr-section-title,
.dr-follow-section .dr-section-title {
  font-size: 14px; font-weight: 800; color: #2c3e50; margin-bottom: 10px;
}
.dr-report-section { margin-bottom: 4px; }
#drSaveHint { margin-top: 12px; }

/* ── 值班记录：多记录（一条记录 = 一个可独立删除的区块）── */
.dr-rec-block {
  border: 1.5px solid #e1e8f0; border-radius: 12px;
  padding: 14px 16px; margin-bottom: 14px; background: #fafcff;
  position: relative;
}
.dr-rec-block:last-of-type { margin-bottom: 6px; }
.dr-rec-head { display: flex; align-items: center; margin-bottom: 10px; }
.dr-rec-index { font-weight: 800; color: #2c3e50; font-size: 14px; }
.dr-rec-del {
  margin-left: auto; border: none; background: #fdecea; color: #c62828;
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 13px;
  line-height: 1; transition: background .15s;
}
.dr-rec-del:hover { background: #f5c6c2; }
.dr-add-btn {
  width: 100%; border-style: dashed; border-color: #b9c6d6; color: #2c3e50;
  font-weight: 700; padding: 10px; margin-top: 4px;
}
.dr-add-btn:hover { background: #eef3f9; border-color: #2c3e50; }
/* 正常运行切换按钮 */
.dr-normal-toggle {
  width: 100%; border-style: dashed; border-color: #4caf50; color: #2e7d32;
  font-weight: 700; padding: 10px; margin-top: 8px;
}
.dr-normal-toggle:hover { background: #e8f5e9; border-color: #2e7d32; }
.dr-normal-toggle.active {
  background: #e8f5e9; border-style: solid; border-color: #4caf50;
  color: #1b5e20;
}
/* 正常模式横幅 */
.dr-normal-banner {
  text-align: center; padding: 18px 14px; margin-bottom: 12px;
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
  border-radius: 10px; font-size: 15px; font-weight: 700; color: #2e7d32;
  letter-spacing: 0.3px;
}
/* 登记异常按钮 */
.dr-switch-to-issue {
  width: 100%; padding: 9px; font-size: 13px; color: #e65100;
  border-color: #ffcc80; font-weight: 600;
}
.dr-switch-to-issue:hover { background: #fff3e0; border-color: #e65100; }
/* 徽章：正常状态 */
.dr-badge.normal { background: #e8f5e9; color: #2e7d32; }
.dr-empty-hint { text-align: center; padding: 14px 0 4px; }
.req-star { color: #e53935; font-weight: 800; margin-left: 2px; }
.dr-field-error, .dr-field-error:focus {
  border-color: #e53935 !important;
  background: #fff5f5;
}
.dr-validate-hint {
  margin-top: 10px; color: #c62828; font-size: 13px; line-height: 1.5;
}
.dr-validate-hint ul { margin: 6px 0 0; padding-left: 20px; }

/* ── 通用设置：语言切换 ── */
.lang-switch { display: flex; gap: 10px; }
.lang-btn.active { background: #2c3e50; color: #fff; border-color: #2c3e50; }

/* ── 登录页语言切换器 ── */
.login-lang-switch {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-top: 22px; padding-top: 18px;
  border-top: 1px solid #eef2f6;
}
.login-lang-opt {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 20px;
  font-size: 13px; font-weight: 500;
  color: #8898aa; background: transparent;
  transition: all 0.25s ease; cursor: pointer;
  border: 1.5px solid transparent;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.login-lang-opt:hover {
  color: #2c3e50; background: #f4f6f8;
}
.login-lang-opt.active {
  color: #fff; background: linear-gradient(135deg, #2c3e50, #4a6580);
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(44,62,80,0.25);
}
.login-lang-flag {
  font-size: 17px; line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
.login-lang-text {
  letter-spacing: 0.3px;
}

/* ── 开发者选项 ── */
.dev-card { text-align: center; padding: 28px 20px; }
.dev-logo {
  width: 56px; height: 56px; border-radius: 50%; border: 2px solid #2c3e50;
  color: #2c3e50; font-weight: 800; font-size: 26px; font-family: Georgia, serif;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.dev-author { font-size: 18px; font-weight: 800; color: #2c3e50; margin-bottom: 10px; }
.dev-copy { color: #555; font-size: 13px; line-height: 1.7; max-width: 460px; margin: 0 auto 10px; }
.dev-contact { color: #2c3e50; font-size: 14px; }
.dev-contact a { color: #1e88e5; }
