/* ========================================
   773511.com 統一彈窗（美化 alert/confirm/prompt）
   深色 + 琥珀金 + 玻璃擬態風格
   ======================================== */

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1rem;
  animation: appModalFadeIn 0.18s ease-out;
}

.app-modal {
  background: linear-gradient(180deg, #1F2533 0%, #181D28 100%);
  border: 1px solid rgba(255, 184, 0, 0.18);
  border-radius: 18px;
  padding: 2rem 1.8rem 1.6rem;
  max-width: 440px;
  width: 100%;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 80px rgba(255, 184, 0, 0.08);
  animation: appModalScaleIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

/* 頂部琥珀光帶 */
.app-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--accent, #FFB800) 50%, transparent 100%);
}

.app-modal-icon {
  font-size: 2.6rem;
  text-align: center;
  margin-bottom: 0.6rem;
  line-height: 1;
}

.app-modal-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: #FFFFFF;
  text-align: center;
  margin: 0 0 0.6rem;
  letter-spacing: 0.02em;
}

.app-modal-title:empty {
  display: none;
}

.app-modal-message {
  color: #A1A7B3;
  text-align: center;
  line-height: 1.65;
  white-space: pre-line;
  margin: 0 0 1.5rem;
  font-size: 0.96rem;
  word-wrap: break-word;
}

.app-modal-message:empty {
  display: none;
}

.app-modal-input-wrap {
  margin-bottom: 1.4rem;
}

.app-modal-input {
  width: 100%;
  background: #131720;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.app-modal-input:focus {
  outline: none;
  border-color: #FFB800;
  box-shadow: 0 0 0 3px rgba(255, 184, 0, 0.18);
}

.app-modal-input-hint {
  color: #6B7280;
  font-size: 0.82rem;
  margin-top: 0.4rem;
}

.app-modal-buttons {
  display: flex;
  gap: 0.6rem;
}

.app-modal-buttons .app-modal-btn {
  flex: 1;
  padding: 0.78rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.app-modal-buttons .app-modal-btn:active {
  transform: scale(0.97);
}

.app-modal-buttons .app-modal-btn-secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.14);
  color: #A1A7B3;
}

.app-modal-buttons .app-modal-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
}

.app-modal-buttons .app-modal-btn-primary {
  background: linear-gradient(135deg, #FFB800 0%, #FFD60A 100%);
  color: #0B0E14;
  box-shadow: 0 4px 14px rgba(255, 184, 0, 0.32);
}

.app-modal-buttons .app-modal-btn-primary:hover {
  background: linear-gradient(135deg, #FFC833 0%, #FFE040 100%);
}

.app-modal-buttons .app-modal-btn-danger {
  background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

.app-modal-buttons .app-modal-btn-danger:hover {
  background: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
}

.app-modal-single .app-modal-buttons {
  justify-content: center;
}

/* 動畫 */
@keyframes appModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes appModalScaleIn {
  from { opacity: 0; transform: scale(0.9) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 手機 */
@media (max-width: 480px) {
  .app-modal {
    padding: 1.6rem 1.3rem 1.3rem;
    border-radius: 16px;
  }
  .app-modal-icon { font-size: 2.2rem; }
  .app-modal-title { font-size: 1.05rem; }
  .app-modal-message { font-size: 0.92rem; }
  .app-modal-buttons .app-modal-btn { padding: 0.7rem 0.8rem; font-size: 0.9rem; }
}
