/* 客户信息 · 底部抽屉 + 浮动入口（旧改设计 / AI 效果图共用） */

.app-viewport {
  position: relative;
}

.cust-drawer-layer {
  position: absolute;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}

.cust-drawer-layer.is-open {
  pointer-events: auto;
}

.cust-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.cust-drawer-layer.is-open .cust-drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.cust-drawer-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(88%, 520px);
  background: #fff;
  border-radius: 16px 16px 0 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.12);
  pointer-events: auto;
}

.cust-drawer-layer.is-open .cust-drawer-sheet {
  transform: translateY(0);
}

.cust-drawer-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.cust-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 8px;
  flex-shrink: 0;
}

.cust-drawer-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.cust-drawer-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.cust-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 12px;
  -webkit-overflow-scrolling: touch;
}

.cust-drawer-foot {
  flex-shrink: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #f1f5f9;
  background: #fff;
}

.cust-drawer-save {
  width: 100%;
  min-height: 46px;
  border: none;
  border-radius: 12px;
  background: var(--primary, #2563eb);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.cust-drawer-save:active {
  opacity: 0.92;
}

/* 旧改设计 · 摘要卡片 */
.cust-summary-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cust-summary-card:active {
  border-color: #bfdbfe;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}

.cust-summary-card.is-filled {
  border-color: #dbeafe;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.cust-summary-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cust-summary-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}

.cust-summary-sub {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  word-break: break-word;
}

.cust-summary-chevron {
  flex-shrink: 0;
  color: #94a3b8;
  font-size: 12px;
}

.cust-summary-link {
  border: none;
  background: transparent;
  color: var(--primary, #2563eb);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
  font-family: inherit;
}

.m-header-actions .m-icon-btn.is-active {
  background: #eff6ff;
  color: var(--primary, #2563eb);
}

.m-header-actions .m-icon-btn .cust-badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  border: 1.5px solid #fff;
}

.m-header-actions .m-icon-btn {
  position: relative;
}

/* AI 效果图 · 右下角圆形浮动客户按钮（位于对比按钮上方） */
.ar-bottom-bar .ar-customer-float {
  position: absolute;
  right: calc(8px + (100% - 16px) / 10 - 22px);
  bottom: calc(100% + 10px);
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.28);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, transform 0.12s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  pointer-events: auto;
}

.ar-viewport:has(.cust-drawer-layer.is-open) .ar-customer-float,
.ar-viewport:has(.ar-erase-overlay:not([hidden])) .ar-customer-float,
.ar-viewport:has(.ar-preview-overlay:not([hidden])) .ar-customer-float,
.ar-viewport:has(.ar-compare-overlay:not([hidden])) .ar-customer-float,
.ar-viewport:has(.ar-modify-sheet.show) .ar-customer-float {
  opacity: 0;
  pointer-events: none;
}

.ar-bottom-bar .ar-customer-float:active {
  transform: scale(0.94);
  background: rgba(15, 23, 42, 0.68);
}

.ar-bottom-bar .ar-customer-float.is-filled {
  background: rgba(37, 99, 235, 0.78);
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.ar-bottom-bar .ar-customer-float i {
  font-size: 17px;
  flex-shrink: 0;
}

.ar-customer-float-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ar-phone-layer:has(.cust-drawer-layer.is-open) {
  pointer-events: auto;
}

.ar-viewport .cust-drawer-layer {
  z-index: 50;
}
