/* 全局查词弹窗 DictPopup（doc/18）—— ELearn 紫，不依赖听写页 sa-dict */
.dp-overlay {
  position: fixed;
  inset: 0;
  /* 盖过练习弹窗 1200、收藏夹目录 1300；壳约束弹窗 ≥ 300 */
  z-index: 1400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, .4);
}
.dp-overlay.is-open { display: flex; }
.dp-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 82vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 18px 18px 14px;
  color: var(--text);
}
.dp-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 8px;
}
.dp-close:hover { background: var(--surface-2); color: var(--text); }
.dp-word-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding-right: 36px;
}
.dp-word { font-size: 26px; font-weight: 800; }
.dp-fold { font-size: 12px; color: var(--text-3); }
.dp-phon {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.dp-ph { display: inline-flex; align-items: center; gap: 6px; }
.dp-ph__label {
  font-size: 10.5px;
  color: #fff;
  background: var(--text-4);
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 700;
}
.dp-ipa {
  font-size: 16px;
  color: var(--text-2);
  font-family: var(--ipa-font);
}
.dp-spk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  background: var(--primary-soft);
  color: var(--primary-strong);
  border-radius: 50%;
  cursor: pointer;
}
.dp-spk svg { width: 14px; height: 14px; }
.dp-spk:hover { background: var(--primary-soft-2); }
.dp-spk.is-playing { background: var(--primary); color: #fff; border-color: var(--primary); }

.dp-body { margin-top: 14px; }
.dp-muted { color: var(--text-3); padding: 12px 0; font-size: 14px; }
.dp-posline { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.dp-def { display: flex; align-items: baseline; gap: 8px; line-height: 1.75; margin: 3px 0; }
.dp-def__cn { flex: 1; min-width: 0; }
.dp-pos {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
  padding: 1px 7px;
  line-height: 1.5;
}
.dp-pos--n { color: #2563eb; background: #eff6ff; }
.dp-pos--v { color: #ea580c; background: #fff7ed; }
.dp-pos--adj { color: #059669; background: #ecfdf5; }
.dp-pos--adv { color: #7c3aed; background: #f3effe; }
.dp-pos--x { color: #64748b; background: #f1f5f9; }
.dp-row { display: flex; gap: 8px; margin: 6px 0; align-items: flex-start; }
.dp-k {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 650;
  padding-top: 3px;
  width: 30px;
}
.dp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dp-chip {
  display: inline-block;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
}
.dp-chip--tag { background: var(--primary-soft); color: var(--primary-strong); }
.dp-ex {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: 10px;
}
.dp-ex__en { line-height: 1.6; }
.dp-ex__cn { color: var(--text-3); font-size: 13px; margin-top: 2px; }

.dp-detail-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary-strong);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.dp-detail-toggle.is-show { display: inline-flex; }
.dp-detail-toggle[aria-expanded="true"] .dp-caret { transform: rotate(180deg); }
.dp-caret { width: 12px; height: 12px; transition: transform .15s; }
.dp-detail {
  display: none;
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.75;
}
.dp-detail.is-open { display: block; }
.dp-detail h5 { margin: 12px 0 4px; font-size: 14px; color: var(--primary-strong); }
.dp-detail h5:first-child { margin-top: 0; }
.dp-detail p { margin: 4px 0; }
.dp-detail ul { margin: 4px 0; padding-left: 18px; }

.dp-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.dp-fav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.dp-fav svg { width: 16px; height: 16px; }
.dp-fav.is-on { background: var(--primary-soft); color: var(--primary-strong); border-color: #e0e7ff; }
.dp-fav.is-on svg { fill: #ef4444; stroke: #ef4444; }

html[data-theme="dark"] .dp-pos--n { color: #93c5fd; background: rgba(37,99,235,.2); }
html[data-theme="dark"] .dp-pos--v { color: #fdba74; background: rgba(234,88,12,.2); }
html[data-theme="dark"] .dp-pos--adj { color: #6ee7b7; background: rgba(5,150,105,.2); }
html[data-theme="dark"] .dp-pos--adv { color: #c4b5fd; background: rgba(124,58,237,.2); }
html[data-theme="dark"] .dp-pos--x { color: #94a3b8; background: rgba(100,116,139,.2); }
