/* 對話框與提示訊息 */
/* ---------- 對話框 ---------- */
dialog {
  width: min(580px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  padding: 20px; overflow: auto;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
dialog::backdrop { background: rgba(10, 14, 6, .55); }
dialog h2 { font-size: 20px; color: var(--accent); margin-bottom: 12px; }
dialog label { display: block; margin-top: 12px; font-size: 14px; font-weight: 500; }
dialog input:not([type=checkbox]), dialog select, dialog textarea {
  display: block; width: 100%; margin-top: 4px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
}
dialog textarea { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; line-height: 1.5; resize: vertical; }
.hint { margin-top: 4px; font-size: 12px; color: var(--muted); }
.err { margin-top: 10px; min-height: 0; color: var(--danger); font-size: 14px; font-weight: 500; }
.err:empty { display: none; }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- 提示 ---------- */
#toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px; border-radius: 12px;
  background: #2a2a28; color: #f4f4f2; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
:root[data-theme="dark"] #toast { background: #e8e8e6; color: #111111; }
