/**
 * 壁纸列表：编辑 / 删除弹窗（与 admin shell 变量一致）
 */
.wp-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.wp-modal.is-open {
  display: flex;
}

.wp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.wp-modal__panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.wp-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--admin-surface-2);
  border-bottom: 1px solid var(--admin-border);
  flex-shrink: 0;
}

.wp-modal__header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--admin-text);
}

.wp-modal__close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface);
  color: var(--admin-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.wp-modal__close:hover {
  border-color: var(--admin-accent);
  color: var(--admin-accent-dark);
  background: var(--admin-accent-soft);
}

.wp-modal__body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.wp-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 22px;
  border-top: 1px solid var(--admin-border);
  background: var(--admin-surface-2);
  flex-shrink: 0;
}

.wp-field {
  margin-bottom: 18px;
}

.wp-field:last-of-type {
  margin-bottom: 0;
}

.wp-field label,
.wp-field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-text);
  margin-bottom: 8px;
}

.wp-field input[type="text"],
.wp-field input[type="number"],
.wp-field select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--admin-text);
  background: var(--admin-surface);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wp-field input:focus,
.wp-field select:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px var(--admin-accent-soft);
}

.wp-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wp-field-hint {
  font-size: 12px;
  color: var(--admin-muted);
}

.wp-sort-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.wp-sort-row input {
  flex: 1;
}

.wp-btn-max-sort {
  flex-shrink: 0;
  padding: 0 16px;
  border: 1px solid var(--admin-accent);
  border-radius: 8px;
  background: var(--admin-accent-soft);
  color: var(--admin-accent-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.wp-btn-max-sort:hover {
  opacity: 0.92;
}

.wp-btn-ghost {
  padding: 10px 20px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface);
  color: var(--admin-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.wp-btn-ghost:hover {
  border-color: var(--admin-accent);
  color: var(--admin-accent-dark);
}

.wp-btn-primary {
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--admin-accent) 0%, var(--admin-accent-dark) 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

.wp-btn-primary:hover {
  opacity: 0.96;
}

.wp-btn-danger {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.wp-btn-danger:hover {
  filter: brightness(1.05);
}

.wp-delete-note {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--admin-muted);
  line-height: 1.55;
}

.wp-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.wp-check-row label {
  margin: 0;
  font-size: 14px;
  color: var(--admin-text);
  font-weight: 500;
  cursor: pointer;
}

/* Toast：替代系统 alert */
.wp-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1200;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.wp-toast.show {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.wp-toast--success {
  background: #15803d;
}

.wp-toast--error {
  background: #b91c1c;
}

.wp-toast--info {
  background: #0f766e;
}
