.gre-dict-trigger {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid rgba(17, 24, 39, .12);
  border-radius: 999px;
  background: #172033;
  color: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .22);
  font: 700 13px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}
.gre-dict-trigger.is-active { background: #df7563; }
.gre-dict-toolbar {
  position: fixed;
  right: 18px;
  bottom: 66px;
  z-index: 2147482999;
  display: none;
  align-items: center;
  gap: 7px;
  width: min(430px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 16px;
  background: #fffdf9;
  box-shadow: 0 16px 42px rgba(15, 23, 42, .22);
  color: #27324b;
  font: 13px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.gre-dict-toolbar.is-active { display: flex; }
.gre-dict-mode-hint {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 0 3px;
  color: #8b4c42;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.gre-dict-mode-hint i { width: 7px; height: 7px; border-radius: 50%; background: #df7563; }
.gre-dict-toolbar-search { display: flex; min-width: 0; flex: 1; gap: 6px; }
.gre-dict-toolbar-search input {
  min-width: 0;
  flex: 1;
  height: 34px;
  padding: 0 9px;
  border: 1px solid #d9d3cb;
  border-radius: 9px;
  background: white;
  color: #1f2937;
  font: inherit;
}
.gre-dict-toolbar-search input:focus { outline: 2px solid rgba(224, 112, 93, .22); border-color: #df7563; }
.gre-dict-toolbar button {
  border: 0;
  border-radius: 9px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.gre-dict-toolbar-search button { padding: 0 11px; background: #df7563; color: white; }
.gre-dict-wordbook-button,
.gre-dict-mode-exit { flex: 0 0 auto; width: 34px; height: 34px; padding: 0; }
.gre-dict-wordbook-button { position: relative; background: #f5ebe5; color: #9b4b40; font-size: 18px; }
.gre-dict-wordbook-button span {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  padding: 1px 4px;
  border: 1px solid #ead8cf;
  border-radius: 999px;
  background: #fff;
  font-size: 10px;
  line-height: 14px;
}
.gre-dict-mode-exit { background: #eceff3; color: #4b5563; font-size: 20px; line-height: 1; }
body.gre-dict-click-mode { cursor: help; }
body.gre-dict-click-mode .gre-dict-trigger,
body.gre-dict-click-mode .gre-dict-toolbar,
body.gre-dict-click-mode .gre-dict-backdrop { cursor: auto; }
.gre-dict-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: none;
  background: rgba(15, 23, 42, .16);
}
.gre-dict-backdrop.is-open { display: block; }
.gre-dict-panel {
  position: absolute;
  top: 72px;
  right: 18px;
  width: min(440px, calc(100vw - 32px));
  max-height: min(650px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 18px;
  background: #fffdf9;
  box-shadow: 0 20px 64px rgba(15, 23, 42, .26);
  color: #1f2937;
}
.gre-dict-header {
  padding: 16px 17px 13px;
  border-bottom: 1px solid #ece7df;
  background: linear-gradient(135deg, #fffaf4, #fff);
}
.gre-dict-topline { display: flex; align-items: flex-start; gap: 12px; }
.gre-dict-word-wrap { min-width: 0; flex: 1; }
.gre-dict-word {
  margin: 0;
  color: #182033;
  font: 800 clamp(24px, 4vw, 30px)/1.15 Georgia, "Times New Roman", serif;
  overflow-wrap: anywhere;
}
.gre-dict-resolved { margin-top: 4px; color: #7a6157; font-size: 13px; }
.gre-dict-close,
.gre-dict-save,
.gre-dict-audio,
.gre-dict-tab {
  border: 0;
  font: inherit;
  cursor: pointer;
}
.gre-dict-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f2ede7;
  color: #4b5563;
  font-size: 22px;
  line-height: 1;
}
.gre-dict-header-actions { display: flex; align-items: center; gap: 8px; }
.gre-dict-save {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  background: #f4e4dc;
  color: #a84e41;
  font-weight: 750;
}
.gre-dict-save.is-saved { background: #e6f2e8; color: #387247; }
.gre-dict-save:disabled { opacity: .5; cursor: default; }
.gre-dict-audio {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  background: #27324b;
  color: white;
  font-size: 15px;
}
.gre-dict-summary {
  padding: 14px 17px 13px;
  border-bottom: 1px solid #eee5dc;
  background: #fff;
}
.gre-dict-summary small {
  display: block;
  margin-bottom: 4px;
  color: #9a776d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}
.gre-dict-summary-meaning { display: block; color: #9b3d33; font-size: 18px; line-height: 1.45; }
.gre-dict-summary-english { display: block; margin-top: 5px; color: #566274; font-size: 13px; line-height: 1.45; }
.gre-dict-summary-context {
  display: -webkit-box;
  margin: 9px 0 0;
  overflow: hidden;
  color: #746b65;
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.gre-dict-summary-context:empty { display: none; }
.gre-dict-tabs { display: flex; padding: 0 20px; border-bottom: 1px solid #ece7df; }
.gre-dict-tab {
  position: relative;
  padding: 13px 14px 12px;
  background: transparent;
  color: #7a716b;
  font-weight: 750;
}
.gre-dict-tab.is-active { color: #cf5f4f; }
.gre-dict-tab.is-active::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #df7563;
}
.gre-dict-content {
  min-height: 150px;
  max-height: calc(min(650px, 100vh - 32px) - 255px);
  overflow: auto;
  padding: 16px 17px 20px;
  font: 14px/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: contain;
}
.gre-dict-content b:first-child { font-size: 1.08em; }
.gre-dict-content .PS { color: #6b7280; }
.gre-dict-content .PoS { color: #bf4f45; }
.gre-dict-content .EnDf { color: #25314a; }
.gre-dict-content .ChDf { color: #9b3d33; }
.gre-dict-content .EnEx { color: #315d77; font-style: italic; }
.gre-dict-content .ChEx { color: #6f625b; }
.gre-dict-content .Seg,
.gre-dict-content .IDM-title { color: #a44d3f; font-weight: 800; }
.gre-dict-content .syn { display: block; margin: 5px 0 10px; color: #34435c; }
.gre-dict-content .label { color: #80746d; font-size: .92em; }
.gre-dict-content ol,
.gre-dict-content ul { margin: 6px 0 10px; padding-left: 24px; }
.gre-dict-content li:empty { display: none; }
.gre-dict-content hr.dict-entry-divider { margin: 22px 0; border: 0; border-top: 1px dashed #d7cec5; }
.gre-dict-state { padding: 28px 10px; text-align: center; color: #756b65; }
.gre-dict-error { color: #a9463b; }
.gre-dict-source-note { margin-top: 16px; color: #93877f; font-size: 12px; }
body.gre-dict-modal-open { overflow: hidden; }
@media (max-width: 640px) {
  .gre-dict-trigger { right: 12px; bottom: 12px; }
  .gre-dict-toolbar { right: 8px; bottom: 58px; width: calc(100vw - 16px); }
  .gre-dict-mode-hint { display: none; }
  .gre-dict-backdrop { background: rgba(15, 23, 42, .35); }
  .gre-dict-panel {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 86vh;
    transform: none;
    border-radius: 20px 20px 0 0;
  }
  .gre-dict-header { padding: 15px 14px 12px; }
  .gre-dict-topline { align-items: flex-start; }
  .gre-dict-header-actions { gap: 6px; }
  .gre-dict-save { padding: 0 8px; }
  .gre-dict-summary { padding: 13px 14px 12px; }
  .gre-dict-tabs { padding: 0 12px; }
  .gre-dict-content { max-height: calc(86vh - 245px); padding: 15px 14px 26px; }
}
