/* ── Dictionary Popup ──────────────────────────────────────────────────── */

.dict-popup {
  position: fixed;
  z-index: 50;
  width: 300px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.dict-popup.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dict-popup .dict-word {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.dict-popup .dict-pos {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  margin-top: 8px;
}

.dict-popup .dict-def {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 2px;
}

.dict-popup .dict-example {
  font-size: 0.78rem;
  color: var(--text-sub);
  font-style: italic;
  margin-top: 2px;
}

.dict-popup .dict-zh {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.dict-popup .dict-loading {
  font-size: 0.82rem;
  color: var(--text-sub);
}

/* ── Mobile ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .dict-popup {
    /* Center at bottom on mobile like a bottom card */
    left: 8px !important;
    right: 8px;
    bottom: 60px !important;
    top: auto !important;
    width: auto;
    max-height: 50vh;
    border-radius: 14px;
  }
}

/* ── Light theme ──────────────────────────────────────────────────────── */
[data-theme="light"] .dict-popup {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
