:root {
  --primary-blue: #2B6CB0;
  --primary-blue-light: #3182CE;
  --primary-blue-dark: #1E4E8C;
  --bg-blue: #2B6CB0;
  --bg-blue-gradient: linear-gradient(135deg, #2B6CB0 0%, #3182CE 50%, #4299E1 100%);
  --text-white: #FFFFFF;
  --text-dark: #1A202C;
  --text-gray: #718096;
  --text-light-gray: #A0AEC0;
  --bg-white: #FFFFFF;
  --bg-gray: #F7FAFC;
  --bg-light-gray: #EDF2F7;
  --border-color: #E2E8F0;
  --color-red: #E53E3E;
  --color-orange: #DD6B20;
  --color-green: #38A169;
  --color-yellow: #D69E2E;
  --color-purple: #805AD5;
}

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

html, body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text-dark);
  background: var(--bg-gray);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  background: var(--bg-gray);
  display: flex;
  flex-direction: column;
}

/* ===== 顶部状态栏 ===== */
.status-bar {
  height: 24px;
  background: var(--bg-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: white;
  font-size: 11px;
  flex-shrink: 0;
}

/* ===== 首页头部 ===== */
.home-header {
  background: var(--bg-blue-gradient);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.home-header .btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

.home-header .btn:active {
  background: rgba(255,255,255,0.3);
}

.home-header .btn svg {
  width: 18px;
  height: 18px;
}

/* ===== 仪表盘 ===== */
.dashboard {
  background: var(--bg-blue-gradient);
  padding: 0 16px 12px;
  flex-shrink: 0;
}

.dashboard-stats {
  display: flex;
  justify-content: space-between;
}

.dashboard-stats .stat-item {
  text-align: center;
  flex: 1;
}

.dashboard-stats .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}

.dashboard-stats .stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  margin-top: 2px;
}

/* ===== 功能网格 ===== */
.func-grid {
  background: white;
  margin: 0;
  padding: 16px 12px 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 0;
}

.func-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.func-item:active {
  opacity: 0.7;
}

.func-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  position: relative;
}

.func-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.func-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  padding: 0 4px;
  background: #E53E3E;
  color: white;
  font-size: 10px;
  font-weight: 600;
  border-radius: 8px;
  text-align: center;
}

.func-name {
  font-size: 12px;
  color: var(--text-dark);
}

/* ===== 悬浮按钮 ===== */
.fab-btn {
  position: fixed;
  bottom: 70px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--color-red);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.4);
  cursor: pointer;
  z-index: 100;
  transition: transform 0.2s;
}

.fab-btn:active {
  transform: scale(0.9);
}

.fab-btn svg {
  width: 28px;
  height: 28px;
}

/* ===== 底部导航 ===== */
.tab-bar {
  height: 52px;
  background: white;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 4px 16px;
  position: relative;
  transition: opacity 0.2s;
}

.tab-item:active {
  opacity: 0.7;
}

.tab-item svg {
  width: 22px;
  height: 22px;
  color: var(--text-light-gray);
}

.tab-item.active svg {
  color: var(--primary-blue);
}

.tab-item .tab-label {
  font-size: 10px;
  color: var(--text-light-gray);
  margin-top: 2px;
}

.tab-item.active .tab-label {
  color: var(--primary-blue);
  font-weight: 600;
}

.tab-item .badge {
  position: absolute;
  top: 0;
  right: 8px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  background: var(--color-red);
  color: white;
  font-size: 10px;
  border-radius: 8px;
  padding: 0 4px;
}

.tab-item.active .tab-icon-wrap {
  background: var(--primary-blue);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-item.active .tab-icon-wrap svg {
  color: white !important;
}

/* ===== 页面内容区 ===== */
.page-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== 消息页 ===== */
.msg-list {
  padding: 0;
}

.msg-item {
  display: flex;
  padding: 14px 16px;
  background: white;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.msg-item:active {
  background: var(--bg-gray);
}

.msg-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.msg-icon.system { background: #EBF4FF; color: var(--primary-blue); }
.msg-icon.order { background: #FFF5F5; color: var(--color-red); }
.msg-icon.remind { background: #FFFFF0; color: var(--color-yellow); }


.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.msg-title .unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-red);
  flex-shrink: 0;
}

.msg-text {
  font-size: 13px;
  color: var(--text-gray);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-time {
  font-size: 11px;
  color: var(--text-light-gray);
  margin-top: 4px;
}

/* ===== 个人中心页 ===== */
.profile-header {
  background: var(--bg-blue-gradient);
  padding: 20px 16px;
  display: flex;
  align-items: center;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  flex-shrink: 0;
}

.profile-avatar svg {
  width: 32px;
  height: 32px;
  color: white;
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 18px;
  font-weight: 600;
  color: white;
}

.profile-status-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 3px 12px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 14px;
  color: white;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.profile-status-btn:active {
  background: rgba(255,255,255,0.1);
}

.profile-arrow {
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
}

.profile-arrow svg {
  width: 20px;
  height: 20px;
}

.profile-menu {
  margin-top: 0;
}

.menu-section {
  background: white;
  margin-bottom: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:active {
  background: var(--bg-gray);
}

.menu-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.menu-icon svg {
  width: 18px;
  height: 18px;
  color: white;
}


.menu-icon.contacts { background: var(--primary-blue); }
.menu-icon.role { background: #E53E3E; }


.menu-icon.help { background: var(--primary-blue); }
.menu-icon.settings { background: #48BB78; }

.menu-text {
  flex: 1;
  font-size: 15px;
  color: var(--text-dark);
}

.menu-arrow {
  color: var(--text-light-gray);
  display: flex;
}

.menu-arrow svg {
  width: 16px;
  height: 16px;
}

.menu-divider {
  height: 8px;
  background: var(--bg-gray);
}

/* ===== 子页面通用 ===== */
.sub-page {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-gray);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  pointer-events: none;
}

.sub-page.visible {
  transform: translateX(0);
  pointer-events: auto;
}

.sub-header {
  height: 48px;
  background: var(--bg-blue);
  display: flex;
  align-items: center;
  padding: 0 12px;
  flex-shrink: 0;
}

.sub-header .back-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
}

.sub-header .back-btn:active {
  background: rgba(255,255,255,0.15);
}

.sub-header .back-btn svg {
  width: 20px;
  height: 20px;
}

.sub-header .sub-title {
  flex: 1;
  text-align: center;
  color: white;
  font-size: 16px;
  font-weight: 500;
  margin-right: 32px;
}

.sub-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sub-content {
  display: none;
}

/* ===== 待办视图切换（我的/全部） ===== */
.todo-view-toggle {
  display: flex;
  margin: 12px 16px 8px;
  background: var(--bg-light-gray);
  border-radius: 8px;
  padding: 3px;
}
.todo-view-toggle .toggle-item {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-gray);
  cursor: pointer;
  transition: all 0.2s;
}
.todo-view-toggle .toggle-item.active {
  background: var(--primary-blue);
  color: white;
  font-weight: 600;
}

/* ===== 工单卡片 ===== */
.order-card {
  background: white;
  margin: 8px 12px;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.order-card:active {
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.order-card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
  flex: 1;
}

.order-card-no {
  font-size: 11px;
  color: var(--text-light-gray);
  margin-top: 2px;
}

.order-card-info {
  font-size: 13px;
  color: var(--text-gray);
  margin-top: 4px;
}

.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.order-card-time {
  font-size: 12px;
  color: var(--text-light-gray);
}

/* ===== 标签 ===== */
.status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.status-tag.pending { background: #FFF5F5; color: var(--color-red); }
.status-tag.accepted { background: #EBF4FF; color: var(--primary-blue); }
.status-tag.in_progress { background: #FFFFF0; color: var(--color-yellow); }
.status-tag.completed { background: #F0FFF4; color: var(--color-green); }
.status-tag.failed { background: #FFF5F5; color: #E53E3E; }
.status-tag.overdue { background: #FFF5F5; color: var(--color-red); }

.priority-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.priority-tag.high { background: #FFF5F5; color: var(--color-red); }
.priority-tag.normal { background: #EDF2F7; color: var(--text-gray); }

/* ===== 搜索栏 ===== */
.search-bar {
  padding: 10px 12px;
  background: white;
}

.search-input {
  width: 100%;
  height: 36px;
  border-radius: 18px;
  border: none;
  background: var(--bg-gray);
  padding: 0 14px;
  font-size: 14px;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-light-gray);
}

/* ===== 报表 ===== */
.report-card {
  background: white;
  margin: 8px 12px;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.report-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.report-numbers {
  display: flex;
  justify-content: space-around;
}

.report-num-item {
  text-align: center;
}

.report-num-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-blue);
}

.report-num-label {
  font-size: 12px;
  color: var(--text-gray);
  margin-top: 4px;
}

.chart-bar {
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 10px 0;
}

.chart-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chart-bar-fill {
  width: 28px;
  background: var(--primary-blue);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.5s ease;
}

.chart-bar-label {
  font-size: 10px;
  color: var(--text-light-gray);
  margin-top: 4px;
}

/* ===== 客户/设备列表 ===== */
.list-card {
  background: white;
  margin: 8px 12px;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.list-card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
}

.list-card-sub {
  font-size: 13px;
  color: var(--text-gray);
  margin-top: 4px;
}

.list-card-tag {
  margin-top: 8px;
}

/* ===== 空状态 ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  color: var(--text-light-gray);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
}

/* ===== 动画 ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* ===== 登录页 ===== */
.login-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: var(--bg-blue-gradient);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.login-logo svg {
  width: 40px;
  height: 40px;
  color: white;
}

.login-title {
  font-size: 22px;
  font-weight: 600;
  color: white;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 36px;
}

.login-form {
  width: 100%;
}

.login-field {
  width: 100%;
  height: 48px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 10px;
  padding: 0 16px;
  font-size: 16px;
  color: white;
  outline: none;
  margin-bottom: 12px;
  -webkit-user-select: text;
  user-select: text;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.login-field::placeholder {
  color: rgba(255,255,255,0.5);
}

.login-btn {
  width: 100%;
  height: 48px;
  background: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-blue);
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.2s;
}

.login-btn:active {
  opacity: 0.8;
}

/* ===== 设置工作状态弹窗 ===== */
.status-popup {
  padding: 16px;
}

.status-option {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.2s;
  border: 2px solid transparent;
}

.status-option:active,
.status-option.selected {
  background: var(--bg-gray);
  border-color: var(--primary-blue);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 10px;
}

.status-dot.online { background: #48BB78; }
.status-dot.busy { background: #D69E2E; }
.status-dot.offline { background: #A0AEC0; }



/* ===== 位置页 ===== */
.map-placeholder {
  height: 200px;
  background: var(--bg-light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light-gray);
  font-size: 14px;
}

/* ===== 帮助页 ===== */
.help-item {
  background: white;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.help-question {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
}

.help-answer {
  font-size: 13px;
  color: var(--text-gray);
  margin-top: 6px;
  line-height: 1.6;
}

/* ===== 设置页 ===== */
.setting-group {
  background: white;
  margin-bottom: 8px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-label {
  font-size: 15px;
  color: var(--text-dark);
}

.setting-value {
  font-size: 14px;
  color: var(--text-gray);
}

/* iOS 风格 toggle 开关（PF-AUTOLOC-FIX） */
.toggle-switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #CBD5E0;
  border-radius: 26px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background: #38A169;
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* 点击式 toggle 开关（PF-NOTIFY） */
.toggle-switch.on {
  background: #38A169;
}
.toggle-switch .toggle-knob {
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch.on .toggle-knob {
  transform: translateX(20px);
}

.logout-btn {
  width: calc(100% - 24px);
  margin: 24px 12px;
  height: 44px;
  background: white;
  border: 1px solid var(--color-red);
  border-radius: 8px;
  color: var(--color-red);
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.logout-btn:active {
  opacity: 0.7;
}

/* ===== 角色管理 ===== */
.role-card {
  background: white;
  margin: 8px 12px;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.role-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-dark);
}

.role-desc {
  font-size: 13px;
  color: var(--text-gray);
  margin-top: 4px;
}

.role-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.perm-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: #EBF4FF;
  color: var(--primary-blue);
}



/* ===== 回访 ===== */
.revisit-card {
  background: white;
  margin: 8px 12px;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ===== Tabs 切换 ===== */
.tabs {
  display: flex;
  background: white;
  border-bottom: 1px solid var(--border-color);
}

.tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text-gray);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.tab.active {
  color: var(--primary-blue);
  font-weight: 600;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: var(--primary-blue);
  border-radius: 1px;
}

/* ===== Scrollbar ===== */
.page-content::-webkit-scrollbar,
.sub-body::-webkit-scrollbar {
  width: 0;
  display: none;
}

/* ===== 桌面端侧边栏 (默认隐藏，手机端不用) ===== */
.sidebar {
  display: none;
}

/* ===== 布局容器 ===== */
.layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================
   响应式：大屏（>= 1024px）桌面端布局
   ============================================ */
@media screen and (min-width: 1024px) {
  #app {
    max-width: 100%;
    height: 100vh;
  }

  /* 隐藏手机端底部tab */
  .tab-bar {
    display: none;
  }

  /* 隐藏手机状态栏 */
  .status-bar {
    display: none;
  }

  /* 布局改为横向：侧边栏 + 主内容 */
  .layout {
    flex-direction: row;
    height: 100vh;
  }

  /* 侧边栏显示 */
  .sidebar {
    display: flex;
    flex-direction: column;
    width: 220px;
    background: var(--bg-blue);
    color: white;
    flex-shrink: 0;
    padding: 0;
  }

  .sidebar-logo {
    display: flex;
    align-items: center;
    padding: 20px 20px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    gap: 10px;
  }

  .sidebar-logo svg {
    width: 28px;
    height: 28px;
  }

  .sidebar-nav {
    flex: 1;
    padding: 12px 0;
  }

  .sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    gap: 12px;
    font-size: 15px;
    transition: background 0.2s, color 0.2s;
  }

  .sidebar-nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
  }

  .sidebar-nav-item.active {
    background: rgba(255,255,255,0.15);
    color: white;
    font-weight: 600;
  }

  .sidebar-nav-item svg {
    width: 22px;
    height: 22px;
  }

  .sidebar-user {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
    gap: 10px;
  }

  .sidebar-user:hover {
    background: rgba(255,255,255,0.08);
  }

  .sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .sidebar-user-avatar svg {
    width: 22px;
    height: 22px;
    color: white;
  }

  .sidebar-user-info {
    flex: 1;
    min-width: 0;
  }

  .sidebar-user-name {
    font-size: 14px;
    color: white;
    font-weight: 500;
  }

  .sidebar-user-status {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-top: 2px;
  }

  /* 主内容区 */
  .main-area {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-gray);
  }

  /* 首页头部 */
  .home-header {
    padding: 16px 32px;
  }

  .home-header .btn {
    width: 40px;
    height: 40px;
  }

  .home-header .btn svg {
    width: 22px;
    height: 22px;
  }

  /* 仪表盘放大 */
  .dashboard {
    padding: 0 32px 28px;
  }

  .dashboard-gauge {
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
  }

  .dashboard-gauge .gauge-ring {
    width: 156px;
    height: 156px;
    border-width: 10px;
  }

  .dashboard-gauge .gauge-value {
    font-size: 48px;
  }

  .dashboard-stats {
    max-width: 600px;
    margin: 0 auto;
  }

  .dashboard-stats .stat-value {
    font-size: 26px;
  }

  .dashboard-stats .stat-label {
    font-size: 14px;
  }

  /* 功能网格放大，最多6列 */
  .func-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    padding: 20px 32px 16px;
    max-width: 1100px;
    margin: 0 auto;
  }

  .func-item {
    padding: 14px 8px;
  }

  .func-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }

  .func-icon svg {
    width: 30px;
    height: 30px;
  }

  .func-name {
    font-size: 14px;
    margin-top: 4px;
  }

  /* 悬浮按钮位置调整 */
  .fab-btn {
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
  }

  .fab-btn svg {
    width: 30px;
    height: 30px;
  }

  /* 消息列表/工单列表卡片：宽屏下两列排列 */
  .msg-list,
  .sub-body .order-card,
  .sub-body .list-card,
  .sub-body .report-card,
  .sub-body .revisit-card,
  .sub-body .role-card {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
  }

  /* 工单/记录卡片：大屏两列网格 */
  .sub-body .order-card,
  .sub-body .list-card,
  .sub-body .revisit-card {
    max-width: 100%;
  }

  /* 子页面在大屏上不再全屏覆盖，而是居中弹层 */
  .sub-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    pointer-events: none;
  }

  .sub-page.visible {
    transform: translateX(0);
    pointer-events: auto;
  }

  .sub-header {
    max-width: 600px;
    margin: 0 auto;
    border-radius: 0;
  }

  .sub-body {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-gray);
    height: calc(100vh - 48px);
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
  }

  /* 个人中心头部 */
  .profile-header {
    padding: 28px 32px;
  }

  .profile-avatar {
    width: 64px;
    height: 64px;
  }

  .profile-avatar svg {
    width: 36px;
    height: 36px;
  }

  .profile-name {
    font-size: 20px;
  }

  .profile-menu {
    max-width: 800px;
    margin: 0 auto;
  }

  .menu-item {
    padding: 16px 20px;
  }

  /* 报表柱状图放大 */
  .chart-bar {
    height: 220px;
  }

  .chart-bar-fill {
    width: 40px;
  }

  /* 搜索栏放大 */
  .search-input {
    height: 40px;
    font-size: 15px;
  }

  /* 登录页桌面端样式 */
  .login-page {
    max-width: 100%;
  }

  .login-form {
    max-width: 360px;
  }
}

/* 平板端（768px - 1023px）：保持手机样式但放宽 */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  #app {
    max-width: 540px;
  }

  .func-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============ 下载中心：文件行 / 按钮族 / 批量条 ============ */
.file-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #EDF2F7;
}
.file-row:last-child {
  border-bottom: none;
}
.file-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  flex-shrink: 0;
}
.file-icon-blue { background: #EBF4FF; }
.file-icon-purple { background: #FAF5FF; }
.file-info {
  flex: 1;
  min-width: 0;
}
.file-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta {
  font-size: 11px;
  color: #A0AEC0;
  margin-top: 2px;
}

/* 按钮族（小号） */
.btn-soft-sm,
.btn-blue-sm,
.btn-green-sm,
.btn-danger-sm,
.btn-danger-sm-active {
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 6px;
  white-space: nowrap;
}
.btn-soft-sm {
  background: #EDF2F7;
  color: #4A5568;
}
.btn-soft-sm:hover { background: #E2E8F0; }
.btn-blue-sm {
  background: #2B6CB0;
  color: white;
}
.btn-green-sm {
  background: #38A169;
  color: white;
}
.btn-danger-sm {
  background: #FFF5F5;
  color: #C53030;
  border: 1px solid #FED7D7;
}
.btn-danger-sm:hover { background: #FED7D7; }
.btn-danger-sm-active {
  background: #E53E3E;
  color: white;
}

/* 批量操作条 */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #FFF5F5;
  border: 1px solid #FED7D7;
  border-radius: 6px;
  margin-bottom: 10px;
}

/* 文件夹卡片 */
.folder-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  overflow: hidden;
}
.folder-header {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.folder-header:active {
  background: #F7FAFC;
}
.folder-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #FEFCBF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  flex-shrink: 0;
}
.folder-body {
  padding: 0 14px 12px 14px;
  border-top: 1px solid #EDF2F7;
}
.folder-body .file-row {
  padding: 8px 0;
}

/* 门店清单行 */
.store-row {
  display: flex;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #EDF2F7;
  gap: 6px;
}
.store-row:last-child {
  border-bottom: none;
}
.store-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #2D3748;
}
.store-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ============ 用户管理 ============ */
.user-card {
  background: white;
  margin: 8px 12px;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.um-input {
  width: 100%;
  height: 40px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  background: #F7FAFC;
  color: #1A202C;
  transition: border-color 0.2s;
}
.um-input:focus {
  border-color: #2B6CB0;
  background: white;
}
.um-input::placeholder {
  color: #A0AEC0;
}
select.um-input {
  appearance: auto;
}

/* ===== Capacitor APP：强制移动端布局 ===== */
body.capacitor-app #app {
  max-width: 100%;
  height: 100%;
}

body.capacitor-app .tab-bar {
  display: flex;
}

/* 提交工单按钮 - 移动端优化触摸 */
.submit-order-btn {
  width: 100%;
  height: 44px;
  background: #2B6CB0;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  margin-top: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.submit-order-btn:active {
  background: #1a4f8a;
  transform: scale(0.98);
}

body.capacitor-app .status-bar {
  display: flex;
}

body.capacitor-app .sidebar {
  display: none !important;
}

body.capacitor-app .layout {
  flex-direction: column;
  height: 100%;
}

body.capacitor-app .main-area {
  flex: 1;
}

body.capacitor-app .login-page {
  max-width: 100%;
}

body.capacitor-app .login-form {
  max-width: none;
}

/* ===== 搜索标签（全局搜索弹窗） ===== */
.search-tab {
  padding: 4px 14px;
  border-radius: 16px;
  font-size: 12px;
  color: #718096;
  background: #EDF2F7;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.search-tab.active {
  background: #2B6CB0;
  color: white;
}

/* ===== 表单标签 ===== */
.form-label {
  font-size: 13px;
  color: #718096;
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

/* ===== 报表-月份选择器 ===== */
.report-month-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px;
  margin-bottom: 12px;
}
.report-month-arrow {
  font-size: 24px;
  color: #2B6CB0;
  cursor: pointer;
  padding: 0 8px;
  user-select: none;
}
.report-month-arrow:active { opacity: 0.6; }
.report-month-label {
  font-size: 16px;
  font-weight: 600;
  color: #1A202C;
  min-width: 80px;
  text-align: center;
}
.report-export-btn {
  margin-left: 12px;
  padding: 4px 14px;
  font-size: 13px;
  color: #2B6CB0;
  background: #EBF4FF;
  border: 1px solid #BEE3F8;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.report-export-btn:active { background: #BEE3F8; }

/* ===== 报表-状态网格 ===== */
.emp-stats-status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.emp-stats-status-item {
  text-align: center;
  padding: 10px 4px;
  border-radius: 8px;
  background: #F7FAFC;
}
.emp-stats-status-num {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}
.emp-stats-status-label {
  font-size: 12px;
  color: #718096;
  margin-top: 2px;
}
.text-pending { color: #D69E2E; }
.text-accepted { color: #2B6CB0; }
.text-touched { color: #805AD5; }
.text-in_progress { color: #DD6B20; }
.text-completed { color: #38A169; }
.text-failed { color: #E53E3E; }

/* ===== 报表-员工列表 ===== */
.emp-stats-emp-item {
  padding: 12px 0;
  border-bottom: 1px solid #EDF2F7;
  cursor: pointer;
}
.emp-stats-emp-item:last-child { border-bottom: none; }
.emp-stats-emp-item:active { background: #F7FAFC; }
.emp-stats-emp-name {
  font-size: 15px;
  font-weight: 600;
  color: #1A202C;
}
.emp-stats-emp-role {
  font-size: 12px;
  color: #718096;
  font-weight: 400;
  margin-left: 6px;
}
.emp-stats-emp-nums {
  font-size: 13px;
  color: #4A5568;
  margin-top: 4px;
  display: flex;
  gap: 16px;
}
.emp-stats-emp-nums b { color: #1A202C; }
.emp-stats-emp-done b { color: #38A169; }

/* ===== 报表-迷你进度条 ===== */
.emp-stats-mini-bar {
  height: 4px;
  background: #EDF2F7;
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.emp-stats-mini-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

/* ===== 报表-员工详情弹窗 ===== */
.emp-stats-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.emp-stats-modal-body {
  background: white;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
}
.emp-stats-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
  color: #1A202C;
}
.emp-stats-modal-close {
  font-size: 28px;
  color: #718096;
  cursor: pointer;
  line-height: 1;
}
.emp-stats-modal-role {
  font-size: 13px;
  color: #718096;
  margin-top: 2px;
}
.emp-stats-modal-section {
  margin-top: 16px;
}
.emp-stats-modal-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: #2D3748;
  margin-bottom: 4px;
}
.emp-stats-modal-total {
  font-size: 12px;
  color: #718096;
  margin-bottom: 8px;
}

/* ===== 报表-状态条 ===== */
.emp-stats-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.emp-stats-bar-label {
  font-size: 12px;
  color: #718096;
  width: 48px;
  flex-shrink: 0;
}
.emp-stats-bar-track {
  flex: 1;
  height: 8px;
  background: #EDF2F7;
  border-radius: 4px;
  overflow: hidden;
}
.emp-stats-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
  min-width: 0;
}
.emp-stats-bar-num {
  font-size: 12px;
  font-weight: 600;
  color: #1A202C;
  width: 24px;
  text-align: right;
  flex-shrink: 0;
}
.bar-pending { background: #D69E2E; }
.bar-accepted { background: #2B6CB0; }
.bar-touched { background: #805AD5; }
.bar-in_progress { background: #DD6B20; }
.bar-completed { background: #38A169; }
.bar-failed { background: #E53E3E; }

/* ===== 报表-月度趋势图 ===== */
.emp-stats-trend-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 8px;
  height: 140px;
  padding: 8px 0;
}
.emp-stats-trend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.emp-stats-trend-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 100px;
}
.emp-stats-trend-bar {
  width: 12px;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
}
.emp-stats-trend-label {
  font-size: 11px;
  color: #718096;
  margin-top: 4px;
}
.emp-stats-trend-nums {
  font-size: 10px;
  color: #A0AEC0;
}
.emp-stats-trend-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #718096;
  margin-top: 8px;
}
.emp-stats-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

/* ===== 库存盘点 ===== */
.inv-actions {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
}
.inv-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.inv-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.inv-btn:active { opacity: 0.7; }
.inv-btn-primary { background: #2B6CB0; color: white; }
.inv-btn-outline { background: white; color: #2B6CB0; border: 1px solid #2B6CB0; }
.inv-btn-block { width: 100%; padding: 14px; font-size: 16px; }
.inv-import-info {
  padding: 0 16px 8px;
  font-size: 12px;
  color: #718096;
}

/* 弹窗 */
.inv-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.inv-modal-body {
  background: white;
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  text-align: center;
}
.inv-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #1A202C;
}
.inv-modal-close {
  margin-top: 16px;
  color: #718096;
  cursor: pointer;
  font-size: 14px;
}
.inv-upload-btn {
  display: inline-block;
  padding: 10px 24px;
  background: #2B6CB0;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
}
.inv-upload-btn.disabled { opacity: 0.5; }
.inv-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #CBD5E0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
}

/* 盘点卡片列表 */
.inv-check-card {
  background: white;
  border-radius: 12px;
  margin: 8px 16px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.inv-check-card:active { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.inv-check-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.inv-check-card-store {
  font-size: 15px;
  font-weight: 600;
  color: #1A202C;
  flex: 1;
}
.inv-check-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.inv-check-badge.ongoing { background: #FEFCBF; color: #D69E2E; }
.inv-check-badge.done { background: #F0FFF4; color: #38A169; }
.inv-check-del {
  font-size: 12px;
  color: #E53E3E;
  margin-left: 8px;
  flex-shrink: 0;
}
.inv-check-export {
  font-size: 12px;
  color: #3182CE;
  margin-left: 8px;
  flex-shrink: 0;
  cursor: pointer;
}
.inv-check-export:active {
  color: #2B6CB0;
}
.inv-btn-secondary {
  background: #fff;
  color: #3182CE;
  border: 1px solid #3182CE;
}
.inv-btn-secondary:active {
  background: #EBF8FF;
}
.inv-check-card-bar {
  height: 6px;
  background: #EDF2F7;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.inv-check-card-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2B6CB0, #4299E1);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.inv-check-card-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.inv-check-card-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #A0AEC0;
}
.inv-matched { color: #38A169; }
.inv-unmatched { color: #E53E3E; }
.inv-extra { color: #D69E2E; }

/* 进度条 */
.inv-progress-bar {
  padding: 12px 16px 8px;
  background: white;
  border-bottom: 1px solid #EDF2F7;
}
.inv-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.inv-progress-label {
  font-size: 15px;
  font-weight: 700;
  color: #1A202C;
}
.inv-progress-detail {
  font-size: 12px;
  display: flex;
  gap: 8px;
}
.inv-progress-track {
  height: 8px;
  background: #EDF2F7;
  border-radius: 4px;
  overflow: hidden;
}
.inv-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2B6CB0, #4299E1);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* 串号录入/扫码区 */
.inv-scan-area {
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #EDF2F7;
}
/* 大按钮：开始扫码 */
.inv-scan-start {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}
.inv-scan-big-btn { display: flex; align-items: center; gap: 10px; padding: 16px 32px; background: #2B6CB0; color: white; border: none; border-radius: 12px; font-size: 18px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(43,108,176,0.3); }
.inv-scan-big-btn:active { opacity: 0.85; transform: scale(0.98); }

/* 取景框扫码引导 */
.inv-scan-guide {
  position: relative;
  background: #1A202C;
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}
.inv-scan-guide:active { opacity: 0.9; }
.inv-scan-guide-disabled { pointer-events: none; opacity: 0.6; }
.inv-scan-guide-text { color: #E2E8F0; font-size: 14px; margin-top: 12px; font-weight: 500; }

.inv-viewfinder {
  width: 240px;
  height: 120px;
  margin: 0 auto;
  position: relative;
  border: 2px dashed rgba(255,255,255,0.3);
  border-radius: 8px;
  background: rgba(0,0,0,0.2);
}
.inv-viewfinder-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: #48BB78;
  border-style: solid;
}
.inv-vf-tl { top: -2px; left: -2px; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.inv-vf-tr { top: -2px; right: -2px; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.inv-vf-bl { bottom: -2px; left: -2px; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.inv-vf-br { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }
.inv-viewfinder-line {
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(72,187,120,0.5), transparent);
}

/* 条码识别预览确认 */
.inv-barcode-preview {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ===== 摄像头扫码枪模式 ===== */
.inv-scanner-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}
.inv-scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  color: #fff;
  z-index: 2;
}
.inv-scanner-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inv-scanner-title {
  font-size: 16px;
  font-weight: 500;
}
.inv-scanner-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inv-scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.inv-scanner-mask {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.55) calc(40% - 10px), transparent calc(40% - 10px), transparent calc(40% + 40px), rgba(0,0,0,0.55) calc(40% + 40px)),
    linear-gradient(to right, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.55) 15%, transparent 15%, transparent 85%, rgba(0,0,0,0.55) 85%);
}
.inv-scanner-frame {
  width: 70%;
  height: 50px;
  position: relative;
  border: 2px solid rgba(49, 130, 206, 0.8);
  border-radius: 6px;
  background: transparent;
}
.inv-scanner-line {
  position: absolute;
  left: 4px; right: 4px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #3182CE, transparent);
  top: 50%;
  transform: translateY(-50%);
  animation: invScanLine 1.8s ease-in-out infinite;
}
@keyframes invScanLine {
  0%, 100% { top: 20%; }
  50% { top: 80%; }
}
.inv-scanner-hint {
  position: absolute;
  bottom: 20px;
  left: 0; right: 0;
  text-align: center;
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.inv-scanner-footer {
  padding: 16px;
  z-index: 2;
}
.inv-scanner-footer .inv-scan-big-btn {
  width: 100%;
}

/* 删除按钮 */
.inv-delete-btn {
  background: none;
  border: none;
  color: #E53E3E;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
}
.inv-delete-btn:active { background: #FFF5F5; }
/* 等待拍照（扫码成功后强制拍照） */
.inv-wait-photo {
  text-align: center;
  padding: 16px 0;
}
.inv-wait-photo-serial {
  font-size: 18px;
  font-family: monospace;
  font-weight: 700;
  color: #1A202C;
  margin-bottom: 4px;
}
.inv-wait-photo-hint {
  font-size: 14px;
  color: #D69E2E;
  font-weight: 600;
  margin-bottom: 12px;
}
.inv-photo-big-btn {
  padding: 14px 40px !important;
  font-size: 17px !important;
  border-radius: 12px !important;
}
/* 扫码器容器 */
.inv-decoding-hint {
  text-align: center;
  color: #1890ff;
  font-size: 14px;
  padding: 10px 0;
}
.inv-scanner-wrap {
  position: relative;
}
.inv-scan-hint {
  text-align: center;
  font-size: 13px;
  color: #888;
  padding: 6px 0;
  background: #f5f5f5;
  border-radius: 8px 8px 0 0;
}
.inv-scanner-view {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  min-height: 200px;
  max-height: 260px;
}
.inv-scanner-view video { border-radius: 10px; }
.inv-scan-stop {
  margin-top: 8px;
  width: 100%;
}

/* 扫描结果闪烁反馈 */
.inv-scan-result {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: inv-flash-in 0.3s ease;
}
.inv-flash-matched { background: #F0FFF4; border: 1px solid #C6F6D5; }
.inv-flash-in_transit { background: #FEFCBF; border: 1px solid #FEFCBF; }
.inv-flash-extra { background: #FFF5F5; border: 1px solid #FED7D7; }
@keyframes inv-flash-in {
  0% { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}
.inv-result-serial {
  font-family: monospace;
  font-weight: 600;
  color: #1A202C;
}
.inv-result-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.inv-tag-matched { color: #38A169; background: #F0FFF4; }
.inv-tag-in_transit { color: #D69E2E; background: #FEFCBF; }
.inv-tag-extra { color: #E53E3E; background: #FFF5F5; }
.inv-tag-unmatched { color: #E53E3E; background: #FFF5F5; }
.inv-result-product {
  font-size: 12px;
  color: #718096;
}

/* 已提交提示 */
.inv-submitted-notice {
  padding: 12px 16px;
  text-align: center;
  color: #718096;
  font-size: 14px;
  background: #F7FAFC;
  border-bottom: 1px solid #EDF2F7;
}

/* 三Tab */
.inv-tabs {
  display: flex;
  border-bottom: 1px solid #EDF2F7;
  background: white;
  position: sticky;
  top: 0;
  z-index: 10;
}
.inv-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: #718096;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.inv-tab.active {
  color: #2B6CB0;
  border-bottom-color: #2B6CB0;
}

/* Tab内容 */
.inv-tab-content {
  padding: 0 16px;
}
.inv-item {
  padding: 10px 0;
  border-bottom: 1px solid #EDF2F7;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.inv-item:last-child { border-bottom: none; }
.inv-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.inv-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.inv-item-serial {
  font-size: 14px;
  font-weight: 600;
  font-family: monospace;
  color: #1A202C;
  word-break: break-all;
}
.inv-item-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.inv-item-product {
  font-size: 12px;
  color: #718096;
}
.inv-photo-btn {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid #CBD5E0;
  border-radius: 6px;
  background: white;
  color: #4A5568;
  cursor: pointer;
  flex-shrink: 0;
}
.inv-photo-btn:disabled { opacity: 0.5; }

.inv-empty-tab {
  text-align: center;
  padding: 32px 0;
  color: #A0AEC0;
  font-size: 14px;
}
.inv-tab-hint {
  text-align: center;
  padding: 12px 0;
  color: #A0AEC0;
  font-size: 12px;
}

/* 提交按钮 */
.inv-submit-area {
  padding: 16px;
}

/* 门店模式：上传成功反馈 */
.inv-flash-success {
  background: #F0FFF4 !important;
  border: 1px solid #C6F6D5 !important;
}
.inv-result-check {
  color: #38A169;
  font-size: 18px;
  font-weight: 700;
}
.inv-tag-success {
  color: #38A169;
  background: #F0FFF4;
}

/* 门店模式：已上传列表 */
.inv-upload-list {
  padding: 0 16px;
}
.inv-upload-title {
  font-size: 14px;
  font-weight: 600;
  color: #4A5568;
  padding: 12px 0 4px;
}
.inv-upload-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #EDF2F7;
  gap: 8px;
}
.inv-upload-item:last-child { border-bottom: none; }
.inv-upload-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inv-upload-check {
  color: #38A169;
  font-size: 16px;
  font-weight: 700;
}
.inv-photo-done {
  font-size: 14px;
  color: #38A169;
}

/* 缩略图 */
.inv-upload-thumb, .inv-pending-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #E2E8F0;
  flex-shrink: 0;
}
.inv-upload-thumb-placeholder, .inv-pending-thumb-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: #EDF2F7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #A0AEC0;
  flex-shrink: 0;
}

/* 待提交列表 */
.inv-pending-list {
  padding: 0 16px;
  margin-top: 8px;
}
.inv-pending-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #D69E2E;
  padding: 12px 0 4px;
}
.inv-pending-item {
  display: flex;
  align-items: center;
  padding: 6px 0;
  gap: 8px;
  border-bottom: 1px solid #FEFCBF;
}
.inv-pending-item:last-child { border-bottom: none; }

/* ===== 图片预览弹窗 (Lightbox) ===== */
.img-lightbox-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.92);
  z-index: 10000;
  display: flex; flex-direction: column;
}
.img-lightbox-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: rgba(0,0,0,0.6);
  flex-shrink: 0; z-index: 10001;
}
.img-lightbox-back {
  background: none; border: none; color: #fff;
  font-size: 16px; font-weight: 600; cursor: pointer;
  padding: 6px 10px; border-radius: 6px;
  white-space: nowrap;
}
.img-lightbox-back:active { background: rgba(255,255,255,0.15); }
.img-lightbox-name {
  color: #ccc; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 50%; text-align: center;
}
.img-lightbox-dl {
  color: #63B3ED; font-size: 14px; font-weight: 600;
  text-decoration: none; padding: 6px 10px; border-radius: 6px;
  white-space: nowrap;
}
.img-lightbox-dl:active { background: rgba(255,255,255,0.15); }
.img-lightbox-body {
  flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none;
}
.img-lightbox-body img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; transform-origin: center center;
  transition: none; -webkit-user-drag: none;
}
.img-lightbox-loading {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  color: #fff; font-size: 16px;
}

