.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: transparent !important;
  /* 移除白底 */
  border: none !important;
  /* 移除邊框 */
  box-shadow: none !important;
  /* 移除陰影 */
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  min-width: 300px;
}

.modal-content button {
  margin-top: 10px;
}

.login-container {
  background: white;
  padding: 40px 30px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}

.form-inline {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.form-inline label {
  width: 120px;
  /* label 固定寬度 */
  text-align: left;
  /* 文字靠左 */
  margin-right: 10px;
  /* label 與 input 間距 */
  font-weight: 500;
}

.form-inline input {
  flex: 1;
  /* 輸入框自動佔滿剩餘空間 */
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 6px solid #e0f2f1;
  border-top: 6px solid #0288d1;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* footer */
.footer {
  text-align: center;
  color: #6aa8c8;
  font-size: 13px;
  padding: 8px 0 28px;
}

.tos-text {
  font-size: 13px;
  color: #666;
}

.tos-text a {
  color: #3aa3d1;
  text-decoration: none;
}

.tos-text a:hover {
  text-decoration: underline;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: white;
  border-radius: 12px;
  padding: 30px 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 260px;
}

.modal-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #0288d1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modal-message {
  font-size: 16px;
  margin: 0;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.modal-btn {
  background: #0288d1;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
}

.modal-btn:hover {
  filter: brightness(0.95);
}

.modal-ok {
  background: #2563eb;
  color: white;
}

.modal-cancel {
  background: #e5e7eb;
  color: #111827;
}

/* 背景遮罩 */
.ai-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 9999;
}

.ai-modal.hidden {
  display: none;
}

/* 卡片 */
.ai-modal-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);

  border-radius: 20px;
  padding: 30px 40px;

  width: 320px;
  margin: auto;
  text-align: center;

  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* Spinner（iOS風） */
.ai-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 20px;

  border: 4px solid rgba(0,0,0,0.1);
  border-top: 4px solid #2F5D7C;

  border-radius: 50%;

  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 標題 */
.ai-title {
  font-size: 18px;
  font-weight: 600;
  color: #2F5D7C;
  margin-bottom: 8px;
}

/* 說明 */
.ai-desc {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

/* Progress bar container */
.ai-progress {
  width: 100%;
  height: 8px;
  background: #e6eef5;
  border-radius: 999px;
  overflow: hidden;
}

/* Progress bar */
.ai-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4facfe, #00f2fe);
  transition: width 0.4s ease;
}

/* 百分比 */
.ai-percent {
  margin-top: 10px;
  font-size: 13px;
  color: #444;
}