/* Modal 弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(5, 5, 12, .68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: backdropIn 220ms var(--ease-out);
}

.modal {
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-hover), 0 0 80px rgba(72, 230, 199, .2);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 360ms var(--ease-spring);
}
.modal-sm { max-width: 360px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, .06);
}

.modal-body {
  padding: 24px;
  overflow: auto;
  flex: 1;
  color: var(--text-secondary);
}
.modal-body > * + * { margin-top: var(--space-3); }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  flex-shrink: 0;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.92) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* drawer 抽屉 */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  background: rgba(5, 5, 12, .5);
  backdrop-filter: blur(4px);
  animation: backdropIn 180ms var(--ease-out);
}
.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 360px;
  max-width: 90vw;
  background: var(--bg-overlay);
  border-left: 1px solid var(--border-subtle);
  z-index: calc(var(--z-drawer) + 1);
  display: flex;
  flex-direction: column;
  animation: drawerIn 320ms var(--ease-spring);
}
.drawer-right { right: 0; }
.drawer-left { left: 0; border-left: none; border-right: 1px solid var(--border-subtle); animation: drawerInLeft 320ms var(--ease-spring); }

@keyframes drawerIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes drawerInLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
