/* UDID 简洁风格 */

body.udid-standalone {
  min-height: 100vh;
  padding: 32px 16px 48px;
  background:
    radial-gradient(circle, #d8dce3 1px, transparent 1px),
    #eef0f4;
  background-size: 22px 22px;
}

.udid-shell {
  width: min(480px, 100%);
}

.udid-main-card {
  padding: 28px 24px !important;
}

.udid-banner {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.udid-banner[hidden] { display: none; }

/* ── 主界面：药丸按钮 + 输入 ── */
.udid-simple {
  display: grid;
  gap: 0;
}

.udid-pill-btn {
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 0 20px;
  border: 1px solid #c8cdd4;
  border-radius: 999px;
  background: #fff;
  color: #3d4450;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.udid-pill-btn:hover {
  border-color: #98a2b3;
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.06);
}

.udid-pill-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.udid-pill-soft {
  margin-top: 12px;
  color: #f40612;
  border-color: #f40612;
}

.udid-pill-assist {
  margin-top: 20px;
  color: #2e7de1;
  border-color: #93c5fd;
  background: #f8fbff;
}

.udid-pill-back {
  margin-top: 10px;
  font-size: 14px;
  min-height: 46px;
  border-color: #e4e7ec;
  color: #667085;
}

.udid-divider {
  position: relative;
  margin: 22px 0;
  text-align: center;
}

.udid-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #d8dce3;
}

.udid-divider span {
  position: relative;
  display: inline-block;
  padding: 0 14px;
  background: #fff;
  font-size: 13px;
  color: #98a2b3;
  font-weight: 500;
}

.udid-main-card .udid-divider span {
  background: #fff;
}

.phone-form .udid-divider span {
  background: #fff;
}

.udid-pill-input {
  width: 100%;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid #c8cdd4;
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  color: #101828;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.udid-pill-input::placeholder {
  color: #b0b8c4;
}

.udid-pill-input:focus {
  border-color: #2e7de1;
  box-shadow: 0 0 0 3px rgba(46, 125, 225, 0.12);
}

.udid-pill-input.is-filled {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  color: #047857;
  border-color: #6ee7b7;
  background: #f0fdf8;
}

/* ── 弹窗：左右对称 ── */
.udid-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 20px;
  pointer-events: none;
}

.udid-modal:not([hidden]) {
  pointer-events: auto;
}

.udid-modal[hidden] {
  display: none !important;
}

.udid-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  backdrop-filter: blur(4px);
}

.udid-modal-dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: min(90vh, 640px);
  overflow: auto;
  padding: 28px 28px 24px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.18);
}

.udid-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f2f4f7;
  color: #667085;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.udid-modal-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: #101828;
  text-align: center;
}

.udid-modal-sub {
  margin: 0 0 24px;
  font-size: 14px;
  color: #667085;
  text-align: center;
}

.udid-modal-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.udid-modal-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 16px;
  border-radius: 16px;
  border: 1px solid #eaecf0;
  background: #fafbfc;
  min-height: 320px;
}

.udid-modal-col-link {
  align-items: stretch;
  text-align: left;
}

.udid-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #2e7de1;
  background: #edf4ff;
}

.udid-status-chip.is-done {
  color: #047857;
  background: #ecfdf5;
}

.udid-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: udid-blink 1.3s ease-in-out infinite;
}

.udid-status-chip.is-done .udid-status-dot {
  animation: none;
}

@keyframes udid-blink {
  50% { opacity: 0.35; }
}

.udid-qr-wrap {
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #edf0f5;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.udid-qr-wrap img {
  display: block;
  border-radius: 4px;
}

.udid-modal-tip {
  margin: 0;
  font-size: 13px;
  color: #667085;
  text-align: center;
  line-height: 1.5;
}

.udid-modal-label {
  margin: 8px 0 12px;
  font-size: 15px;
  font-weight: 800;
  color: #101828;
}

.udid-modal-link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.udid-modal-link-row input {
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  font-size: 11px;
  font-family: ui-monospace, Menlo, monospace;
  color: #344054;
  background: transparent;
}

.udid-modal-copy {
  min-width: 72px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-left: 1px solid #d0d5dd;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #f40612, #2e7de1);
}

.udid-modal-foot-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  margin-top: auto;
  padding-top: 20px;
}

.udid-modal-foot-single .udid-pill-outline-sm {
  width: 100%;
}

.udid-pill-outline-sm {
  min-height: 46px;
  font-size: 14px;
  border-color: #f40612;
  color: #f40612;
  border-radius: 12px;
}

.udid-modal-result {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.udid-modal-result[hidden] { display: none; }

.udid-modal-result-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: #047857;
}

.udid-modal-result-val {
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: #fff;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
  color: #101828;
}

.udid-modal-result .udid-pill-btn {
  min-height: 44px;
  font-size: 14px;
}

/* ── 步骤 & 功能 ── */
.udid-shell .sign-step-card {
  padding: 20px;
}

.udid-shell .sign-step-card h2,
.phone-form .sign-step-card h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
}

.udid-guide-list {
  display: grid;
  gap: 10px;
}

.udid-guide-list p {
  margin: 0;
  font-size: 14px;
  color: #667085;
  line-height: 1.75;
}

.udid-guide-list strong {
  color: #101828;
}

.udid-feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.udid-feature h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 800;
}

.udid-feature p {
  margin: 0;
  font-size: 13px;
  color: #667085;
  line-height: 1.65;
}

.udid-status-line {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  color: #98a2b3;
}

.udid-status-line[hidden] { display: none; }
.udid-status-line.is-ok { color: #047857; font-weight: 700; }
.udid-status-line.is-busy { color: #2e7de1; }
.udid-status-line.is-warn { color: #d97706; }

.phone-form .sign-step-card {
  margin-top: 20px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid #edf0f5;
  background: #fafbfc;
}

@media (max-width: 640px) {
  .udid-modal-split {
    grid-template-columns: 1fr;
  }

  .udid-modal-col {
    min-height: auto;
  }

  .udid-feature-grid {
    grid-template-columns: 1fr;
  }
}

.phone-form .sign-step-card.udid-guide-card {
  margin-top: 18px;
}

.udid-bottom-nav {
  z-index: 1200;
}

.udid-bottom-nav a {
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #344054;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 4px;
  text-decoration: none;
}

.udid-bottom-nav a.active,
.udid-bottom-nav a:hover {
  color: #fff;
  background: linear-gradient(135deg, #f40612, #2e7de1);
}

body.udid-standalone {
  padding-bottom: 100px;
}
