/* components-modal.css */
/* 模态框 / Dialog 组件 - 玻璃风格 */

:root {
  --blue-main: #2563ff;
  --blue-soft: #e5edff;
  --blue-deep: #1d4ed8;
}

/* 模态框遮罩层 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* 模态框主体 */
.modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 25px 60px rgba(15, 23, 42, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-overlay.is-active .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* 模态框尺寸变体 */
.modal.is-sm {
  max-width: 360px;
}

.modal.is-lg {
  max-width: 640px;
}

.modal.is-xl {
  max-width: 800px;
}

.modal.is-full {
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
}

/* 模态框头部 */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: rgba(148, 163, 184, 0.15);
  color: #6b7280;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-close:hover {
  background: rgba(148, 163, 184, 0.3);
  color: #374151;
}

/* 模态框内容 */
.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  font-size: 13px;
  color: #4b5563;
  line-height: 1.7;
}

/* 模态框底部 */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(249, 250, 251, 0.5);
}

.modal-footer.is-centered {
  justify-content: center;
}

.modal-footer.is-between {
  justify-content: space-between;
}

/* 确认对话框 - 简化模态框 */
.dialog {
  text-align: center;
  padding: 24px;
}

.dialog-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 24px;
}

.dialog-icon.is-info {
  background: rgba(219, 234, 254, 0.9);
  color: var(--blue-deep);
}

.dialog-icon.is-success {
  background: rgba(220, 252, 231, 0.9);
  color: #16a34a;
}

.dialog-icon.is-warning {
  background: rgba(254, 243, 199, 0.9);
  color: #d97706;
}

.dialog-icon.is-danger {
  background: rgba(254, 226, 226, 0.9);
  color: #dc2626;
}

.dialog-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
}

.dialog-message {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 20px;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* 侧边抽屉 - Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 100%;
  max-width: 400px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
  box-shadow:
    -10px 0 40px rgba(15, 23, 42, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.drawer-overlay.is-active .drawer {
  transform: translateX(0);
}

/* 左侧抽屉 */
.drawer.is-left {
  left: 0;
  right: auto;
  transform: translateX(-100%);
}

.drawer-overlay.is-active .drawer.is-left {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  flex-shrink: 0;
}

.drawer-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(249, 250, 251, 0.5);
  flex-shrink: 0;
}
