/* 一见钟情 · 红娘工作台（移动端 H5） */
:root {
  --primary: #e64340;
  --primary-light: #ff7875;
  --primary-bg: #fff1f0;
  --text: #303133;
  --text-sub: #909399;
  --text-light: #c0c4cc;
  --border: #ebeef5;
  --bg: #f5f6f8;
  --card: #fff;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #f5222d;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[v-cloak] { display: none !important; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
input, textarea, select, button { font-family: inherit; font-size: 14px; color: inherit; outline: none; }
button { cursor: pointer; border: none; background: none; }

/* ==================== 登录 ==================== */
.login {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #e64340 0%, #ff7875 60%, #ffb199 100%);
}
.login-card {
  width: 100%; max-width: 380px;
  background: #fff; border-radius: 16px;
  padding: 30px 24px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}
.brand { text-align: center; margin-bottom: 26px; }
.brand-logo { font-size: 24px; font-weight: 700; color: var(--primary); letter-spacing: 2px; }
.brand-sub { font-size: 13px; color: var(--text-sub); margin-top: 6px; }
.login-tip { margin-top: 18px; font-size: 12px; color: var(--text-sub); line-height: 1.7; }

/* ==================== 通用表单 ==================== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fafbfc; appearance: none;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary); background: #fff;
}
.btn-main {
  width: 100%; padding: 12px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 1px;
}
.btn-main:disabled { opacity: .6; }
.btn-main.ghost { background: #fff; color: var(--danger); border: 1px solid var(--border); }
.btn-mini {
  padding: 6px 14px; border-radius: 16px; font-size: 12px;
  background: var(--primary-bg); color: var(--primary); font-weight: 500;
}
.btn-mini.ghost { background: #f5f6f8; color: var(--text-sub); }

/* ==================== 布局 ==================== */
.app { min-height: 100vh; padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
.nav {
  position: sticky; top: 0; z-index: 20;
  height: 48px; display: flex; align-items: center;
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 0 8px; padding-top: env(safe-area-inset-top);
}
.nav-left { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.nav-back { font-size: 26px; color: var(--text); line-height: 1; margin-top: -4px; }
.nav-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; }
.nav-right { width: 44px; position: relative; display: flex; justify-content: center; }
.dot {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--primary); color: #fff; font-size: 11px; line-height: 18px;
  text-align: center; font-weight: 600;
}
.body { padding: 10px 12px 20px; }

/* ==================== 卡片 ==================== */
.card {
  background: var(--card); border-radius: 12px;
  padding: 14px; margin-bottom: 10px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title-row .card-title { margin-bottom: 0; }
.more { font-size: 13px; color: var(--primary); }
.more.ok { color: var(--ok); }
.empty { text-align: center; color: var(--text-light); font-size: 13px; padding: 22px 0; }
.notice {
  margin-top: 10px; padding: 9px 11px; border-radius: 8px;
  background: var(--primary-bg); color: #b34a47; font-size: 12px; line-height: 1.6;
}

/* ==================== 头部横幅 ==================== */
.hero {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 12px; padding: 16px; margin-bottom: 10px; color: #fff;
}
.hero-sm { padding: 14px; }
.hero-row { display: flex; align-items: center; }
.hero-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600; margin-right: 12px; flex-shrink: 0;
}
.hero-info { flex: 1; min-width: 0; }
.hero-name { font-size: 17px; font-weight: 600; }
.hero-sub { font-size: 12px; opacity: .85; margin-top: 3px; }
/* 用户ID（16 位）：等宽数字，长按可选中复制 */
.hero-id { font-size: 12px; opacity: .8; margin-top: 3px; font-variant-numeric: tabular-nums; user-select: all; }
.hero-stats { display: flex; margin-top: 16px; }
.hero-stats .hs { flex: 1; text-align: center; }
.hero-stats .hs b { display: block; font-size: 19px; font-weight: 700; }
.hero-stats .hs span { font-size: 11px; opacity: .85; }

/* ==================== 九宫格 ==================== */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 0; }
.grid-item { position: relative; text-align: center; padding: 8px 0; }
.gi-ico {
  width: 42px; height: 42px; margin: 0 auto 6px; border-radius: 12px;
  background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
}
.gi-txt { font-size: 12px; color: var(--text); }
.gi-badge {
  position: absolute; top: 4px; right: 50%; transform: translateX(24px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 10px; line-height: 16px;
}

/* ==================== 待办 / 入口 ==================== */
.todo { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.todo:last-child { border-bottom: none; }
.todo-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-right: 9px; }
.todo-txt { flex: 1; font-size: 13px; }
.entry {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.entry:last-child { border-bottom: none; }
.arrow { color: var(--text-light); font-size: 18px; }

/* ==================== 键值行 ==================== */
.kv { display: flex; padding: 8px 0; border-bottom: 1px solid #f7f8fa; font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv .k { width: 92px; color: var(--text-sub); flex-shrink: 0; }
.kv .v { flex: 1; word-break: break-all; }

/* ==================== 客户列表 ==================== */
.searchbar { display: flex; gap: 8px; margin-bottom: 10px; }
.searchbar input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: #fff;
}
.searchbar button {
  padding: 0 18px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 500;
}
.chips { display: flex; gap: 8px; margin-bottom: 10px; overflow-x: auto; padding-bottom: 2px; }
.chip {
  flex-shrink: 0; padding: 6px 14px; border-radius: 16px;
  background: #fff; color: var(--text-sub); font-size: 13px; border: 1px solid var(--border);
}
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }

.cli { display: flex; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.cli:last-child { border-bottom: none; }
.cli-avatar {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 600;
  margin-right: 11px;
}
.cli-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cli-main { flex: 1; min-width: 0; }
.cli-row1 { display: flex; align-items: center; gap: 7px; }
.cli-name { font-size: 14px; font-weight: 600; }
.cli-row2 { font-size: 12px; color: var(--text-sub); margin-top: 3px; }
.cli-row3 { font-size: 11px; color: var(--text-light); margin-top: 3px; }

.tag { padding: 2px 7px; border-radius: 9px; font-size: 11px; background: #f0f1f3; color: var(--text-sub); }
.tag.ok { background: #e8f8f0; color: var(--ok); }
.tag.warn { background: #fff5e6; color: var(--warn); }
.tag.danger { background: var(--primary-bg); color: var(--primary); }

/* ==================== 跟进时间线 ==================== */
.follow-item { padding: 11px 0; border-bottom: 1px solid var(--border); }
.follow-item:last-child { border-bottom: none; }
.fi-top { display: flex; align-items: center; justify-content: space-between; }
.fi-name { font-size: 14px; font-weight: 600; }
.fi-type { font-size: 11px; color: var(--primary); background: var(--primary-bg); padding: 2px 8px; border-radius: 9px; }
.fi-content { font-size: 13px; color: #5a5e66; margin-top: 5px; }
.fi-time { font-size: 11px; color: var(--text-light); margin-top: 5px; }

.timeline { padding-left: 4px; }
.tl-item { position: relative; padding: 0 0 16px 18px; border-left: 1px solid var(--border); }
.tl-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -4px; top: 3px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--primary);
}
.tl-top { display: flex; align-items: center; gap: 8px; }
.tl-time { font-size: 11px; color: var(--text-light); }
.tl-content { font-size: 13px; color: #5a5e66; margin-top: 4px; }

/* ==================== 牵线 ==================== */
.match-item { padding: 11px 0; border-bottom: 1px solid var(--border); }
.match-item:last-child { border-bottom: none; }
.mi-top { display: flex; align-items: center; justify-content: space-between; }
.mi-name { font-size: 14px; font-weight: 600; }
.mi-score { font-size: 12px; color: var(--primary); margin-top: 4px; }
.mi-reason { font-size: 12px; color: var(--text-sub); margin-top: 3px; }
.mi-ops { display: flex; gap: 8px; margin-top: 8px; }

/* ==================== 活动 / 申请 ==================== */
.act-item, .ap-item { padding: 11px 0; border-bottom: 1px solid var(--border); }
.act-item:last-child, .ap-item:last-child { border-bottom: none; }
.ai-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-title { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; }
.ai-sub { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.ai-time { font-size: 11px; color: var(--text-light); margin-top: 3px; }
.ai-ops { display: flex; gap: 8px; margin-top: 8px; }

/* ==================== Tabs ==================== */
.tabs { display: flex; background: #fff; border-radius: 12px; padding: 4px; margin-bottom: 10px; }
.tab { flex: 1; text-align: center; padding: 8px 0; font-size: 13px; color: var(--text-sub); border-radius: 9px; }
.tab.on { background: var(--primary-bg); color: var(--primary); font-weight: 600; }

/* ==================== 通知 ==================== */
.nt-item { padding: 11px 0; border-bottom: 1px solid var(--border); }
.nt-item:last-child { border-bottom: none; }
.nt-item.unread .nt-title::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); margin-right: 6px; vertical-align: middle;
}
.nt-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nt-title { font-size: 14px; font-weight: 600; }
.nt-time { font-size: 11px; color: var(--text-light); flex-shrink: 0; }
.nt-content { font-size: 13px; color: #5a5e66; margin-top: 5px; }

/* ==================== 业绩 ==================== */
.hero-stats-2 { flex-wrap: wrap; }
.hero-stats-2 .hs { flex: 0 0 50%; margin-bottom: 12px; }
.mon-item { padding: 9px 0; border-bottom: 1px solid var(--border); }
.mon-item:last-child { border-bottom: none; }
.mon-head { display: flex; align-items: center; justify-content: space-between; }
.mon-title { font-size: 13px; font-weight: 600; }
.mon-sub { font-size: 11px; color: var(--text-sub); }
.bar { height: 5px; border-radius: 3px; background: #f0f1f3; margin-top: 7px; overflow: hidden; }
.bar-in { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--primary), var(--primary-light)); }

/* ==================== 分页 ==================== */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 0; font-size: 13px; color: var(--text-sub); }
.pager button { padding: 6px 14px; border-radius: 8px; background: #fff; border: 1px solid var(--border); }
.pager button:disabled { opacity: .45; }

/* ==================== 底部 TabBar ==================== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: #fff; border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item { flex: 1; text-align: center; padding: 7px 0 6px; position: relative; color: var(--text-sub); }
.tab-item.on { color: var(--primary); }
.ti-ico { display: block; font-size: 19px; line-height: 1.1; }
.ti-txt { display: block; font-size: 10px; margin-top: 2px; }
.ti-badge {
  position: absolute; top: 3px; left: 50%; transform: translateX(9px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 10px; line-height: 16px;
}

/* ==================== Toast ==================== */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: rgba(0, 0, 0, .8); color: #fff;
  padding: 10px 18px; border-radius: 8px; font-size: 13px;
  z-index: 999; max-width: 76vw; text-align: center; line-height: 1.5;
}
