/* 企微审批 H5 v1.0 —— 样式（2026-09-16） */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #F4F5F7; color: #202124; font-size: 14px;
}
.wrapper { display: flex; justify-content: center; padding: 0; }
.phone {
  width: 390px; height: 812px; background: #EDEDED;
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  border-radius: 0; flex-shrink: 0;
}
.hidden { display: none !important; }

/* ===== 视图一：企微群会话 ===== */
.wx-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.grp-hd { background: #fff; padding: 10px 16px 12px; border-bottom: 1px solid #EFEFEF; flex-shrink: 0; }
.grp-t { font-size: 15px; font-weight: 700; color: #202124; display: flex; align-items: center; gap: 6px; }
.grp-n { background: #FA5151; color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.grp-s { font-size: 11.5px; color: #9CA3AF; margin-top: 3px; }
.demo-tip {
  margin: 10px 12px 0; padding: 9px 11px; background: #FFF7E8; border: 1px solid #FFE3B0;
  border-radius: 10px; font-size: 11.5px; line-height: 1.7; color: #9A6B1A; flex-shrink: 0;
}
.demo-tip code { background: rgba(0,0,0,.05); padding: 0 4px; border-radius: 4px; font-size: 11px; }
.wx-flow { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px 24px; display: flex; flex-direction: column; gap: 14px; }
.wx-flow::-webkit-scrollbar { width: 3px; }
.wx-flow::-webkit-scrollbar-thumb { background: #D8D8D8; border-radius: 2px; }

.wx-msg { display: flex; gap: 9px; align-items: flex-start; }
.wx-av {
  width: 34px; height: 34px; border-radius: 6px; background: #3E8EF7; color: #fff;
  font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wx-main { flex: 1; min-width: 0; }
.wx-nm { font-size: 11.5px; color: #9CA3AF; margin-bottom: 4px; }
.wx-nm b { color: #3E8EF7; font-weight: 600; }
.wx-bubble { background: #fff; border-radius: 6px; border-top-left-radius: 2px; padding: 11px 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.wx-t { font-size: 13.5px; font-weight: 700; color: #202124; margin-bottom: 7px; }
.wx-row { font-size: 12.5px; color: #4B5563; line-height: 1.9; display: flex; gap: 6px; }
.wx-row .k { color: #9CA3AF; flex-shrink: 0; }
.wx-row .v { color: #202124; font-weight: 600; word-break: break-all; }
.wx-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; color: #3E8EF7; font-size: 13px; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(62,142,247,.35); }
.wx-link:active { opacity: .6; }
.wx-link.off { color: #B0B7C3; border-bottom-color: transparent; pointer-events: none; }
.wx-st { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
.wx-st.ok { background: #E8F6EE; color: #17903E; }
.wx-st.no { background: #FDECEC; color: #D93B3B; }
.wx-st.wa { background: #FFF3E0; color: #C77700; }
.wx-gray { filter: grayscale(1); opacity: .62; }
.wx-time { font-size: 10.5px; color: #B0B7C3; margin-top: 6px; }
.wx-empty { text-align: center; color: #B0B7C3; font-size: 13px; padding: 40px 16px; line-height: 2; }

/* ===== 视图二：审批卡片 ===== */
.card-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 14px 20px; }
.card-scroll::-webkit-scrollbar { width: 3px; }
.card-scroll::-webkit-scrollbar-thumb { background: #D8D8D8; border-radius: 2px; }
.ap-card { background: #fff; border-radius: 12px; padding: 16px 15px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.ap-hd { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid #F2F2F2; }
.ap-id { font-size: 14.5px; font-weight: 700; color: #202124; }
.ap-tag { font-size: 11px; font-weight: 700; border-radius: 4px; padding: 2px 7px; }
.ap-tag.wa { background: #FFF3E0; color: #C77700; }
.ap-tag.ok { background: #E8F6EE; color: #17903E; }
.ap-tag.no { background: #FDECEC; color: #D93B3B; }
.ap-row { display: flex; gap: 10px; font-size: 13px; line-height: 1.9; padding: 5px 0; border-bottom: 1px dashed #F5F5F5; }
.ap-row:last-child { border-bottom: none; }
.ap-row .k { color: #9CA3AF; width: 76px; flex-shrink: 0; }
.ap-row .v { color: #202124; font-weight: 500; flex: 1; word-break: break-word; }
.ap-row .v.big { color: #D96E89; font-weight: 700; font-size: 15px; }
.ap-row .v.mute { color: #B0B7C3; font-weight: 400; }
.ap-sec { font-size: 12px; font-weight: 700; color: #9CA3AF; margin: 14px 0 2px; }
.ap-quote { background: #FAFAFA; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: #4B5563; line-height: 1.8; }
.ap-note { margin-top: 12px; font-size: 11.5px; line-height: 1.7; color: #9CA3AF; }
.ap-empty { text-align: center; padding: 80px 20px; color: #B0B7C3; }
.ap-empty .e-ico { font-size: 34px; margin-bottom: 12px; }
.ap-empty .e-t { font-size: 14px; font-weight: 600; color: #7B8190; margin-bottom: 6px; }
.ap-empty .e-s { font-size: 12px; line-height: 1.8; }

.card-foot { flex-shrink: 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #EFEFEF; display: flex; gap: 10px; }
.card-foot button { flex: 1; height: 44px; border-radius: 10px; border: none; font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer; }
.btn-pass { background: #D96E89; color: #fff; }
.btn-pass:active { background: #C75F79; }
.btn-reject { background: #F2F3F5; color: #5F6368; }
.btn-reject:active { background: #E8E9EB; }
.card-foot .foot-done { flex: 1; text-align: center; font-size: 13px; color: #7B8190; line-height: 44px; }

/* ===== 底部浮层 ===== */
.sheet-mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: flex-end; z-index: 40; }
.sheet-mask.show { display: flex; }
.sheet { width: 100%; background: #fff; border-radius: 18px 18px 0 0; padding: 8px 18px calc(16px + env(safe-area-inset-bottom)); animation: sheetUp .2s ease-out; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .6 } to { transform: none; opacity: 1 } }
.sheet-bar { width: 36px; height: 4px; border-radius: 2px; background: #E3E5E8; margin: 2px auto 12px; }
.sheet-t { font-size: 16px; font-weight: 700; text-align: center; color: #202124; }
.sheet-d { font-size: 13px; color: #6B7280; line-height: 1.8; text-align: center; margin: 10px 0 4px; }
.sheet-d b { color: #202124; }
.sheet-field { margin-top: 12px; }
.sheet-field textarea { width: 100%; height: 72px; border: 1px solid #E8EAED; border-radius: 10px; padding: 9px 11px; font-size: 13px; font-family: inherit; line-height: 1.7; resize: none; outline: none; color: #202124; }
.sheet-field textarea:focus { border-color: #D96E89; }
.sf-cnt { text-align: right; font-size: 11px; color: #B0B7C3; margin-top: 3px; }
.sheet-btns { display: flex; gap: 10px; margin-top: 16px; }
.sheet-btns button { flex: 1; height: 44px; border-radius: 10px; border: none; font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer; }
.sbtn-ghost { background: #F2F3F5; color: #5F6368; }
.sbtn-main { background: #D96E89; color: #fff; }
.sbtn-main.reject { background: #D93B3B; }

/* ===== toast ===== */
.toast {
  position: absolute; left: 50%; bottom: 96px; transform: translate(-50%, 12px);
  background: rgba(32,33,36,.9); color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: all .22s; z-index: 60; max-width: 78%; text-align: center; line-height: 1.6;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== v1.1 批量：消息内多行明细 + 卡片明细表 ===== */
.wx-sub{font-size:11.5px;color:#9CA3AF;margin:8px 0 4px}
.ap-list{margin-top:4px;border:1px solid #F2F2F2;border-radius:8px;overflow:hidden}
.ap-li{display:flex;align-items:center;gap:8px;font-size:12.5px;padding:7px 10px;border-bottom:1px solid #F7F7F7}
.ap-li:last-child{border-bottom:none}
.ap-li .i{width:16px;color:#B0B7C3;flex-shrink:0}
.ap-li .p{width:96px;color:#202124;font-weight:600;flex-shrink:0}
.ap-li .o{flex:1;min-width:0;color:#7B8190;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ap-li .q{width:46px;text-align:right;color:#D96E89;font-weight:700;flex-shrink:0}
.ap-li .s{width:46px;text-align:right;color:#7B8190;flex-shrink:0}

/* v1.1 修订：批量明细行 —— 订单号换行完整显示 */
.ap-li{flex-wrap:wrap}
.ap-li .p{font-size:13px}
.ap-li .q{width:auto;min-width:56px;font-size:13px}
.ap-li .s{width:auto;font-size:11.5px}
.ap-li .o{width:100%;flex:1 0 100%;font-size:11.5px;color:#9CA3AF;padding-left:24px;white-space:normal;word-break:break-all}

/* v1.1 修订：批量卡片 —— 只让「明细」区滚动，整卡/整页不滚 */
.card-scroll.batch-mode{overflow:hidden;display:flex;flex-direction:column}
.card-scroll.batch-mode .ap-card{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column}
.card-scroll.batch-mode .ap-list{flex:1 1 auto;min-height:64px;overflow-y:auto;overscroll-behavior:contain}
.card-scroll.batch-mode .ap-list::-webkit-scrollbar{width:3px}
.card-scroll.batch-mode .ap-list::-webkit-scrollbar-thumb{background:#D8D8D8;border-radius:2px}
.card-scroll.batch-mode .ap-hd,.card-scroll.batch-mode .ap-row,.card-scroll.batch-mode .ap-sec,.card-scroll.batch-mode .ap-quote,.card-scroll.batch-mode .ap-note{flex-shrink:0}

/* v1.1 修订：卡片上的「审批人」输入 */
.ap-inp::placeholder{color:#B0B7C3}

/* v1.1 修订：审批人必填的行内错误 */
.ap-err.hidden{display:none}
