/* 支付宝商机推荐系统 - 移动端优先响应式样式（兼容 PC 与微信内嵌浏览器） */
:root {
  --blue: #1677ff;
  --blue-dark: #0958d9;
  --green: #16a34a;
  --orange: #fa8c16;
  --red: #dc2626;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #86909c;
  --line: #e5e8ef;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
}
#app { max-width: 720px; margin: 0 auto; min-height: 100%; padding-bottom: 32px; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: linear-gradient(135deg, #1677ff, #3b8cff);
  color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar .brand { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.topbar .brand small { display: block; font-size: 11px; font-weight: 400; opacity: .85; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.user-chip .avatar {
  width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
}
.btn-link { background: none; border: 1px solid rgba(255,255,255,.6); color: #fff; border-radius: 999px; padding: 3px 12px; font-size: 12px; cursor: pointer; }

/* ---------- 通用组件 ---------- */
.container { padding: 14px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(31,35,41,.06); }
.card h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h3::before { content: ""; width: 4px; height: 16px; background: var(--blue); border-radius: 2px; display: inline-block; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }

label.field { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
label.field > span { display: block; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 15px; background: #fafbfc; color: var(--text); outline: none; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); background: #fff; }
textarea { resize: vertical; min-height: 64px; }

.btn {
  display: inline-block; border: none; border-radius: 8px; padding: 10px 18px;
  font-size: 14px; cursor: pointer; background: var(--blue); color: #fff; font-weight: 500;
}
.btn:active { opacity: .85; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn.danger { background: var(--red); }
.btn.success { background: var(--green); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* 状态徽章 */
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.chip.pending { background: #e8f3ff; color: var(--blue); }
.chip.assigned { background: #fff7e6; color: var(--orange); }
.chip.installed { background: #e6f4ff; color: #0e6fd8; }
.chip.paid { background: #e7f7ec; color: var(--green); }
.chip.unable { background: #fee2e2; color: var(--red); }
.chip.urgent { background: var(--red); color: #fff; }
.chip.active { background: #e7f7ec; color: var(--green); }
.chip.disabled { background: #f2f3f5; color: var(--muted); }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 12px 6px; text-align: center; box-shadow: 0 1px 4px rgba(31,35,41,.06); }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.s-pending b { color: var(--blue); }
.stat.s-assigned b { color: var(--orange); }
.stat.s-installed b { color: #0e6fd8; }
.stat.s-paid b { color: var(--green); }
.stat.s-unable b { color: var(--red); }

/* 筛选 tabs */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; -webkit-overflow-scrolling: touch; }
.tab {
  flex-shrink: 0; padding: 6px 14px; border-radius: 999px; font-size: 13px;
  background: var(--card); color: var(--muted); border: 1px solid var(--line); cursor: pointer;
}
.tab.on { background: var(--blue); color: #fff; border-color: var(--blue); }

/* 商机卡片 */
.opp { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(31,35,41,.06); }
.opp .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.opp .head .name { font-weight: 600; font-size: 16px; }
.opp .meta { font-size: 13px; color: var(--muted); margin-top: 3px; word-break: break-all; }
.opp .meta b { color: var(--text); font-weight: 500; }
.opp .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.opp .actions select { flex: 1; min-width: 120px; width: auto; }
.opp .timeline { font-size: 12px; color: var(--muted); margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; display: grid; gap: 2px; }
.amount { color: var(--green); font-weight: 600; }

/* 空状态 */
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.empty .icon { font-size: 40px; margin-bottom: 8px; }

/* 登录页 */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.auth-hero { background: linear-gradient(135deg, #1677ff, #3b8cff); color: #fff; padding: 48px 24px 64px; text-align: center; }
.auth-hero h1 { font-size: 22px; margin-bottom: 8px; }
.auth-hero p { font-size: 13px; opacity: .9; }
.auth-body { margin: -32px 16px 0; }
.auth-tabs { display: flex; background: var(--card); border-radius: 10px 10px 0 0; overflow: hidden; }
.auth-tabs button { flex: 1; border: none; background: none; padding: 13px; font-size: 15px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.auth-tabs button.on { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.auth-card { border-radius: 0 0 var(--radius) var(--radius); }
.hint { background: #fffbe6; border: 1px solid #ffe58f; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #8c6d1f; margin-bottom: 12px; line-height: 1.7; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 400px; padding: 20px; }
.modal h4 { margin-bottom: 14px; font-size: 16px; }
.modal .modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal .modal-actions .btn { flex: 1; }

/* Toast */
#toast-wrap { position: fixed; top: 70px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; pointer-events: none; }
.toast { background: rgba(31,35,41,.9); color: #fff; padding: 9px 18px; border-radius: 999px; font-size: 13px; animation: fadeIn .2s; }
.toast.err { background: rgba(220,38,38,.95); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (min-width: 640px) {
  #app { max-width: 860px; }
}

/* 站内通知横幅 */
.notif-banner { border-left: 4px solid #1677ff; margin-bottom: 12px; }
.notif-banner b { display: block; margin-bottom: 6px; }
.notif-banner .btn { margin-top: 8px; }
