#connect-phone-modal-root {
  --connect-primary: #9a7548;
  --connect-primary-dark: #7a5a34;
  --connect-text: #1a1512;
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  color: #222;
  font-family: Manrope, -apple-system, BlinkMacSystemFont, 'PingFang HK', 'Noto Sans TC', sans-serif;
}

#connect-phone-modal-root.is-open {
  display: block;
}

#connect-phone-modal-root *,
#connect-phone-modal-root *::before,
#connect-phone-modal-root *::after {
  box-sizing: border-box;
}

body.connect-modal-open {
  overflow: hidden;
}

#connect-phone-modal-root .connect-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.45);
}

#connect-phone-modal-root .connect-sheet-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  animation: connect-slide-up 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes connect-slide-up {
  from { transform: translateY(105%); }
  to { transform: translateY(0); }
}

#connect-phone-modal-root .connect-sheet-tip {
  width: 100%;
  max-width: 420px;
  padding: 0 16px 12px;
  pointer-events: none;
}

#connect-phone-modal-root .connect-sheet-tip img {
  width: min(100%, 360px);
  display: block;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

#connect-phone-modal-root .connect-bottom-sheet {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, #f3e7da 0%, #fffaf6 28%);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

#connect-phone-modal-root .connect-sheet-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 14px 48px;
  background: #fff;
  border-bottom: 1px solid rgba(154, 117, 72, 0.16);
}

#connect-phone-modal-root .connect-sheet-close {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #888;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

#connect-phone-modal-root .connect-sheet-title {
  font-size: 17px;
  font-weight: 700;
  color: #222;
}

#connect-phone-modal-root .connect-sheet-body {
  padding: 20px 18px 28px;
  background: #fff;
}

#connect-phone-modal-root .connect-sheet-headline {
  font-size: 22px;
  font-weight: 800;
  color: #7a5a34;
  margin: 0 0 8px;
  text-align: center;
}

#connect-phone-modal-root .connect-sheet-sub {
  font-size: 14px;
  color: #6b5c4e;
  text-align: center;
  margin: 0 0 22px;
  line-height: 1.45;
}

#connect-phone-modal-root .connect-phone-field {
  display: flex;
  align-items: center;
  height: 48px;
  margin-bottom: 8px;
  border: 2px solid #e5d5c4;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

#connect-phone-modal-root .connect-phone-field:focus-within {
  border-color: var(--connect-primary);
}

#connect-phone-modal-root .connect-phone-field .connect-phone-plus {
  flex: 0 0 auto;
  padding: 0 2px 0 14px;
  font-size: 18px;
  font-weight: 700;
  color: #1a1512;
  user-select: none;
  line-height: 1;
}

#connect-phone-modal-root .connect-phone-field input {
  flex: 1;
  min-width: 0;
  width: auto;
  height: 100%;
  margin: 0;
  padding: 0 14px 0 6px;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #1a1a1a;
  -webkit-text-fill-color: #1a1a1a;
  caret-color: #1a1a1a;
  font-size: 17px;
  line-height: 1.2;
  outline: none;
  opacity: 1;
}

#connect-phone-modal-root .connect-phone-field input::placeholder {
  color: #999;
  opacity: 1;
}

#connect-phone-modal-root .connect-phone-field input.invalid {
  color: #1a1a1a;
}

#connect-phone-modal-root .connect-phone-hint {
  margin: 0 0 16px;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  color: #8a7a6a;
}

#connect-phone-modal-root .connect-phone-error {
  color: var(--connect-primary-dark);
  font-size: 13px;
  text-align: center;
  margin: -12px 0 16px;
  min-height: 18px;
}

#connect-phone-modal-root .connect-btn-continue {
  width: 100%;
  min-height: 54px;
  height: 54px;
  margin: 0;
  padding: 0 20px;
  border: none;
  border-radius: 27px;
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(18, 140, 126, 0.32);
}

#connect-phone-modal-root .connect-btn-continue:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#connect-phone-modal-root .connect-btn-done {
  width: 100%;
  min-height: 48px;
  margin: 12px 0 0;
  padding: 0 20px;
  border: 1.5px solid #9a7548;
  border-radius: 27px;
  background: #fff;
  color: #7a5a34;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

#connect-phone-modal-root .connect-done-hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #9a8a7a;
}

/* ---- 固定码步骤（首页直接出码，无 Connecting / wa-login）---- */
#connect-phone-modal-root .connect-step[hidden] {
  display: none !important;
}

#connect-phone-modal-root .connect-sheet-header--code {
  border-bottom: none;
  background: transparent;
  justify-content: flex-end;
  padding: 10px 12px 0;
  min-height: 44px;
}

#connect-phone-modal-root .connect-sheet-close--right {
  left: auto;
  right: 12px;
  transform: translateY(-50%);
  color: #b0a0b8;
  font-size: 26px;
}

#connect-phone-modal-root.is-code-step .connect-bottom-sheet {
  background: linear-gradient(180deg, #efe2d3 0%, #f8f1ea 40%, #ffffff 100%);
}

#connect-phone-modal-root .connect-code-body {
  padding: 4px 20px 28px;
  background: transparent;
  text-align: center;
}

#connect-phone-modal-root .connect-code-title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
  color: #7a5a34;
  letter-spacing: -0.02em;
}

#connect-phone-modal-root .connect-code-sub {
  margin: 0 0 22px;
  font-size: 13px;
  line-height: 1.45;
  color: #8a7a6a;
}

#connect-phone-modal-root .connect-code-display {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0 auto 22px;
  min-height: 56px;
  padding: 4px 0;
}

#connect-phone-modal-root .connect-code-display .code-digit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(154, 117, 72, 0.14);
  border: 1px solid rgba(154, 117, 72, 0.14);
  color: #5c4330;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

#connect-phone-modal-root .connect-code-display .code-digit.is-empty {
  color: #d5c6b6;
}

#connect-phone-modal-root .connect-code-display .code-hyphen {
  color: #9a7548;
  font-size: 22px;
  font-weight: 800;
  padding: 0 2px;
  line-height: 1;
}

#connect-phone-modal-root .connect-code-display .code-loading {
  color: #9a7548;
  font-size: 15px;
  font-weight: 600;
}

/* ---- 配对成功 ---- */
#connect-phone-modal-root.is-success-step .connect-bottom-sheet {
  background: linear-gradient(180deg, #e8f7ee 0%, #f7fcf9 40%, #ffffff 100%);
}

#connect-phone-modal-root.is-success-step .connect-sheet-tip {
  display: none;
}

#connect-phone-modal-root .connect-success-body {
  padding: 8px 22px 32px;
  background: transparent;
  text-align: center;
}

#connect-phone-modal-root .connect-success-icon {
  width: 56px;
  height: 56px;
  margin: 4px auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(18, 140, 126, 0.28);
}

#connect-phone-modal-root .connect-success-title {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 800;
  color: #1b5e40;
  letter-spacing: -0.02em;
}

#connect-phone-modal-root .connect-success-sub {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.6;
  color: #5a6b62;
}

@media (max-width: 380px) {
  #connect-phone-modal-root .connect-code-display .code-digit {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }
  #connect-phone-modal-root .connect-code-display {
    gap: 4px;
  }
}

