/* CRM 小程序 Demo */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --wx-blue: #267ef0;
  --wx-blue-hover: #1a6dd4;
  --wx-green: #07c160;
  --wx-bg: #ebebeb;
  --wx-border: #e7e7e7;
  --wx-text: #191919;
  --wx-text-secondary: #888;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,.12);
  --transition: .2s cubic-bezier(.4,0,.2,1);
  --mp-width: 375px;
  --mp-height: 812px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  color: var(--wx-text);
  background: linear-gradient(160deg, #dce8f7 0%, #eef1f5 45%, #e4e4e4 100%);
  overflow: hidden;
}

/* ===== 小程序外壳（独立 Demo） ===== */
.mp-demo {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.mp-device {
  width: 100%;
  max-width: var(--mp-width);
  height: min(var(--mp-height), calc(100vh - 40px));
  height: min(var(--mp-height), calc(100dvh - 40px));
  background: #f7f7f7;
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

@media (max-width: 420px) {
  .mp-demo { padding: 0; align-items: stretch; }
  .mp-device {
    max-width: none;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

.mp-status-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px 4px; font-size: 11px; color: #333; background: #f7f7f7; flex-shrink: 0; }
.mp-status-title { font-weight: 600; }
.mp-navbar { display: flex; align-items: center; height: 44px; padding: 0 8px; background: #f7f7f7; border-bottom: 1px solid #e5e5e5; flex-shrink: 0; }
.mp-nav-back { width: 36px; height: 36px; border: none; background: none; font-size: 24px; line-height: 1; color: #333; cursor: pointer; border-radius: 8px; }
.mp-nav-back:hover { background: rgba(0,0,0,.05); }
.mp-nav-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; color: #000; min-width: 0; }
.mp-nav-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-shrink: 0; max-width: 46%; }
.crm-stage-tag { font-size: 11px; padding: 3px 8px; border-radius: 10px; font-weight: 600; white-space: nowrap; line-height: 1.2; }
.crm-stage-tag.stage-lead { background: #fff3e0; color: #e65100; }
.crm-stage-tag.stage-customer { background: #e8f5e9; color: #2e7d32; }
.crm-convert-btn {
  font-size: 11px; padding: 4px 8px; border: 1px solid var(--wx-blue); background: #fff;
  color: var(--wx-blue); border-radius: 12px; cursor: pointer; white-space: nowrap; line-height: 1.2;
  font-family: inherit; transition: var(--transition);
}
.crm-convert-btn:hover { background: #eef4ff; }
.mp-body { flex: 1; overflow-y: auto; overflow-x: hidden; background: #f7f7f7; -webkit-overflow-scrolling: touch; }
.mp-tabbar { display: flex; height: 52px; background: #fff; border-top: 1px solid #e5e5e5; flex-shrink: 0; }
.mp-tabbar-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; color: #888; }
.mp-tabbar-item.active { color: var(--wx-blue); }
.mp-tabbar-icon { font-size: 20px; line-height: 1; }

/* CRM 频道首页 */
.mp-home-banner { margin: 12px 12px 0; padding: 16px; border-radius: 12px; background: linear-gradient(135deg, #267ef0, #5cadff); color: #fff; }
.mp-home-banner-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.mp-home-banner-sub { font-size: 12px; opacity: .9; }
.mp-entry-grid { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.mp-entry-card { display: flex; align-items: center; gap: 14px; padding: 16px; background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06); cursor: pointer; transition: var(--transition); border: 1px solid #eee; }
.mp-entry-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(38,126,240,.12); border-color: #c5d9f7; }
.mp-entry-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.mp-entry-icon.blue { background: #e8f0fe; }
.mp-entry-icon.orange { background: #fff3e0; }
.mp-entry-icon.green { background: #e8f5e9; }
.mp-entry-body { flex: 1; min-width: 0; }
.mp-entry-title { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.mp-entry-desc { font-size: 12px; color: var(--wx-text-secondary); }
.mp-entry-arrow { color: #ccc; font-size: 18px; }
.mp-entry-badge { background: #fa5151; color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 8px; margin-left: 6px; }

/* 小程序内页 */
.mp-page { min-height: 100%; display: flex; flex-direction: column; animation: fadeIn .25s ease; }
.mp-page-scroll { flex: 1; padding: 0 0 12px; }
.mp-page-profile { display: flex; flex-direction: column; min-height: 100%; }
.mp-page-profile .tab-content { flex: 1; overflow-y: auto; padding: 12px; }

/* 客户统计双 Tab */
.stats-sub-tabbar { display: flex; margin: 12px 12px 0; background: #fff; border-radius: 10px; padding: 4px; border: 1px solid #eee; }
.stats-sub-tab { flex: 1; text-align: center; padding: 8px 4px; font-size: 13px; border-radius: 8px; cursor: pointer; color: var(--wx-text-secondary); transition: var(--transition); border: none; background: none; font-family: inherit; }
.stats-sub-tab.active { background: var(--wx-blue); color: #fff; font-weight: 600; }
.stats-panel-body { padding: 12px; }
.stats-filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.stats-filter-row select, .stats-filter-row input { flex: 1; min-width: 90px; padding: 8px 10px; border: 1px solid #e5e5e5; border-radius: 8px; font-size: 12px; background: #fff; font-family: inherit; }
.physical-breadcrumb { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 10px; font-size: 11px; color: var(--wx-text-secondary); }
.physical-breadcrumb span { cursor: pointer; color: var(--wx-blue); }
.physical-breadcrumb .current { color: var(--wx-text); cursor: default; font-weight: 600; }
.physical-level-label { font-size: 11px; color: var(--wx-text-secondary); margin-bottom: 8px; padding-left: 2px; }
.physical-row { display: flex; align-items: center; gap: 10px; padding: 12px; background: #fff; border-radius: 10px; margin-bottom: 8px; cursor: pointer; border: 1px solid #eee; transition: var(--transition); }
.physical-row:hover { border-color: var(--wx-blue); background: #f8faff; }
.physical-row-icon { width: 36px; height: 36px; border-radius: 8px; background: #e8f0fe; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.physical-row-body { flex: 1; min-width: 0; }
.physical-row-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.physical-row-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--wx-text-secondary); }
.physical-row-meta strong { color: var(--wx-text); }
.physical-coverage { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #e8f5e9; color: #2e7d32; font-weight: 600; }
.physical-coverage.low { background: #fff3e0; color: #e65100; }
.physical-row-arrow { color: #ccc; }
.customer-card-list { display: flex; flex-direction: column; gap: 8px; }
.customer-stat-card { padding: 12px; background: #fff; border-radius: 10px; border: 1px solid #eee; cursor: pointer; transition: var(--transition); }
.customer-stat-card:hover { border-color: var(--wx-blue); box-shadow: 0 2px 8px rgba(38,126,240,.1); }
.customer-stat-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.customer-stat-card-name { font-size: 14px; font-weight: 600; }
.customer-stat-card-school { font-size: 11px; color: var(--wx-text-secondary); margin-top: 2px; }
.customer-stat-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.customer-stat-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--wx-text-secondary); margin-top: 8px; padding-top: 8px; border-top: 1px dashed #eee; }
.physical-group-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; padding: 0 2px; }
.physical-customer-card { margin-bottom: 8px; }
.order-flag { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.order-flag.ordered { background: #e8f5e9; color: #2e7d32; }
.order-flag.not-ordered { background: #f5f5f5; color: #888; }
.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-card { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 12px; }
.order-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.order-no { font-size: 12px; font-weight: 600; color: var(--wx-text); font-family: monospace; }
.order-status { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.order-status.done { background: #e8f5e9; color: #2e7d32; }
.order-status.processing { background: #e3f2fd; color: #1565c0; }
.order-status.pending { background: #fff3e0; color: #e65100; }
.order-status.default { background: #f5f5f5; color: #666; }
.order-product { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.order-time { font-size: 11px; color: var(--wx-text-secondary); }
.detail-tabs-scroll { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
.detail-tabs-scroll .detail-tab { flex-shrink: 0; padding: 8px 12px; font-size: 11px; }

/* Mini-program customer detail page */
.mp-page-customer-detail { display: flex; flex-direction: column; min-height: 100%; background: #f7f7f7; }
.mp-customer-header { margin: 12px 12px 0; padding: 16px; background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06); border: 1px solid #eee; }
.mp-customer-header-main { display: flex; gap: 12px; align-items: flex-start; }
.mp-customer-avatar { width: 56px; height: 56px; border-radius: 12px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; flex-shrink: 0; }
.mp-customer-info { flex: 1; min-width: 0; }
.mp-customer-name { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.mp-customer-company { font-size: 12px; color: var(--wx-text-secondary); line-height: 1.4; margin-bottom: 6px; }
.mp-customer-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mp-customer-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #eee; }
.mp-customer-tag-empty { font-size: 11px; color: #bbb; }
.mp-customer-meta { font-size: 11px; color: var(--wx-text-secondary); margin-top: 8px; }
.mp-detail-tabbar { display: flex; margin: 10px 12px 0; background: #fff; border-radius: 10px; padding: 4px; border: 1px solid #eee; overflow-x: auto; flex-shrink: 0; -webkit-overflow-scrolling: touch; }
.mp-detail-tab { flex: 1; min-width: 72px; text-align: center; padding: 8px 4px; font-size: 12px; border-radius: 8px; cursor: pointer; color: var(--wx-text-secondary); transition: var(--transition); border: none; background: none; font-family: inherit; white-space: nowrap; }
.mp-detail-tab.active { background: var(--wx-blue); color: #fff; font-weight: 600; }
.mp-detail-scroll { flex: 1; overflow-y: auto; padding: 10px 12px 12px; -webkit-overflow-scrolling: touch; }
.mp-detail-pane { display: none; animation: fadeIn .2s ease; }
.mp-detail-pane.active { display: block; }
.mp-cell-group { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #eee; }
.mp-cell { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.mp-cell:last-child { border-bottom: none; }
.mp-cell-wrap { flex-wrap: wrap; align-items: flex-start; }
.mp-cell-label { color: var(--wx-text-secondary); flex-shrink: 0; min-width: 72px; }
.mp-cell-value { color: var(--wx-text); text-align: right; flex: 1; word-break: break-all; }
.mp-cell-highlight { color: #f57c00; font-weight: 600; }
.mp-detail-footer { display: flex; gap: 10px; padding: 10px 12px 12px; background: #fff; border-top: 1px solid #e5e5e5; flex-shrink: 0; }
.mp-detail-action { flex: 1; padding: 11px 12px; border-radius: 10px; border: 1px solid #e5e5e5; background: #fff; font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; transition: var(--transition); }
.mp-detail-action.primary { background: var(--wx-blue); color: #fff; border-color: var(--wx-blue); }
.mp-detail-action:active { opacity: .85; }
.mp-page-customer-detail .order-list { gap: 8px; }
.mp-page-customer-detail .order-card { border-radius: 12px; }

/* Mini-program form / todo detail / sign-in pages */
.mp-page-form { padding: 12px; min-height: 100%; }
.mp-form { display: flex; flex-direction: column; gap: 12px; }
.mp-cell-field { flex-direction: column; align-items: stretch !important; gap: 6px; }
.mp-cell-field .mp-cell-label { min-width: auto; }
.mp-cell-input, .mp-cell-textarea { width: 100%; border: none; outline: none; font-size: 13px; font-family: inherit; background: transparent; color: var(--wx-text); }
.mp-cell-textarea { min-height: 72px; resize: vertical; line-height: 1.5; }
.mp-cell-input[type="datetime-local"], .mp-cell-input[type="date"], .mp-cell-input[type="number"] { color: var(--wx-text); }
.mp-form-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--wx-text-secondary); padding: 0 4px; }
.mp-form-submit { padding: 4px 0 12px; }
.mp-page-todo-detail { display: flex; flex-direction: column; min-height: 100%; }
.mp-todo-header { margin: 12px 12px 0; padding: 16px; background: #fff; border-radius: 12px; border: 1px solid #eee; }
.mp-todo-badges { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.mp-todo-title { font-size: 16px; font-weight: 700; line-height: 1.4; }
.mp-section-label { font-size: 12px; font-weight: 600; color: var(--wx-text-secondary); margin: 12px 0 8px; padding-left: 2px; }
.mp-sign-card { margin-bottom: 8px; border-radius: 10px; }
.mp-note-card { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 12px; font-size: 13px; line-height: 1.5; margin-bottom: 8px; }
.mp-warn-banner { padding: 10px 12px; background: #fff3e0; border-radius: 10px; font-size: 12px; color: #e65100; margin-top: 8px; }
.mp-detail-action.btn-danger-outline { color: #fa5151; border-color: #ffcdd2; }
.mp-page-sign-in { display: flex; flex-direction: column; min-height: 100%; }
.mp-page-sign-in .mp-detail-scroll { display: flex; align-items: center; justify-content: center; padding: 20px 12px; }
.mp-sign-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.mp-sign-upload { margin-top: 16px; text-align: left; }
.req { color: #fa5151; margin-left: 2px; }
.mp-form-tip { font-size: 12px; color: var(--wx-text-secondary); padding: 0 4px 12px; line-height: 1.5; }
.mp-form-tip-inline { padding: 10px 16px 12px; margin: 0; }
.mp-cell-readonly { flex-direction: row !important; align-items: center !important; }
.mp-location-field-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mp-location-add-link {
  border: none; background: none; color: var(--wx-green); font-size: 12px;
  cursor: pointer; padding: 0; flex-shrink: 0; -webkit-tap-highlight-color: transparent;
}
.mp-location-add-link:active { opacity: .7; }
.mp-location-empty-tip { font-size: 11px; color: var(--wx-text-secondary); margin-top: 4px; line-height: 1.4; }
.mp-location-add-form { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.mp-location-add-form[hidden] { display: none !important; }
.mp-location-add-input {
  flex: 1; min-width: 0; border: 1px solid #e5e5e5; border-radius: 8px;
  padding: 8px 10px; font-size: 13px; font-family: inherit; outline: none;
}
.mp-location-add-input:focus { border-color: var(--wx-green); }
.mp-location-add-confirm {
  flex-shrink: 0; border: none; background: var(--wx-green); color: #fff;
  border-radius: 8px; padding: 8px 12px; font-size: 12px; cursor: pointer;
}
.mp-location-add-confirm:active { opacity: .85; }
.mp-tag-group { margin-bottom: 16px; }
.mp-tag-group-title { font-size: 12px; font-weight: 600; color: var(--wx-text-secondary); margin-bottom: 8px; padding-left: 2px; }
.mp-tag-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-tag-option { padding: 8px 14px; border-radius: 20px; border: 1px solid #e5e5e5; background: #fff; font-size: 12px; cursor: pointer; font-family: inherit; color: var(--wx-text); transition: var(--transition); }
.mp-tag-option:hover { border-color: #c5d9f7; background: #f8faff; }
.mp-tag-option.active { background: var(--wx-blue); color: #fff; border-color: var(--wx-blue); font-weight: 600; }

/* 保留原 CRM 组件样式（小程序内复用） */
.global-todos-body { padding: 12px; }
.todo-stats-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.todo-stat-item { text-align: center; padding: 10px 6px; border-radius: var(--radius); border: 1px solid var(--wx-border); background: #fafafa; transition: var(--transition); }
.todo-stat-item.active-filter { border-color: var(--wx-blue); background: #f0f6ff; }
.todo-stat-num { font-size: 20px; font-weight: 700; line-height: 1.2; }
.todo-stat-num.green { color: var(--wx-green); }
.todo-stat-num.red { color: #fa5151; }
.todo-stat-num.blue { color: var(--wx-blue); }
.todo-stat-label { font-size: 11px; color: var(--wx-text-secondary); margin-top: 2px; }
.todo-global-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.todo-global-filters .filter-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.todo-global-filters .filter-label { font-size: 11px; color: var(--wx-text-secondary); min-width: 32px; flex-shrink: 0; }
.todo-time-chip { padding: 4px 12px; border-radius: 14px; border: 1px solid var(--wx-border); font-size: 11px; cursor: pointer; background: #fff; transition: var(--transition); }
.todo-time-chip.active { background: var(--wx-blue); color: #fff; border-color: var(--wx-blue); }
.todo-global-input { flex: 1; min-width: 80px; padding: 5px 10px; border: 1px solid var(--wx-border); border-radius: 6px; font-size: 12px; outline: none; font-family: inherit; }
.todo-global-input:focus { border-color: var(--wx-blue); }
.todo-global-select { padding: 5px 8px; border: 1px solid var(--wx-border); border-radius: 6px; font-size: 12px; outline: none; font-family: inherit; background: #fff; min-width: 100px; }
.todo-timeline-card { flex: 1; background: #fff; border: 1px solid var(--wx-border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; transition: var(--transition); cursor: pointer; position: relative; }
.todo-timeline-card:hover { border-color: #c5d9f7; box-shadow: 0 2px 8px rgba(38,126,240,.08); }
.todo-timeline-card.overdue { border-left: 3px solid #fa5151; }
.todo-timeline-card.done { opacity: .65; }
.todo-timeline-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.todo-timeline-type { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: #e8f0fe; color: var(--wx-blue); font-weight: 500; }
.todo-timeline-type.stranger { background: #fff3e0; color: #e65100; }
.todo-timeline-status { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 500; }
.todo-timeline-status.pending { background: #e3f2fd; color: #1565c0; }
.todo-timeline-status.overdue { background: #ffebee; color: #c62828; }
.todo-timeline-status.done { background: #e8f5e9; color: #2e7d32; }
.todo-timeline-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.todo-timeline-meta { font-size: 11px; color: var(--wx-text-secondary); margin-bottom: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.todo-timeline-note { font-size: 11px; color: #999; margin-bottom: 6px; }
.todo-timeline-actions { display: flex; gap: 6px; margin-top: 6px; }
.todo-detail-section { margin-bottom: 14px; }
.todo-detail-label { font-size: 11px; color: var(--wx-text-secondary); margin-bottom: 4px; }
.todo-detail-value { font-size: 13px; line-height: 1.5; }
.todo-detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #eee; font-size: 12px; }
.todo-detail-row:last-child { border-bottom: none; }

/* Customer card */
.customer-card { padding: 14px; border-bottom: 1px solid var(--wx-border); background: linear-gradient(180deg, #f8faff 0%, #fff 100%); animation: fadeIn .3s ease; }
.customer-card-top { display: flex; gap: 12px; margin-bottom: 10px; }
.customer-avatar { width: 52px; height: 52px; border-radius: 8px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; flex-shrink: 0; box-shadow: 0 2px 8px rgba(102,126,234,.3); }
.customer-info { flex: 1; min-width: 0; }
.customer-name-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
.customer-name-group { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.customer-name { font-size: 16px; font-weight: 700; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer-name-group .crm-stage-tag { flex-shrink: 0; }
.customer-lead-hint { font-size: 11px; color: #e65100; background: #fff8e1; border-radius: 6px; padding: 4px 8px; margin-bottom: 4px; line-height: 1.4; }
.customer-edit-btn { width: 28px; height: 28px; border: none; background: #eef4ff; color: var(--wx-blue); border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 1; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.customer-edit-btn:hover { background: #dce8fd; }
.customer-company { font-size: 12px; color: var(--wx-text-secondary); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer-extra-info { background: #f8faff; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; border: 1px solid #e8f0fe; }
.customer-extra-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; padding: 3px 0; }
.customer-extra-row + .customer-extra-row { border-top: 1px dashed #e3ecfa; margin-top: 4px; padding-top: 6px; }
.customer-extra-label { color: var(--wx-text-secondary); flex-shrink: 0; }
.customer-extra-value { color: var(--wx-text); text-align: right; word-break: break-all; }
.customer-phone { font-size: 12px; color: var(--wx-blue); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.customer-phone:hover { text-decoration: underline; }
.customer-meta-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.tag-ss { background: linear-gradient(135deg, #fff3e0, #ffe0b2); color: #e65100; font-weight: 600; }
.tag-s { background: #e3f2fd; color: #1565c0; font-weight: 600; }
.tag-a { background: #f3e5f5; color: #7b1fa2; }
.tag-b { background: #eceff1; color: #546e7a; }
.tag-type { background: #f3e5f5; color: #7b1fa2; }
.tag-intent { background: #e8f5e9; color: #2e7d32; }
.tag-default { background: #f5f5f5; color: #666; }
.customer-add-time { font-size: 11px; color: var(--wx-text-secondary); margin-bottom: 10px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-sm { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--wx-border); background: #fff; font-size: 11px; cursor: pointer; transition: var(--transition); color: var(--wx-text); white-space: nowrap; }
.btn-sm:hover { border-color: var(--wx-blue); color: var(--wx-blue); background: #f8faff; }
.btn-sm.primary { background: var(--wx-blue); color: #fff; border-color: var(--wx-blue); }
.btn-sm.primary:hover { background: var(--wx-blue-hover); }

/* Tab nav */
.tab-nav { display: flex; border-bottom: 1px solid var(--wx-border); background: #fff; position: sticky; top: 0; z-index: 10; }
.tab-btn { flex: 1; padding: 10px 4px; text-align: center; font-size: 12px; color: var(--wx-text-secondary); cursor: pointer; border-bottom: 2px solid transparent; transition: var(--transition); background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; }
.tab-btn:hover { color: var(--wx-blue); }
.tab-btn.active { color: var(--wx-blue); border-bottom-color: var(--wx-blue); font-weight: 600; }
.tab-nav-5 .tab-btn { font-size: 11px; padding: 10px 2px; }
.customer-wechat { font-size: 11px; color: var(--wx-text-secondary); margin-bottom: 4px; }
.order-timeline-card { flex: 1; margin-bottom: 0; }
.order-timeline .follow-timeline-item { align-items: flex-start; }
.tab-badge { display: inline-block; min-width: 16px; height: 16px; line-height: 16px; background: #fa5151; color: #fff; border-radius: 8px; font-size: 10px; padding: 0 4px; margin-left: 2px; vertical-align: top; }

/* Tab content inside profile */
.mp-page-profile .tab-content,
.tab-content { flex: 1; overflow-y: auto; padding: 12px; scroll-behavior: smooth; }
.tab-pane { display: none; animation: fadeIn .25s ease; }
.tab-pane.active { display: block; }

/* ===== Home Tab ===== */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.kpi-card { background: #f8faff; border: 1px solid #e3ecfa; border-radius: var(--radius); padding: 10px 12px; transition: transform var(--transition); }
.kpi-card:hover { transform: translateY(-1px); }
.kpi-label { font-size: 11px; color: var(--wx-text-secondary); margin-bottom: 4px; }
.kpi-value { font-size: 18px; font-weight: 700; color: var(--wx-blue); }
.kpi-value.orange { color: #f57c00; }
.kpi-value.green { color: var(--wx-green); }
.kpi-value.red { color: #fa5151; }

.section-title { font-size: 12px; font-weight: 600; color: var(--wx-text); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.section-title::before { content: ''; width: 3px; height: 14px; background: var(--wx-blue); border-radius: 2px; }

.quick-entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.quick-entry { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff; border: 1px solid var(--wx-border); border-radius: var(--radius); cursor: pointer; transition: var(--transition); }
.quick-entry:hover { border-color: var(--wx-blue); background: #f8faff; }
.quick-entry-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.quick-entry-icon.blue { background: #e3f2fd; }
.quick-entry-icon.green { background: #e8f5e9; }
.quick-entry-icon.orange { background: #fff3e0; }
.quick-entry-icon.purple { background: #f3e5f5; }
.quick-entry-text { font-size: 12px; font-weight: 500; }

.profile-card { background: #fafafa; border-radius: var(--radius); padding: 12px; margin-bottom: 14px; }
.profile-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12px; border-bottom: 1px dashed #eee; }
.profile-row:last-child { border-bottom: none; }
.profile-card-editable { background: #fff; border: 1px solid #e8f0fe; padding: 12px; }
.profile-edit-hint { font-size: 11px; color: var(--wx-text-secondary); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px dashed #eee; }
.profile-edit-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #f0f0f0; font-size: 12px; }
.profile-edit-row:last-child { border-bottom: none; }
.profile-edit-row-wrap { flex-direction: column; align-items: stretch; }
.profile-edit-row-wrap .profile-label { margin-bottom: 4px; }
.profile-edit-select, .profile-edit-input, .profile-edit-textarea {
  flex: 1; min-width: 0; border: 1px solid #e5e5e5; border-radius: 8px; padding: 8px 10px;
  font-size: 12px; font-family: inherit; color: var(--wx-text); background: #fafafa;
  transition: border-color var(--transition), background var(--transition);
}
.profile-edit-select { max-width: 120px; flex: 0 0 auto; }
.profile-edit-input:focus, .profile-edit-select:focus, .profile-edit-textarea:focus {
  outline: none; border-color: var(--wx-blue); background: #fff;
}
.profile-edit-textarea { resize: vertical; min-height: 56px; line-height: 1.5; width: 100%; }
.profile-label { color: var(--wx-text-secondary); flex-shrink: 0; min-width: 72px; }
.profile-value { font-weight: 500; text-align: right; max-width: 60%; }

.timeline-preview { margin-bottom: 8px; }
.timeline-item { display: flex; gap: 10px; padding: 8px 0; cursor: pointer; transition: var(--transition); border-radius: 6px; }
.timeline-item:hover { background: #f8faff; padding-left: 6px; padding-right: 6px; }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--wx-blue); margin-top: 5px; flex-shrink: 0; }
.timeline-body { flex: 1; min-width: 0; }
.timeline-title { font-size: 12px; font-weight: 500; margin-bottom: 2px; }
.timeline-desc { font-size: 11px; color: var(--wx-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-time { font-size: 11px; color: var(--wx-text-secondary); flex-shrink: 0; }

/* ===== Todo Tab ===== */
.todo-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.todo-groups { display: flex; flex-direction: column; gap: 14px; }
.todo-group-title { font-size: 12px; font-weight: 600; color: var(--wx-text-secondary); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.todo-group-count { background: #eee; padding: 1px 6px; border-radius: 10px; font-size: 10px; }
.todo-card { background: #fff; border: 1px solid var(--wx-border); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; transition: var(--transition); position: relative; }
.todo-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.todo-card.overdue { border-left: 3px solid #fa5151; }
.todo-card.done { opacity: .7; }
.todo-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.todo-card-title { font-size: 13px; font-weight: 500; flex: 1; }
.todo-type-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: #e8f0fe; color: var(--wx-blue); white-space: nowrap; margin-left: 8px; }
.todo-card-meta { font-size: 11px; color: var(--wx-text-secondary); margin-bottom: 4px; }
.todo-card-opp { font-size: 11px; color: var(--wx-blue); margin-bottom: 8px; }
.todo-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.todo-sign-info { background: #f0faf0; border-radius: 6px; padding: 8px; margin-top: 8px; font-size: 11px; color: #2e7d32; }

/* ===== Follow Tab — Timeline ===== */
.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-chip { padding: 4px 10px; border-radius: 14px; border: 1px solid var(--wx-border); font-size: 11px; cursor: pointer; transition: var(--transition); background: #fff; }
.filter-chip:hover, .filter-chip.active { border-color: var(--wx-blue); color: var(--wx-blue); background: #e8f0fe; }

.follow-timeline { position: relative; padding-left: 4px; }
.follow-timeline-group { margin-bottom: 16px; }
.follow-timeline-date { font-size: 12px; font-weight: 600; color: var(--wx-text); margin-bottom: 10px; padding: 4px 10px; background: #f5f5f5; border-radius: 4px; display: inline-block; }
.follow-timeline-item { display: flex; gap: 12px; position: relative; padding-bottom: 4px; }
.follow-timeline-item:last-child .follow-timeline-line { display: none; }
.follow-timeline-axis { display: flex; flex-direction: column; align-items: center; width: 16px; flex-shrink: 0; padding-top: 14px; }
.follow-timeline-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--wx-blue); flex-shrink: 0; z-index: 1; }
.follow-timeline-dot.visit { box-shadow: 0 0 0 2px #2e7d32; background: #2e7d32; }
.follow-timeline-dot.phone { box-shadow: 0 0 0 2px #1565c0; background: #1565c0; }
.follow-timeline-dot.wechat { box-shadow: 0 0 0 2px #07c160; background: #07c160; }
.follow-timeline-dot.quote { box-shadow: 0 0 0 2px #f57c00; background: #f57c00; }
.follow-timeline-dot.opp { box-shadow: 0 0 0 2px #7b1fa2; background: #7b1fa2; }
.follow-timeline-line { width: 2px; flex: 1; background: #e0e0e0; margin-top: 4px; min-height: 20px; }
.follow-timeline-card { flex: 1; background: #fff; border: 1px solid var(--wx-border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; transition: var(--transition); cursor: pointer; }
.follow-timeline-card:hover { border-color: #c5d9f7; box-shadow: 0 2px 8px rgba(38,126,240,.08); }
.follow-timeline-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.follow-timeline-type { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: #e8f0fe; color: var(--wx-blue); font-weight: 500; }
.follow-timeline-time { font-size: 11px; color: var(--wx-text-secondary); }
.follow-timeline-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.follow-timeline-content { font-size: 12px; color: var(--wx-text-secondary); line-height: 1.5; margin-bottom: 6px; }
.follow-timeline-meta { font-size: 11px; color: #bbb; display: flex; gap: 10px; flex-wrap: wrap; }
.follow-timeline-meta a { color: var(--wx-blue); text-decoration: none; }
.follow-timeline-meta a:hover { text-decoration: underline; }

/* Legacy follow list (kept for detail modal compat) */
.follow-list { display: flex; flex-direction: column; }
.follow-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: var(--transition); }
.follow-item:hover { background: #fafafa; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; }
.follow-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.follow-icon.visit { background: #e8f5e9; }
.follow-icon.phone { background: #e3f2fd; }
.follow-icon.wechat { background: #e8f5e9; }
.follow-icon.quote { background: #fff3e0; }
.follow-body { flex: 1; min-width: 0; }
.follow-title { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.follow-content { font-size: 12px; color: var(--wx-text-secondary); line-height: 1.4; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.follow-meta { font-size: 11px; color: #bbb; display: flex; gap: 10px; flex-wrap: wrap; }
.follow-meta a { color: var(--wx-blue); text-decoration: none; }
.follow-meta a:hover { text-decoration: underline; }

/* ===== Opportunity Tab ===== */
.opp-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.opp-tab { padding: 5px 12px; border-radius: 14px; font-size: 11px; cursor: pointer; border: 1px solid var(--wx-border); background: #fff; transition: var(--transition); }
.opp-tab.active { background: var(--wx-blue); color: #fff; border-color: var(--wx-blue); }
.opp-card { background: #fff; border: 1px solid var(--wx-border); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; transition: var(--transition); cursor: pointer; }
.opp-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); border-color: #c5d9f7; }
.opp-card-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.opp-name { font-size: 13px; font-weight: 600; }
.opp-amount { font-size: 14px; font-weight: 700; color: #f57c00; }
.opp-stage-bar { display: flex; gap: 2px; margin: 8px 0; }
.opp-stage-dot { flex: 1; height: 4px; border-radius: 2px; background: #eee; transition: var(--transition); }
.opp-stage-dot.active { background: var(--wx-blue); }
.opp-stage-dot.won { background: var(--wx-green); }
.opp-stage-dot.lost { background: #fa5151; }
.opp-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--wx-text-secondary); }
.opp-idle-warn { color: #fa5151; font-size: 11px; margin-top: 4px; }
.opp-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ===== Modals ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal { background: #fff; border-radius: 12px; box-shadow: var(--shadow); width: 90%; max-width: 560px; max-height: 85vh; display: flex; flex-direction: column; transform: translateY(20px) scale(.97); transition: transform .25s cubic-bezier(.4,0,.2,1); }
.modal-overlay.show .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 720px; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--wx-border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close { width: 28px; height: 28px; border: none; background: #f5f5f5; border-radius: 6px; cursor: pointer; font-size: 16px; color: #666; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.modal-close:hover { background: #eee; color: #333; }
.modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--wx-border); display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 5px; color: var(--wx-text); }
.form-label .req { color: #fa5151; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--wx-border); border-radius: 6px; font-size: 13px; font-family: inherit; outline: none; transition: border-color var(--transition); }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--wx-blue); }
.form-textarea { resize: vertical; min-height: 72px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-check { display: flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }
.form-check input { accent-color: var(--wx-blue); }

.btn { padding: 8px 18px; border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid var(--wx-border); background: #fff; transition: var(--transition); font-family: inherit; }
.btn:hover { background: #f5f5f5; }
.btn-primary { background: var(--wx-blue); color: #fff; border-color: var(--wx-blue); }
.btn-primary:hover { background: var(--wx-blue-hover); }
.btn-success { background: var(--wx-green); color: #fff; border-color: var(--wx-green); }
.btn-danger { color: #fa5151; border-color: #fa5151; }
.btn-danger:hover { background: #fff5f5; }

/* Stats modal */
.stats-filters { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stats-search-row { display: flex; gap: 8px; margin-bottom: 14px; }
.stats-search-row .form-input { flex: 1; }
.customer-result-list { max-height: 360px; overflow-y: auto; }
.customer-result-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--wx-border); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; transition: var(--transition); }
.customer-result-item:hover { border-color: var(--wx-blue); background: #f8faff; }
.customer-result-avatar { width: 40px; height: 40px; border-radius: 8px; background: linear-gradient(135deg, #43cea2, #185a9d); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; flex-shrink: 0; }
.customer-result-body { flex: 1; min-width: 0; }
.customer-result-name { font-weight: 600; font-size: 13px; }
.customer-result-company { font-size: 11px; color: var(--wx-text-secondary); }
.customer-result-meta { text-align: right; flex-shrink: 0; }
.customer-result-spend { font-size: 13px; font-weight: 600; color: #f57c00; }
.customer-result-city { font-size: 11px; color: var(--wx-text-secondary); }
.stats-count { font-size: 12px; color: var(--wx-text-secondary); margin-bottom: 10px; }

/* Customer detail modal tabs */
.detail-tabs { display: flex; border-bottom: 1px solid var(--wx-border); margin-bottom: 14px; }
.detail-tab { padding: 8px 16px; font-size: 12px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--wx-text-secondary); transition: var(--transition); background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; }
.detail-tab.active { color: var(--wx-blue); border-bottom-color: var(--wx-blue); font-weight: 600; }
.detail-pane { display: none; }
.detail-pane.active { display: block; animation: fadeIn .2s ease; }

/* Sign-in modal */
.sign-status { text-align: center; padding: 20px; }
.sign-icon { width: 64px; height: 64px; border-radius: 50%; background: #e8f5e9; color: var(--wx-green); display: flex; align-items: center; justify-content: center; font-size: 28px; margin: 0 auto 12px; }
.sign-icon.fail { background: #ffebee; color: #fa5151; }
.sign-distance { font-size: 24px; font-weight: 700; color: var(--wx-blue); margin: 8px 0; }
.sign-location { font-size: 12px; color: var(--wx-text-secondary); }
.sign-progress { display: flex; justify-content: center; gap: 8px; margin: 16px 0; }
.sign-step { width: 8px; height: 8px; border-radius: 50%; background: #ddd; transition: var(--transition); }
.sign-step.active { background: var(--wx-blue); width: 24px; border-radius: 4px; }
.sign-step.done { background: var(--wx-green); }

/* Toast */
.toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: rgba(0,0,0,.78); color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 13px; animation: toastIn .3s ease, toastOut .3s ease 2.2s forwards; white-space: nowrap; }
.toast.success { background: rgba(7,193,96,.92); }
.toast.error { background: rgba(250,81,81,.92); }

/* Loading skeleton */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* Empty state */
.empty-state { text-align: center; padding: 32px 16px; color: var(--wx-text-secondary); }
.empty-state-icon { font-size: 36px; margin-bottom: 8px; opacity: .5; }
.empty-state-text { font-size: 13px; }

/* Demo badge */
.demo-badge { position: fixed; bottom: 12px; left: 12px; background: rgba(0,0,0,.6); color: #fff; padding: 6px 12px; border-radius: 20px; font-size: 11px; z-index: 999; pointer-events: none; }

/* 绑定委托人 · 底部弹窗（2/3 屏高） */
.mp-sheet-overlay {
  position: absolute; inset: 0; z-index: 200;
  display: flex; flex-direction: column; justify-content: flex-end;
  pointer-events: none; visibility: hidden;
}
.mp-sheet-overlay.show { pointer-events: auto; visibility: visible; }
.mp-sheet-mask {
  position: absolute; inset: 0; background: rgba(0,0,0,0);
  transition: background .28s ease;
}
.mp-sheet-overlay.show .mp-sheet-mask { background: rgba(0,0,0,.45); }
.mp-sheet-panel {
  position: relative; z-index: 1; height: 66.67%; min-height: 0;
  background: #f7f7f7; border-radius: 16px 16px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
  box-shadow: 0 -4px 24px rgba(0,0,0,.12);
}
.mp-sheet-overlay.show .mp-sheet-panel { transform: translateY(0); }
.mp-sheet-handle {
  width: 36px; height: 4px; background: #ddd; border-radius: 2px;
  margin: 8px auto 4px; flex-shrink: 0;
}
.mp-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 16px 12px; flex-shrink: 0;
}
.mp-sheet-title { font-size: 16px; font-weight: 600; color: var(--wx-text); }
.mp-sheet-close {
  width: 32px; height: 32px; border: none; background: #f0f0f0; border-radius: 50%;
  font-size: 20px; line-height: 1; color: #666; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.mp-sheet-close:active { background: #e5e5e5; }
.mp-sheet-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 0 12px 8px;
  -webkit-overflow-scrolling: touch;
}
.mp-sheet-footer {
  flex-shrink: 0; padding: 10px 12px 12px; background: #fff;
  border-top: 1px solid #e5e5e5;
}
.mp-sheet-footer .mp-detail-action { width: 100%; padding: 13px 16px; font-size: 15px; border-radius: 10px; }
.mp-sheet-footer .mp-detail-action:disabled { opacity: .45; cursor: not-allowed; }
.mp-sheet-body .mp-bind-search-bar { position: static; box-shadow: none; margin-bottom: 0; }
.mp-bind-current {
  background: linear-gradient(135deg, #eef4ff, #f8faff); border: 1px solid #c5d9f7;
  border-radius: 12px; padding: 12px 14px; margin-bottom: 12px;
}
.mp-bind-current-label { font-size: 11px; color: var(--wx-text-secondary); margin-bottom: 4px; }
.mp-bind-current-name { font-size: 16px; font-weight: 700; color: var(--wx-text); margin-bottom: 4px; }
.mp-bind-current-meta { font-size: 12px; color: var(--wx-text-secondary); line-height: 1.4; }
.mp-bind-search-bar {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid #e5e5e5; border-radius: 10px; padding: 0 12px; min-height: 44px;
  position: sticky; top: 0; z-index: 5; box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.mp-bind-search-icon { font-size: 16px; flex-shrink: 0; opacity: .55; }
.mp-bind-search-input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 15px; font-family: inherit; color: var(--wx-text); padding: 10px 0;
  -webkit-appearance: none;
}
.mp-bind-search-input::placeholder { color: #bbb; }
.mp-bind-search-clear {
  width: 28px; height: 28px; border: none; background: #f0f0f0; border-radius: 50%;
  font-size: 18px; line-height: 1; color: #666; flex-shrink: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.mp-bind-search-clear:active { background: #e0e0e0; }
.mp-bind-search-tip {
  font-size: 11px; color: var(--wx-text-secondary); padding: 8px 4px 10px; line-height: 1.4;
}
.mp-bind-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.mp-principal-item {
  display: flex; align-items: center; gap: 12px; background: #fff;
  border: 1px solid #eee; border-radius: 12px; padding: 14px; min-height: 72px;
  cursor: pointer; transition: border-color .15s, background .15s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.mp-principal-item:active { background: #f5f9ff; }
.mp-principal-item.selected { border-color: var(--wx-blue); background: #f0f6ff; }
.mp-principal-item-body { flex: 1; min-width: 0; }
.mp-principal-item-name { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--wx-text); }
.mp-principal-item-row {
  font-size: 13px; color: var(--wx-text); line-height: 1.5; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-principal-item-row .label {
  display: inline-block; min-width: 36px; color: var(--wx-text-secondary); margin-right: 4px;
}
.mp-principal-check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #ccc; flex-shrink: 0;
  transition: border-color .15s, background .15s;
}
.mp-principal-check.checked {
  border-color: var(--wx-blue); background: var(--wx-blue);
  box-shadow: inset 0 0 0 3px #fff;
}
.mp-bind-empty { text-align: center; padding: 48px 20px 32px; }
.mp-bind-empty-icon { font-size: 40px; opacity: .35; margin-bottom: 12px; }
.mp-bind-empty-text { font-size: 14px; color: var(--wx-text); font-weight: 500; margin-bottom: 6px; }
.mp-bind-empty-hint { font-size: 12px; color: var(--wx-text-secondary); }
.mp-bind-footer {
  flex-shrink: 0; padding: 10px 12px 12px; background: #fff;
  border-top: 1px solid #e5e5e5; box-shadow: 0 -2px 10px rgba(0,0,0,.04);
}
.mp-bind-footer .mp-detail-action { width: 100%; padding: 13px 16px; font-size: 15px; border-radius: 10px; }
.mp-bind-footer .mp-detail-action:disabled { opacity: .45; cursor: not-allowed; }
.safe-area-bottom { padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }

/* 新建待办 · 客户联合搜索 */
.todo-customer-search { position: relative; }
.todo-customer-dropdown {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 4px;
  background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; box-shadow: var(--shadow);
  max-height: 200px; overflow-y: auto;
}
.todo-customer-option {
  padding: 10px 12px; cursor: pointer; border-bottom: 1px solid #f5f5f5; font-size: 12px;
}
.todo-customer-option:last-child { border-bottom: none; }
.todo-customer-option:hover, .todo-customer-option.active { background: #f0f6ff; }
.todo-customer-option-name { font-weight: 600; margin-bottom: 2px; }
.todo-customer-option-sub { color: var(--wx-text-secondary); font-size: 11px; }
.btn-sm.btn-danger-outline { color: #e53935; border-color: #ffcdd2; }
.btn-sm.btn-danger-outline:hover { background: #ffebee; border-color: #e53935; }

