/* ============================================================
   闪收虾管理系统 - 全局样式（纯 CSS，电脑端后台布局）
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: #0f172a; background: #f1f5f9; min-width: 1180px;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
input, select, textarea, button { font-family: inherit; font-size: 14px; outline: none; }

:root {
  --primary: #2563eb; --primary-dark: #1d4ed8; --primary-light: #dbeafe;
  --success: #16a34a; --success-light: #dcfce7;
  --warning: #d97706; --warning-light: #fef3c7;
  --danger: #dc2626;  --danger-light: #fee2e2;
  --gray: #64748b;    --gray-light: #f8fafc;
  --border: #e2e8f0;  --bg: #f1f5f9; --card: #ffffff;
  --sidebar-bg: #0f172a; --sidebar-text: #cbd5e1;
}

/* ============ 整体布局 ============ */
.layout { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ============ 侧边栏 ============ */
.sidebar {
  width: 224px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.logo {
  display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid #1e293b;
}
.logo-img {
  width: 38px; height: 38px; object-fit: contain; border-radius: 6px; flex-shrink: 0; display: block;
}
.logo-text { color: #fff; font-size: 17px; font-weight: 700; line-height: 1.2; }
.logo-text small { display: block; font-size: 11px; font-weight: 400; color: var(--sidebar-text); margin-top: 2px; }
.menu { flex: 1; overflow-y: auto; padding: 10px 0 20px; }
.menu-group {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: #94a3b8; padding: 14px 20px 6px; letter-spacing: 1px;
  text-align: center; opacity: .55; white-space: nowrap;
}
.menu-group::before, .menu-group::after {
  content: ''; flex: 1; height: 1px; background: currentColor;
}
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--sidebar-text);
  font-size: 14px; transition: all .15s; border-left: 3px solid transparent;
}
.menu-item svg { flex-shrink: 0; opacity: .85; }
.menu-item:hover { background: #1e293b; color: #e2e8f0; }
.menu-item.active { background: rgba(37,99,235,.15); color: #fff; border-left-color: var(--primary); }
.menu-item.active svg { color: #60a5fa; }
.sidebar-foot { padding: 12px 20px; font-size: 11px; color: #475569; border-top: 1px solid #1e293b; }

/* ============ 顶栏 ============ */
.topbar {
  background: var(--card); border-bottom: 1px solid var(--border); padding: 0 24px; height: 60px;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.page-title { font-size: 18px; font-weight: 700; color: #0f172a; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.tb-user { color: var(--gray); font-size: 13px; }
.tb-scope { color: var(--primary); font-size: 12px; background: rgba(24,144,255,.08); padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.tb-logout {
  display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-size: 13px;
  padding: 6px 12px; border: 1px solid var(--danger-light); border-radius: 8px; background: #fff;
  transition: all .15s;
}
.tb-logout:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.tb-chpwd { color: var(--primary); border-color: var(--primary-light); }
.tb-chpwd:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============ 内容区 ============ */
.content { padding: 20px 24px 40px; flex: 1; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-head .ph-title { font-size: 16px; font-weight: 700; }
.page-head .ph-desc { font-size: 12px; color: var(--gray); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; }

/* ============ 卡片 ============ */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04); margin-bottom: 16px;
  overflow: hidden; /* 裁剪卡片内贴边元素（如表尾行 hover 背景、表头底色）到圆角内 */
}
.card-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 700; }
.card-body { padding: 20px; }
/* 城市切换 */
.city-switch { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 70%; }
.city-switch-btn {
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; color: var(--gray); font-size: 12px; cursor: pointer; line-height: 1.5;
  transition: all .15s;
}
.city-switch-btn:hover { border-color: var(--primary); color: var(--primary); }
.city-switch-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============ 统计卡片 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px;
  display: flex; align-items: center; gap: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.stat-ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-ico.green  { background: var(--success-light); color: var(--success); }
.stat-ico.blue   { background: var(--primary-light); color: var(--primary); }
.stat-ico.orange { background: var(--warning-light); color: var(--warning); }
.stat-ico.red    { background: var(--danger-light); color: var(--danger); }
.stat-label { font-size: 12px; color: var(--gray); margin-bottom: 4px; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-num { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-info { flex: 1; min-width: 0; }
.stat-sub { font-size: 11px; color: var(--gray); margin-top: 2px; }

/* ============ 筛选区 ============ */
.filter-bar { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-item { display: flex; flex-direction: column; gap: 5px; }
.filter-item label { font-size: 12px; color: var(--gray); }
.filter-actions { display: flex; gap: 8px; padding-top: 19px; }

/* ============ 表单 ============ */
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="datetime-local"], textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; background: #fff;
  color: #0f172a; transition: border-color .15s, box-shadow .15s; width: 100%;
}
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
textarea { resize: vertical; min-height: 72px; }
input:disabled, textarea:disabled { background: var(--gray-light); color: var(--gray); cursor: not-allowed; }

/* 下拉菜单：统一圆角/边框，自定义箭头，悬停聚焦反馈 */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 8px 12px;
  padding-right: 32px; width: 100%; color: #0f172a; background: #fff;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
select:hover { border-color: var(--primary); }
select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
select:disabled { background: var(--gray-light); color: var(--gray); cursor: not-allowed; }
select option { color: #0f172a; background: #fff; font-size: 13px; padding: 6px 10px; }
select option:checked { background: var(--primary-light); color: var(--primary-dark); }

/* 明细表格内紧凑下拉：保留原生箭头，避免窄列挤压 */
.items-table select { appearance: auto; -webkit-appearance: auto; -moz-appearance: auto; background-image: none; padding: 6px 8px; }

/* ============ 自定义下拉（替换原生 select 外框） ============ */
.ui-select { position: relative; display: block; width: 100%; font-size: 14px; color: #0f172a; }
.ui-select__native { position: absolute; left: -9999px; top: 0; opacity: 0; pointer-events: none; height: 0; width: 100%; }
.ui-select__trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 40px; padding: 8px 12px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  cursor: pointer; user-select: none;
  transition: border-color .15s, box-shadow .15s;
}
.ui-select__trigger:hover { border-color: var(--primary); }
.ui-select.open .ui-select__trigger { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.ui-select__value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-select__value.placeholder { color: #94a3b8; }
.ui-select__arrow { flex: none; width: 16px; height: 16px; color: #64748b; transition: transform .2s, color .2s; }
.ui-select.open .ui-select__arrow { transform: rotate(180deg); color: var(--primary); }
.ui-select__menu {
  position: fixed; top: 0; left: 0; z-index: 1200;
  display: none; white-space: nowrap;
  max-width: 320px; max-height: 264px; overflow: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15,23,42,.14); padding: 4px;
}
.ui-select.open .ui-select__menu { display: block; animation: uiSelectIn .16s ease; }
@keyframes uiSelectIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ui-select__group-title { padding: 7px 10px 4px; font-size: 12px; font-weight: 700; color: var(--gray); }
.ui-select__option {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 6px; font-size: 13px; color: #0f172a;
  cursor: pointer; transition: background .12s;
}
.ui-select__option:hover { background: var(--gray-light); }
.ui-select__option.sel { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.ui-select__option .ck { flex: none; width: 16px; height: 16px; color: var(--primary); opacity: 0; transition: opacity .12s; }
.ui-select__option.sel .ck { opacity: 1; }
.ui-select.disabled .ui-select__trigger { background: var(--gray-light); color: var(--gray); cursor: not-allowed; }
.ui-select.disabled .ui-select__trigger:hover { border-color: var(--border); }
.ui-select__menu::-webkit-scrollbar { width: 8px; }
.ui-select__menu::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.ui-select__menu::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
/* 兼容既有宽度工具类与批量操作条 */
.ui-select.w-110 { width: 110px; }
.ui-select.w-120 { width: 120px; }
.ui-select.w-140 { width: 140px; }
.ui-select.w-160 { width: 160px; }
.ui-select.w-200 { width: 200px; }
.ui-select.w-240 { width: 240px; }
.batch-bar .ui-select { width: 160px; }
/* 明细表格（订单明细行）内下拉紧凑适配：窄列不挤压，菜单 fixed 定位不被表格裁剪 */
.items-table .ui-select__trigger { min-height: 30px; padding: 5px 8px; font-size: 13px; }
.items-table .ui-select__value { font-size: 13px; }
.items-table .ui-select__option { padding: 6px 8px; font-size: 12px; }
.items-table .ui-select__menu { max-width: 280px; max-height: 220px; }
.f-inline { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 20px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item label { font-size: 13px; color: var(--gray); font-weight: 600; }
.form-item label .req { color: var(--danger); margin-left: 2px; }
.form-item.full { grid-column: 1 / -1; }
.form-hint { font-size: 12px; color: var(--gray); }

/* 单选组 */
.radio-group { display: flex; gap: 18px; padding-top: 6px; }
.radio-group label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #0f172a; font-weight: 400; cursor: pointer; }

/* 权限勾选 */
.perm-section { margin-bottom: 18px; }
.perm-group-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; padding-left: 10px; border-left: 3px solid var(--primary); }
.perm-checks { display: flex; flex-wrap: wrap; gap: 10px; }
.perm-check {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; display: flex; align-items: center; gap: 7px;
  cursor: pointer; user-select: none; transition: all .15s; background: var(--gray-light);
}
.perm-check input { width: 15px; height: 15px; accent-color: var(--primary); }
.perm-check.checked { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px; padding: 8px 16px; cursor: pointer;
  font-size: 14px; transition: all .15s; white-space: nowrap;
}
.btn svg { flex-shrink: 0; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger-light); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-plain { background: #fff; color: var(--gray); border-color: var(--border); }
.btn-plain:hover { color: var(--primary); border-color: var(--primary); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 10px 24px; font-size: 15px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* 行内图标按钮 */
.ibtn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; font-size: 12px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; transition: all .15s; }
.ibtn-view  { color: var(--primary); background: var(--primary-light); }
.ibtn-view:hover { background: #bfdbfe; }
.ibtn-edit  { color: var(--warning); background: var(--warning-light); }
.ibtn-edit:hover { background: #fde68a; }
.ibtn-del   { color: var(--danger); background: var(--danger-light); }
.ibtn-del:hover { background: #fecaca; }
.ibtn-status { color: var(--success); background: var(--success-light); }
.ibtn-status:hover { background: #bbf7d0; }
.ibtn + .ibtn { margin-left: 4px; }

/* ============ 表格 ============ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap:hover::-webkit-scrollbar-thumb { background: #94a3b8; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); font-size: 13px; }
.table thead th {
  background: var(--gray-light); font-weight: 700; color: #475569; font-size: 13px; white-space: nowrap;
}
.table tbody tr[data-id] { cursor: pointer; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.table .ops { white-space: nowrap; }
.sort-link { color: var(--primary); cursor: pointer; user-select: none; }
.sort-link:hover { text-decoration: underline; }
.table-empty { padding: 40px !important; text-align: center; color: var(--gray); }

/* 状态徽章 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; white-space: nowrap; }
.badge-green  { background: var(--success-light); color: var(--success); }
.badge-orange { background: var(--warning-light); color: var(--warning); }
.badge-gray   { background: #f1f5f9; color: var(--gray); }
.badge-red    { background: var(--danger-light); color: var(--danger); }
.badge-blue   { background: var(--primary-light); color: var(--primary); }

/* ============ 分页 ============ */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 16px; justify-content: flex-end; flex-wrap: wrap; }
.pagination .pg-info { font-size: 12px; color: var(--gray); margin-right: 8px; }
.pagination a, .pagination span.pg-cur {
  min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; color: #0f172a; padding: 0 8px;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination span.pg-cur { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.pagination input { width: 52px; height: 30px; text-align: center; padding: 0 4px; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 1000;
  display: none; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 60px 20px;
}
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.2); animation: modalIn .18s ease; }
.modal-head { padding: 16px 22px; 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 { cursor: pointer; color: var(--gray); font-size: 22px; line-height: 1; background: none; border: none; }
.modal-close:hover { color: #0f172a; }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* ============ 轻提示 ============ */
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 10px 22px; border-radius: 10px; color: #fff; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.15);
  animation: toastIn .2s ease; min-width: 180px; text-align: center;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ============ 确认弹窗 ============ */
.confirm-box { text-align: center; padding: 10px 0 4px; }
.confirm-ico { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; }
.confirm-ico.danger { background: var(--danger-light); color: var(--danger); }
.confirm-msg { font-size: 15px; color: #0f172a; line-height: 1.6; }

/* ============ 柱状图 ============ */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding: 10px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-val { font-size: 11px; color: var(--gray); }
.bar {
  width: 70%; max-width: 34px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg,#3b82f6,#2563eb);
  min-height: 2px; transition: height .3s;
}
.bar-col:nth-child(even) .bar { background: linear-gradient(180deg,#34d399,#10b981); }
.bar-label { font-size: 11px; color: var(--gray); white-space: nowrap; }

/* 横向排名条 */
.rank-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rank-name { width: 110px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.rank-bar { flex: 1; height: 18px; background: var(--gray-light); border-radius: 9px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg,#60a5fa,#2563eb); }
.rank-val { width: 110px; font-size: 12px; color: var(--gray); text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ============ 详情 ============ */
.detail-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 18px; }
.detail-item { background: var(--gray-light); border-radius: 8px; padding: 12px 14px; }
.detail-item .dl { font-size: 12px; color: var(--gray); margin-bottom: 4px; }
.detail-item .dv { font-size: 15px; font-weight: 400; word-break: break-all; }
.detail-item .dv-sub { display: block; font-size: 12px; color: var(--gray); margin-top: 3px; font-weight: 400; }
.detail-item.full { grid-column: 1 / -1; }

/* ============ 登录页 ============ */
.login-body {
  min-width: 0; display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg, rgba(15,23,42,.82), rgba(29,78,216,.45)), url('../img/A_modern_dark_blue_tech_and_di_2026-08-26T20-44-25.png') center / cover no-repeat;
}
.login-box { width: 400px; background: #fff; border-radius: 16px; padding: 40px 38px 34px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login-logo { text-align: center; margin-bottom: 8px; }
.login-logo-img { width: auto; height: 65px; object-fit: contain; }
.login-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 18px; font-weight: 400; color: var(--gray); margin-bottom: 28px;
}
.login-title::before,
.login-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.login-sub { text-align: center; color: var(--gray); font-size: 13px; margin: 6px 0 26px; }
.login-item { margin-bottom: 18px; }
.login-item label { display: block; font-size: 13px; color: var(--gray); margin-bottom: 6px; font-weight: 600; }
.login-item input { height: 42px; font-size: 15px; }
.login-error { background: var(--danger-light); color: var(--danger); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 16px; display: none; }
.login-error.show { display: block; }
.login-btn { width: 100%; height: 44px; font-size: 15px; }
.login-tip { text-align: center; color: var(--gray); font-size: 12px; margin-top: 18px; }

/* ============ 订单明细表 ============ */
.items-table { width: 100%; min-width: 1400px; border-collapse: collapse; table-layout: fixed; }
.items-table .photo-tools { display: flex; justify-content: center; align-items: center; margin-bottom: 0; }
.items-table .photo-thumbs { display: flex; justify-content: center; align-items: center; margin-top: 6px; }
.items-table .photo-thumbs:empty { margin-top: 0; }
.items-table tr { height: 50px; }
.items-table th { background: var(--gray-light); padding: 0 8px; font-size: 13px; color: #475569; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.items-table td { padding: 15px 8px; border-bottom: 1px solid var(--border); overflow: hidden; position: relative; vertical-align: middle; text-align: center; }
.items-table input, .items-table select { width: 100%; box-sizing: border-box; padding: 6px 8px; font-size: 13px; height: 34px; line-height: 20px; vertical-align: middle; text-align: center; text-align-last: center; }
.items-table td > * { display: inline-block; vertical-align: middle; }
.items-table .ibtn { display: inline-flex; white-space: nowrap; vertical-align: middle; }
.items-table input[type="number"]::-webkit-outer-spin-button, .items-table input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.items-table input[type="number"] { -moz-appearance: textfield; }
.items-table .f-price-ref {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 2px;
  margin: 0;
  min-height: 0;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.items-table .num { text-align: center; }
.items-table .center { text-align: center; }
.totals-bar {
  display: flex; gap: 30px; background: var(--gray-light); border-radius: 10px; padding: 14px 20px;
  margin-top: 16px; flex-wrap: wrap;
}
.totals-bar .t-item { display: flex; align-items: baseline; gap: 6px; }
.totals-bar .t-label { font-size: 13px; color: var(--gray); }
.totals-bar .t-value { font-size: 18px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.totals-bar .t-value.green { color: var(--success); }
.totals-bar .t-value.red { color: var(--danger); }

/* ============ 工具类 ============ */
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-muted { color: var(--gray); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.font-bold { font-weight: 700; }
.w-120 { width: 120px; }
.w-140 { width: 140px; }
.w-160 { width: 160px; }
.w-200 { width: 200px; }
.w-240 { width: 240px; }
.empty { text-align: center; padding: 36px 0; color: var(--gray); font-size: 13px; }

/* ============ 批量操作条 ============ */
.batch-bar {
  display: none; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--primary-light); border-bottom: 1px solid var(--border);
}
.batch-bar.show { display: flex; }
.batch-bar .batch-info { font-size: 13px; color: var(--primary-dark); font-weight: 600; }
.batch-bar select { width: 160px; }

/* ============ 表格复选框 / 文本链接 ============ */
.table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
.link { color: var(--primary); }
.link:hover { text-decoration: underline; }

/* ============ 待办提醒条（首页） ============ */
.alert-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.alert-item {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--warning-light); color: var(--warning);
  border: 1px solid #fde68a; border-radius: 10px; padding: 9px 16px; font-size: 13px;
  transition: all .15s;
}
.alert-item:hover { box-shadow: 0 2px 8px rgba(217,119,6,.2); }
.alert-item b { font-size: 16px; }

/* ============ 回收报价参考提示 ============ */
.f-price-ref { font-size: 11px; color: var(--gray); line-height: 1.35; margin-top: 2px; word-break: break-all; }

/* ============ 登录验证码 ============ */
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-img { width: 120px; height: 42px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); background: #f3f6fa; object-fit: cover; flex: 0 0 auto; }

/* ============ 移动端侧边栏 ============ */
.menu-toggle { display: none; }
.sidebar-mask { display: none; }

/* ============ 验机照片 ============ */
.photo-cell { min-width: 130px; }
.photo-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-thumb { position: relative; width: 52px; height: 52px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); background: #f8fafc; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo-thumb .ph-del { position: absolute; top: -5px; right: -5px; width: 18px; height: 18px; border-radius: 50%; background: var(--danger, #dc2626); color: #fff; font-size: 11px; line-height: 18px; text-align: center; cursor: pointer; border: none; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.photo-view-mask { position: fixed; inset: 0; background: rgba(15,23,42,.85); z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.photo-view-mask .pv-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 20px; line-height: 36px; text-align: center; cursor: pointer; border: none; }
.photo-view-mask img { max-width: 100%; max-height: 100%; border-radius: 6px; }

/* ============ 响应式：平板（横/竖屏） / 手机端 ============ */

/* 双列卡片工具类（首页/统计页并排卡片，小屏自动降单列） */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* 平板/手机：表格列保持内容宽度不换行，总宽超出容器时横向滚动 */
@media (max-width: 1199px) {
  .table { min-width: 100%; }
  .table td { white-space: nowrap; }
}

/* iPad 横屏 / 窄桌面（992~1199px）：消除横向滚动，网格减列 */
@media (min-width: 992px) and (max-width: 1199px) {
  body { min-width: 0; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 平板竖屏 / 手机（≤991px）：侧边栏变抽屉 */
@media (max-width: 991px) {
  body { min-width: 0; }
  .layout { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 1200; width: 240px; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 4px 0 20px rgba(15,23,42,.18); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1190; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
  .sidebar-mask.show { opacity: 1; visibility: visible; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 16px; cursor: pointer; color: #0f172a; flex: 0 0 auto; }
  .topbar { padding: 0 12px; }
  .topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .topbar-left .page-title { font-size: 17px; }
  .topbar-right { gap: 8px; }
  .content { padding: 12px 12px 30px; }
  .page-head { flex-wrap: wrap; gap: 8px; }
  .page-actions { flex-wrap: wrap; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-cards { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .form-grid, .form-grid.cols-2, .form-grid.cols-5 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .filter-bar { padding: 12px; }
  .filter-row { gap: 8px; }
  .filter-item { width: 100%; }
  .filter-actions { padding-top: 2px; }
  .totals-bar { flex-wrap: wrap; gap: 8px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .modal-mask { padding: 10px; align-items: flex-end; }
  .modal { max-height: 92vh; max-width: 100%; overflow-y: auto; border-radius: 14px 14px 0 0; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .tb-user .hide-m, .tb-user .real-name { display: none; }
  .dict-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
}

/* iPad 竖屏（768~991px）细分：筛选项两列排列，更紧凑 */
@media (min-width: 768px) and (max-width: 991px) {
  .filter-item { width: calc(50% - 6px); }
  .filter-actions { padding-top: 19px; }
}

/* 手机端（≤767px，含手机横屏） */
@media (max-width: 767px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .form-grid.cols-2, .form-grid.cols-5 { grid-template-columns: 1fr; }
  .filter-actions .btn { flex: 1; }
  .topbar-right .tb-scope { display: none; }
  .card-head { flex-wrap: wrap; gap: 8px; }
  .city-switch { max-width: 100%; justify-content: flex-start; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .table th, .table td { padding: 8px 10px; }
  .pagination { justify-content: center; overflow-x: auto; }
  .rank-name { width: 90px; }
  .rank-val { width: 84px; font-size: 11px; }
  .bar-chart { gap: 4px; }
  .totals-bar .t-value { font-size: 16px; }
  .content { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
}

/* 手机竖屏（≤480px） */
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-ico { width: 38px; height: 38px; }
  .stat-value, .stat-num { font-size: 18px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item { padding: 10px 12px; }
  .tb-user { display: none; }
  .topbar-left .page-title { font-size: 15px; }
  .modal-head { padding: 12px 16px; }
  .modal-body { padding: 14px; }
  .login-box { width: 92%; padding: 30px 20px 26px; }
  .brand-name { word-break: break-all; }
}

/* ============ 日期选择器（内置日历，点击文本框弹出） ============ */
input.datepicker {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
  padding-right: 34px;
}
.dp-panel {
  position: absolute; z-index: 1200; width: 264px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15,23,42,.15); padding: 12px; font-size: 13px;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { font-weight: 600; font-size: 14px; }
.dp-nav { border: 1px solid var(--border); background: #fff; border-radius: 8px; width: 26px; height: 26px; cursor: pointer; font-size: 16px; line-height: 1; color: var(--gray); padding: 0; }
.dp-nav:hover { background: var(--primary-light); color: var(--primary); }
.dp-foot { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; text-align: center; }
.dp-clear { border: none; background: none; color: var(--gray); font-size: 12px; cursor: pointer; padding: 4px 10px; border-radius: 6px; }
.dp-clear:hover { background: var(--gray-light); color: var(--danger); }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-week span { text-align: center; color: var(--gray); font-size: 11px; padding: 4px 0; }
.dp-cell { text-align: center; padding: 6px 0; border-radius: 8px; cursor: pointer; line-height: 1; }
.dp-cell:hover { background: var(--primary-light); color: var(--primary); }
.dp-cell.other { color: #c5c9d4; }
.dp-cell.today { color: var(--primary); font-weight: 700; }
.dp-cell.sel { background: var(--primary); color: #fff; font-weight: 700; }
