/* 通用弹层：替代 alert / confirm / prompt（兼容手机 WebView） */
.app-dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
}

.app-dialog-layer.hidden {
  display: none !important;
}

.app-dialog-layer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.app-dialog-layer__sheet {
  position: relative;
  width: min(400px, 100%);
  padding: 18px 16px 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
  animation: appDialogIn 0.22s ease-out;
}

@keyframes appDialogIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.app-dialog-layer__title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.app-dialog-layer__msg {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
  white-space: pre-wrap;
  word-break: break-word;
}

.app-dialog-layer__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.5;
  color: #0f172a;
  font-family: inherit;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.app-dialog-layer__input--area {
  min-height: 88px;
  resize: vertical;
}

.app-dialog-layer__input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.app-dialog-layer__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.app-dialog-layer__btn {
  min-width: 84px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
}

.app-dialog-layer__btn--ghost {
  background: #f1f5f9;
  color: #475569;
}

.app-dialog-layer__btn--ok {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.app-dialog-layer--danger .app-dialog-layer__title {
  color: #b91c1c;
}

.app-dialog-layer--danger .app-dialog-layer__btn--ok {
  background: linear-gradient(135deg, #f87171, #ef4444);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.28);
}
