.dict-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  z-index: 2700;
}

.dict-overlay.active {
  display: block;
}

.dict-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: env(safe-area-inset-top, 0px);
  z-index: 2701;
  background: #fff;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  border-radius: 0;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
}

.dict-panel.active {
  transform: translateY(0);
}

.dict-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.28);
  margin: 6px auto 0;
  flex-shrink: 0;
}

.dict-header {
  padding: 3px 10px 5px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid rgba(60, 60, 67, 0.12);
  flex-shrink: 0;
}

.dict-title {
  font-size: 15px;
  color: #3a3a3c;
  font-weight: 700;
  white-space: nowrap;
}

.dict-close-btn {
  border: none;
  background: transparent;
  color: #666;
  font-size: 18px;
  line-height: 1;
  width: 24px;
  height: 24px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.dict-suggest-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px calc(6px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(60, 60, 67, 0.12);
  flex-shrink: 0;
  background: #fff;
}

.dict-suggest-wrap.hidden {
  display: none;
}

.dict-suggest-chip {
  border: 1px solid rgba(0, 122, 255, 0.28);
  background: rgba(0, 122, 255, 0.08);
  color: #075ecf;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.dict-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 10px 18px;
  -webkit-overflow-scrolling: touch;
}

.dict-entry-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  line-height: 1.35;
  margin-bottom: 4px;
}

.dict-entry-html {
  color: #1f1f1f;
  line-height: 1.6;
  font-size: 15px;
  word-break: break-word;
}

.dict-entry-selectable {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dict-entry-line {
  border-bottom: none;
  padding: 0;
  cursor: text;
}

.dict-entry-line .content {
  display: block;
  font-size: 15px;
  line-height: 1.7;
  text-align: left;
  padding: 0;
}

.dict-entry-line .word-span.lp-selected-word {
  background: rgba(0, 122, 255, 0.22);
  border-radius: 4px;
}

.dict-entry-line.lp-selected-sentence .content {
  background: rgba(0, 122, 255, 0.12);
  border-radius: 8px;
}

.dict-entry-line .word-span.lp-selected-range {
  background: transparent !important;
}

.dict-entry-html .ocdbody {
  margin: 0;
  color: #1f1f1f;
}

.dict-entry-html a {
  color: #075ecf;
  text-decoration: none;
}

.dict-entry-html a:active {
  opacity: 0.72;
}

.dict-entry-html .entry {
  margin-bottom: 16px;
}

.dict-empty {
  color: #8e8e93;
  font-size: 14px;
}

.dict-error {
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: #b42318;
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 12px;
}

.dict-skeleton {
  padding-top: 2px;
}

.dict-sk-line {
  height: 13px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: rgba(60, 60, 67, 0.12);
  animation: dictSkPulse 1.2s ease-in-out infinite;
}

.dict-sk-line.w90 { width: 90%; }
.dict-sk-line.w80 { width: 80%; }
.dict-sk-line.w70 { width: 70%; }
.dict-sk-line.w65 { width: 65%; }

@keyframes dictSkPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.92; }
}
