/* ===== 客户库存查询 - 样式 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f0f2f5;
  color: #333;
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 20px;
}

header {
  background: linear-gradient(135deg, #1e5fb4, #2f8bf0);
  color: #fff;
  padding: 18px 16px 14px;
  text-align: center;
}
header h1 { font-size: 20px; font-weight: 600; }
.data-info {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.9;
}

/* 搜索区 */
.search-box {
  display: flex;
  gap: 8px;
  padding: 14px 12px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}
.search-box input {
  flex: 1;
  height: 42px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 15px;
  outline: none;
}
.search-box input:focus { border-color: #2f8bf0; box-shadow: 0 0 0 2px rgba(47,139,240,.15); }
.search-box button {
  width: 76px;
  height: 42px;
  border: none;
  border-radius: 8px;
  background: #2f8bf0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.search-box button:active { background: #1e5fb4; }

/* 送达方列表 */
.result-list { padding: 8px 12px; }
.result-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  cursor: pointer;
  border-left: 4px solid #2f8bf0;
}
.result-card:active { background: #f3f7fd; }
.result-card .name { font-size: 15px; font-weight: 600; }
.result-card .meta {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}
.match-tags { margin-top: 6px; }
.match-tag {
  display: inline-block;
  font-size: 11px;
  color: #1e5fb4;
  background: #e8f1fd;
  border: 1px solid #c5dbf7;
  border-radius: 10px;
  padding: 1px 8px;
  margin-right: 4px;
  margin-bottom: 4px;
}
.result-card .fuse-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}
.fuse-y { background: #fee2e2; color: #dc2626; font-weight: 600; }
.fuse-n { background: #dcfce7; color: #16a34a; }
.fuse-none { background: #f3f4f6; color: #9ca3af; }

.empty-tip {
  text-align: center;
  color: #999;
  padding: 40px 0;
  font-size: 14px;
}

/* 明细 */
.detail-panel { padding: 8px 12px; }
.detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.back-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.detail-head .title { font-size: 15px; font-weight: 600; flex: 1; }
.detail-head .sub { font-size: 11px; color: #888; margin-top: 2px; }

.table-wrap {
  background: #fff;
  border-radius: 10px;
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
th {
  background: #f8fafc;
  padding: 10px 8px;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
}
td {
  padding: 10px 8px;
  text-align: right;
  border-bottom: 1px solid #f1f5f9;
}
td:first-child, th:first-child { text-align: center; font-weight: 600; color: #1e5fb4; }
tr.fuse-row { background: #fef2f2; }
tr.fuse-row td:first-child { color: #dc2626; }
.fuse-badge {
  display: inline-block;
  min-width: 26px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.fuse-badge.y { background: #dc2626; color: #fff; }
.fuse-badge.n { background: #e8f5e9; color: #2e7d32; }
.fuse-badge.dash { color: #c0c4cc; }
td.num-dash { color: #c0c4cc; }
.highlight { color: #dc2626; font-weight: 700; }

.legend {
  margin-top: 8px;
  font-size: 12px;
  color: #888;
  text-align: center;
}

/* 货龄清单 */
.age-summary { margin-bottom: 8px; }
.age-stats {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  flex-wrap: wrap;
}
.age-stats b { font-size: 15px; color: #1e5fb4; }
.old-age {
  color: #dc2626;
  font-weight: 700;
  background: #fee2e2;
  padding: 1px 6px;
  border-radius: 4px;
}
tr.prod-sum td {
  background: #f0f7ff;
  font-weight: 600;
  color: #1e5fb4;
  border-top: 2px solid #dbeafe;
}
tr.prod-sum td.highlight { color: #dc2626; }
.closing-link {
  color: #1e5fb4;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed #2f8bf0;
}
.closing-link:active { color: #dc2626; }

/* 目标月(202608 预估) */
tr.target-row td { background: #fffbf0; }
tr.target-row td:first-child { font-weight: 700; color: #b45309; }
.tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  vertical-align: 1px;
  white-space: nowrap;
}
.tag-blue   { color: #1e5fb4; background: #eaf3fe; }
.tag-orange { color: #b45309; background: #fef3c7; }
.tag-green  { color: #15803d; background: #dcfce7; }

/* 当月已下单(订单报表) */
.order-info {
  margin: 10px 12px 0;
  padding: 10px 14px;
  background: #eef6ff;
  border: 1px solid #cfe4fb;
  border-radius: 8px;
  font-size: 14px;
  color: #1e3a5f;
}
.order-info b { color: #1e5fb4; }
.order-info .order-qty { font-size: 17px; }

/* 导入 */
.import-box { padding: 16px 12px; text-align: center; }
.import-btn {
  width: 100%;
  height: 46px;
  border: 2px dashed #2f8bf0;
  background: #eaf3fe;
  color: #1e5fb4;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.import-btn:active { background: #d8e9fd; }
.import-hint { margin-top: 8px; font-size: 12px; color: #999; }

footer {
  text-align: center;
  font-size: 11px;
  color: #bbb;
  padding: 10px;
}

.hidden { display: none; }

/* 导入进度遮罩 */
#importMask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99;
}
#importMask.show { display: flex; }
.mask-box {
  background: #fff;
  border-radius: 12px;
  padding: 24px 32px;
  text-align: center;
  max-width: 85%;
}
.mask-box .spin {
  width: 32px; height: 32px;
  border: 4px solid #e5e7eb;
  border-top-color: #2f8bf0;
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: rot 0.8s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }
.mask-box p { font-size: 14px; color: #555; }
