/* ============================================
   智慧收银 Smart POS - 全局样式
   主色参考智慧记 Ailit：绿色 #00a651
   ============================================ */
:root {
  --primary: #00a651;
  --primary-dark: #008a43;
  --primary-light: #e6f7ee;
  --accent: #ff6b35;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --border: #e5e7eb;
  --danger: #ef4444;
  --warn: #f59e0b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
  --sidebar-w: 96px;
  --topbar-h: 56px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- 布局骨架 ---------- */
#app { display: flex; height: 100vh; height: 100dvh; }  /* 动态视口：平板浏览器地址栏占位时底部不被裁切 */
#sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 50;
}
.brand { padding: 18px 0 14px; text-align: center; border-bottom: 1px solid #f1f3f5; }
.brand-logo {
  width: 44px; height: 44px; margin: 0 auto 8px;
  background: linear-gradient(135deg, #00c46a, #008a43);
  border-radius: 12px; color: #fff; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0,166,81,.3);
}
.brand-name { font-size: 13px; font-weight: 700; }
.brand-sub { font-size: 10px; color: var(--text-3); margin-top: 2px; }

#nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.nav-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 4px; border-radius: 10px; color: var(--text-2);
  margin-bottom: 4px; transition: all .15s;
}
.nav-item .nav-ico { font-size: 20px; margin-bottom: 4px; filter: grayscale(.4); }
.nav-item .nav-txt { font-size: 11px; }
.nav-item:hover { background: #f5f7f8; color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-item.active .nav-ico { filter: none; }

.side-foot { padding: 12px 8px; border-top: 1px solid #f1f3f5; text-align: center; }
.lang-switch {
  font-size: 12px; color: var(--text-2); background: #f5f7f8;
  padding: 6px 8px; border-radius: 8px; cursor: pointer;
}

#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar {
  height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 14px; flex-shrink: 0;
}
.menu-btn { display: none; font-size: 20px; background: none; border: none; color: var(--text-2); }
.top-title { font-size: 17px; font-weight: 700; flex: 1; }
.top-right { display: flex; align-items: center; gap: 12px; }
.clock { color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
#view { flex: 1; overflow-y: auto; padding: 18px; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 9px 16px; border-radius: 10px; font-size: 14px; transition: all .15s;
  white-space: nowrap; user-select: none;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #e85a26; color: #fff; }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #f3f4f6; color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
/* 结账按钮：无商品时灰白（非半透明橙） */
.btn-accent:disabled { background: #e5e7eb; border-color: #e5e7eb; color: #9ca3af; opacity: 1; box-shadow: none; }
.btn { touch-action: manipulation; }   /* 消除移动端 300ms 点击延迟 */

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px;
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 10px; outline: none; background: #fff; transition: border .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,166,81,.12); }
textarea.input { resize: vertical; min-height: 60px; }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; padding: 10px 12px; color: var(--text-2); font-weight: 600;
  background: #fafbfc; border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0;
}
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--primary); background: #f0faf4; }
.tbl .sort-arrow { font-size: 10px; color: var(--text-3); margin-left: 2px; }
.tbl th.sortable:hover .sort-arrow { color: var(--primary); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #f1f3f5; vertical-align: middle; }
.tbl tr:hover td { background: #fafdfb; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .ctr { text-align: center; }
/* 商品"最后修改"列：仅手机卡片显示（桌面保留原表格列，不展示该列） */
.tbl th.pm-updated-m, .tbl td.pm-updated-m { display: none; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px;
  font-weight: 600;
}
.tag-green { background: var(--primary-light); color: var(--primary); }
.tag-admin { background: #0f172a; color: #fff; }
.tag-red { background: #fee2e2; color: var(--danger); }
.tag-amber { background: #fef3c7; color: #b45309; }
.tag-gray { background: #f3f4f6; color: var(--text-2); }

/* 开关 */
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: #d1d5db; border-radius: 24px;
  transition: .2s; cursor: pointer;
}
.switch .slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* 模态框 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(17,24,39,.5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .15s; overscroll-behavior: contain;
}
.modal {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column;
  animation: slideUp .18s;
}
.modal-lg { max-width: 860px; }
.modal-sm { max-width: 400px; }
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-3); padding: 4px; }
.modal-body { padding: 18px 20px; overflow-y: auto; min-height: 0; flex: 1 1 auto; touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }   /* flex 子项可收缩：内容超高时内部滚动而非撑破弹窗 */
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } }

/* Toast */
#toast-root { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #1f2937; color: #fff; padding: 10px 20px; border-radius: 10px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toastIn .2s; max-width: 90vw;
}
.toast.ok { background: var(--primary); }
.toast.err { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* 表单布局 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.form-item label .req { color: var(--danger); }
.form-hint { font-size: 12px; color: var(--text-3); }

/* 设置行 */
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid #f1f3f5;
}
.set-row:last-child { border-bottom: none; }
.set-label { font-weight: 500; }
.set-desc { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.set-value { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.stat-card .st-label { font-size: 12.5px; color: var(--text-2); }
.stat-card .st-value { font-size: 26px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-card .st-ico { position: absolute; right: 14px; top: 14px; font-size: 26px; opacity: .18; }
.stat-card.green .st-value { color: var(--primary); }
.stat-card.orange .st-value { color: var(--accent); }
.stat-card.gold { background: #fef9e7; }
.stat-card.gold .st-value { color: #b8860b; }
.stat-card.red .st-value { color: var(--danger); }

/* 空状态 */
.empty {
  text-align: center; color: var(--text-3); padding: 48px 20px; font-size: 13.5px;
}
/* 购物车空态：垂直水平居中显示（桌面端面板内） */
.cart-items .empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.empty .empty-ico { font-size: 44px; margin-bottom: 10px; opacity: .5; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 0; color: var(--text-2); font-size: 13px; }

/* 加载 */
.loading { display: flex; align-items: center; justify-content: center; padding: 60px; color: var(--text-3); gap: 10px; }
.spinner {
  width: 22px; height: 22px; border: 3px solid var(--primary-light);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 登录页（浅绿色背景居中卡片） */
.login-page {
  width: 100%; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  background: linear-gradient(180deg, #eaf7f0 0%, #d9f0e3 60%, #cdeadd 100%);
  position: relative; overflow-y: auto; padding: 6vh 20px 40px;
  /* 最稳妥布局：顶部留白排列（6vh），内容超高时向下滚动自然可达，任何视口高度都不会裁切控件 */
}
.login-page::before {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: rgba(0,166,81,.06); top: -180px; right: -140px;
  pointer-events: none;   /* 装饰元素不拦截点击 */
}
.login-page::after {
  content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%;
  background: rgba(0,166,81,.07); bottom: -140px; left: -90px;
  pointer-events: none;   /* 装饰元素不拦截点击 */
}
.login-card {
  background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg);
  padding: 32px 40px 28px; width: 100%; max-width: 380px; position: relative; z-index: 1;
  animation: slideUp .25s;
}
.login-logo {
  width: 60px; height: 60px; margin: 0 auto 12px;
  background: linear-gradient(135deg, #00c46a, #008a43); border-radius: 17px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 28px; box-shadow: 0 8px 20px rgba(0,166,81,.3);
}
.login-brand { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.login-sub { text-align: center; color: var(--text-3); font-size: 13px; margin: 6px 0 24px; }
.login-form label { color: var(--text-2); font-weight: 600; }
.login-input { padding: 12px 14px; font-size: 16px; border-radius: 12px; }
.login-btn { padding: 16px; font-size: 17px; letter-spacing: 4px; border-radius: 12px; }
.login-foot { color: var(--text-3); font-size: 12px; margin-top: 18px; position: relative; z-index: 1; text-align: center; }

/* 顶栏用户区 */
.user-box { display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 7px; cursor: pointer; padding: 4px 10px 4px 4px; border-radius: 24px; background: #f4f6f8; }
.user-chip:hover { background: var(--primary-light); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.user-name { font-size: 12.5px; font-weight: 600; max-width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.refresh-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  height: 34px; padding: 0 12px; border-radius: 10px; background: #fff; border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; color: var(--text-2); box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.refresh-chip:hover { background: var(--primary-light); color: var(--primary); border-color: #b7ebd2; box-shadow: 0 4px 10px rgba(0, 166, 81, .12); }
.user-box .user-chip { padding: 3px; border-radius: 50%; }
.user-box .user-avatar { width: 30px; height: 30px; font-size: 15px; }

/* 收银台新布局 */
.pos-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.price-big {
  padding: 18px 10px; border-radius: 16px; border: 2px solid var(--border); background: #fff;
  font-size: 17px; font-weight: 800; display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: all .12s; color: var(--text-2);
}
.price-big .pb-ico { font-size: 30px; }
.price-big:hover { border-color: var(--primary); transform: translateY(-1px); }
.price-big.active-retail { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(0,166,81,.35); }
.price-big.active-wholesale { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(255,107,53,.35); }
.price-big:active { transform: scale(.96); }

.pos-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.search-wrap { position: relative; flex: 1; display: flex; align-items: center; }
.filter-bar .search-wrap .input { width: 100%; min-width: 0; }
.search-wrap .input { padding-right: 76px; }
.search-x {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: #e5e7eb; color: #4b5563; font-size: 13px; line-height: 1;
  display: none; align-items: center; justify-content: center; cursor: pointer;
  font-weight: 700;
}
.search-x:hover { background: var(--danger); color: #fff; }
.search-wrap.has-value .search-x { display: flex; }
.pos-search-big { flex: 1; padding: 14px 18px; font-size: 16px; border-radius: 14px; border: 2px solid var(--border); }
.pos-search-big:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0,166,81,.12); }
.btn-scan-big {
  width: 48px; height: 48px; border-radius: 13px; background: var(--primary); color: #fff;
  border: none; font-size: 22px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(0,166,81,.3); transition: all .12s; flex-shrink: 0;
}
.btn-scan-big:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-scan-big:active { transform: scale(.94); }
.btn-scan-sm {
  width: 42px; height: 42px; border-radius: 10px; background: var(--primary); color: #fff;
  border: none; font-size: 20px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .12s;
}
.btn-scan-sm:hover { background: var(--primary-dark); }
.btn-scan-sm:active { transform: scale(.94); }

.pos-hint-box {
  border: 2px dashed var(--border); border-radius: 16px; padding: 40px 20px; text-align: center;
  color: var(--text-3); background: #fff;
}
.pos-hint-box .ph-ico { font-size: 52px; margin-bottom: 12px; opacity: .6; }
.pos-hint-box .ph-text { font-size: 15px; font-weight: 600; }
.pos-hint-box .ph-sub { font-size: 12.5px; margin-top: 6px; }

/* 扫码对话框（小尺寸） */
.scan-dialog { text-align: center; }
.scan-frame { position: relative; display: inline-block; width: min(320px, 76vw); height: min(210px, 50vw); border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
/* 考勤扫码：二维码取景框改为正方形（宽度不变，上下加高） */
.scan-dialog.scan-qr .scan-frame { height: min(320px, 76vw); }
/* 视频绝对定位铺满外框 + min-width/min-height：规避 iOS Safari 首帧不应用 object-fit 的渲染缺陷（否则会先按竖屏原始比例显示、随后才跳变裁剪填充） */
.scan-video { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 100%; min-height: 100%; object-fit: cover; background: #000; display: block; }
/* 预览画布：开播初期由 JS 逐帧裁剪铺满绘制（iOS 视频首帧渲染不可控，画布由我们完全掌控），随后淡出 */
.scan-canvas { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.scan-ver { margin-top: 8px; font-size: 10.5px; color: #b6bec8; letter-spacing: .3px; }
.scan-mask {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,0) 22%, rgba(0,0,0,0) 78%, rgba(0,0,0,.35));
}
.scan-corner { position: absolute; width: 34px; height: 34px; border: 3px solid #fff; opacity: .95; }
.scan-corner.tl { top: 12px; left: 12px; border-right: none; border-bottom: none; border-radius: 8px 0 0 0; }
.scan-corner.tr { top: 12px; right: 12px; border-left: none; border-bottom: none; border-radius: 0 8px 0 0; }
.scan-corner.bl { bottom: 12px; left: 12px; border-right: none; border-top: none; border-radius: 0 0 0 8px; }
.scan-corner.br { bottom: 12px; right: 12px; border-left: none; border-top: none; border-radius: 0 0 8px 0; }
.scan-line {
  position: absolute; left: 8%; right: 8%; top: 16%; height: 2px; background: var(--accent);
  box-shadow: 0 0 10px var(--accent); border-radius: 2px;
  /* transform 动画在合成器线程运行，主线程解码再忙也不掉帧 */
  animation: scanMove 1.8s ease-in-out infinite;
  will-change: transform;
}
@keyframes scanMove {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(var(--scan-distance, 140px)); }
}
.scan-tip { font-size: 12.5px; color: var(--text-2); margin-top: 10px; }
.scan-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.scan-actions .btn { font-size: 13px; }

/* ---------- 收银台布局 ---------- */
.pos-layout { display: flex; gap: 16px; height: calc(100vh - 92px); height: calc(100dvh - 92px); }
/* 桌面端购物车始终占满右侧区域全高（Windows/苹果浏览器一致） */
.pos-left { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pos-right { width: 54%; min-width: 0; flex-shrink: 0; display: flex; flex-direction: column; }

.pos-search { display: flex; gap: 8px; margin-bottom: 10px; }
.pos-search .input { flex: 1; font-size: 15px; padding: 11px 14px; }
.pos-cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 10px; }
.cat-chip {
  padding: 7px 14px; border-radius: 20px; background: #fff; border: 1px solid var(--border);
  font-size: 13px; white-space: nowrap; color: var(--text-2);
}
.cat-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.cat-chip:hover { border-color: var(--primary); color: var(--primary); }
.cat-chip.active:hover { color: #fff; }
/* 无条形码商品筛选 chip：醒目标识 */
#pos-nobarcode-chip { border-style: dashed; display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; color: #b45309; border-color: #fcd34d; background: #fffbeb; }
#pos-nobarcode-chip:hover { border-color: #f59e0b; color: #92400e; }
#pos-nobarcode-chip.active { border-style: solid; background: #f59e0b; border-color: #f59e0b;
  color: #fff; font-weight: 700; box-shadow: 0 2px 8px rgba(245,158,11,.35); }

.prod-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; overflow-y: auto; flex: 1; padding-bottom: 8px; }
.prod-card {
  background: #fff; border-radius: 12px; padding: 12px; cursor: pointer; text-align: center;
  border: 1px solid transparent; box-shadow: var(--shadow); transition: all .15s;
  display: flex; flex-direction: column;
}
.prod-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.prod-card:active { transform: scale(.96); }
.prod-card .pc-img {
  width: 100%; height: 74px; border-radius: 8px; object-fit: cover; margin-bottom: 8px;
  background: #f5f7f8;
}
.prod-card .pc-noimg {
  width: 100%; height: 74px; border-radius: 8px; margin-bottom: 8px; background: #f5f7f8;
  display: flex; align-items: center; justify-content: center; font-size: 26px; color: #d1d5db;
}
.prod-card .pc-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; height: 32px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prod-card .pc-price { color: var(--accent); font-weight: 800; font-size: 15px; margin-top: 6px; }
.prod-card .pc-price small { font-size: 11px; color: var(--text-3); font-weight: 400; margin-left: 2px; }
.prod-card .pc-stock { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.prod-card .pc-stock.low { color: var(--danger); font-weight: 600; }

/* 购物车（放大版） */
.cart-panel {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden; height: 100%;
}
.cart-head { padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.cart-head .ch-title { font-weight: 800; font-size: 18px; }
.cart-head .tag { font-size: 16px; padding: 6px 14px; }
.cart-head .btn { font-size: 14px; padding: 7px 12px; }
.cart-items { flex: 1; overflow-y: auto; padding: 6px 14px; }
.cart-item { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px dashed #f1f3f5; }
/* 购物车商品图：无图时显示默认图标（📦），有图时显示图片且可点击放大 */
.ci-img { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 10px; object-fit: cover; background: #f3f5f7; display: flex; align-items: center; justify-content: center; font-size: 20px; }
img.ci-img { display: block; cursor: zoom-in; }
.ci-info { flex: 1; min-width: 0; }
.ci-name { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-stock { font-size: 12.5px; color: var(--text-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-stock.warn { color: var(--danger); font-weight: 600; }
.ci-stock.low { color: var(--warn); font-weight: 600; }
.ci-stock.ok { color: var(--primary); font-weight: 600; }
.qty-ctl { display: flex; align-items: center; gap: 6px; }
.qty-ctl button {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border);
  background: #fff; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.qty-ctl button:hover { border-color: var(--primary); color: var(--primary); }
.qty-ctl .qty-val { width: 40px; text-align: center; font-weight: 800; font-size: 15px;
  border: 1px solid var(--border); border-radius: 8px; background: #f8faf9;
  padding: 4px 2px; outline: none; appearance: textfield; -moz-appearance: textfield;
  font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s, background .15s; }
.qty-ctl .qty-val::-webkit-inner-spin-button,
.qty-ctl .qty-val::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-ctl .qty-val:focus { border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px var(--primary-light); }
.ci-sub { width: 96px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 15px; flex-shrink: 0; }
.ci-del { background: none; border: none; color: var(--text-3); font-size: 16px; padding: 2px 4px; flex-shrink: 0; }
.ci-del:hover { color: var(--danger); }

.cart-foot { border-top: 1px solid var(--border); padding: 14px 16px; }

/* 桌面端购物车：名称两行完整显示，加减按钮缩小腾出空间 */
@media (min-width: 561px) {
  .ci-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .qty-ctl button { width: 30px; height: 30px; font-size: 17px; border-radius: 8px; }
  .qty-ctl .qty-val { width: 38px; font-size: 15px; }
  .ci-sub { width: 82px; }
}
.cart-sum { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.cart-sum .cs-label { color: var(--text-2); font-size: 15px; }
.cart-sum .cs-total { font-size: 34px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.cart-actions { display: flex; gap: 8px; }
.cart-actions .btn { flex: 1; height: 48px; display: flex; align-items: center; justify-content: center; }
.cart-actions #cart-pay { flex: 2; }
.cart-actions #cart-hold2, .cart-actions #cart-held2 { flex: 1; background: #fff; border: 1px solid var(--border); color: var(--text-2); position: relative; }
/* 取单按钮角标：右上角显示挂单数量 */
.cart-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.cart-actions #cart-hold2:hover, .cart-actions #cart-held2:hover { background: var(--primary-light); color: var(--primary); }
.cart-actions .btn { flex: 1; padding: 14px 16px; font-size: 16px; }

.price-mode-bar { display: flex; background: var(--primary-light); border-radius: 10px; padding: 3px; margin-bottom: 10px; }
.price-mode-bar .pm-btn {
  flex: 1; padding: 8px; border: none; background: transparent; border-radius: 8px;
  font-weight: 700; font-size: 13.5px; color: var(--primary); transition: all .15s;
}
.price-mode-bar .pm-btn.active { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(0,166,81,.3); }

/* 结账对话框 */
.chk-box { background: var(--primary-light); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.chk-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13.5px; color: var(--text-2); }
.chk-row.total { border-top: 1px dashed #c9e8d7; margin-top: 6px; padding-top: 10px; }
.chk-row.total .val { font-size: 24px; font-weight: 800; color: var(--accent); }
.pay-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.pay-method {
  padding: 12px 6px; border: 2px solid var(--border); border-radius: 12px; background: #fff;
  text-align: center; font-size: 13px; font-weight: 600; color: var(--text-2); transition: all .15s;
}
.pay-method .pm-ico { font-size: 22px; display: block; margin-bottom: 5px; }
.pay-method.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

/* 商品卡片（管理页） */
.pm-card {
  display: flex; gap: 12px; align-items: center; padding: 12px;
}
.pm-img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #f5f7f8; flex-shrink: 0; display:flex; align-items:center; justify-content:center; font-size:22px; color:#d1d5db; }
.pm-info { flex: 1; min-width: 0; }
.pm-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.pm-price { text-align: right; font-size: 13px; }
.pm-price .rp { color: var(--accent); font-weight: 800; font-size: 14px; }
.pm-price .wp { color: var(--primary); font-weight: 700; font-size: 12px; }

/* 筛选栏 */
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filter-bar .input { width: auto; min-width: 180px; }
.filter-bar .spacer { flex: 1; }
/* 筛选栏内的相机按钮：与搜索框同高（36px）、垂直居中对齐 */
.filter-bar .btn-scan-big { width: 36px; height: 36px; border-radius: 10px; font-size: 17px; box-shadow: 0 3px 10px rgba(0,166,81,.25); }
/* 日期范围成组（开始 — 截止） */
.date-range { display: inline-flex; align-items: center; gap: 6px; }
/* 排序下拉：点选字段排序；再次点同一字段切换升序/降序 */
.sort-dd { position: relative; display: inline-block; }
.sort-dd > .btn { white-space: nowrap; }
.sort-dd .s-arrow { font-size: 11px; opacity: .75; }
.sort-menu { display: none; position: absolute; z-index: 70; top: calc(100% + 4px); right: 0; min-width: 160px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; }
.sort-menu.open { display: block; }
.sort-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.sort-item:hover { background: var(--primary-light); }
.sort-item.active { color: var(--primary); font-weight: 700; }
.sort-item .si-arrow { font-size: 11px; opacity: .8; min-width: 10px; text-align: right; }

/* 标签打印选择 */
.label-check { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.label-check:hover { border-color: var(--primary); }
.label-check input { accent-color: var(--primary); }
.label-check .lc-info { flex: 1; }
.label-check .lc-name { font-weight: 600; font-size: 13.5px; }
.label-check .lc-sub { font-size: 12px; color: var(--text-3); }

/* 图表占位 */
.chart-bar { display: flex; align-items: flex-end; gap: 4px; height: 216px; padding: 4px 4px 6px; overflow-x: auto; }
/* 柱子最小宽度：手机 42px（另有 +4px 间距）——数量一多就横向滚动，避免挤成一团 */
.chart-bar .bar-col { flex: 1; min-width: 42px; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
.chart-bar .bar-val { font-size: 10.5px; font-weight: 800; color: var(--accent); white-space: nowrap; line-height: 1.15; max-width: 100%; overflow: hidden; }
.chart-bar .bar { width: 70%; max-width: 36px; background: linear-gradient(180deg, #00c46a, #00a651); border-radius: 5px 5px 0 0; min-height: 2px; transition: height .3s; flex-shrink: 0; }
.chart-bar .bar-lbl { font-size: 10.5px; color: var(--text-2); white-space: nowrap; padding-top: 2px; border-top: 1px solid #eee; width: 100%; text-align: center; flex-shrink: 0; }
/* 趋势图滑动按钮：仅在图表可横向滚动时由 JS 显示 */
.chart-nav { display: none; justify-content: flex-end; gap: 6px; margin-bottom: 6px; }
.chart-nav-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #e3e7ec; background: #fff; color: #5a6572; font-size: 17px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.chart-nav-btn:hover { background: #f4f7fa; }
.chart-nav-btn:active { transform: scale(.94); }
.chart-nav-btn:disabled { opacity: .35; cursor: default; }
@media (min-width: 901px) {
  /* 趋势图一屏最多20条：超过20条时由 JS 加 .cap20，20列平分内容宽度（19个间距共76px） */
  .chart-bar.cap20 .bar-col { flex: 0 0 calc((100% - 76px) / 20); min-width: 0; }
  .chart-bar .bar { max-width: 56px; }
}
/* 销量排行滚动条：细条 + 与金额留出间距 */
#rp-ranking { scrollbar-width: thin; scrollbar-color: #d3d9e0 transparent; }
#rp-ranking::-webkit-scrollbar { width: 6px; }
#rp-ranking::-webkit-scrollbar-thumb { background: #d3d9e0; border-radius: 3px; }
#rp-ranking::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 560px) {
  .chart-bar .bar-val { font-size: 9.5px; }
}

/* 仪表盘 */
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
/* 允许 grid 子项收缩到内容以下：防止内部横向滚动区（如手机端趋势图）把卡片撑出屏幕 */
.dash-grid > * { min-width: 0; }
.rp-grid { grid-template-columns: 1fr 1fr; }
.dash-grid .full { grid-column: 1 / -1; }
.quick-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.quick-card {
  background: #fff; border-radius: 12px; padding: 16px; text-align: center; cursor: pointer;
  box-shadow: var(--shadow); transition: all .15s; border: 1px solid transparent;
}
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.quick-card .qc-ico { font-size: 26px; margin-bottom: 8px; }
.quick-card .qc-txt { font-size: 13px; font-weight: 600; color: var(--text-2); }

/* 设置分组 */
.set-group { margin-bottom: 18px; }
.set-group-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; padding-left: 2px; display: flex; align-items: center; gap: 6px; }

/* 底部导航（移动端） */
#mobile-nav { display: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  #sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 220px; z-index: 130;
    background: #fff;
    display: flex; transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: none; border-right: none; border-radius: 0 16px 16px 0;
    /* iOS Safari 兼容：使用 transform 抽屉动画（left 动画在 iOS 渲染不可靠） */
  }
  #sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.25); }
  body.nav-open::after {
    content: ""; position: fixed; inset: 0; background: rgba(17,24,39,.45); z-index: 120;
  }
  #topbar { padding: 0 12px; }
  .menu-btn { display: block; }
  .clock { display: none; }
  .pos-layout { flex-direction: column; height: auto; }   /* 覆盖桌面 calc 高度，避免内容重叠 */
  /* 移动端：购物车按内容自适应高度（全部显示，超出整页滚动） */
  .pos-layout { gap: 4px; }   /* 缩短购物车与搜索框距离 */
  .pos-left { flex: 1; min-height: 0; }
  .pos-right { width: 100%; max-width: none; min-width: 0; flex: 0 1 auto; min-height: 0; margin-top: 0; }
  .cart-panel { height: auto; }
  .cart-items { flex: 0 1 auto; max-height: none; }  /* 取消内置滑动：全部商品直接显示，高度自适应 */
  .prod-grid { min-height: 0; }
  .dash-grid { grid-template-columns: 1fr; }
  .rp-grid { grid-template-columns: 1fr; }
  #view { padding: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); }
}

/* 模板设计器 */
.tpl-editor { display: grid; grid-template-columns: 260px 1fr; gap: 14px; }

/* 横屏平板/矮视口宽屏（高度 ≤800px）：仅页面滚动兜底；收银台保持固定全屏布局 */
@media (max-height: 800px) and (min-width: 901px) {
  #app { height: auto; min-height: 100vh; min-height: 100dvh; }
  body { overflow-y: auto; }
  #view { overflow-y: visible; padding-bottom: 30px; }
  /* 收银台：购物车占满右屏全高，商品多时内部滑动（不被矮视口规则破坏） */
  .pos-layout { height: calc(100vh - 92px); height: calc(100dvh - 92px); }
  .pos-right { height: 100%; }
  .cart-panel { height: 100%; }
  .cart-items { flex: 1; overflow-y: auto; }
}
.tpl-fields { max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.tpl-field {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: 10px; background: #fafbfc; cursor: grab;
}
.tpl-field:active { cursor: grabbing; }
.tpl-field .tf-ico { color: var(--text-3); cursor: move; font-size: 14px; }
.tpl-field .tf-name { flex: 1; font-size: 13px; font-weight: 600; }
.tpl-preview { border: 1px dashed var(--border); border-radius: 10px; background: #f5f7f8; padding: 10px; text-align: center; }
.tpl-preview iframe { width: 100%; min-height: 320px; border: none; background: #fff; border-radius: 8px; }
.ld-el { white-space: nowrap; border-radius: 4px; padding: 1px 3px; user-select: none; touch-action: none; }
.ld-el:hover { outline: 1px solid var(--primary-light); }
.login-hint { text-align: center; color: var(--text-3); font-size: 12px; margin: -14px 0 18px; background: var(--primary-light); border-radius: 8px; padding: 6px 10px; display: inline-block; width: 100%; box-sizing: border-box; }

@media (max-width: 700px) {
  /* 模板设计器：左列字段 + 右列预览固定最小宽度，手机端右滑查看完整预览 */
  .tpl-editor { grid-template-columns: 260px minmax(320px, 1fr); overflow-x: auto; }
}

@media (max-width: 380px) {
  /* 小屏手机：搜索框提示文字缩小，避免显示不全 */
  .pos-search-big { font-size: 14px; padding: 12px 14px; }
  .pos-search-big::placeholder { font-size: 12.5px; }
}

@media (max-width: 560px) {
  /* 手机端：分页栏自动换行（日志/订单/库存等多控件页不挤压） */
  .pager { flex-wrap: wrap; gap: 8px; }
  /* 手机端：订单搜索框独占整行显示完整（!important 覆盖 inline style） */
  .filter-bar .search-wrap { width: 100% !important; min-width: 0 !important; max-width: none !important; flex-basis: 100% !important; }
  /* 手机端：挂单/取单/结账三按钮不溢出 */
  .cart-actions { gap: 6px; }
  .cart-actions .btn { height: 44px; padding: 0 4px; font-size: 13px; }
  .cart-actions #cart-hold2, .cart-actions #cart-held2 { white-space: nowrap; }
  /* 手机端：弹窗内容限高内部滚动（商品编辑等长表单不溢出屏幕） */
  /* 手机端购物车：图片+名称第一行（名字自动换行两行），数量/小计第二行 */
  .cart-item { flex-wrap: wrap; position: relative; padding: 6px 2px; }
  .ci-info { flex: 1 1 calc(100% - 54px); min-width: 0; padding-top: 0; }
  .ci-price { display: none; }
  .ci-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; }
  .ci-stock { font-size: 11px; margin-top: 1px; }
  .qty-ctl { margin-top: 4px; }
  .qty-ctl button { width: 28px; height: 28px; font-size: 16px; }
  .qty-ctl .qty-val { width: 40px; font-size: 15px; }
  /* 手机端收银台搜索结果：一行 3 个（配合每页 12 个 = 4 行） */
  .prod-grid { grid-template-columns: repeat(3, 1fr); }
  .ci-sub { margin-left: auto; width: auto; font-size: 14px; }
  body { overflow: auto; }
  #app { min-height: 100vh; height: auto; }
  #main { min-height: 100vh; }
  #view { padding-bottom: 70px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .pay-methods { grid-template-columns: repeat(2, 1fr); }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .cart-sum .cs-total { font-size: 22px; }

  /* ===== 顶栏紧凑：标题单行省略、缩小按钮（用户名保留显示） ===== */
  #topbar { padding: 0 10px; gap: 8px; }
  .top-title { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .refresh-chip { font-size: 12px; height: 32px; padding: 0 9px; gap: 3px; }
  .top-action-txt, .att-top-txt { display: none; }
  .user-box { gap: 6px; }
  #btn-logout { font-size: 12px; padding: 5px 9px; }

  /* ===== 筛选栏：收紧间距、隐藏冗余标签、日期框并排 ===== */
  .filter-bar { gap: 8px; margin-bottom: 10px; }
  .filter-bar .set-label { display: none; }
  .filter-bar input[type="date"] { flex: 1 1 40%; min-width: 0; }
  .filter-bar .btn { white-space: nowrap; }
  /* 日期范围成组：手机端独占一行，开始/截止日期框平分宽度 */
  .filter-bar .date-range { flex: 1 1 100%; }
  .filter-bar .date-range input[type="date"] { flex: 1 1 0; width: auto; }

  /* ===== 列表表格 → 手机卡片（每行一块，标签+值行式排列，不再横向滚动） ===== */
  .table-wrap { overflow: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: auto; }
  .tbl tr { padding: 10px 12px; border-bottom: 1px solid #eef1f4; position: relative; }
  .tbl tr:last-child { border-bottom: none; }
  .tbl tr:hover td { background: transparent; }
  .tbl td { border: none; padding: 1.5px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .tbl td::before { content: attr(data-th); color: var(--text-3); font-size: 12px; flex-shrink: 0; }
  .tbl td:not([data-th])::before { content: none; }
  .tbl td.num { text-align: left; }
  .tbl td[colspan] { display: block; padding: 4px 0; }
  .tbl td[colspan]::before { content: none; }

  /* 商品/库存主列表卡片：选择框右上角、名称块独占整行、商品图居左上 */
  #pm-list tr > td:nth-child(1), #sk-list tr > td:nth-child(1) { position: absolute; top: 12px; right: 10px; padding: 0; }
  #pm-list tr > td:nth-child(2) { float: left; width: 46px; height: 46px; margin: 2px 10px 2px 0; padding: 0; }
  #pm-list tr > td:nth-child(2) .pm-img { width: 46px; height: 46px; font-size: 20px; border-radius: 10px; }
  #pm-list tr > td:nth-child(3), #sk-list tr > td:nth-child(2) { display: block; padding-right: 34px; }
  /* 零售价行起不再被商品图绕排，与下方行对齐 */
  #pm-list tr > td:nth-child(5) { clear: left; }
  /* 卡片内操作按钮组：保持右侧聚拢不被 flex 拉开 */
  .ops-wrap { display: inline-flex; align-items: center; gap: 4px; }
  /* 手机端商品列表隐藏"添加时间"列，降低卡片密度 */
  #pm-list tr > td:nth-child(10) { display: none; }
  /* 手机端商品卡片：隐藏"分类"列，显示"最后修改"时间 */
  #pm-list tr > td:nth-child(9) { display: none; }
  .tbl td.pm-updated-m { display: flex; }
  /* 日志卡片：对象/详情长文本允许换行完整显示 */
  #lg-list tr > td:nth-child(4), #lg-list tr > td:nth-child(5) { max-width: none !important; white-space: normal !important; overflow: visible !important; align-items: flex-start; }
}

/* 触屏设备：商品名称/库存行长按用于弹出完整名称，禁止系统选中文字/呼出复制菜单（不影响桌面端选中） */
@media (pointer: coarse) {
  .ci-name, .ci-stock, .pm-name, .rp-name {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
}

/* ===== iOS Safari 专项：防止输入框聚焦自动放大，导致弹窗/保存按钮点击错位 =====
   Safari 标签页中 input 字号 <16px 会强制放大整个页面；添加到主屏幕的独立窗口缩放行为不同，
   因此同一套代码会出现“桌面 APP 正常、Safari 不正常”。 */
@supports (-webkit-touch-callout: none) {
  input, select, textarea, .input { font-size: 16px !important; }
  /* 用动态视口高度，避开 Safari 底部工具栏；modal 居中区域始终在工具栏上方 */
  .modal-mask { height: 100vh; height: 100dvh; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .modal { max-height: 90vh; max-height: 90dvh; }
}

/* ===== 考勤（独立视觉风格） ===== */
.att-page { max-width: 1120px; margin: 0 auto; }
.att-hero {
  position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding: 22px 24px; border-radius: 22px; margin-bottom: 16px; color: #fff;
  background: radial-gradient(circle at 88% 0%, #2dd4bf 0%, transparent 42%), linear-gradient(135deg, #0f172a 0%, #134e4a 100%);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
}
.att-hero::after {
  content: ""; position: absolute; right: -70px; top: -90px; width: 240px; height: 240px;
  border-radius: 50%; background: rgba(255, 255, 255, .08);
}
.att-hero-left { display: flex; align-items: center; gap: 14px; min-width: 0; z-index: 1; }
.att-avatar {
  width: 54px; height: 54px; border-radius: 17px; flex-shrink: 0;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center; font-size: 25px; font-weight: 800;
}
.att-hero-name { font-size: 21px; font-weight: 800; letter-spacing: .3px; }
.att-hero-sub { font-size: 12.5px; color: rgba(255, 255, 255, .72); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-hero-right { text-align: right; z-index: 1; flex-shrink: 0; }
.att-clock { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.att-date { font-size: 12px; color: rgba(255, 255, 255, .7); }
.att-section, .att-admin {
  background: #fff; border-radius: 22px; padding: 18px 20px; margin-bottom: 16px;
  border: 1px solid #eef2f7; box-shadow: 0 12px 32px rgba(15, 23, 42, .07);
}
.att-section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; color: #0f172a; margin-bottom: 12px; }
.att-punch-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.att-punch {
  border: 0; border-radius: 18px; padding: 14px; min-height: 140px; display: flex; flex-direction: column;
  align-items: flex-start; gap: 3px; color: #fff; cursor: pointer; position: relative; overflow: hidden;
  font-family: inherit; text-align: left; transition: transform .16s ease, box-shadow .16s ease;
}
.att-punch:not(.done):not(.locked):hover { transform: translateY(-3px); box-shadow: 0 12px 22px rgba(15, 23, 42, .18); }
.att-punch .ap-ico { font-size: 22px; margin-bottom: 2px; }
.att-punch .ap-label { font-size: 12.5px; font-weight: 600; opacity: .9; }
.att-punch .ap-time { font-size: 22px; font-weight: 800; letter-spacing: .5px; margin-top: 2px; }
.att-punch .ap-state { font-size: 11.5px; font-weight: 600; opacity: .85; margin-top: auto; }
.att-punch .ap-state.ap-ready {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: auto; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .24); border: 1px solid rgba(255, 255, 255, .4);
  color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .5px; opacity: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
}
.att-punch.p-in { background: linear-gradient(135deg, #10b981, #047857); }
.att-punch.p-ls { background: linear-gradient(135deg, #f59e0b, #d97706); }
.att-punch.p-le { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.att-punch.p-out { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.att-punch.done { background: linear-gradient(180deg, #f8fafc, #fff); color: #0f172a; border: 1px solid #e2e8f0; cursor: default; }
.att-punch.done .ap-time, .att-punch.done .ap-state { color: #0f766e; opacity: 1; }
.att-punch.done .ap-state.ap-warn { color: #dc2626; }
.att-punch.locked { background: #f8fafc; color: #94a3b8; border: 1px dashed #e2e8f0; cursor: default; }
.att-punch.locked .ap-time { color: #cbd5e1; }
.att-hint-line { margin-top: 10px; font-size: 12px; color: #64748b; background: #f1f5f9; border-radius: 10px; padding: 8px 10px; }
.att-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.att-stat { background: linear-gradient(180deg, #f8fafc, #fff); border: 1px solid #eef2f7; border-radius: 14px; padding: 10px 12px; min-width: 0; }
.att-stat .as-label { font-size: 11.5px; color: #64748b; }
.att-stat .as-value { font-size: 19px; font-weight: 800; color: #0f172a; margin-top: 2px; font-variant-numeric: tabular-nums; }
.att-req-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px dashed #eef2f7; font-size: 13px; }
.att-req-item:last-child { border-bottom: none; }
.att-empty-hint { font-size: 12.5px; color: #94a3b8; padding: 6px 0; }
.att-qr-card {
  background: radial-gradient(circle at 50% 0%, #eff6ff, #fff 62%); border: 1px solid #e2e8f0;
  border-radius: 22px; padding: 20px; text-align: center; margin-bottom: 16px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
}
.att-qr-card canvas { width: 260px; height: 260px; image-rendering: pixelated; background: #fff; border-radius: 16px; cursor: zoom-in; box-shadow: 0 10px 28px rgba(15, 23, 42, .1); }
.att-qr-countdown { display: flex; width: fit-content; align-items: center; justify-content: center; gap: 6px; background: #0f172a; color: #fff; border-radius: 999px; padding: 5px 14px; font-size: 12px; font-weight: 600; margin: 10px auto 0; font-variant-numeric: tabular-nums; }
.att-qr-countdown.att-qr-expired { background: #b91c1c; cursor: pointer; box-shadow: 0 4px 12px rgba(185, 28, 28, .28); }
.att-qr-hint { font-size: 12px; color: #64748b; margin-top: 8px; line-height: 1.6; }
.att-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; background: #f1f5f9; border-radius: 14px; padding: 5px; margin-bottom: 12px; }
.att-tabs .btn { border: 0; background: transparent; box-shadow: none; border-radius: 10px; padding: 8px 13px; font-weight: 600; color: #64748b; font-size: 13px; }
.att-tabs .btn-primary { background: #fff; color: #0f172a; box-shadow: 0 3px 10px rgba(15, 23, 42, .1); }
.att-qr-modal { text-align: center; padding: 4px 0; max-width: 100%; overflow: hidden; }
.att-qr-modal canvas { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto; image-rendering: pixelated; background: #fff; border-radius: 16px; box-shadow: 0 10px 30px rgba(15, 23, 42, .12); }
.att-top-btn { background: linear-gradient(135deg, #0f766e, #0d9488) !important; color: #fff !important; border: 0 !important; font-weight: 700; box-shadow: 0 6px 14px rgba(13, 148, 136, .25); }
.att-top-btn:hover { background: linear-gradient(135deg, #0d5f59, #0f766e) !important; color: #fff !important; }
@media (max-width: 900px) { .att-punch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .att-hero { padding: 17px 16px; border-radius: 18px; align-items: flex-start; }
  .att-avatar { width: 46px; height: 46px; font-size: 22px; border-radius: 14px; }
  .att-hero-name { font-size: 18px; }
  .att-clock { font-size: 25px; }
  .att-punch-grid { gap: 9px; }
  .att-punch { min-height: 124px; padding: 11px; border-radius: 15px; }
  .att-punch .ap-time { font-size: 20px; }
  .att-stats { grid-template-columns: 1fr 1fr; }
  .att-qr-card { padding: 16px 12px; }
  .att-qr-card canvas { width: 220px; height: 220px; }
  .att-section, .att-admin { padding: 14px; border-radius: 18px; }
  .att-top-btn .att-top-txt { display: none; }
}

.att-tabs .btn { position: relative; }
.att-tab-badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #ef4444; color: #fff; font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  box-shadow: 0 2px 6px rgba(239, 68, 68, .35);
}
.att-request-form { grid-template-columns: 1fr !important; width: 100%; max-width: 100%; min-width: 0; }
.att-request-form .form-item { min-width: 0; }
.att-request-form .input { width: 100%; min-width: 0; box-sizing: border-box; }
/* iOS Safari 会按原生控件内容计算日期/时间框最小宽度，导致弹窗内横向溢出 */
@media (max-width: 700px) {
  .att-request-form input[type="date"],
  .att-request-form input[type="time"],
  .att-request-form input[type="month"],
  .att-rec-filters input[type="date"],
  .att-rec-filters input[type="month"],
  .att-tool-input[type="date"],
  .att-tool-input[type="month"],
  .att-settings-grid input[type="time"],
  .att-holiday-add input[type="date"],
  .att-holiday-add input[type="month"],
  .att-req-month {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    height: 40px;
    padding: 8px 12px;
    font-size: 16px !important;
    line-height: normal;
    -webkit-text-size-adjust: 100%;
  }
  .att-request-form input[type="date"]::-webkit-datetime-edit,
  .att-request-form input[type="time"]::-webkit-datetime-edit {
    padding: 0;
  }
}
.att-records-modal .table-wrap { max-height: 55vh; overflow: auto; }

/* ===== 考勤后台区块：居中标签/筛选、可滚动表格 ===== */
.att-admin-title { text-align: center; font-size: 16px; font-weight: 800; color: #0f172a; margin-bottom: 12px; }
.att-settings-wrap { width: 100%; }
.att-settings { padding: 2px; }
.att-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.att-settings-grid .input { height: 40px; padding: 6px 10px; }
.att-lunch-btn { width: 100%; height: 40px; padding: 6px 10px; font-size: 13px; }
.att-lunch-list { display: flex; flex-direction: column; gap: 8px; }
.att-lunch-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  border: 1px solid #eef2f7; border-radius: 12px; background: #f8fafc;
}
.att-lunch-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: #0f172a; }
.att-lunch-name .form-hint { margin-top: 2px; }
.att-lunch-input { display: flex; align-items: center; gap: 6px; flex-shrink: 0; color: #64748b; font-size: 12.5px; }
.att-lunch-input .input { width: 84px; height: 36px; padding: 4px 8px; text-align: center; }
.att-settings-block { margin-top: 14px; }
.att-settings-label { font-size: 13px; font-weight: 700; color: #334155; margin-bottom: 8px; }
.att-week-days { display: flex; flex-wrap: wrap; gap: 8px; }
.att-week-day {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px;
  border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc;
  font-size: 13px; color: #475569; cursor: pointer; user-select: none;
}
.att-week-day input { accent-color: var(--primary); }
.att-week-day:has(input:checked) { background: var(--primary-light); border-color: rgba(0, 166, 81, .35); color: var(--primary); font-weight: 700; }
.att-holiday-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.att-holiday-add .input { flex: 1 1 0; min-width: 0; width: 0; height: 40px; padding: 6px 10px; }
.att-holiday-add .att-holiday-month { flex: 0 0 130px !important; width: 130px !important; }
.att-holiday-add .btn { flex-shrink: 0; height: 40px; padding: 0 14px; white-space: nowrap; }
.att-holiday-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.att-holiday-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: 999px; background: #eef2f7; color: #334155; font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.att-holiday-chip button { border: 0; background: none; padding: 0 2px; color: #94a3b8; font-size: 13px; cursor: pointer; }
.att-holiday-chip button:hover { color: var(--danger); }
.att-rest-note { margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: #f0fdf4; border: 1px solid #dcfce7; color: #15803d; font-size: 12.5px; line-height: 1.6; }
.att-settings-foot { display: flex; justify-content: flex-end; margin-top: 14px; }
.att-tools { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.att-tool-label { font-size: 12px; font-weight: 600; color: #64748b; }
.att-tool-input { width: auto !important; min-width: 135px; }
.att-count { font-size: 12px; color: #94a3b8; }
.att-export-btn { white-space: nowrap; }
.att-table-scroll { max-height: 60vh; overflow: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; }
/* 表头与单元格统一居中（首列员工信息保持左对齐） */
@media (min-width: 701px) {
  .att-table-scroll .tbl th { text-align: center; }
  .att-table-scroll .tbl td { text-align: center; }
  .att-table-scroll .tbl th:first-child,
  .att-table-scroll .tbl td:first-child { text-align: left; }
}
.att-row-ops { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
.att-rec-filters { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.att-rec-filters label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #64748b; }
.att-rec-filters .input { width: auto !important; min-width: 140px; }
.att-rec-filters label.att-rec-month-label { flex: 0 0 calc(50% - 5px); width: calc(50% - 5px); min-width: 0; }
.att-rec-filters label.att-rec-month-label .input { width: 100% !important; min-width: 0; height: 40px; }
.att-rec-total {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex: 0 0 calc(50% - 5px); width: calc(50% - 5px); min-width: 0; height: 40px; padding: 0 12px;
  border: 1px solid #dcfce7; border-radius: 10px; background: #f0fdf4;
  color: #15803d; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.att-rec-total b { font-size: 16px; color: #0f172a; font-variant-numeric: tabular-nums; }
.att-rec-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.att-rec-stat { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 12px; padding: 8px 10px; text-align: center; }
.att-rec-stat span { display: block; font-size: 11.5px; color: #64748b; }
.att-rec-stat b { font-size: 19px; color: #0f172a; }
.att-records-scroll { max-height: none; overflow: visible; padding: 0; }
.att-records-table tbody tr { border-bottom: 2px solid #dbe3ec; }
.att-records-table tbody tr:last-child { border-bottom: none; }
/* 每天之间的分隔线画在单元格上，避免被下一行背景/滚动容器遮挡 */
@media (min-width: 701px) {
  .att-records-table tbody tr + tr td { border-top: 2px solid #cbd5e1; }
}
.att-req-list { max-height: none; overflow: visible; padding: 0; }
.att-req-month { width: 140px !important; height: 36px; padding: 4px 8px; font-size: 13px; }
@media (max-width: 560px) {
  .att-tabs .btn { padding: 7px 11px; font-size: 12.5px; }
  .att-tool-input { min-width: 120px; }
  .att-rec-summary { grid-template-columns: 1fr 1fr; }
  .att-rec-filters { gap: 6px; }
  .att-rec-filters label { flex: 1 1 100%; }
  .att-rec-filters label.att-rec-month-label { flex: 0 0 calc(50% - 3px); width: calc(50% - 3px); min-width: 0; }
  .att-rec-total { flex: 0 0 calc(50% - 3px); width: calc(50% - 3px); }
  .att-rec-filters .input { min-width: 0; flex: 1; width: 100% !important; }
  .att-rec-filters label.att-rec-month-label .input { width: 100% !important; }
  .att-settings-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .att-settings-grid .form-item label { font-size: 12px; }
  .att-lunch-item { grid-column: 1 / -1; }
  .att-lunch-row { flex-wrap: wrap; gap: 8px; }
  .att-lunch-input { width: 100%; justify-content: flex-end; }
  .att-holiday-add { gap: 6px; }
  .att-holiday-add .input { flex: 1 1 0; width: 0 !important; }
  .att-holiday-add .att-holiday-month { flex: 0 0 120px !important; width: 120px !important; }
  .att-holiday-add .btn { padding: 0 10px; font-size: 12.5px; }
  .att-rest-note { margin-top: 12px; padding: 8px 10px; }
  .att-records-table tbody tr { margin-bottom: 12px; border: 1px solid #cbd5e1; border-radius: 12px; box-shadow: 0 1px 3px rgba(15, 23, 42, .05); }
  .att-records-table tbody tr:last-child { margin-bottom: 0; border-bottom: 1px solid #cbd5e1; }
}

/* 手机端考勤管理：每条记录独立卡片分割（与员工打卡记录弹窗一致） */
@media (max-width: 700px) {
  .att-table-scroll { padding: 2px; }
  .att-table-scroll .tbl tr {
    margin-bottom: 12px; border: 1px solid #cbd5e1; border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
  }
  .att-table-scroll .tbl tr:last-child { margin-bottom: 0; border-bottom: 1px solid #cbd5e1; }
}

/* 手机端滚动区域：给滚动条留出空隙，避免压住卡片/弹窗边框 */
@media (max-width: 700px) {
  .att-table-scroll {
    padding: 2px 6px 6px;
    scrollbar-gutter: stable both-edges;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .att-records-scroll {
    padding: 0;
    overflow: visible;
    max-height: none;
  }
  .att-req-month { width: 132px !important; height: 38px; }
}
.att-table-scroll::-webkit-scrollbar,
.att-records-scroll::-webkit-scrollbar,
.att-req-list::-webkit-scrollbar { width: 6px; height: 6px; }
.att-table-scroll::-webkit-scrollbar-track,
.att-records-scroll::-webkit-scrollbar-track,
.att-req-list::-webkit-scrollbar-track { background: transparent; }
.att-table-scroll::-webkit-scrollbar-thumb,
.att-records-scroll::-webkit-scrollbar-thumb,
.att-req-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

/* 导出员工选择 */
.att-export-picker { min-width: 0; }
.att-export-all { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #334155; padding-bottom: 8px; border-bottom: 1px solid #e2e8f0; }
.att-export-all input, .att-export-row input { accent-color: var(--primary); width: 18px; height: 18px; flex-shrink: 0; }
.att-export-list { max-height: 50vh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 4px; }
.att-export-row {
  display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 10px;
  border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; cursor: pointer;
}
.att-export-row .att-export-name { font-size: 13.5px; font-weight: 600; color: #0f172a; }
.att-export-row .form-hint { margin-left: auto; }

/* 状态标签组合：避免手机端卡片弹性布局把多个标签拉开 */
.att-status-tags { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }

/* 员工打卡记录汇总：可点击筛选 */
.att-rec-stat { font-family: inherit; color: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; min-width: 0; }
.att-rec-stat.active { background: var(--primary-light); border-color: rgba(0, 166, 81, .35); box-shadow: 0 0 0 2px rgba(0, 166, 81, .12); }
.att-rec-stat.active span, .att-rec-stat.active b { color: var(--primary); }

/* 员工管理弹窗 */
.staff-filter {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap;
  gap: 4px; padding: 4px; margin: 0 auto 12px; background: #f1f5f9;
  border-radius: 12px; width: fit-content; max-width: 100%;
}
.staff-filter .btn { border: 0; background: transparent; box-shadow: none; color: #64748b; }
.staff-filter .btn-primary { background: #fff; color: #0f172a; box-shadow: 0 2px 8px rgba(15, 23, 42, .1); }
.staff-modal-list {
  max-height: 58vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges; padding: 0 6px;
}
.staff-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px;
  border: 1px solid #eef2f7; border-radius: 14px; background: #fff;
  margin-bottom: 8px; box-shadow: 0 1px 3px rgba(15, 23, 42, .03);
}
.staff-item:last-child { margin-bottom: 0; }
.staff-avatar {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f766e, #10b981); color: #fff;
  font-size: 17px; font-weight: 800;
}
.staff-main { flex: 1; min-width: 0; }
.staff-name { font-size: 14px; font-weight: 700; color: #0f172a; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.staff-perms { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.staff-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.staff-arrows { display: flex; gap: 3px; }
.staff-action-row { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.staff-modal-list::-webkit-scrollbar { width: 6px; }
.staff-modal-list::-webkit-scrollbar-track { background: transparent; }
.staff-modal-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
@media (max-width: 900px) {
  /* 手机/平板：取消列表内滚动，改由弹窗 body 统一滚动，避免最后一张卡片被底部按钮裁切 */
  .staff-modal-list {
    max-height: none; overflow: visible; -webkit-overflow-scrolling: auto;
    scrollbar-gutter: auto; padding: 0;
  }
}
@media (max-width: 560px) {
  .staff-item { flex-wrap: wrap; }
  .staff-actions { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
  .staff-action-row { justify-content: flex-end; }
}

/* 导出员工状态筛选 */
.att-export-filter { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

/* 员工排序箭头 */
.staff-move-btn {
  width: 28px; height: 28px; border-radius: 9px; border: 1px solid #e2e8f0;
  background: #f8fafc; color: #475569; font-size: 11px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
/* 仅鼠标悬停时高亮，避免触屏点击后 :hover 粘滞残留 */
@media (hover: hover) and (pointer: fine) {
  .staff-move-btn:hover { background: #ecfdf5; border-color: #a7f3d0; color: #0f766e; }
}
.staff-move-btn:active { background: #d1fae5; border-color: #6ee7b7; color: #0f766e; }
.staff-move-btn:disabled { opacity: .35; cursor: not-allowed; }
.staff-move-btn:disabled:active { background: #f8fafc; border-color: #e2e8f0; color: #475569; }
