/* ui.css - Toast / Modal / Loading 等 Web 版交互组件 */

#ui-layer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

/* ===== Toast ===== */
.toast-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.toast-box {
  max-width: 5.6rem;
  padding: 0.24rem 0.4rem;
  border-radius: 0.16rem;
  background: rgba(0, 0, 0, 0.78);
  color: #FFFFFF;
  font-size: 0.28rem;
  line-height: 1.5;
  text-align: center;
  word-break: break-all;
  animation: toast-in 0.18s ease-out;
}

.toast-box.with-icon {
  padding: 0.36rem 0.4rem;
  min-width: 2.4rem;
}

.toast-icon {
  display: block;
  font-size: 0.6rem;
  line-height: 1;
  margin-bottom: 0.16rem;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(0.1rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Loading ===== */
.loading-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.15);
  pointer-events: auto;
}

.loading-box {
  min-width: 2.4rem;
  max-width: 5rem;
  padding: 0.32rem 0.4rem;
  border-radius: 0.16rem;
  background: rgba(0, 0, 0, 0.78);
  color: #FFFFFF;
  font-size: 0.28rem;
  text-align: center;
  line-height: 1.5;
}

.loading-box .spinner {
  width: 0.48rem;
  height: 0.48rem;
  margin: 0 auto 0.16rem;
  border: 0.04rem solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: ui-spin 0.8s linear infinite;
}

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

/* ===== Modal ===== */
.modal-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  animation: fade-in 0.15s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  width: 5.8rem;
  max-height: 76vh;
  overflow-y: auto;
  border-radius: 0.24rem;
  background: #FFFFFF;
  animation: modal-in 0.2s ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-title {
  padding: 0.4rem 0.4rem 0.16rem;
  font-size: 0.34rem;
  font-weight: 600;
  color: #1C1C1E;
  text-align: center;
}

.modal-content {
  padding: 0 0.4rem 0.36rem;
  font-size: 0.28rem;
  line-height: 1.65;
  color: #1C1C1E;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-actions {
  display: flex;
  border-top: 0.01rem solid #E5E5EA;
}

.modal-btn {
  flex: 1;
  height: 0.96rem;
  border: none;
  background: none;
  font-size: 0.32rem;
  color: #8E8E93;
}

.modal-btn + .modal-btn {
  border-left: 0.01rem solid #E5E5EA;
}

.modal-btn.confirm {
  color: #007AFF;
  font-weight: 600;
}

.modal-btn.danger {
  color: #FF3B30;
  font-weight: 600;
}

.modal-btn:active {
  background: #F5F6FA;
}

/* ===== 下拉刷新提示 ===== */
.ptr-indicator {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  font-size: 0.24rem;
  color: #8E8E93;
  pointer-events: none;
}

.ptr-spinner {
  width: 0.32rem;
  height: 0.32rem;
  border: 0.03rem solid #E5E5EA;
  border-top-color: #007AFF;
  border-radius: 50%;
  animation: ui-spin 0.8s linear infinite;
}
