/* 计量物资管理 H5 - 样式
   主色 #1a5fb4；禁止 emoji，箭头/图形均用 CSS 绘制；移动端自适应 */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow-x: hidden; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6f9;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  margin: 0;
  padding: 0;
}
#app { min-height: 100vh; display: flex; flex-direction: column; margin: 0; padding: 0; }

/* 顶部导航 */
.topbar {
  background: #1a5fb4; color: #fff;
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  margin-top: 0;
}
.topbar-title { font-size: 18px; font-weight: 600; color: #fff; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; margin-right: 10px; }
.btn-link-light { color: #fff; background: rgba(255,255,255,.16); padding: 5px 14px; border-radius: 6px; }
.topbar .btn-link { color: #fff; }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-shrink: 0; }
.topbar-user .uname { font-weight: 600; }
.topbar-user .urole {
  background: rgba(255,255,255,.18); padding: 2px 8px; border-radius: 10px; font-size: 12px;
}
.settings-menu { position: relative; }
.settings-btn {
  background: rgba(255,255,255,.15); border: none; color: #fff; width: 32px; height: 32px;
  border-radius: 50%; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.settings-btn:hover { background: rgba(255,255,255,.28); }
.settings-dropdown {
  position: absolute; top: 40px; right: 0; background: #fff; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15); overflow: hidden; min-width: 140px; z-index: 100;
}
.settings-item {
  padding: 11px 16px; font-size: 14px; color: #374151; cursor: pointer; white-space: nowrap;
  border-bottom: 1px solid #f3f4f6; transition: background .15s;
}
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: #f0f5fb; color: #1a5fb4; }
.readonly-toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.9);
  background: rgba(26,95,180,.95); color: #fff; padding: 14px 28px; border-radius: 8px;
  font-size: 15px; z-index: 9999; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.readonly-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* 底部 tab 导航 */
.tabbar {
  display: flex; overflow-x: auto; background: #fff;
  border-bottom: 1px solid #e5e7eb; position: fixed; top: 50px; left: 0; right: 0; z-index: 40;
  -webkit-overflow-scrolling: touch;
  height: 48px; align-items: center;
}
.tabbar a {
  flex: 0 0 auto; padding: 0 18px; text-decoration: none; color: #6b7280;
  font-size: 15px; white-space: nowrap; height: 48px; line-height: 48px;
  display: inline-block; position: relative;
}
.tabbar a.active { color: #1a5fb4; font-weight: 600; }
.tabbar a.active::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 2px; background: #1a5fb4;
}

/* 主内容 */
.main { flex: 1; padding: 14px; max-width: 1600px; width: 100%; margin: 0 auto; padding-top: 100px; }
.page-title { font-size: 18px; font-weight: 600; color: #1a5fb4; margin-bottom: 12px; }

/* 页面标题头 */
.page-header {
  margin: 16px 0 14px; padding: 10px 18px;
  background: linear-gradient(135deg, #1a5fb4 0%, #2470c4 100%);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(26,95,180,.25);
}
.page-header-title {
  font-size: 16px; font-weight: 700; color: #ffffff;
  margin: 0; line-height: 1.3; letter-spacing: .5px;
}
.page-header-sub {
  font-size: 12px; color: rgba(255,255,255,.8);
  margin: 2px 0 0; line-height: 1.4;
}
.hint { color: #6b7280; font-size: 13px; margin: 6px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.hint.err { color: #dc2626; }
.hint .btn-primary.small, .hint .btn-secondary.small { font-size: 12px; padding: 3px 10px; border-radius: 5px; }
/* 批量入库 */
.batch-fields { border: 1px dashed #bcd0ea; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; background: #f6f9fe; }
.batch-fields .row { display: flex; gap: 12px; }
.batch-fields .row .field { flex: 1; margin-bottom: 0; }
/* 批量检定：batch-fields 变透明，只留 subcard 作版块 */
.batch-fields.verify-batch {
  border: none; background: transparent; padding: 0; margin: 0;
}
.batch-fields.verify-batch .row .field { margin-bottom: 12px; }
/* 子版块 */
.subcard {
  border: 1px solid #e5e7eb; border-radius: 6px;
  padding: 20px 24px; margin-bottom: 20px; background: #fff;
}
.subcard:last-child { margin-bottom: 0; }
.subcard-title {
  font-size: 13px; font-weight: 700; color: #1a5fb4;
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid #eef1f5;
}
/* 移动端：首号/尾号分两行（仅外层行，不影响内层"输入框+相机"横排），保证编号完整可见 */
@media (max-width: 480px) {
  .batch-fields > .row { flex-direction: column; gap: 8px; }
}
/* 批量入库：首号/尾号撑满，数量框固定窄宽 */
.batch-row-3 { gap: 10px; }
.batch-row-3 > .field { flex: 1 1 0; min-width: 0; margin-bottom: 0; }
.batch-row-3 > .field:last-child { flex: 0 0 110px; }
/* 数量显示框：ok=正常 / idle=未填 / err=首尾号无效 */
.batch-qty-box {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: 100%; height: 42px; border-radius: 8px; border: 1px solid #c9dcf5;
  background: linear-gradient(135deg, #eef4fd 0%, #f8fbff 100%);
  color: #1a5fb4; font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}
.batch-qty-box .bq-num { font-size: 22px; font-weight: 700; line-height: 1; }
.batch-qty-box .bq-unit { font-size: 13px; font-weight: 600; }
.batch-qty-box.idle { color: #b6bfcb; background: #f6f8fa; border-style: dashed; }
.batch-qty-box.idle .bq-num { color: #b6bfcb; }
.batch-qty-box.err { color: #dc2626; background: #fef2f2; border-color: #f3c2c2; }
.batch-qty-box.err .bq-num { color: #dc2626; }
/* 两列均分（名称/物资编码） */
.row-2 { display: flex; gap: 10px; }
.row-2 > .field { flex: 1; min-width: 0; margin-bottom: 12px; }
/* 三列均分（厂家/型号/规格） */
.row-3 { display: flex; gap: 10px; }
.row-3 > .field { flex: 1; min-width: 0; margin-bottom: 12px; }
.row-4 { display: flex; gap: 10px; }
.row-4 > .field { flex: 1; min-width: 0; margin-bottom: 12px; }
/* 相机图标按钮（拍照识别条码） */
.icon-btn {
  flex-shrink: 0; width: 42px; height: 42px; border: 1px solid #bcd0ea; border-radius: 8px;
  background: #f6f9fe; color: #1a5fb4; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; padding: 0;
}
.icon-btn:active { background: #e3edf9; }
/* 出库登记：编号查询结果信息条 */
.ob-info {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: -4px 0 12px; padding: 9px 12px; border-radius: 8px; font-size: 13px;
  background: #f0f9f1; border: 1px solid #bfe3c5; color: #14532d;
}
.ob-info.err { background: #fdf2f2; border-color: #f5c6c6; color: #7f1d1d; }
.ob-info .ob-badge {
  flex-shrink: 0; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #16a34a; color: #fff;
}
.ob-info.err .ob-badge { background: #dc2626; }
.ob-info .ob-line { color: inherit; }
/* 实时扫码弹窗：取景框 + 四角定位框 */
.scan-video-box { position: relative; background: #000; border-radius: 10px; overflow: hidden; margin: 10px 0; }
.scan-video-box video { width: 100%; display: block; max-height: 55vh; object-fit: cover; }
.scan-frame {
  position: absolute; left: 12%; right: 12%; top: 18%; bottom: 18%;
  border: 2px solid rgba(26,95,180,.95); border-radius: 10px;
  box-shadow: 0 0 0 2000px rgba(0,0,0,.28); pointer-events: none;
}
.scan-frame::before, .scan-frame::after {
  content: ''; position: absolute; width: 26px; height: 26px;
  border: 3px solid #6db3ff;
}
.scan-frame::before { left: -2px; top: -2px; border-right: none; border-bottom: none; border-radius: 8px 0 0 0; }
.scan-frame::after { right: -2px; bottom: -2px; border-left: none; border-top: none; border-radius: 0 0 8px 0; }
.scan-video-box p {
  position: absolute; left: 0; right: 0; bottom: 10px; text-align: center;
  color: #fff; font-size: 13px; margin: 0; text-shadow: 0 1px 3px rgba(0,0,0,.85); padding: 0 12px;
}

/* 卡片 */
.card {
  background: #fff; border-radius: 10px; padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 14px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-weight: 600; }

/* 表单 */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; color: #374151; margin-bottom: 4px; }
.field .req { color: #dc2626; font-style: normal; }
.row { display: flex; gap: 8px; }
input, select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 15px; background-color: #fff; color: #1f2937; outline: none;
  box-sizing: border-box; -webkit-appearance: none; appearance: none;
}

/* select 下拉箭头：直接加在 select 元素上，background-color 不覆盖 background-image */
select {
  cursor: pointer;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7280' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 6px;
}
select::-ms-expand { display: none; }
select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%231a5fb4' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
}
input[type="date"], input[type="time"], input[type="datetime-local"] {
  height: 38px; line-height: 1.4;
}
input:focus, select:focus, textarea:focus { border-color: #1a5fb4; box-shadow: 0 0 0 2px rgba(26,95,180,.12); }
textarea { resize: vertical; }
/* 只读字段（如操作时间）：灰底，突出"系统自动生成、不可编辑" */
input.readonly, input[readonly] { background: #f3f4f6; color: #6b7280; cursor: default; }

/* 按钮 */
.btn-primary, .btn-secondary, .btn-danger, .btn-link {
  border: none; border-radius: 8px; cursor: pointer; font-size: 15px; padding: 10px 16px;
  transition: opacity .15s;
}
.btn-primary { background: #1a5fb4; color: #fff; }
.btn-primary:hover { opacity: .9; }
.btn-primary.disabled, .btn-secondary.disabled { background: #ccc; color: #999; cursor: not-allowed; opacity: 1; }
.btn-secondary { background: #e5e7eb; color: #1f2937; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-link { background: transparent; color: #1a5fb4; padding: 6px 8px; }
.btn-link.danger { color: #dc2626; }
.btn-primary.small, .btn-secondary.small, .btn-danger.small { font-size: 12px; padding: 4px 10px; border-radius: 5px; }
.op-cell { white-space: nowrap; }
.op-cell .btn-link { padding: 4px 6px; font-size: 13px; }
.small { padding: 6px 10px; font-size: 13px; }
.btn-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }

/* CSS 三角箭头（折叠用，不使用任何字体图标/emoji） */
.arrow {
  display: inline-block; width: 0; height: 0;
  border-left: 5px solid #9ca3af; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  transition: transform .2s; flex: 0 0 auto;
}
.arrow.open { transform: rotate(90deg); border-left-color: #1a5fb4; }

/* 库存行 */
.inv-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-bottom: 1px solid #f3f4f6;
}
.inv-item > .inv-row { cursor: pointer; }
.inv-item > .inv-row:hover { background: #f8fafd; }
.inv-row.head {
  color: #6b7280; font-size: 13px; border-bottom: 1px solid #e5e7eb;
  background: #f9fafb; font-weight: 600;
}
.inv-row.head .qty { font-weight: 500; }
.inv-row .iname { flex: 1; }
.inv-row.head > span:first-child, .inv-row.total > span:first-child { flex: 1; }
.inv-row .qty { width: 70px; text-align: right; font-weight: 600; flex-shrink: 0; }
.inv-row.total { border-top: 2px solid #1a5fb4; border-bottom: none; font-weight: 700; color: #1a5fb4; padding-top: 12px; }
.inv-detail { padding: 4px 8px 8px; background: #fff; border-radius: 0; margin: 0; border-bottom: 1px solid #f3f4f6; }

/* 表格 */
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th, .mini-table td { padding: 7px 8px; text-align: left; border-bottom: 1px solid #f3f4f6; }
.mini-table th { color: #6b7280; font-weight: 600; background: #f9fafb; }
.mini-table tr:last-child td { border-bottom: none; }
.clickable-row { cursor: pointer; transition: background .15s; }
.clickable-row:hover { background: #eff6ff; }
.inv-overview-table th, .inv-overview-table td { white-space: nowrap; padding: 7px 10px; }
.inv-overview-table th:first-child, .inv-overview-table td:first-child { min-width: 120px; }
.inv-overview-list { padding: 4px 0; }
.inv-overview-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; border-bottom: 1px solid #f3f4f6; }
.inv-overview-row .dept { font-size: 14px; color: #374151; }
.inv-overview-row .qty { font-size: 14px; font-weight: 600; color: #1a5fb4; }
.inv-overview-row.total { border-top: 2px solid #1a5fb4; border-bottom: none; margin-top: 4px; }
.inv-overview-row.total .dept { font-weight: 700; color: #1f2937; }
.inv-overview-row.total .qty { font-size: 16px; }
.cell-sub { font-size: 11px; color: #9ca3af; margin-top: 2px; line-height: 1.3; }

/* 库存信息三列布局 */
.inv-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  align-items: start;
}
.inv-col { max-height: 72vh; overflow-y: auto; }
.inv-kpi { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
.inv-station-sel { width: 100%; margin-bottom: 10px; }

/* 供电所二级导航条（两排固定展示，每排 7 个） */
.station-nav {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 12px;
}
.station-nav button {
  border: 1px solid #d1d9e6; background: #fff; color: #374151;
  padding: 8px 4px; border-radius: 6px; font-size: 14px; line-height: 1.3;
  cursor: pointer; text-align: center;
  transition: background .12s, color .12s, border-color .12s;
}
.station-nav button:hover { border-color: #1a5fb4; color: #1a5fb4; }
.station-nav button.active { background: #1a5fb4; border-color: #1a5fb4; color: #fff; font-weight: 600; }
.station-nav .m-br { display: none; }
@media (max-width: 600px) {
  .inv-grid { grid-template-columns: 1fr; }
  .inv-col { max-height: none; }
  .station-nav { gap: 6px; }
  .station-nav button { padding: 6px 2px; font-size: 12px; line-height: 1.3; border-radius: 5px; }
  .station-nav .m-br { display: inline; }
}

/* 目录分组 */
.search { margin-bottom: 12px; }
.cat-group { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.group-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: #1a5fb4; color: #fff; cursor: pointer;
}
.group-head .gname { flex: 1; font-weight: 600; }
.group-head .gcount { font-size: 12px; background: rgba(255,255,255,.2); padding: 2px 8px; border-radius: 10px; }
.group-head .arrow { border-left-color: #fff; }
.group-head .arrow.open { border-left-color: #fff; }
.group-body { padding: 8px 12px; background: #fff; }

/* 调拨单 */
.order-form { background: #f9fafb; border-radius: 8px; padding: 14px; margin-bottom: 16px; }
.order-form h3 { color: #1a5fb4; margin-bottom: 10px; }
.order-form h4 { margin: 10px 0 8px; font-size: 14px; color: #374151; }
.item-line { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; padding: 10px; background: transparent; border-radius: 0; border: none; box-shadow: none; }
.item-line + .item-line { border-top: 1px solid #1a5fb4; padding-top: 18px; }
.sec-title { font-size: 15px; color: #1a5fb4; padding-bottom: 6px; border-bottom: 1px solid #1a5fb4; }
.item-line .item-sub { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.it-lbl { font-size: 12px; color: #6b7280; flex-shrink: 0; margin-right: -4px; }
.item-sub select, .item-sub input { min-width: 0; }

/* ===== 供电所多只出库卡片样式 ===== */
.multi-card {
  border: 1px solid #e0e6ee;
  border-radius: 8px;
  padding: 12px 14px 10px;
  margin-bottom: 12px;
  background: #fafcff;
}
.multi-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.multi-num {
  font-weight: 600;
  color: #1a5fb4;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}
.multi-barcode {
  flex: 1 1 140px;
  min-width: 90px;
  padding: 6px 8px;
  border: 1px solid #d0d7e1;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}
.multi-barcode:focus { border-color: #1a5fb4; box-shadow: 0 0 0 3px rgba(26,95,180,.12); }
.multi-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.multi-badge.ok { background: #d4edda; color: #155724; }
.multi-badge.err { background: #f8d7da; color: #721c24; }
.multi-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.multi-row + .multi-row { margin-top: 14px; }
.input-btn-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.input-btn-row select, .input-btn-row input { flex: 1; min-width: 0; }
.input-btn-row .btn-danger { margin: 0; align-self: stretch; }
.btn-right { display: block; margin-left: auto; margin-top: 6px; }
.item-line .it-name { flex: 2 1 140px; }
.item-line .it-code { flex: 1.3 1 100px; }
.item-line .it-model { flex: 1 1 80px; }
.item-line .it-spec { flex: 1 1 80px; }
.item-line .it-qty { width: 72px; flex: 0 0 72px; }
.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-card { background: #f9fafb; border-radius: 8px; padding: 12px; border: 1px solid #e5e7eb; }
.order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.order-head .ono { font-weight: 700; color: #1a5fb4; }
.order-head .status { font-size: 12px; padding: 2px 10px; border-radius: 10px; background: #fef3c7; color: #92400e; }
.order-head .status.done { background: #d1fae5; color: #065f46; }
.order-route { font-weight: 600; margin-bottom: 4px; }
.order-meta { font-size: 12px; color: #6b7280; margin: 4px 0; }

/* 登录/注册 */
.auth-wrap {
  position: relative; overflow: hidden;
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: linear-gradient(155deg, #0a2748 0%, #123f75 42%, #1a5fb4 78%, #2a6fc4 100%);
}
.auth-inner { position: relative; z-index: 1; width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; }

/* 品牌区（公司全称，单行不换行） */
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-org {
  margin: 0; color: #fff; font-size: 20px; font-weight: 700;
  letter-spacing: 2px; line-height: 1.4; white-space: nowrap;
  text-shadow: 0 2px 10px rgba(0,20,50,.35);
}

.auth-card { background: #fff; border-radius: 14px; padding: 30px 24px 24px; width: 100%; max-width: none; box-shadow: 0 16px 44px rgba(4,24,56,.35); }
.auth-logo { text-align: center; font-size: 24px; font-weight: 700; color: #1a5fb4; letter-spacing: 4px; margin-bottom: 8px; }
.auth-sysname { text-align: center; color: #6b7280; font-size: 13px; letter-spacing: 4px; margin-bottom: 22px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input { width: 100%; }
.auth-switch { text-align: center; font-size: 13px; color: #6b7280; margin-top: 6px; }
.auth-switch a { color: #1a5fb4; text-decoration: none; }

/* 弹层 */
[v-cloak] { display: none !important; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-body { background: #fff; border-radius: 12px; padding: 16px; max-width: 420px; width: 100%; }
.modal-body.doc-detail-modal { max-width: none !important; width: 100vw !important; height: 100vh !important; display: flex; flex-direction: column; border-radius: 0; padding: 16px; margin: 0; position: fixed; inset: 0; z-index: 101; }
.modal:has(> .doc-detail-modal) { background: transparent; padding: 0; }
.modal-body.doc-detail-modal > .modal-head { flex: 0 0 auto; }
.modal-body.doc-detail-modal > .btn-row { flex: 0 0 auto; }
.modal-body.doc-detail-modal > template { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.modal-body.doc-detail-modal > iframe { flex: 1; min-height: 0; }
.modal-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 10px; }

.empty { text-align: center; color: #9ca3af; padding: 16px; font-size: 14px; }

/* 页内子标签（库存信息） */
.subtab {
  display: flex; gap: 8px; margin-bottom: 12px;
  background: #fff; padding: 4px; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.subtab button {
  flex: 1; border: none; background: transparent; padding: 9px 0;
  font-size: 14px; color: #6b7280; border-radius: 6px; cursor: pointer;
  transition: background .15s, color .15s;
}
.subtab button.active { background: #1a5fb4; color: #fff; font-weight: 600; }

/* 移动端微调 */
@media (max-width: 600px) {
  .main { padding: 10px; padding-top: 92px; }
  .topbar-title { font-size: 15px; letter-spacing: 0; }
  .topbar { padding: 10px 12px; min-height: 48px; }
  .tabbar { top: 48px; }
  .topbar-user { gap: 6px; font-size: 12px; }
  .item-line .it-model, .item-line .it-spec { flex: 1 1 72px; }
  .mini-table th, .mini-table td { padding: 6px; }
  /* 表单字段全改单列（但输入框+扫码按钮保持同行） */
  .row:not(:has(.icon-btn)), .row-2, .row-3, .row-4, .batch-row-3, .verify-batch .row-3 { flex-direction: column; gap: 0; }
  .row:not(:has(.icon-btn)) .field, .row-2 .field, .row-3 .field, .row-4 .field { width: 100%; margin-bottom: 10px; }
}
@media (max-width: 380px) {
  /* 极窄屏隐藏角色徽标，保证系统名称完整显示 */
  .topbar-user .urole { display: none; }
}

/* ============ 数据看板（首页） ============ */
.home-grid { display: flex; flex-direction: column; gap: 16px; }

/* KPI 统计卡 */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi-card {
  background: #fff; border-radius: 10px; padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); border: 1px solid #f1f5f9;
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.kpi-blue::before { background: #1a5fb4; }
.kpi-indigo::before { background: #4f46e5; }
.kpi-teal::before { background: #0d9488; }
.kpi-orange::before { background: #ea580c; }
.kpi-num { font-size: 28px; font-weight: 700; line-height: 1; color: #111827; }
.kpi-blue .kpi-num { color: #1a5fb4; }
.kpi-indigo .kpi-num { color: #4f46e5; }
.kpi-teal .kpi-num { color: #0d9488; }
.kpi-orange .kpi-num { color: #ea580c; }
.kpi-label { font-size: 13px; color: #6b7280; margin-top: 8px; }

/* 区块小标题（通用） */
.home-sec-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0 3px 0; margin-bottom: 8px;
  border-bottom: 1px solid #1a5fb4;
  min-height: 22px;
}
.home-sec-head .btn-link { padding: 0 6px; font-size: 13px; line-height: 22px; }
.home-sec-title { font-size: 14px; font-weight: 600; color: #374151; line-height: 22px; }

/* 动态表格 2x3 网格，所有卡片等高 */
.home-dynamic-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  align-items: stretch;
}
.home-dynamic-col { min-width: 0; }
.home-dynamic-col.card {
  display: flex; flex-direction: column;
  min-height: 240px;
}
.home-dynamic-col .announce-list { flex: 1; overflow: hidden; }
.home-dynamic-col .table-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.home-dynamic-col .table-wrap table { flex-shrink: 0; }
.home-dynamic-col .table-wrap .dash-more { margin-top: auto; }

/* 移动端 */
@media (max-width: 1024px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .home-dynamic-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .home-kpi { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .home-kpi .kpi-card { padding: 16px 8px; }
  .home-kpi .kpi-num { font-size: 22px; }
  .home-kpi .kpi-label { font-size: 11px; }
}
.announce-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: -14px -14px 14px; padding: 16px 22px;
  background: linear-gradient(135deg, #1a5fb4 0%, #2470c4 100%);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 2px 8px rgba(26,95,180,.25);
}
.announce-title {
  margin: 0; font-size: 20px; font-weight: 700; color: #ffffff; line-height: 1.3; letter-spacing: 1px;
}
.announce-meta { display: flex; align-items: center; gap: 10px; }
.announce-date { font-size: 13px; color: rgba(255,255,255,.85); }
.announce-head .btn-link { color: #fff; background: rgba(255,255,255,.2); padding: 5px 14px; border-radius: 6px; }
.announce-list { margin: 0; padding-left: 0; list-style: none; color: #374151; font-size: 14px; line-height: 1.9; }
.announce-list li { padding-left: 16px; position: relative; }
.announce-list li::before {
  content: ''; position: absolute; left: 2px; top: 12px;
  width: 6px; height: 6px; border-radius: 50%; background: #1a5fb4;
}
.ann-item {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 8px 6px 18px; border-radius: 4px; transition: background .15s;
}
.ann-item::before { display: none; }
.ann-item:hover { background: #f0f5fc; }
.ann-item .ann-dot {
  width: 0; height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid #1a5fb4;
  flex-shrink: 0;
  margin-right: 2px;
}
.ann-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ann-time { font-size: 12px; color: #9ca3af; flex-shrink: 0; }
.ann-empty { color: #9ca3af; text-align: center; padding: 12px 0 !important; }
.ann-empty::before { display: none !important; }

/* 公告弹窗 */
.ann-modal { max-width: 640px; }
.ann-meta-row {
  display: flex; gap: 20px; font-size: 13px; color: #6b7280;
  padding: 8px 0 14px; border-bottom: 1px solid #e5e7eb; margin-bottom: 16px;
}
.ann-content {
  font-size: 14px; line-height: 1.8; color: #374151;
  min-height: 80px; white-space: normal; word-break: break-word;
  max-height: 60vh; overflow-y: auto;
}
/* 公告详情页 - 大气版 */
.ann-detail-page {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  min-height: 80vh;
  display: flex; flex-direction: column;
}
.ann-detail-hero {
  background: linear-gradient(135deg, #1a5fb4 0%, #2a6fc4 60%, #3a7fd4 100%);
  padding: 22px 28px; color: #fff; position: relative; overflow: hidden;
}
.ann-detail-hero::after {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,.08); pointer-events: none;
}
.ann-detail-hero::before {
  content: ''; position: absolute; bottom: -80px; left: -40px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.05); pointer-events: none;
}
.ann-detail-badge {
  display: inline-block; padding: 3px 10px; border-radius: 16px;
  background: rgba(255,255,255,.2); font-size: 12px; font-weight: 600;
  letter-spacing: 2px; margin-bottom: 10px; position: relative; z-index: 1;
}
.ann-detail-title {
  font-size: 22px; font-weight: 700; line-height: 1.4;
  margin: 0 0 10px; letter-spacing: .5px; position: relative; z-index: 1;
}
.ann-detail-meta {
  display: flex; align-items: center; gap: 14px; font-size: 14px;
  color: rgba(255,255,255,.85); position: relative; z-index: 1;
}
.ann-detail-author { font-weight: 600; }
.ann-detail-dot { font-size: 8px; opacity: .5; }
.ann-detail-time { opacity: .85; }
.ann-detail-body { padding: 32px 28px 24px; flex: 1; }
.ann-detail-content {
  font-size: 15px; line-height: 2; color: #1f2937;
  white-space: normal; word-break: break-word;
}
.ann-detail-content p { margin-bottom: 14px; }
.ann-detail-content h1, .ann-detail-content h2, .ann-detail-content h3 {
  margin: 20px 0 10px; color: #1a5fb4;
}
.ann-detail-footer {
  display: flex; justify-content: flex-end; gap: 12px;
  padding: 16px 28px 24px; border-top: 1px solid #f0f2f5; margin-top: 0;
}
@media (min-width: 1025px) {
  .ann-detail-hero { padding: 28px 36px; }
  .ann-detail-body { padding: 36px 36px 28px; }
  .ann-detail-content { font-size: 16px; line-height: 2.1; }
  .ann-detail-footer { padding: 20px 36px 28px; }
}
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.dash-title { font-size: 20px; font-weight: 700; color: #1f2937; margin: 0; }
.dash-date { font-size: 13px; color: #6b7280; margin: 4px 0 0; }
/* 首页最近动态卡片：标题与标签栏间距收紧 */
.dash-card .rp-tabs { margin-top: 4px; }
.dash-refresh { white-space: nowrap; }

/* KPI 卡片（嵌于库存总览白卡内） */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi-card {
  background: #f5f8fc; border-radius: 8px; padding: 16px 14px; text-align: center;
}
.kpi-num { font-size: 28px; font-weight: 700; line-height: 1.1; color: #1f2937; }
.kpi-label { font-size: 13px; color: #6b7280; margin-top: 6px; }
.kpi-blue .kpi-num { color: #1a5fb4; }
.kpi-cyan .kpi-num { color: #0891b2; }
.kpi-green .kpi-num { color: #059669; }
.kpi-orange .kpi-num { color: #d97706; }

.dash-card-title {
  font-size: 15px; font-weight: 700; color: #1f2937; margin: 0 0 12px;
  padding-left: 9px; border-left: 3px solid #1a5fb4;
}

/* 计量器具查询 */
.ms-panel { display: flex; gap: 8px; }
.ms-input {
  flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid #d1d9e6; border-radius: 6px; font-size: 14px;
}
.ms-input:focus { outline: none; border-color: #1a5fb4; box-shadow: 0 0 0 2px rgba(26,95,180,.12); }
.ms-btn { flex-shrink: 0; padding: 9px 22px; border-radius: 6px; }
.ms-result { margin-top: 14px; }
.ms-count { margin: 8px 0 0; text-align: right; }
.ms-pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 12px; flex-wrap: wrap; font-size: 13px; color: #374151;
}
.ms-pager-info { font-weight: 600; color: #111827; }
.ms-pager-size { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ms-pager-size select {
  padding: 3px 6px; border: 1px solid #d1d9e6; border-radius: 4px; font-size: 13px;
}
.ms-pager-btns { display: inline-flex; align-items: center; gap: 6px; }
.btn-page {
  padding: 4px 12px; border: 1px solid #d1d9e6; border-radius: 4px;
  background: #fff; color: #374151; font-size: 13px; cursor: pointer;
}
.btn-page:hover:not(:disabled) { border-color: #1a5fb4; color: #1a5fb4; }
.btn-page:disabled { opacity: 0.45; cursor: not-allowed; }
.ms-pager-cur { padding: 0 6px; color: #6b7280; }
.ms-filter {
  border-top: 1px dashed #e5e7eb; margin-top: 12px; padding-top: 12px;
}
.chk-inline { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #374151; cursor: pointer; white-space: nowrap; }
.chk-inline input { display: inline-block; margin: 0; }
@media (max-width: 600px) {
  .ms-panel { flex-direction: column; }
  .ms-btn { width: 100%; }
}

/* 状态标签 */
.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.tag-green { background: #d1fae5; color: #065f46; }
.tag-orange { background: #fef3c7; color: #92400e; }
.table-wrap { overflow-x: auto; }
.dash-more { margin: 12px 0 0; text-align: right; font-size: 13px; }

/* ============ 统计报表（简约：选项卡 + 简洁表格） ============ */
.btn-ghost {
  border: 1px solid #c9dcf5; background: #fff; color: #1a5fb4;
  border-radius: 8px; padding: 7px 18px; font-size: 13px; cursor: pointer;
}
.btn-ghost:hover { background: #f1f6fd; }

/* 一级栏：中心 / 供电所（分段按钮） */
.rp-scope {
  display: inline-flex; gap: 4px; padding: 4px;
  background: #eef2f8; border-radius: 10px; margin-bottom: 4px;
}
.rp-scope-btn {
  border: none; background: transparent; cursor: pointer;
  font-size: 15px; font-weight: 500; color: #5b6675;
  padding: 8px 30px; border-radius: 8px; white-space: nowrap;
}
.rp-scope-btn:hover { color: #1a5fb4; }
.rp-scope-btn.on { background: #1a5fb4; color: #fff; font-weight: 600; box-shadow: 0 1px 4px rgba(26,95,180,.3); }

/* 选项卡：下划线式 */
.rp-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 14px 0 12px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.rp-tabs::-webkit-scrollbar { display: none; }
.rp-tab {
  border: 1px solid #e5e7eb; background: #fff; padding: 5px 14px;
  font-size: 13px; color: #6b7280; cursor: pointer; white-space: nowrap;
  border-radius: 4px;
}
.rp-tab:hover { color: #1a5fb4; border-color: #1a5fb4; }
.rp-tab.on { background: #1a5fb4; color: #fff; font-weight: 600; border-color: #1a5fb4; }

/* 二级标签 */
.rp-subtabs {
  display: flex; flex-wrap: wrap; gap: 8px 10px;
  margin: 0 0 14px;
}
.rp-subtab {
  border: 1px solid #d1d5db; background: #f9fafb; border-radius: 6px;
  padding: 6px 14px; font-size: 13px; color: #6b7280; cursor: pointer;
  white-space: nowrap; transition: all .15s;
}
.rp-subtab:hover { border-color: #1a5fb4; color: #1a5fb4; }
.rp-subtab.on { background: #1a5fb4; border-color: #1a5fb4; color: #fff; font-weight: 500; }

.rp-card { padding: 18px 20px 22px; }

/* 时段筛选行 */
.rp-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.rp-toolbar-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; align-items: center; }
.rp-toolbar-2col .rp-field { white-space: nowrap; }
.rp-toolbar-2col .rp-field select,
.rp-toolbar-2col .rp-field input { flex: 1; min-width: 0; width: 100%; }
.rp-toolbar-actions { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-start; }
.rp-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #4b5563; white-space: nowrap; }
.rp-field input { padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; color: #111827; }
.rp-select { padding: 7px 30px 7px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; color: #111827; background-color: #fff; min-width: 132px; cursor: pointer; -webkit-appearance: none; appearance: none; }
.rp-query { width: auto; padding: 8px 26px; font-size: 14px; }
.rp-quick { display: flex; gap: 6px; margin-left: auto; }
.rp-quick button { border: 1px solid #d1d5db; background: #fff; color: #4b5563; border-radius: 14px; padding: 5px 14px; font-size: 12px; cursor: pointer; }
.rp-quick button:hover { border-color: #1a5fb4; color: #1a5fb4; }
.rp-reset { padding: 8px 20px; font-size: 14px; }

/* 单据查询 */
.rp-field input[type="text"] { min-width: 150px; }
.doc-table { margin-top: 16px; min-width: 900px; }
.doc-table.doc-wide { min-width: 1100px; }
.doc-table th, .doc-table td { white-space: nowrap; }
.doc-table .rp-name { white-space: normal; min-width: 130px; }
.doc-table .op-cell { white-space: nowrap; }
.doc-table .op-exec { color: #1a5fb4; font-weight: 600; }
.doc-table .op-del { color: #d62d20; }
.btn-link:disabled, .btn-link.disabled { color: #b0b6bf; cursor: not-allowed; }
.hint-ok { color: #1a7f37; }
.doc-detail-row td { background: #fafbfd; padding: 0; }
.doc-detail-table { margin: 0; }
.doc-detail-table th, .doc-detail-table td { padding: 7px 12px; font-size: 13px; }
.rp-bad { color: #d62d20; font-weight: 600; }
.doc-pager {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap gap: 10px; margin-top: 16px; font-size: 13px; color: #6b7280;
}
.pager-btns { display: flex; gap: 8px; }
.btn-ghost.small { padding: 5px 16px; font-size: 13px; border-radius: 6px; }
.btn-ghost:disabled, .btn-ghost.small:disabled { opacity: .45; cursor: not-allowed; }

/* 打印 / 屏显表头 */
.rp-print-head { text-align: center; padding: 18px 0 14px; margin-top: 6px; border-bottom: 1px solid #eef1f5; }
.rp-print-head h3 { font-size: 19px; font-weight: 700; color: #111827; letter-spacing: 1px; }
.rp-print-head p { font-size: 13px; color: #6b7280; margin-top: 8px; }

/* 主表 */
.rp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rp-table th, .rp-table td { padding: 11px 12px; text-align: center; border-bottom: 1px solid #eef1f5; }
.rp-table thead th {
  background: #f7f9fc; color: #374151; font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
}
.rp-table tbody tr:hover { background: #fafcff; }
.rp-table .rp-name { text-align: left; color: #111827; }
.rp-table .rp-total { font-weight: 700; color: #1a5fb4; }
.rp-table .rp-ok { color: #059669; }
.rp-table .rp-bad { color: #dc2626; }
.rp-table tfoot td {
  border-top: 2px solid #1a5fb4; border-bottom: none;
  font-weight: 700; color: #111827; background: #fbfdff;
}
.rp-empty { text-align: center; color: #9ca3af; padding: 26px 0; font-size: 13px; }

/* 表格下方操作按钮 */
.rp-actions { display: flex; justify-content: center; gap: 16px; margin-top: 22px; }
.rp-btn { min-width: 120px; padding: 9px 0; font-size: 14px; }

@media (max-width: 700px) {
  .rp-card { padding: 14px 12px 18px; }
  .rp-scope-btn { padding: 7px 18px; font-size: 14px; }
  .rp-tabs { gap: 6px; }
  .rp-tab { font-size: 12px; padding: 3px 8px; }
  .rp-quick { margin-left: 0; }
  .rp-field input { width: 140px; }
  .rp-table { font-size: 13px; }
  .rp-table th, .rp-table td { padding: 9px 8px; }
  .rp-actions { gap: 10px; }
  .rp-btn { flex: 1; min-width: 0; }
}

/* 打印：仅保留报表内容 */
@media print {
  .topbar, .tabbar, .site-footer, .no-print { display: none !important; }
  .main { padding: 0; }
  .rp-page { padding: 0; }
  .rp-card { box-shadow: none; border: none; padding: 0; }
  .rp-table th { background: #fff !important; }
  .rp-table tfoot td { background: #fff !important; }
}
.dash-more a { color: #1a5fb4; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.dash-more a:hover .dash-arrow { transform: translateX(3px); }
.dash-arrow { transition: transform .2s ease; }

/* 页脚 */
.site-footer { background: #143f73; color: rgba(255,255,255,.82); margin-top: 24px; }
.footer-inner { max-width: 1600px; margin: 0 auto; padding: 14px 16px; text-align: center; font-size: 13px; line-height: 1.7; }
.footer-title { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.footer-line { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; }
.site-footer a { color: #9cc4f5; text-decoration: none; }

/* 登录页脚注与移动端适配 */
.auth-foot { color: rgba(255,255,255,.72); font-size: 12px; margin-top: 18px; letter-spacing: 1px; }

@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card { padding: 14px 12px; }
  .kpi-num { font-size: 24px; }
  .auth-wrap { padding: 16px 12px; }
  .auth-org { font-size: 14px; letter-spacing: 1px; }
  .auth-sysname { letter-spacing: 3px; }
  .auth-logo { font-size: 21px; letter-spacing: 3px; }
  .auth-brand { margin-bottom: 18px; }
  .footer-title { font-size: 13px; line-height: 1.4; }
  .footer-inner { padding: 14px 12px; line-height: 1.5; font-size: 12px; }
  .footer-line { flex-direction: column; gap: 2px; }
  .footer-sep { display: none; }
}

/* 复检表单-器具属性单选组 */
.prop-group { display: flex; gap: 18px; flex-wrap: wrap; padding: 4px 2px; }
.prop-item { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 15px; }
.prop-item input { width: 16px; height: 16px; accent-color: #1a5fb4; cursor: pointer; }
.prop-item span { user-select: none; }

/* ============ PC 端优化（屏幕 > 1024px） ============ */
@media (min-width: 1025px) {
  .main { padding: 20px 24px; padding-top: 108px; }
  .topbar { padding: 14px 28px; }
  .tabbar { top: 54px; }
  .inv-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .modal-body { max-width: 520px; }
  .ann-modal { max-width: 760px; }
  .page-header { padding: 12px 20px; }
  .page-header-title { font-size: 17px; }
  .card { padding: 18px 20px; }
  .rp-card { padding: 22px 24px 26px; }
}

@media (min-width: 1441px) {
  .ann-modal { max-width: 860px; }
  .modal-body { max-width: 560px; }
}
