* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #f3f5fa;
  color: #24324a;
  min-height: 100vh;
}

.layout {
  display: flex;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  align-items: flex-start;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* ---------- 卡片 ---------- */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(36, 50, 74, .06);
  padding: 22px 24px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; }
.card h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; display: inline-block; }
.dot.orange { background: #f59e0b; }

.quota {
  font-size: 12px; color: #b45309; background: #fef3c7;
  border: 1px solid #fde68a; border-radius: 999px; padding: 3px 10px;
}

/* ---------- 查询框 ---------- */
.field-label { font-size: 13px; color: #8494ad; margin: 18px 0 8px; }
.query-box { display: flex; gap: 10px; }
#phone {
  flex: 1; height: 46px;
  border: 1.5px solid #dbe3f0; border-radius: 9px;
  padding: 0 14px; font-size: 15px; outline: none;
  transition: border-color .2s;
}
#phone:focus { border-color: #4f6ef7; }
#btn {
  height: 46px; padding: 0 22px; border: none; border-radius: 9px;
  background: linear-gradient(135deg, #4f6ef7, #3457f5);
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: opacity .2s, transform .1s;
}
#btn:hover { opacity: .92; }
#btn:active { transform: scale(.98); }
#btn:disabled { opacity: .55; cursor: not-allowed; }
.ghost {
  width: 46px; height: 46px; border: 1.5px solid #dbe3f0; border-radius: 9px;
  background: #fff; color: #6b7c99; font-size: 17px; cursor: pointer;
}
.ghost:hover { border-color: #4f6ef7; color: #4f6ef7; }

.msg { color: #e11d48; font-size: 13px; margin-top: 12px; min-height: 18px; line-height: 1.6; }
.msg.info { color: #3457f5; }
/* 今日剩余次数 / 次数用完提示 */
.quota-hint { color: #8494ad; font-size: 12px; margin-top: 6px; min-height: 16px; line-height: 1.6; }
#btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 平台 ---------- */
.plat-title { font-size: 13px; color: #8494ad; margin: 20px 0 10px; }
.plat-row { display: flex; flex-wrap: wrap; gap: 10px; }
.plat {
  font-size: 13px; color: #475981; background: #f4f7fd;
  border: 1px solid #e3eaf6; border-radius: 8px; padding: 7px 16px;
}
.plat-note { margin-top: 14px; font-size: 12px; color: #a5b1c6; line-height: 1.7; }

/* ---------- 查询记录 ---------- */
.record-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.record-tools { display: flex; gap: 8px; }
#search, #filter {
  height: 34px; border: 1.5px solid #dbe3f0; border-radius: 8px;
  padding: 0 12px; font-size: 13px; outline: none; color: #475981; background: #fff;
}
#search:focus, #filter:focus { border-color: #4f6ef7; }
.record-count { font-size: 12px; color: #a5b1c6; margin: 10px 2px 6px; }

.record-list { display: flex; flex-direction: column; }
.record-item {
  display: grid;
  grid-template-columns: 28px 1.3fr 1.1fr 0.9fr 1.6fr;
  gap: 8px; align-items: center;
  padding: 12px 8px; border-bottom: 1px solid #eef2f9;
  border-radius: 8px; cursor: pointer; font-size: 14px;
  transition: background .15s;
}
.record-item:hover { background: #f6f8fe; }
.record-item.active { background: #eef2ff; }
.record-item .idx { color: #a5b1c6; font-size: 12px; }
.record-item .ph { font-weight: 600; letter-spacing: .5px; }
.record-item .time { color: #8494ad; font-size: 12px; line-height: 1.5; }
.badge {
  display: inline-block; font-size: 12px; border-radius: 6px; padding: 3px 10px;
  white-space: nowrap; /* 防止手机上"已完成"被挤成竖排 */
}
.badge.done { background: #e8f1ff; color: #3457f5; }
.badge.pending { background: #fef3c7; color: #b45309; }
.badge.failed { background: #fee2e2; color: #b91c1c; }
.record-item .summary { font-size: 13px; }
.summary.ok { color: #16a34a; }
.summary.bad { color: #e11d48; }
.summary.none { color: #a5b1c6; }
.empty { text-align: center; color: #a5b1c6; font-size: 13px; padding: 30px 0; }

/* ---------- 右侧报告 ---------- */
.report {
  width: 330px; flex-shrink: 0; position: sticky; top: 24px;
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(36, 50, 74, .06);
}
.report-head {
  background: linear-gradient(135deg, #6a5cff, #4f6ef7);
  color: #fff; padding: 18px 20px 20px;
}
.report-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.report-meta div { display: flex; gap: 10px; font-size: 12px; margin-top: 6px; }
.report-meta .k { opacity: .75; min-width: 52px; }
.report-meta .v { font-weight: 600; word-break: break-all; }

.report-body { padding: 16px 16px 20px; }
.stat-row { display: flex; gap: 10px; margin-bottom: 14px; }
.stat {
  flex: 1; text-align: center; font-size: 12px; border-radius: 8px; padding: 7px 0;
}
.stat b { font-size: 15px; }
.stat.ok { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.stat.bad { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.stat.wait { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

.report-table { font-size: 13px; }
.rt-head {
  display: grid; grid-template-columns: 1.1fr 0.9fr 1.2fr;
  color: #a5b1c6; font-size: 12px; padding: 4px 4px 8px;
}
.rt-row {
  display: grid; grid-template-columns: 1.1fr 0.9fr 1.2fr;
  align-items: center; padding: 9px 4px; border-top: 1px solid #f1f4fa;
}
.rt-row .pname { color: #475981; word-break: break-all; }
.rt-badge { font-size: 11px; border-radius: 5px; padding: 3px 8px; display: inline-block; }
.rt-badge.ok { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.rt-badge.bad { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.rt-badge.wait { background: #f1f5f9; color: #94a3b8; border: 1px solid #e2e8f0; }
.rt-detail { font-size: 12px; color: #64748b; line-height: 1.5; word-break: break-all; }
.rt-detail.warn { color: #dc2626; }

.rep-empty { color: #a5b1c6; font-size: 13px; text-align: center; padding: 26px 10px; line-height: 1.8; }
.rep-empty.hidden, .hidden { display: none; }

/* ---------- 一键清除 CTA ---------- */
.clear-cta {
  width: 100%;
  margin: 4px 0 14px;
  padding: 13px 0;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(220, 38, 38, .3);
  animation: pulse 1.6s infinite;
  transition: transform .1s;
}
.clear-cta:active { transform: scale(.98); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(220,38,38,.3); }
  50% { box-shadow: 0 4px 22px rgba(220,38,38,.55); }
}

/* ---------- 企微导流弹窗 ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .6);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; padding: 20px;
}
.modal.hidden { display: none; }
.modal-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: pop .25s ease;
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-close {
  position: absolute; top: 10px; right: 12px;
  border: none; background: none; font-size: 16px; color: #94a3b8; cursor: pointer;
}
.modal-icon { font-size: 40px; }
.modal-box h3 { font-size: 19px; margin: 8px 0; color: #1f2d3d; }
.modal-text { font-size: 13px; color: #64748b; line-height: 1.7; margin-bottom: 14px; }
.modal-note {
  font-size: 12px;
  color: #b45309;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 6px 8px;
  margin: -4px 0 12px;
  line-height: 1.6;
}
.modal-qr {
  width: 200px; height: 200px;
  border: 1px solid #e2e8f0; border-radius: 10px;
  background: #f8fafc;
}
.modal-btn {
  display: block;
  margin-top: 14px;
  padding: 12px 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff; font-size: 15px; font-weight: 600; text-decoration: none;
}
.modal-btn:active { transform: scale(.98); }

/* ---------- 滑块验证 ---------- */
.cap-box { max-width: 360px; text-align: left; }
.cap-box h3 { text-align: center; }
.cap-box .modal-text { text-align: center; margin-bottom: 16px; }
.cap-track { user-select: none; -webkit-user-select: none; }
.cap-bar {
  position: relative;
  height: 44px;
  border-radius: 10px;
  background:
    repeating-linear-gradient(45deg, #f1f5f9 0 8px, #e8eef5 8px 16px);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}
.cap-notch {
  position: absolute;
  top: 4px; bottom: 4px;
  width: 44px;
  border-radius: 8px;
  background: #cbd5e1;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.7);
}
.cap-notch::after {
  content: '';
  position: absolute; left: 50%; top: 50%;
  width: 10px; height: 10px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: #94a3b8;
  border-radius: 2px;
}
.cap-fill {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 0;
  background: rgba(16, 185, 129, .18);
}
.cap-thumb {
  position: absolute; top: 0; left: 0;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(5, 150, 105, .35);
  touch-action: none;
}
.cap-thumb.dragging { cursor: grabbing; box-shadow: 0 6px 16px rgba(5, 150, 105, .45); }
.cap-hint {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  min-height: 18px;
}
.cap-hint.err { color: #dc2626; }
.cap-hint.ok { color: #059669; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .layout { flex-direction: column; }
  /* 手机上:号码检测 → 查询报告 → 查询记录(报告不再沉底) */
  .main { display: contents; }
  .card-detect { order: 1; }
  .report { order: 2; width: 100%; position: static; }
  .card-records { order: 3; }
}

/* ---------- 手机适配(重点) ---------- */
@media (max-width: 640px) {
  body { overflow-x: hidden; }
  .layout { padding: 14px 12px 32px; gap: 14px; }
  .main { gap: 14px; }
  .card { padding: 18px 14px; border-radius: 12px; }
  .card-head { flex-wrap: wrap; gap: 8px; }
  .card h2 { font-size: 16px; }
  .quota { white-space: normal; text-align: center; font-size: 12px; }

  /* 查询框:输入框独占一行,按钮独占一行 */
  .field-label { margin: 14px 0 8px; }
  .query-box { flex-wrap: wrap; gap: 8px; }
  #phone {
    flex: 1 1 100%;
    width: 100%;
    height: 50px;
    font-size: 18px;
    text-align: center;
    letter-spacing: .5px;
  }
  #btn {
    flex: 1 1 100%;
    height: 48px;
    justify-content: center;
    font-size: 17px;
  }
  .ghost { flex: 1; width: auto; height: 44px; }
  .msg { font-size: 13px; }

  /* 平台标签 */
  .plat { padding: 6px 12px; font-size: 12px; }
  .plat-row { gap: 8px; }

  /* 查询记录 */
  .record-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .record-tools { width: 100%; }
  #search { flex: 1; min-width: 0; width: auto; }
  #filter { flex: 0 0 44%; }
  .record-item {
    grid-template-columns: 22px 1fr auto;
    row-gap: 4px;
    padding: 11px 6px;
  }
  .record-item .time,
  .record-item .summary { grid-column: 1 / -1; }
  .record-item .ph { font-size: 15px; }

  /* 报告面板 */
  .report-head { padding: 16px; }
  .report-body { padding: 14px 12px 18px; }
  .rt-head, .rt-row { grid-template-columns: 1.2fr 0.8fr 1.4fr; }
  .rt-row { padding: 9px 2px; }
  .rt-detail { font-size: 11px; }
  .pname { font-size: 12px; }
  .clear-cta { font-size: 15px; padding: 13px 0; }

  /* 弹窗 */
  .modal { padding: 16px; }
  .modal-box { padding: 22px 16px 18px; }
  .modal-qr { width: 170px; height: 170px; }

  /* 员工看板页 */
  .wrap { padding: 0 2px; }
  .card { margin-bottom: 14px; }
  /* 看板列多,手机上横向滑动查看,避免挤成一团 */
  .card table { display: block; overflow-x: auto; white-space: nowrap; }
  table { font-size: 13px; }
  th, td { padding: 8px 4px; }
}
