/* rider-self-app 骑手自助取货 H5（微信内置浏览器风格） */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%;
  background: #f5f6f7;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

/* ============ 顶部仓库信息栏 ============ */
.wh-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
  color: #fff;
  padding: 14px 16px calc(14px + env(safe-area-inset-top));
  padding-top: calc(14px + env(safe-area-inset-top));
  box-shadow: 0 2px 8px rgba(7, 193, 96, 0.25);
}
.wh-row { display: flex; align-items: center; }
.wh-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600;
  flex-shrink: 0;
}
.wh-info { flex: 1; min-width: 0; margin-left: 10px; }
.wh-name { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-addr { font-size: 12px; opacity: 0.85; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-tel {
  flex-shrink: 0;
  margin-left: 10px;
  padding: 6px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* ============ 主视图 ============ */
.view-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 14px calc(90px + env(safe-area-inset-bottom));
  min-height: calc(100vh - 70px);
}

/* ============ 首页顶部联系商家（浅绿胶囊，与整体主题统一） ============ */
.top-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px 16px 14px;
  padding: 9px 16px;
  border-radius: 22px;
  background: #f0faf4;
  color: #666;
  font-size: 13px;
}
.top-contact .contact-icon { font-size: 15px; color: #07c160; line-height: 1; }
.top-contact .contact-phone {
  color: #07c160;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  letter-spacing: 0.5px;
}

/* ============ 首页 ============ */
.home-hero {
  background: #fff;
  border-radius: 14px;
  padding: 16px 20px 24px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* ============ 尾号输入（麦芽田扫码页风格：Tab + 数字格子 + 自定义键盘） ============ */
.key-tabs {
  display: flex;
  justify-content: center;
  margin: 16px auto 20px;
  background: #f0f1f3;
  border-radius: 24px;
  padding: 4px;
  max-width: 100%;
}
.key-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 9px 8px;
  border-radius: 20px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  word-break: break-all;
  line-height: 1.3;
}
.key-tab .tab-icon { font-size: 16px; line-height: 1; }
.key-tab.active {
  background: #07c160;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(7, 193, 96, 0.4);
}

.digit-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}
.digit-cell {
  width: 52px;
  height: 60px;
  border: 1.5px solid #e3e5e7;
  border-radius: 10px;
  background: #fff;
  font-size: 28px;
  font-weight: 600;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.digit-cell.filled { border-color: #07c160; color: #07c160; }
.digit-cell.active {
  border-color: #07c160;
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.12);
}
.digit-caret {
  width: 2px;
  height: 26px;
  background: #07c160;
  animation: caret-blink 1s infinite;
}
@keyframes caret-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.num-keypad {
  max-width: 320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px 8px 4px;
}
.num-key {
  height: 54px;
  border: none;
  border-radius: 12px;
  background: #fff;
  color: #1a1a1a;
  font-size: 24px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.1s;
  user-select: none;
}
.num-key:active { background: #f2f3f5; transform: scale(0.96); }
.num-key.key-del { font-size: 18px; color: #8a8a8a; background: #f7f8f9; }
.num-key.key-confirm {
  background: #07c160;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  grid-row: span 2;
  height: auto;
  min-height: 118px;
  box-shadow: 0 2px 6px rgba(7, 193, 96, 0.3);
}
.num-key.key-confirm:active { background: #06ad56; opacity: 0.9; }
.num-key.key-confirm:disabled { background: #c8e6d3; box-shadow: none; }

.btn-primary {
  width: 100%;
  margin-top: 16px;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: #07c160;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:active { opacity: 0.8; }

.home-divider {
  height: 1px;
  background: #e9eaec;
  margin: 18px 0;
}
.home-section { text-align: center; }
.btn-ghost {
  width: 100%;
  height: 48px;
  border: 1.5px solid #07c160;
  border-radius: 12px;
  background: #fff;
  color: #07c160;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost:active { background: #f0faf4; }

/* ============ 页面头 / 列表 ============ */
.page-head {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.back-link { color: #07c160; font-size: 15px; text-decoration: none; margin-right: 8px; }
.page-head h2 { font-size: 17px; flex: 1; }
.page-count { color: #9a9a9a; font-size: 12px; }

.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.1s;
}
.order-card:active { transform: scale(0.985); }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e8f8ef;
  color: #07c160;
  font-size: 12px;
  font-weight: 600;
}
.card-time { color: #9a9a9a; font-size: 12px; }
.card-main { margin: 10px 0 8px; }
.card-no {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  word-break: break-all;
  line-height: 1.3;
}
.card-no b { color: #07c160; }
.card-cust { color: #555; font-size: 13px; margin-top: 4px; }
.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: #9a9a9a;
  font-size: 12px;
  padding-top: 8px;
  border-top: 1px dashed #eee;
}
.card-bottom > span:first-child {
  flex: 1;
  min-width: 0;
}
.card-rider {
  color: #07c160;
  flex-shrink: 0;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============ 订单详情 ============ */
.order-detail { display: flex; flex-direction: column; gap: 10px; }
.detail-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.detail-title {
  font-size: 14px;
  font-weight: 600;
  color: #07c160;
  padding-left: 8px;
  border-left: 3px solid #07c160;
  margin-bottom: 10px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 13px;
}
.detail-row span { color: #9a9a9a; flex-shrink: 0; }
.detail-row b { font-weight: 500; text-align: right; word-break: break-all; }
.text-ok { color: #07c160; }
/* 平台 # 流水号 行：强调，便于骑手核对 */
.order-no-row b {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
}

/* 商品货位（第一屏核心）：货位号 + 数量，大字号便于骑手快速核对 */
.goods-first { border: 1.5px solid #07c160; }
.goods-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #f4f5f6;
}
.goods-row:last-child { border-bottom: none; }
.goods-loc {
  flex: 1;
  min-width: 0;
  font-size: 30px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 1px;
  word-break: break-all;
  line-height: 1.2;
}
.goods-qty {
  font-size: 26px;
  font-weight: 700;
  color: #07c160;
  flex-shrink: 0;
}
.goods-empty { color: #9a9a9a; text-align: center; padding: 16px 0; font-size: 14px; }

.rel-order {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #f4f5f6;
  cursor: pointer;
  font-size: 13px;
}
.rel-order:last-child { border-bottom: none; }
.rel-order > div:first-child {
  flex: 1;
  min-width: 0;
  word-break: break-all;
  line-height: 1.4;
}
.rel-arrow { color: #c0c4c8; font-size: 18px; flex-shrink: 0; }

/* ============ 底部操作栏 ============ */
.op-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.06);
}
.btn-lg { flex: 1; margin-top: 0; height: 48px; }
.btn-confirm {
  flex: 1;
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 12px;
  background: #ff9500;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn-confirm:active { opacity: 0.85; }

/* ============ 开门结果页 ============ */
.opened-hero {
  background: #fff;
  border-radius: 14px;
  padding: 48px 20px 32px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.opened-check {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: #07c160;
  color: #fff;
  font-size: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pop-in 0.4s ease;
}
@keyframes pop-in {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.opened-hero h2 { font-size: 22px; margin-bottom: 6px; }
.opened-hero p { color: #8a8a8a; font-size: 14px; }
.opened-sub { font-size: 12px !important; margin-bottom: 22px; }
.opened-hero .btn-primary, .opened-hero .btn-plain { margin-top: 10px; }

/* ============ 弹层 ============ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.5);
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 51;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
}
.modal-box {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border-radius: 14px;
  padding: 22px 18px;
  pointer-events: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  animation: slide-up 0.25s ease;
}
@keyframes slide-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-box h3 { font-size: 17px; text-align: center; margin-bottom: 8px; }
.modal-tip { color: #8a8a8a; font-size: 13px; text-align: center; margin: 4px 0 10px; }
.modal-input {
  width: 100%;
  height: 46px;
  border: 1.5px solid #e3e5e7;
  border-radius: 10px;
  text-align: center;
  font-size: 20px;
  outline: none;
  margin: 6px 0 12px;
}
.modal-input:focus { border-color: #07c160; }
.btn-block { margin-top: 8px; }
.btn-plain {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 12px;
  background: #f2f3f5;
  color: #555;
  font-size: 15px;
  cursor: pointer;
}
.modal-list { max-height: 46vh; overflow-y: auto; }
.modal-order-item {
  padding: 10px 12px;
  border: 1px solid #eef0f2;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
}
.modal-order-item:active { background: #f6f9f7; }
.modal-order-top { margin-bottom: 4px; }
.modal-order-no {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  word-break: break-all;
  line-height: 1.3;
}
.modal-order-sub { color: #8a8a8a; font-size: 12px; margin-top: 4px; }

/* ============ 空态 / 提示 ============ */
.empty-state {
  background: #fff;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  color: #8a8a8a;
}
.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #f2f3f5;
  color: #b0b4b8;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast {
  position: fixed;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99;
  max-width: 76%;
  padding: 12px 18px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 14px;
  text-align: center;
  pointer-events: none;
}

.loading-mask {
  position: fixed;
  inset: 0;
  z-index: 98;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
}
.loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #e3e5e7;
  border-top-color: #07c160;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: #8a8a8a; font-size: 13px; margin-top: 10px; }
