/* 单词释义公共组件样式 - 简洁实用版 v5 */

/* 基础弹窗样式 */
.word-popup {
  position: fixed;
  top: 35%;  /* 居中偏上 */
  left: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center top;  /* 高度变化时以顶部为基准，只向下扩展 */
  background: var(--color-bg, #ffffff);
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  z-index: 11001;
  display: none;
  flex-direction: column;
  width: 360px;
  max-width: 95vw;
  max-height: 70vh;  /* 最大高度70vh */
  overflow: hidden;
  transition: top 0.2s ease-out, transform 0.2s ease-out, max-height 0.2s ease-out;
}

/* 移动端底部滑出遮罩层 */
.word-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 11000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.word-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

[data-theme="dark"] .word-popup {
  background: var(--color-bg, #1f1f1f);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* 头部 */
.word-popup-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
  cursor: move; /* PC端可拖动 */
  user-select: none; /* 防止拖动时选中文字 */
}

/* 拖动时的样式 */
.word-popup.dragging {
  transition: none !important; /* 拖动时禁用过渡动画 */
  opacity: 0.95;
}

.word-popup.dragging .word-popup-head {
  cursor: grabbing;
}

[data-theme="dark"] .word-popup-head {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.word-popup-word-section {
  flex: 1;
  min-width: 0;
}

/* 导航历史 */
.nav-history {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.nav-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: var(--color-surface, #f3f4f6);
  border-radius: 6px;
  cursor: pointer;
  color: var(--color-text-muted, #6b7280);
  transition: all 0.15s ease;
}

[data-theme="dark"] .nav-back-btn {
  background: rgba(255, 255, 255, 0.08);
}

.nav-back-btn:hover {
  background: var(--color-primary, #3b82f6);
  color: white;
}

.nav-path {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  color: var(--color-text-muted, #9ca3af);
  overflow: hidden;
}

.nav-path-item {
  color: var(--color-primary, #3b82f6);
  cursor: pointer;
  white-space: nowrap;
}

.nav-path-item:hover {
  text-decoration: underline;
}

.nav-path-item.current {
  color: var(--color-text-muted, #9ca3af);
  cursor: default;
}

.nav-path-item.current:hover {
  text-decoration: none;
}

.nav-path-divider {
  color: var(--color-text-muted, #9ca3af);
}

.word-popup-word {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-primary, #3b82f6);
  line-height: 1.2;
}

/* Lemma提示 */
.word-popup-lemma {
  margin-top: 3px;
}

.lemma-hint {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6875rem;
  color: var(--color-text-muted, #6b7280);
}

.lemma-link {
  color: var(--color-primary, #3b82f6);
  text-decoration: none;
  cursor: pointer;
}

.lemma-link:hover {
  text-decoration: underline;
}

/* 操作按钮 */
.word-popup-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.word-popup-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--color-text-muted, #6b7280);
  transition: all 0.15s ease;
}

.word-popup-btn:hover {
  background: var(--color-surface, #f3f4f6);
  color: var(--color-text, #1f2937);
}

[data-theme="dark"] .word-popup-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.word-popup-favorite.is-favorite .star-icon {
  fill: #fbbf24;
  stroke: #fbbf24;
}

/* 最小化按钮 */
[data-theme="dark"] #wp-minimize {
  color: rgba(255, 255, 255, 0.9);
}

/* 单词区域包装器 */
.word-popup-word-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}

/* 单词搜索框样式 */
.word-popup-search {
  display: flex;
  align-items: center;
  width: 100%;
  height: 32px;
  background: var(--color-primary, #3b82f6);
  border-radius: 8px;
  padding: 0 8px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  animation: searchExpand 0.25s ease;
}

/* 查询模式 - 头部换行为两行：操作按钮 + 搜索框 */
.word-popup-head.search-mode {
  flex-wrap: wrap;
}

.word-popup-head.search-mode .word-popup-word-section {
  flex: 1;
  order: 1;
}

.word-popup-head.search-mode .word-popup-actions {
  order: 2;
}

.word-popup-head.search-mode .word-popup-search {
  flex: 1 1 100%;
  order: 3;
  margin-top: 6px;
}

/* 查询模式 - 始终显示的大搜索框 */
.word-popup-search.always-visible {
  height: 40px;
  border-radius: 10px;
  padding: 0 10px;
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.35);
}

@keyframes searchExpand {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.word-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0 8px;
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  outline: none;
}

/* 查询模式 - 更大的输入框 */
.word-popup-search.always-visible .word-search-input {
  font-size: 1.25rem;
  padding: 0 10px;
}

.word-search-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

.word-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  color: #fff;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

/* 查询模式 - 更大的清空按钮 */
.word-popup-search.always-visible .word-search-clear {
  width: 28px;
  height: 28px;
}

.word-search-clear:hover {
  background: rgba(255, 255, 255, 0.3);
}

.word-search-clear:active {
  transform: scale(0.95);
}

/* 内容区域 - 隐藏滚动条 */
.word-popup-content {
  flex: 1;
  min-height: 0;  /* 允许flex子元素收缩，使overflow生效 */
  max-height: calc(70vh - 100px);  /* 限制最大高度，预留头部和底部空间 */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 14px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.word-popup-content::-webkit-scrollbar {
  display: none;
}

/* 发音行 */
.word-popup-pronunciation {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 6px 10px;
  background: var(--color-surface, #f8fafc);
  border-radius: 8px;
  font-size: 0.8125rem;
}

[data-theme="dark"] .word-popup-pronunciation {
  background: rgba(255, 255, 255, 0.04);
}

.pronunciation-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pronunciation-label {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  color: white;
}

.pronunciation-label.us { background: #3b82f6; }
.pronunciation-label.uk { background: #10b981; }

.pronunciation-ipa {
  color: var(--color-text-muted, #6b7280);
  font-family: 'Lucida Sans Unicode', sans-serif;
}

.pronunciation-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.pronunciation-btn:hover {
  background: var(--color-primary, #3b82f6);
  color: white;
}

/* 发音按钮加载状态 */
.pronunciation-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.pronunciation-btn.loading .pronounce-icon {
  display: none;
}

.pronunciation-btn .pronounce-loading {
  display: none;
}

.pronunciation-btn.loading .pronounce-loading {
  display: block;
  animation: pronounce-spin 1s linear infinite;
}

@keyframes pronounce-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.pronunciation-divider {
  color: var(--color-border, #e5e7eb);
  margin: 0 2px;
}

/* 释义区域 */
.word-popup-definitions {
  margin-bottom: 10px;
}

.definition-item {
  display: flex;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--color-border, rgba(0, 0, 0, 0.06));
}

[data-theme="dark"] .definition-item {
  border-bottom-color: rgba(255, 255, 255, 0.04);
}

.definition-item:last-child {
  border-bottom: none;
}

.definition-pos {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--color-primary, #3b82f6);
  background: rgba(59, 130, 246, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  height: fit-content;
}

[data-theme="dark"] .definition-pos {
  background: rgba(59, 130, 246, 0.15);
}

.definition-text {
  font-size: 0.8125rem;
  color: var(--color-text, #1f2937);
  line-height: 1.5;
}

[data-theme="dark"] .definition-text {
  color: rgba(255, 255, 255, 0.85);
}

/* 自定义释义 */
.word-popup-custom {
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--color-surface, #f8fafc);
  border-radius: 8px;
}

[data-theme="dark"] .word-popup-custom {
  background: rgba(255, 255, 255, 0.04);
}

.custom-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text-muted, #6b7280);
  margin-bottom: 4px;
}

.custom-edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
  border-radius: 4px;
}

.custom-edit-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-primary, #3b82f6);
}

.custom-content {
  font-size: 0.75rem;
  color: var(--color-text, #1f2937);
  line-height: 1.5;
  white-space: pre-wrap;
}

[data-theme="dark"] .custom-content {
  color: rgba(255, 255, 255, 0.8);
}

.custom-content.empty {
  color: var(--color-text-muted, #9ca3af);
  font-style: italic;
}

.custom-textarea {
  width: 100%;
  min-height: 50px;
  padding: 6px 8px;
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
  border-radius: 6px;
  font-size: 0.75rem;
  resize: vertical;
  outline: none;
  font-family: inherit;
  background: var(--color-bg, #ffffff);
  color: var(--color-text, #1f2937);
}

[data-theme="dark"] .custom-textarea {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.custom-textarea:focus {
  border-color: var(--color-primary, #3b82f6);
}

.custom-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
}

.custom-save-btn,
.custom-cancel-btn {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.6875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.custom-save-btn {
  background: var(--color-primary, #3b82f6);
  color: white;
  border: none;
}

.custom-save-btn:hover { opacity: 0.9; }

.custom-cancel-btn {
  background: transparent;
  color: var(--color-text-muted, #6b7280);
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
}

.custom-cancel-btn:hover {
  background: var(--color-surface, #f3f4f6);
}

/* 扩展信息区 */
.word-popup-extend {
  border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
  padding-top: 8px;
  margin-top: 4px;
}

/* 扩展信息加载骨架屏 */
.extend-loading {
  padding: 8px 0;
}

.extend-skeleton {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.extend-skeleton:last-child {
  margin-bottom: 0;
}

.skeleton-label {
  width: 28px;
  height: 12px;
  background: linear-gradient(90deg, var(--color-surface, #f3f4f6) 25%, var(--color-border, #e5e7eb) 50%, var(--color-surface, #f3f4f6) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 3px;
  flex-shrink: 0;
}

.skeleton-tags {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.skeleton-tag {
  height: 18px;
  width: 60px;
  background: linear-gradient(90deg, var(--color-surface, #f3f4f6) 25%, var(--color-border, #e5e7eb) 50%, var(--color-surface, #f3f4f6) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 10px;
}

.skeleton-tag:nth-child(2) {
  width: 70px;
  animation-delay: 0.1s;
}

.skeleton-tag:nth-child(3) {
  width: 55px;
  animation-delay: 0.2s;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* 扩展内容淡入动画 */
.extend-section.fade-in {
  animation: extendFadeIn 0.3s ease-out;
}

@keyframes extendFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-theme="dark"] .word-popup-extend {
  border-top-color: rgba(255, 255, 255, 0.04);
}

.extend-section {
  margin-bottom: 6px;
}

.extend-section:last-child {
  margin-bottom: 0;
}

.extend-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.extend-label {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text-muted, #9ca3af);
  width: 28px;
  padding-top: 3px;
}

/* 标签容器 */
.extend-tags {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: flex-start;
}

/* 可折叠行 */
.foldable-row {
  cursor: pointer;
}

.foldable-row .extend-tags {
  /* 默认只显示一行 */
  max-height: 26px;
  overflow: hidden;
  transition: max-height 0.2s ease;
}

.foldable-row.expanded .extend-tags {
  max-height: 200px;
}

.foldable-arrow {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--color-text-muted, #9ca3af);
  transition: transform 0.2s ease;
  align-self: center;
  margin-top: 3px;
}

.foldable-row.expanded .foldable-arrow {
  transform: rotate(180deg);
}

/* 变形标签 - 包含单词和形式 */
.variant-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--color-surface, #f3f4f6);
  border-radius: 10px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-theme="dark"] .variant-tag {
  background: rgba(255, 255, 255, 0.06);
}

.variant-tag:hover {
  background: var(--color-primary, #3b82f6);
  color: white;
}

.variant-word {
  color: var(--color-primary, #3b82f6);
  font-weight: 500;
}

.variant-tag:hover .variant-word {
  color: white;
}

.variant-form {
  color: var(--color-text-muted, #9ca3af);
  font-size: 0.625rem;
}

.variant-tag:hover .variant-form {
  color: rgba(255, 255, 255, 0.8);
}

/* 派生词标签 */
.derived-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--color-surface, #f3f4f6);
  border-radius: 10px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-theme="dark"] .derived-tag {
  background: rgba(255, 255, 255, 0.06);
}

.derived-tag:hover {
  background: var(--color-primary, #3b82f6);
  color: white;
}

.derived-word {
  color: var(--color-primary, #3b82f6);
  font-weight: 500;
}

.derived-tag:hover .derived-word {
  color: white;
}

.derived-pos {
  color: var(--color-text-muted, #9ca3af);
  font-size: 0.5625rem;
}

.derived-tag:hover .derived-pos {
  color: rgba(255, 255, 255, 0.8);
}

/* "还有更多"提示标签 */
.more-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  background: transparent;
  border: 1px dashed var(--color-border, rgba(0, 0, 0, 0.1));
  border-radius: 10px;
  font-size: 0.6875rem;
  color: var(--color-text-muted, #9ca3af);
  cursor: default;
  white-space: nowrap;
}

[data-theme="dark"] .more-tag {
  border-color: rgba(255, 255, 255, 0.15);
}

/* 使用场景标签 */
.usage-tags {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.usage-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  background: var(--color-surface, #f3f4f6);
  border-radius: 8px;
  font-size: 0.6875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-theme="dark"] .usage-tag {
  background: rgba(255, 255, 255, 0.06);
}

.usage-tag:hover {
  background: var(--color-primary, #3b82f6);
  color: white;
}

.usage-name {
  font-weight: 500;
}

.usage-score {
  font-weight: 600;
  color: var(--color-primary, #3b82f6);
  font-size: 0.625rem;
}

.usage-tag:hover .usage-score {
  color: white;
}

/* 使用场景 tooltip */
.usage-tooltip {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg, #ffffff);
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
  border-radius: 6px;
  padding: 8px 10px;
  min-width: 150px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  z-index: 100;
  font-size: 0.6875rem;
}

[data-theme="dark"] .usage-tooltip {
  background: #2d2d2d;
  border-color: rgba(255, 255, 255, 0.1);
}

.usage-tag:hover .usage-tooltip {
  opacity: 1;
  visibility: visible;
}

.tooltip-title {
  font-weight: 600;
  color: var(--color-text, #1f2937);
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
}

[data-theme="dark"] .tooltip-title {
  color: rgba(255, 255, 255, 0.9);
}

.tooltip-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
  color: var(--color-text-muted, #6b7280);
}

.tooltip-item:last-child {
  margin-bottom: 0;
}

.tooltip-value {
  font-weight: 500;
  color: var(--color-text, #1f2937);
}

[data-theme="dark"] .tooltip-value {
  color: rgba(255, 255, 255, 0.9);
}

/* 可折叠区块（语义网络） */
.foldable-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  cursor: pointer;
  user-select: none;
}

.foldable-header .extend-label {
  width: auto;
  padding-top: 0;
}

.foldable-arrow {
  margin-left: auto;
  color: var(--color-text-muted, #9ca3af);
  transition: transform 0.2s ease;
}

.foldable.expanded .foldable-arrow {
  transform: rotate(180deg);
}

.foldable-content {
  margin-top: 8px;
}

/* 语义网络 - 独立布局，更宽 */
#wp-semantic-section {
  margin-top: 8px;
}

#wp-semantic-section .foldable-content {
  /* 不受左边标签对齐限制 */
  padding-left: 0;
}

#wp-semantic-canvas {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] #wp-semantic-canvas {
  background: rgba(255, 255, 255, 0.02);
}

.semantic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.625rem;
  color: var(--color-text-muted, #9ca3af);
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.legend-dot.synonym { background: #3b82f6; }
.legend-dot.antonym { background: #ef4444; }
.legend-dot.hypernym { background: #10b981; }
.legend-dot.hyponym { background: #f59e0b; }

/* 语义网络画布容器 */
.semantic-canvas-container {
  position: relative;
  width: 100%;
  min-height: 180px;
  height: auto;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
  cursor: grab;
}

.semantic-canvas-container:active {
  cursor: grabbing;
}

[data-theme="dark"] .semantic-canvas-container {
  background: rgba(255, 255, 255, 0.02);
}

#wp-semantic-canvas {
  display: block;
  cursor: grab;
}

.semantic-hint {
  text-align: center;
  font-size: 0.5625rem;
  color: var(--color-text-muted, #9ca3af);
  margin-top: 6px;
}

/* 语义网络图例 */
.semantic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  justify-content: center;
}

.semantic-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  color: var(--color-text-muted, #9ca3af);
}

.semantic-legend .legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* 语义网络展开按钮 */
.semantic-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  margin-top: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  color: var(--color-primary, #6366f1);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.semantic-expand-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.semantic-expand-btn svg {
  flex-shrink: 0;
}

[data-theme="dark"] .semantic-expand-btn {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border-color: rgba(99, 102, 241, 0.3);
}

/* 底部 */
.word-popup-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
}

[data-theme="dark"] .word-popup-bottom {
  border-top-color: rgba(255, 255, 255, 0.06);
}

/* 版本信息徽章 */
.version-info-badge {
  display: flex;
  align-items: center;
  position: relative;
  font-size: 0.6875rem;
  color: var(--color-text-muted, #9ca3af);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}

.version-info-badge:hover {
  background: var(--color-bg-tertiary, rgba(0, 0, 0, 0.05));
}

.version-badge-label {
  font-weight: 500;
  color: var(--color-text-muted, #9ca3af);
}

.version-badge-tooltip {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 6px;
  background: var(--color-bg, #ffffff);
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 6px 10px;
  display: none;
  z-index: 100;
  font-size: 0.625rem;
  white-space: nowrap;
}

.version-badge-tooltip.show {
  display: block;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  line-height: 1.4;
}

.tooltip-row + .tooltip-row {
  margin-top: 3px;
}

.tooltip-label {
  color: var(--color-text-muted, #9ca3af);
  flex-shrink: 0;
}

.tooltip-value {
  color: var(--color-text, #374151);
}

[data-theme="dark"] .version-badge-tooltip {
  background: #2d2d2d;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .tooltip-value {
  color: #e5e7eb;
}

.correction-link {
  font-size: 0.6875rem;
  color: var(--color-text-muted, #9ca3af);
  cursor: pointer;
}

.correction-link:hover {
  color: var(--color-primary, #3b82f6);
}

/* 显示/隐藏状态 */
.word-popup.hidden {
  display: none !important;
}

.word-popup.visible {
  display: flex;
}

/* 移动端适配 - 底部滑出样式 */
@media (max-width: 768px) {
  .word-popup {
    position: fixed !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 80vh !important;
    border: none !important;
    border-radius: 16px 16px 0 0 !important;
    transform: translateY(100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  }

  .word-popup.visible {
    transform: translateY(0) !important;
  }

  /* 底部滑出拖拽手柄 */
  .word-popup-handle {
    display: flex;
    justify-content: center;
    padding: 10px 0 0;
    flex-shrink: 0;
    cursor: grab;
    touch-action: none; /* 防止默认滚动行为 */
  }

  .word-popup-handle:active {
    cursor: grabbing;
  }

  .word-popup-handle::before {
    content: '';
    display: block;
    width: 44px;
    height: 5px;
    background: var(--color-border, rgba(0, 0, 0, 0.1));
    border-radius: 3px;
    opacity: 0.6;
    transition: opacity 0.2s, background-color 0.2s;
  }

  .word-popup-handle:active::before {
    opacity: 1;
    background: var(--color-border, rgba(0, 0, 0, 0.2));
  }

  /* 收起状态 - 只显示手柄（加大高度避开 iPhone 底部横杠）*/
  .word-popup.collapsed {
    transform: translateY(calc(100% - 56px)) !important;
    pointer-events: none;
  }

  /* 收起状态下，手柄区域恢复 pointer-events 以响应点击 */
  .word-popup.collapsed .word-popup-handle {
    pointer-events: auto;
  }

  /* 收起状态下手柄区域撑满，贴紧底部 */
  .word-popup.collapsed .word-popup-handle {
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
    min-height: 56px;
  }

  /* 拖拽手柄时的样式 */
  .word-popup.handle-dragging {
    transition: none !important;
  }

  .word-popup.handle-dragging .word-popup-handle::before {
    opacity: 1;
    background: var(--color-border, rgba(0, 0, 0, 0.2));
  }

  .word-popup-head {
    padding: 8px 16px 10px;
  }

  .word-popup-content {
    max-height: calc(80vh - 140px);
    padding: 10px 16px;
    padding-bottom: 10px;
  }

  /* 底部纠错区域 - 需要足够的 padding 适配 safe-area */
  .word-popup-bottom {
    padding: 8px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 20px));
    flex-shrink: 0;
  }

  /* 语义网络容器 - 自适应宽度 */
  #wp-semantic-container {
    width: 100% !important;
    min-height: 180px;
  }

  #wp-semantic-canvas {
    width: 100% !important;
    height: 100% !important;
  }
}

/* 桌面端隐藏拖拽手柄 */
@media (min-width: 769px) {
  .word-popup-handle {
    display: none;
  }

  /* PC端折叠状态 - 主面板隐藏，由JS控制 */
  .word-popup.collapsed .word-popup-handle {
    display: none;
  }

  .word-popup.collapsed .word-popup-main {
    display: none;
  }

  .word-popup.collapsed .correction-toolbar {
    display: none !important;
  }

  .word-popup.collapsed::after {
    display: none;
  }
}

/* PC端最小化迷你窗口 */
.minimized-bar {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 11000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--color-bg, #ffffff);
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.12));
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 220px;
  animation: minimized-bar-in 0.2s ease-out;
}

@keyframes minimized-bar-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

[data-theme="dark"] .minimized-bar {
  background: var(--color-bg, #2a2a2a);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.minimized-bar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  color: var(--color-text, #1f2937);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
}

[data-theme="dark"] .minimized-bar-title {
  color: rgba(255, 255, 255, 0.9);
}

.minimized-bar-icon {
  flex-shrink: 0;
  color: var(--color-text-muted, #6b7280);
}

[data-theme="dark"] .minimized-bar-icon {
  color: rgba(255, 255, 255, 0.5);
}

.minimized-bar-title span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.minimized-bar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.minimized-bar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-text-muted, #6b7280);
  transition: all 0.15s ease;
}

.minimized-bar-btn:hover {
  background: var(--color-surface, #f3f4f6);
  color: var(--color-text, #1f2937);
}

[data-theme="dark"] .minimized-bar-btn {
  color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .minimized-bar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 768px) {
  .minimized-bar {
    display: none !important;
  }
}

/* 移动端折叠状态优化 */
@media (max-width: 768px) {
  .word-popup.collapsed {
    cursor: pointer;
  }

  .word-popup.collapsed .word-popup-main {
    display: none;
  }

  .word-popup.collapsed .correction-toolbar {
    display: none !important;
  }
}

/* 小屏幕移动端适配 */
@media (max-width: 400px) {
  .word-popup {
    max-height: 85vh !important;
  }

  .word-popup-head {
    padding: 8px 12px 8px;
  }

  .word-popup-word {
    font-size: 1.25rem;
  }

  .word-popup-content {
    padding: 8px 12px;
  }
}

/* 导航加载状态 */
.word-popup-word.loading {
  opacity: 0.7;
}

.nav-loading-text {
  color: var(--color-text-muted, #9ca3af);
  font-style: italic;
}

.nav-loading-placeholder {
  color: var(--color-text-muted, #9ca3af);
  padding: 20px;
  text-align: center;
  font-size: 0.875rem;
}


/* 面板骨架屏加载动画 */
.panel-skeleton {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg, #ffffff);
  border-radius: 16px;
  z-index: 10;
  padding: 14px;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .panel-skeleton {
  background: var(--color-bg, #1f1f1f);
}

.panel-skeleton-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
  margin-bottom: 10px;
}

[data-theme="dark"] .panel-skeleton-header {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.skeleton-word {
  width: 80px;
  height: 28px;
  background: linear-gradient(90deg, var(--color-surface, #f3f4f6) 25%, var(--color-border, #e5e7eb) 50%, var(--color-surface, #f3f4f6) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 6px;
}

.skeleton-actions {
  display: flex;
  gap: 2px;
}

.skeleton-btn {
  width: 28px;
  height: 28px;
  background: linear-gradient(90deg, var(--color-surface, #f3f4f6) 25%, var(--color-border, #e5e7eb) 50%, var(--color-surface, #f3f4f6) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 6px;
}

.skeleton-btn:nth-child(2) {
  animation-delay: 0.1s;
}

.skeleton-btn:nth-child(3) {
  animation-delay: 0.2s;
}

.panel-skeleton-content {
  flex: 1;
  overflow: hidden;
}

.skeleton-pronunciation {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.skeleton-ipa {
  width: 60px;
  height: 16px;
  background: linear-gradient(90deg, var(--color-surface, #f3f4f6) 25%, var(--color-border, #e5e7eb) 50%, var(--color-surface, #f3f4f6) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-divider {
  width: 1px;
  height: 16px;
  background: var(--color-border, #e5e7eb);
}

.skeleton-definitions {
  margin-bottom: 12px;
}

.skeleton-def-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.skeleton-pos {
  width: 32px;
  height: 14px;
  background: linear-gradient(90deg, var(--color-surface, #f3f4f6) 25%, var(--color-border, #e5e7eb) 50%, var(--color-surface, #f3f4f6) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 3px;
  flex-shrink: 0;
}

.skeleton-pos-short {
  width: 24px;
}

.skeleton-def-text {
  flex: 1;
  height: 14px;
  background: linear-gradient(90deg, var(--color-surface, #f3f4f6) 25%, var(--color-border, #e5e7eb) 50%, var(--color-surface, #f3f4f6) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 3px;
}

.skeleton-def-long {
  width: 80%;
}

.skeleton-extend {
  border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
  padding-top: 8px;
}

[data-theme="dark"] .skeleton-extend {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.skeleton-extend-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.skeleton-label {
  width: 28px;
  height: 12px;
  background: linear-gradient(90deg, var(--color-surface, #f3f4f6) 25%, var(--color-border, #e5e7eb) 50%, var(--color-surface, #f3f4f6) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 3px;
  flex-shrink: 0;
}

.skeleton-tags {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.skeleton-tag {
  height: 18px;
  width: 60px;
  background: linear-gradient(90deg, var(--color-surface, #f3f4f6) 25%, var(--color-border, #e5e7eb) 50%, var(--color-surface, #f3f4f6) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 10px;
}

.skeleton-tag:nth-child(2) {
  width: 70px;
  animation-delay: 0.1s;
}

.skeleton-tag:nth-child(3) {
  width: 55px;
  animation-delay: 0.2s;
}

/* 骨架屏显示/隐藏动画 */
.panel-skeleton.visible {
  display: flex;
  animation: skeletonFadeIn 0.2s ease-out;
}

.panel-skeleton.hidden {
  display: none;
}

@keyframes skeletonFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 主内容区域过渡 */
.word-popup-main {
  transition: opacity 0.2s ease;
}

.word-popup-main.loading {
  opacity: 0;
  pointer-events: none;
}

/* ========== 纠错模式样式 ========== */

/* 纠错模式下禁用其他交互 */
.word-popup.correction-mode {
  /* 禁止拖动 */
  cursor: default !important;
}

.word-popup.correction-mode .word-popup-head {
  pointer-events: none;
}

.word-popup.correction-mode .word-popup-head .popup-btn,
.word-popup.correction-mode .word-popup-head .favorite-btn,
.word-popup.correction-mode .word-popup-head .close-btn {
  pointer-events: none;
  opacity: 0.5;
}

/* 禁用内容区域的交互 */
.word-popup.correction-mode .word-popup-content {
  pointer-events: none;
  user-select: none;
}

/* 禁用底部导航和收藏按钮 */
.word-popup.correction-mode .word-popup-bottom {
  pointer-events: none;
}

/* 纠错蒙版 - 覆盖在目标区域上（添加到body，所以单独设置）*/
.correction-overlay {
  position: fixed;
  z-index: 11002;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.15);
  border: 2px dashed rgba(59, 130, 246, 0.6);
  box-sizing: border-box;
  transition: all 0.2s ease;
}

[data-theme="dark"] .correction-overlay {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.7);
}

.correction-overlay:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.9);
  transform: scale(1.02);
}

[data-theme="dark"] .correction-overlay:hover {
  background: rgba(59, 130, 246, 0.3);
}

.correction-overlay-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: rgba(59, 130, 246, 0.95);
  color: white;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  white-space: nowrap;
}

.correction-overlay-hint svg {
  flex-shrink: 0;
}

/* 纠错模式底部操作栏 */
.correction-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--color-surface, #f3f4f6);
  border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
  flex-shrink: 0;
}

[data-theme="dark"] .correction-toolbar {
  background: rgba(255, 255, 255, 0.04);
  border-top-color: rgba(255, 255, 255, 0.06);
}

.correction-toolbar-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted, #6b7280);
}

.correction-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.correction-toolbar-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.correction-toolbar-btn.correction-cancel {
  background: transparent;
  color: var(--color-text-muted, #6b7280);
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
}

.correction-toolbar-btn.correction-cancel:hover {
  background: var(--color-surface, #f3f4f6);
}

.correction-toolbar-btn.correction-done {
  background: var(--color-primary, #3b82f6);
  color: white;
  border: none;
}

.correction-toolbar-btn.correction-done:hover {
  opacity: 0.9;
}

/* 纠错对话框 */
.correction-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11003;
  pointer-events: auto;
}

[data-theme="dark"] .correction-dialog {
  background: rgba(0, 0, 0, 0.6);
}

.correction-dialog-content {
  background: var(--color-bg, #ffffff);
  border-radius: 12px;
  width: 90%;
  max-width: 340px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
}

[data-theme="dark"] .correction-dialog-content {
  background: #2d2d2d;
}

.correction-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
}

[data-theme="dark"] .correction-dialog-header {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.correction-dialog-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text, #1f2937);
  margin: 0;
}

[data-theme="dark"] .correction-dialog-title {
  color: rgba(255, 255, 255, 0.9);
}

.correction-dialog-title span {
  color: var(--color-primary, #3b82f6);
}

.correction-dialog-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
  border-radius: 6px;
}

.correction-dialog-close:hover {
  background: var(--color-surface, #f3f4f6);
  color: var(--color-text, #1f2937);
}

[data-theme="dark"] .correction-dialog-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.correction-dialog-body {
  padding: 16px;
}

.correction-field {
  margin-bottom: 12px;
}

.correction-field-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted, #6b7280);
  margin-bottom: 6px;
}

.correction-field-content {
  font-size: 0.8125rem;
  color: var(--color-text, #1f2937);
  padding: 10px 12px;
  background: var(--color-surface, #f8fafc);
  border-radius: 8px;
  line-height: 1.5;
  max-height: 300px;
  overflow-y: auto;
}

[data-theme="dark"] .correction-field-content {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
}

.correction-input-group {
  margin-top: 12px;
}

.correction-input-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted, #6b7280);
  margin-bottom: 6px;
}

.correction-input {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
  border-radius: 8px;
  font-size: 0.8125rem;
  resize: vertical;
  outline: none;
  font-family: inherit;
  background: var(--color-bg, #ffffff);
  color: var(--color-text, #1f2937);
  box-sizing: border-box;
}

[data-theme="dark"] .correction-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.correction-input:focus {
  border-color: var(--color-primary, #3b82f6);
}

.correction-input::placeholder {
  color: var(--color-text-muted, #9ca3af);
}

.correction-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
}

[data-theme="dark"] .correction-dialog-footer {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.correction-dialog-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.correction-dialog-btn.correction-dialog-cancel {
  background: transparent;
  color: var(--color-text-muted, #6b7280);
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
}

.correction-dialog-btn.correction-dialog-cancel:hover {
  background: var(--color-surface, #f3f4f6);
}

.correction-dialog-btn.correction-dialog-submit {
  background: var(--color-primary, #3b82f6);
  color: white;
  border: none;
}

.correction-dialog-btn.correction-dialog-submit:hover {
  opacity: 0.9;
}

/* 收藏来源区域样式 */
.word-popup-source {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
}

[data-theme="dark"] .word-popup-source {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.wp-source-header {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
  margin-bottom: 8px;
  text-align: left;
}

.wp-source-content {
  background-color: var(--color-surface, #f3f4f6);
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
  position: relative;
}

[data-theme="dark"] .wp-source-content {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.wp-source-sentence {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text, #1f2937);
  margin-bottom: 6px;
}

.wp-source-sentence .wp-highlighted-word {
  color: var(--color-primary, #3b82f6);
  background-color: rgba(59, 130, 246, 0.1);
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
}

.wp-source-translation {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text-secondary, #6b7280);
  font-style: italic;
}

.wp-source-link-wrapper {
  text-align: right;
  margin-top: 10px;
}

.wp-source-link {
  display: inline-block;
  color: var(--color-primary, #3b82f6);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  background-color: rgba(59, 130, 246, 0.08);
  transition: all 0.2s ease;
}

.wp-source-link:hover {
  background-color: rgba(59, 130, 246, 0.18);
  color: var(--color-primary, #2563eb);
}

.wp-source-link:active {
  transform: translateY(1px);
}

/* 移动端纠错对话框适配 */
@media (max-width: 768px) {
  .correction-dialog-content {
    width: 95%;
    max-width: none;
    margin: 0 10px;
  }
}
