/* ── Text selection snippet menu ── */
.text-snippet-menu {
  position: fixed;
  z-index: 120;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transform: translate(-50%, 0);
  margin-top: 8px;
}
.text-snippet-menu.visible {
  display: flex;
  animation: snippetMenuIn 0.15s ease;
}
@keyframes snippetMenuIn {
  from { opacity: 0; transform: translate(-50%, -10%); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.text-snippet-menu button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.text-snippet-menu button:hover {
  background: var(--accent-bg);
  color: var(--accent-light);
}

/* ── Snippet image preview modal ── */
.snippet-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0; /* 显式定位（inset 需 Chromium 87+） */
  z-index: 300;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.snippet-overlay.open { display: flex; }
.snippet-dialog {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.snippet-dialog img {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: 1px solid var(--line);
}
.snippet-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  flex-wrap: wrap;
}
.snippet-dialog-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.snippet-timestamp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.snippet-timestamp-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}
.snippet-dialog-actions button {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.snippet-dialog-actions button:hover {
  background: var(--surface-hover);
}
.snippet-dialog-actions button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.snippet-dialog-actions button.primary:hover {
  opacity: 0.9;
}

/* Desktop: show the snippet card smaller so the quote text doesn't look oversized */
@media (min-width: 769px) {
  .snippet-dialog {
    max-width: 560px;
  }
}

