/* ============================================================
   Toast / 模态框 / 下拉菜单 / 通用空状态
   ============================================================ */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 460px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 99px;
  background: rgba(61, 55, 51, 0.94);
  color: #faf4eb;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  pointer-events: auto;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast.leaving { opacity: 0; transform: translateY(6px) scale(0.98); }
.toast[data-type="success"] svg { color: #b9c9ae; }
.toast[data-type="error"] { background: rgba(143, 76, 68, 0.96); }
.toast svg { flex: none; }

/* ---------------- 模态框 ---------------- */
.modal-root { position: relative; z-index: 150; }

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(61, 55, 51, 0.30);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 180ms var(--ease);
  z-index: 150;
}
.modal-overlay.open { opacity: 1; }

.modal {
  width: min(var(--modal-width, 440px), 100%);
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.985);
  transition: transform 200ms var(--ease);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px 6px;
}
.modal-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}
.modal-body {
  padding: 10px 22px 4px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.modal-message {
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 22px 20px;
}

.field-error {
  margin: 0;
  font-size: 12.5px;
  color: var(--danger);
}

/* ---------------- 下拉菜单 ---------------- */
.popmenu {
  position: fixed;
  z-index: 300;
  min-width: 172px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  animation: popIn 140ms var(--ease);
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.popmenu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink-soft);
  font-size: 13.5px;
  text-align: left;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.popmenu-item:hover { background: var(--accent-wash); color: var(--ink); }
.popmenu-item.danger { color: var(--danger); }
.popmenu-item.danger:hover { background: var(--danger-soft); color: #8f4c44; }
.popmenu-item:disabled { opacity: 0.4; cursor: not-allowed; }
.popmenu-icon-placeholder { width: 15px; flex: none; }
.popmenu-sep { height: 1px; margin: 5px 4px; background: var(--line); }

/* ---------------- 空状态 ---------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: clamp(48px, 10vh, 96px) 24px;
  text-align: center;
}
.empty-illustration {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 22px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px rgba(176, 137, 104, 0.16);
}
.empty-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
}
.empty-desc {
  max-width: 340px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-muted);
}

/* ---------------- 骨架卡片 ---------------- */
.sk-line { height: 12px; border-radius: 6px; }
