:root {
  --paper: #f7f3ec;
  --panel: #fffcf6;
  --panel-soft: #fbf8f2;
  --line: #e7dccd;
  --line-strong: #d8c4ad;
  --ink: #2f2a24;
  --muted: #8b8174;
  --brand: #7a4e2d;
  --brand-soft: #efe4d4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

.mobile-chat-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.choice-shell {
  min-height: 100vh;
  padding: 28px 18px;
  display: flex;
  align-items: center;
}

.choice-card {
  width: 100%;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(95, 68, 43, 0.12);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.choice-card h1 {
  margin: 0;
  font-size: 30px;
}

.choice-copy {
  margin: 14px 0 24px;
  color: var(--muted);
  line-height: 1.7;
}

.choice-actions {
  display: grid;
  gap: 12px;
}

.primary-action,
.ghost-action {
  min-height: 48px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
}

.primary-action {
  color: #fffaf2;
  background: var(--brand);
}

.ghost-action {
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--line-strong);
}

.chat-shell {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mobile-topbar {
  flex: 0 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}

.mobile-topbar strong,
.mobile-topbar small {
  display: block;
}

.mobile-topbar small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

#debugText {
  max-width: 58vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-pill {
  max-width: 38vw;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--line-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-top-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: 58vw;
  flex-wrap: wrap;
}

.top-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #3b6ef7 !important;
  color: #fff !important;
  border-color: #3b6ef7 !important;
}
.top-action-button {
  flex: 0 0 auto;
  min-height: 34px;
  min-width: 34px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px;
  -webkit-overflow-scrolling: touch;
}

.message {
  display: flex;
  margin-bottom: 12px;
}

.message.user {
  justify-content: flex-end;
}

.bubble {
  max-width: 82%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  line-height: 1.65;
  white-space: pre-wrap;
}

.message.user .bubble {
  color: #fffaf2;
  background: var(--brand);
  border-color: var(--brand);
}

.typing-bubble {
  min-width: 0;
  max-width: 160px;
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.typing-title {
  margin-bottom: 0;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 10px;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.34;
  animation: typingPulse 1.05s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes typingPulse {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.34;
  }

  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.bubble img {
  display: block;
  width: min(64vw, 260px);
  max-height: 320px;
  object-fit: cover;
  margin-top: 10px;
  border-radius: 10px;
  cursor: zoom-in;
}

body.preview-open {
  overflow: hidden;
}

.image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  background: rgba(15, 16, 18, 0.94);
}

.image-preview-overlay[hidden] {
  display: none;
}

.image-preview-overlay img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.composer {
  flex: 0 0 auto;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  background: var(--panel-soft);
  border-top: 1px solid var(--line);
}

.composer textarea {
  width: 100%;
  min-height: 58px;
  max-height: 150px;
  resize: none;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: var(--panel);
  outline: none;
}

.composer-actions {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-group {
  display: flex;
  gap: 8px;
}

.tool-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--line-strong);
  font-size: 14px;
  font-weight: 700;
}

.send-button {
  min-width: 82px;
  height: 36px;
  border-radius: 999px;
  color: #fffaf2;
  background: var(--brand);
  font-weight: 700;
}

.attachment-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.attachment-card {
  flex: 0 0 230px;
  display: flex;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--panel);
}

.attachment-media {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
}

.attachment-media img,
.file-mark {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--brand-soft);
}

.file-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-weight: 800;
}

.attachment-index {
  position: absolute;
  left: 4px;
  top: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  color: #fffaf2;
  background: rgba(47, 42, 36, 0.78);
  font-size: 11px;
}

.attachment-info {
  flex: 1;
  min-width: 0;
}

.attachment-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.attachment-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.attachment-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fffaf2;
  background: var(--brand);
  line-height: 20px;
  font-weight: 800;
}

.attachment-note {
  width: 100%;
  height: 28px;
  margin-top: 7px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  outline: none;
  font-size: 12px;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  background: var(--panel);
  box-shadow: 0 -18px 60px rgba(95, 68, 43, 0.18);
}

.sheet[hidden] {
  display: none;
}

.sheet-head {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.sheet-head button,
.library-search-row button,
.library-pager button {
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--line-strong);
}

.project-list {
  overflow-y: auto;
}

.project-item {
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  background: transparent;
  border-bottom: 1px solid var(--line);
}

.project-item.active {
  background: #f2e5d3;
}

.project-item strong,
.project-item span {
  display: block;
}

.project-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.library-sheet {
  height: 78vh;
}

.library-search-row {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
}

.library-search-row input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-soft);
}

.library-grid {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.library-card {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.library-card img {
  width: 100%;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--brand-soft);
}

.library-title {
  margin-top: 7px;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-meta {
  height: 18px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-card button {
  width: 100%;
  margin-top: 7px;
  height: 30px;
  border-radius: 999px;
  color: #fffaf2;
  background: var(--brand);
}

.library-pager {
  padding: 10px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ====== 消息长按浮动菜单 ====== */
.message,
.message * { -webkit-user-select: text; user-select: text; }
.message { -webkit-touch-callout: none; }
.message-selecting {
  -webkit-touch-callout: default !important;
  background: rgba(59, 110, 247, 0.06);
  outline: 2px dashed rgba(59, 110, 247, 0.5);
  outline-offset: 2px;
  border-radius: 8px;
}
.msg-menu {
  position: fixed;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  min-width: 168px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e5e5ec;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 15px;
  user-select: none;
  -webkit-user-select: none;
  animation: msgMenuPop 0.13s ease-out;
}
@keyframes msgMenuPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.msg-menu[hidden] { display: none; }
.msg-menu button {
  appearance: none;
  background: transparent;
  border: none;
  text-align: left;
  padding: 12px 16px;
  font-size: 15px;
  color: #1f1f24;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}
.msg-menu button:active {
  background: rgba(59, 110, 247, 0.1);
}
.msg-menu button.danger { color: #c64545; }
.msg-menu button.danger:active { background: rgba(220, 90, 90, 0.1); }

/* ====== 智能体设置 sheet 内的 tab 切换 ====== */
.sheet-tabs {
  display: flex;
  gap: 8px;
  padding: 8px 16px 4px;
  border-bottom: 1px solid var(--line, #e8e2d6);
}
.sheet-tab {
  flex: 1;
  appearance: none;
  background: transparent;
  border: none;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 500;
  color: #9a9189;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
}
.sheet-tab:active { opacity: 0.7; }
.sheet-tab.active {
  color: #2f2a24;
  border-bottom-color: #3b6ef7;
}
.sheet-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted, #9a9189);
  font-size: 14px;
}

/* ====== 客户详情页(模仿口袋助理) ====== */
.customer-page {
  background: #f5f6fa;
  margin: 0;
  min-height: 100vh;
}
.customer-shell {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 92px;
}
.customer-topbar {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #eef0f4;
  z-index: 10;
}
.customer-topbar strong {
  flex: 1;
  text-align: center;
  font-size: 17px;
  color: #1f1f24;
}
.cust-back {
  background: transparent;
  border: none;
  font-size: 24px;
  width: 36px;
  height: 36px;
  color: #1f1f24;
  cursor: pointer;
}
.cust-top-right {
  display: flex;
  gap: 4px;
}
.cust-icon-btn {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #5a85ee;
  text-decoration: none;
  cursor: pointer;
  border-radius: 50%;
}
.cust-icon-btn:active { background: rgba(90, 133, 238, 0.1); }

.customer-body {
  padding: 14px;
}
.cust-loading,
.cust-error,
.cust-empty {
  padding: 40px 24px;
  text-align: center;
  color: #9a9189;
  font-size: 14px;
  line-height: 1.7;
}
.cust-error { color: #c64545; }

.cust-name-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: #fff;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 12px;
}
.cust-name {
  font-size: 18px;
  font-weight: 600;
  color: #1f1f24;
  margin-right: 8px;
}
.cust-stage {
  display: inline-block;
  padding: 2px 10px;
  font-size: 12px;
  background: rgba(59, 110, 247, 0.1);
  color: #3b6ef7;
  border-radius: 999px;
  vertical-align: middle;
}
.cust-stage[data-stage="签约"],
.cust-stage[data-stage="已购"] { background: rgba(34, 174, 110, 0.12); color: #1f8e57; }
.cust-stage[data-stage="战败"] { background: rgba(220, 90, 90, 0.12); color: #c64545; }
.cust-phone {
  color: #6a6a73;
  font-size: 13px;
  margin-top: 4px;
}

/* 数据卡 5 格 */
.cust-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: linear-gradient(180deg, #5a85ee, #4c75dd);
  border-radius: 12px;
  padding: 14px 8px 18px;
  margin-bottom: 12px;
}
.cust-stat {
  text-align: center;
  color: #fff;
}
.cust-stat strong {
  display: block;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}
.cust-stat span {
  font-size: 12px;
  opacity: 0.88;
}
.cust-stat.single {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255,255,255,0.18);
  padding-top: 10px;
  margin-top: 6px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}
.cust-stat.single strong { display: inline; font-size: 18px; }

/* 客户标签 */
.cust-labels {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.cust-labels h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #4a4a55;
  font-weight: 500;
}
.cust-label-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cust-label {
  display: inline-block;
  padding: 5px 12px;
  font-size: 12px;
  background: rgba(90, 133, 238, 0.1);
  color: #4c75dd;
  border-radius: 999px;
  word-break: break-all;
}
.cust-label-empty {
  color: #9a9189;
  font-size: 12px;
}
.cust-label-add {
  width: 32px;
  height: 28px;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.04);
  color: #6a6a73;
  border: 1px dashed #c8cad0;
  border-radius: 999px;
  cursor: pointer;
}
.cust-label-add:active { background: rgba(0, 0, 0, 0.08); }

/* Tab */
.cust-tabs {
  display: flex;
  gap: 0;
  background: #fff;
  border-radius: 12px 12px 0 0;
  border-bottom: 1px solid #eef0f4;
  margin-bottom: 0;
}
.cust-tab {
  flex: 1;
  appearance: none;
  background: transparent;
  border: none;
  padding: 14px 0;
  font-size: 15px;
  font-weight: 500;
  color: #9a9189;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
}
.cust-tab.active {
  color: #1f1f24;
  border-bottom-color: #3b6ef7;
  font-weight: 600;
}

/* Feed / 跟进项 */
.cust-feed {
  background: #fff;
  border-radius: 0 0 12px 12px;
  padding: 0 14px;
}
.cust-feed-item {
  padding: 14px 0;
  border-bottom: 1px solid #f0f1f5;
}
.cust-feed-item:last-child { border-bottom: none; }
.cust-feed-item header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.cust-feed-author {
  font-size: 14px;
  font-weight: 500;
  color: #1f1f24;
}
.cust-feed-item header small {
  font-size: 12px;
  color: #9a9189;
}
.cust-feed-text {
  font-size: 14px;
  color: #2f2f38;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
}
.cust-feed-imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.cust-feed-img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  background: #f0f1f5;
}
.cust-feed-item footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.cust-feed-type {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  background: #f0f1f5;
  color: #6a6a73;
  border-radius: 4px;
}
.cust-feed-action {
  border: 1px solid #3b6ef7;
  background: #fff;
  color: #3b6ef7;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.cust-feed-action.primary { background: #3b6ef7; color: #fff; }
.cust-feed-delete {
  background: transparent;
  border: none;
  color: #c64545;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  font-family: inherit;
}
.cust-feed-item.plan-done { opacity: 0.6; }
.cust-feed-item.plan-canceled { opacity: 0.45; }

/* 底部 CTA */
.customer-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid #eef0f4;
  z-index: 5;
}
.cust-cta-row {
  display: flex;
  gap: 10px;
}
.cust-cta-screenshot {
  appearance: none;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #7c5cff 0%, #3b6ef7 100%);
  box-shadow: 0 6px 18px rgba(86, 92, 247, 0.32);
  cursor: pointer;
}
.cust-cta-screenshot:active { transform: scale(0.98); }
.cust-cta-screenshot:disabled { opacity: 0.7; }
.cust-cta-btn {
  flex: 1;
  appearance: none;
  background: #fff;
  border: 1px solid #3b6ef7;
  color: #3b6ef7;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}
.cust-cta-btn.primary {
  background: #3b6ef7;
  color: #fff;
  border-color: #3b6ef7;
}
.cust-cta-btn:active { opacity: 0.85; }

/* Modal */
.cust-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  z-index: 999;
}
.cust-modal-mask[hidden] { display: none; }
.cust-modal {
  background: #fff;
  width: 100%;
  border-radius: 16px 16px 0 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: custModalUp 0.18s ease-out;
}
@keyframes custModalUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.cust-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 8px;
  font-size: 16px;
}
.cust-modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  color: #9a9189;
  width: 32px;
  height: 32px;
  cursor: pointer;
}
.cust-modal-body {
  padding: 8px 18px 14px;
  overflow-y: auto;
  flex: 1;
}
.cust-modal-label {
  display: block;
  font-size: 13px;
  color: #6a6a73;
  margin-bottom: 14px;
}
.cust-modal-label select,
.cust-modal-label input,
.cust-modal-label textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font-size: 15px;
  color: #1f1f24;
  background: #f7f8fa;
  border: 1px solid #e3e5ea;
  border-radius: 8px;
  box-sizing: border-box;
  font-family: inherit;
}
.cust-modal-label textarea { resize: vertical; min-height: 80px; }
.cust-modal-foot {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  border-top: 1px solid #f0f1f5;
}
.cust-modal-foot button {
  flex: 1;
  padding: 11px 0;
  font-size: 15px;
  background: #f0f1f5;
  border: none;
  border-radius: 10px;
  color: #2f2f38;
  cursor: pointer;
  font-family: inherit;
}
.cust-modal-foot button.primary {
  background: #3b6ef7;
  color: #fff;
}
.cust-modal-foot button:disabled { opacity: 0.5; }

/* Toast */
.cust-toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  background: rgba(31, 31, 36, 0.92);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 9998;
}
.cust-toast[hidden] { display: none; }

/* ====== 客户列表页 ====== */
.mobile-customers-page { background: var(--paper); min-height: 100vh; }
.customer-list-topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.customer-list-topbar strong { flex: 1; font-size: 16px; text-align: center; }
.customer-back {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  font-size: 22px; color: #4a4030;
  text-decoration: none;
  border-radius: 50%;
}
.customer-back:active { background: rgba(0,0,0,0.05); }
.customer-topbar-action {
  appearance: none; background: transparent;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px; color: #4a4030;
  font-family: inherit;
}
.customer-list-meta {
  padding: 14px 16px 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.customer-list-project { font-size: 14px; color: #6b6354; }
.customer-list-counters { display: flex; gap: 12px; font-size: 12px; color: #8b8174; }
.customer-list-counters strong { color: #2f2a24; font-weight: 600; }
.customer-list-counters strong.warn { color: #c64545; }
.customer-list-filters {
  padding: 0 14px 10px;
}
.customer-search-row { display: flex; gap: 8px; align-items: center; }
.customer-search-row input {
  flex: 1; min-width: 0; box-sizing: border-box;
  padding: 10px 14px;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: inherit;
}
.customer-filter-toggle {
  flex: 0 0 auto;
  padding: 9px 16px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #4a4030;
  font-family: inherit;
}
.customer-filter-toggle.active { background: #3b6ef7; color: #fff; border-color: #3b6ef7; }
.customer-filter-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 10px;
}
.customer-filter-sel {
  flex: 0 0 auto;
  padding: 7px 10px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  max-width: 46%;
}
.customer-filter-clear {
  padding: 7px 14px;
  font-size: 13px;
  border: 1px solid #e0533a;
  color: #e0533a;
  background: #fff;
  border-radius: 8px;
  font-family: inherit;
}
.customer-list-wrap {
  padding: 0 12px 100px;
  display: flex; flex-direction: column; gap: 8px;
}
.customer-list-empty {
  padding: 36px 16px;
  text-align: center;
  color: #9a9189;
  font-size: 14px;
  line-height: 1.7;
}
.customer-row {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}
.customer-row:active { background: rgba(0,0,0,0.03); }
.customer-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.customer-row-name {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: #2f2a24;
}
.customer-row-tag {
  display: inline-flex; align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px; font-weight: 500;
  background: rgba(59, 110, 247, 0.1);
  color: #3b6ef7;
}
.customer-row-tag.intent-A { background: rgba(34, 174, 110, 0.14); color: #1f8e57; }
.customer-row-tag.intent-B { background: rgba(59, 110, 247, 0.12); color: #3b6ef7; }
.customer-row-tag.intent-C { background: rgba(245, 180, 60, 0.16); color: #b87800; }
.customer-row-tag.intent-D { background: rgba(150, 150, 165, 0.18); color: #686878; }
.customer-row-meta {
  display: flex; gap: 12px;
  font-size: 12px; color: #8b8174;
}
.customer-row-meta .customer-overdue { color: #c64545; font-weight: 500; }
.customer-row-arrow { font-size: 22px; color: #c8c0b3; flex-shrink: 0; }
.customer-fab {
  position: fixed;
  bottom: 28px; right: 20px;
  z-index: 10;
  appearance: none;
  padding: 14px 22px;
  background: #3b6ef7;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 15px; font-weight: 600;
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(59, 110, 247, 0.35);
  cursor: pointer;
}
.customer-fab:active { transform: scale(0.96); }
/* 项目选择 + 新增客户的模态(继承 customer-modal-* 已有的) */
.customer-modal--project { max-height: 70vh; overflow-y: auto; }
.customer-project-list { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 18px; }
.customer-project-item {
  text-align: left;
  appearance: none; background: #fff;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  display: flex; flex-direction: column; gap: 4px;
}
.customer-project-item strong { font-size: 14px; color: #2f2a24; }
.customer-project-item span { font-size: 12px; color: #8b8174; }
.customer-project-item.active { border-color: #3b6ef7; background: rgba(59, 110, 247, 0.06); }
.customer-new-form {
  padding: 14px 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.customer-new-form label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: #6b6354;
}
.customer-new-form input,
.customer-new-form select,
.customer-new-form textarea {
  padding: 8px 12px;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
}
.customer-new-form textarea { resize: vertical; min-height: 60px; }
.customer-form-actions { display: flex; justify-content: flex-end; padding-top: 6px; }
.customer-form-submit {
  appearance: none;
  padding: 10px 28px;
  background: #3b6ef7;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  font-family: inherit;
}
.customer-form-submit:active { opacity: 0.85; }

/* 新增客户·独立整页表单 */
.customer-new-page-form { padding: 14px 16px 96px; }
.customer-new-page-form .cf-field { margin-bottom: 14px; }

/* 新增客户·完整表单(旧弹窗,保留兜底) */
.customer-modal--form { max-height: 86vh; display: flex; flex-direction: column; }
.customer-modal--form .customer-new-form { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px 18px; }
.cf-loading { padding: 28px 8px; text-align: center; color: #9a9189; font-size: 14px; }
.cf-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.cf-label { font-size: 13px; color: #6b6354; }
.cf-req { color: #e0533a; font-style: normal; }
.cf-field input, .cf-field select, .cf-field textarea {
  padding: 9px 12px; font-size: 15px; background: #fff;
  border: 1px solid var(--line, #e3ddd0); border-radius: 9px; font-family: inherit; width: 100%; box-sizing: border-box;
}
.cf-field textarea { resize: vertical; min-height: 56px; }
.customer-modal--form .customer-form-actions {
  position: sticky; bottom: 0; background: #fff; padding-top: 10px; margin-top: 4px; border-top: 1px solid #f0ece2;
}
.customer-modal--form .customer-form-submit { width: 100%; }

/* 状态选择 + 房源关联选择器 */
.cust-stage { cursor: pointer; }
.cust-stage::after { content: " ▾"; font-size: 11px; opacity: .6; }
.cust-modal-hint { font-size: 13px; color: #6b6354; padding: 4px 2px 12px; line-height: 1.6; }
.cust-pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 56vh; overflow-y: auto; }
.cust-stage-opt {
  appearance: none; text-align: left; padding: 13px 16px; font-size: 15px;
  background: #fff; border: 1px solid var(--line, #e3ddd0); border-radius: 10px; font-family: inherit;
}
.cust-stage-opt.on { border-color: #3b6ef7; background: #eef3ff; color: #2455d6; font-weight: 600; }
.cust-stage-opt:active { background: #f0f0f0; }
.cust-unit-search {
  width: 100%; box-sizing: border-box; padding: 9px 12px; font-size: 14px; margin-bottom: 10px;
  border: 1px solid var(--line, #e3ddd0); border-radius: 9px; font-family: inherit;
}
.cust-unit-opt {
  appearance: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; font-size: 14px; background: #fff;
  border: 1px solid var(--line, #e3ddd0); border-radius: 10px; font-family: inherit; text-align: left;
}
.cust-unit-opt small { color: #1f8e57; flex: 0 0 auto; }
.cust-unit-opt:active { background: #f0f0f0; }

/* 手机端历史编辑记录 */
.cust-history-item { padding: 12px 2px; border-bottom: 1px solid #eee; }
.cust-history-item:last-child { border-bottom: none; }
.cust-history-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cust-history-head strong { font-size: 14px; }
.cust-history-head span { font-size: 12px; color: #9a9189; }
.cust-history-body { font-size: 13px; color: #555; line-height: 1.7; }

/* 成交类状态未关联房源 提醒条 */
.cust-deal-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 16px 12px; padding: 12px 14px;
  background: #fff7 e6; background: #fff6e5; border: 1px solid #f0c879; border-radius: 12px;
  font-size: 13px; color: #8a5a00;
}
.cust-deal-banner button {
  flex: 0 0 auto; padding: 8px 16px; border: none; border-radius: 999px;
  background: #f5a623; color: #fff; font-size: 13px; font-weight: 600; font-family: inherit;
}
.cust-deal-banner button:active { opacity: .85; }

/* 客户列表 加载更多 */
.customer-load-more { display: block; width: 100%; padding: 14px; margin: 6px 0 12px; background: #fff; border: 1px solid var(--line, #e3ddd0); border-radius: 12px; font-size: 14px; color: #3b6ef7; font-family: inherit; }
.customer-load-more:active { background: #f0f0f0; }
.customer-list-end { text-align: center; padding: 14px; color: #b0a89a; font-size: 13px; }

/* 成交大脑 C1:AI 话术/跟进 */
.cust-cta-btn.ai { background: linear-gradient(90deg,#7c5cff,#3b6ef7); color:#fff; }
.coach-out { white-space:pre-wrap; line-height:1.65; background:#f7f8fb; border:1px solid #e6e8ee; border-radius:10px; padding:12px 14px; font-size:14px; color:#1d2330; max-height:50vh; overflow-y:auto; min-height:60px; }
.cust-modal-input { padding:10px 12px; border:1px solid #e6e8ee; border-radius:10px; font-size:14px; }

/* 手机端 批量/查重/字段 */
.customer-list-actions { display:flex; gap:8px; padding:6px 12px 0; }
.cust-act-btn { flex:1; padding:7px 0; border:1px solid #e6e8ee; background:#fff; border-radius:8px; font-size:13px; color:#333; }
.cust-act-btn.active { background:#eef3ff; border-color:#a9c4ff; color:#2455d6; font-weight:600; }
.customer-row.batch { display:flex; align-items:center; gap:10px; text-decoration:none; }
.customer-row.batch.sel { background:#eef3ff; }
.cust-cb { width:20px; height:20px; flex-shrink:0; pointer-events:none; }
.cust-extra { color:#7a8aa0; }
.customer-batch-bar { position:fixed; left:0; right:0; bottom:0; z-index:40; background:#fff; border-top:1px solid #e6e8ee; display:flex; align-items:center; gap:10px; padding:10px 12px; box-shadow:0 -2px 10px rgba(0,0,0,.06); }
.batch-selall { display:flex; align-items:center; gap:4px; font-size:13px; color:#333; white-space:nowrap; }
#batchCount { font-size:13px; color:#2455d6; font-weight:600; white-space:nowrap; }
.batch-bar-acts { margin-left:auto; display:flex; gap:6px; }
.batch-bar-acts button { padding:8px 12px; border:none; border-radius:8px; background:#eef3ff; color:#2455d6; font-size:13px; font-weight:600; }
.batch-bar-acts button.danger { background:#fdecea; color:#d9362b; }
.sheet-body { padding:4px 0; max-height:58vh; overflow-y:auto; }
.cust-modal-label { display:flex; flex-direction:column; gap:6px; font-size:13px; color:#333; margin-bottom:12px; }
.cust-modal-label select, .cust-modal-label input { padding:10px 12px; border:1px solid #e6e8ee; border-radius:10px; font-size:14px; }
.dedup-result-m { margin-top:6px; }
.dedup-hd { font-size:13px; color:#666; margin:8px 0 6px; }
.dedup-none { padding:18px; text-align:center; color:#2bb673; }
.dedup-item { display:flex; flex-direction:column; gap:2px; padding:10px 12px; border:1px solid #eef0f4; border-radius:8px; margin-bottom:6px; text-decoration:none; color:#1d2330; }
.dedup-item span { font-size:12px; color:#8a93a6; }
.fld-hint { font-size:12px; color:#8a93a6; margin-bottom:8px; }
.fld-list { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.fld-item { display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid #e6e8ee; border-radius:8px; font-size:13px; }

/* AI 多方案可选卡片 */
.coach-opt { border:1px solid #e6e8ee; border-radius:10px; padding:10px 12px; margin-bottom:8px; cursor:pointer; transition:border-color .15s, background .15s; }
.coach-opt:hover { border-color:#a9c4ff; }
.coach-opt.sel { border-color:#3b6ef7; background:#f4f8ff; }
.coach-opt-head { display:flex; align-items:center; gap:8px; margin-bottom:5px; }
.coach-opt-radio { color:#3b6ef7; font-size:15px; }
.coach-opt-body { white-space:pre-wrap; line-height:1.6; font-size:13.5px; color:#333; }
.coach-tip { font-size:12px; color:#888; margin-bottom:8px; }
