.dlg {
  position: fixed; inset: 0; z-index: 99;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 12px; box-sizing: border-box;
  background: rgba(0,0,0,0.28);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.dlg-card {
  width: min(420px, 100%); max-height: min(86vh, 640px);
  overflow: auto; padding: 10px 12px 14px; box-sizing: border-box;
  border-radius: 14px; background: var(--dlg-bg, var(--card)); color: var(--text);
  box-shadow: 0 12px 40px rgba(0,0,0,0.22);
}
.dlg-title {
  margin: 4px 4px 14px; font-size: 1rem; font-weight: 600;
  letter-spacing: 0; text-align: left; color: var(--text);
}
.dlg-label {
  margin: 0 4px 8px; font-size: 0.75rem; font-weight: 400;
  line-height: 1.3; color: var(--dim);
}
.dlg-input {
  display: block; width: 100%; height: 44px; box-sizing: border-box;
  padding: 0 14px; border: 0; border-radius: 12px;
  background: var(--input); color: var(--text);
  font: inherit; font-size: 0.9375rem; outline: none;
  box-shadow: 0 0 0 1px var(--line);
}
.dlg-input:focus { box-shadow: 0 0 0 1.5px var(--accent); }
.dlg-input + .dlg-label { margin-top: 14px; }
.dlg-textarea {
  height: auto; min-height: 132px; padding: 10px 14px;
  line-height: 1.45; resize: vertical;
}
.dlg-mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 0.85rem; }
.dlg-select {
  appearance: none; -webkit-appearance: none;
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%238e8e93' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
}
.dlg-group { margin-top: 14px; }
.dlg-group[hidden] { display: none; }
.dlg-note {
  margin: 8px 4px 0;
  font-size: 0.75rem; line-height: 1.35; color: var(--dim);
}
.dlg-note:empty { display: none; }
.dlg-bar {
  display: flex; align-items: center; gap: 6px;
  margin-top: 20px; padding: 0 2px 2px;
}
.dlg-bar .spacer { flex: 1; }
.dlg-link {
  border: 0; background: transparent; color: var(--accent);
  font: inherit; font-size: 0.9375rem; font-weight: 400;
  padding: 8px 6px; cursor: pointer;
}
/* 对齐安卓 AppDialog：只有主按钮半粗，取消 / 测试 / 导入文件这些文字按钮都是常规字重。 */
.dlg-link:disabled { opacity: 0.45; cursor: default; }
.dlg-primary {
  height: 36px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff;
  font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer;
}
.dlg-primary:disabled { opacity: 0.45; cursor: default; }
@media (min-width: 720px) {
  .dlg { align-items: center; padding: 24px; }
}
