/* 单词详情弹窗样式 */

/* 收藏按钮 */
.word-favorite-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  transition: all 0.2s;
  filter: grayscale(100%);
  opacity: 0.5;
}

.word-favorite-btn:hover {
  transform: scale(1.2);
  opacity: 0.8;
}

.word-favorite-btn.favorited {
  filter: grayscale(0%);
  opacity: 1;
  animation: favoriteAdded 0.3s ease;
}

@keyframes favoriteAdded {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* 音标容器 */
.phonetics-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phonetic-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.phonetic-label {
  font-size: 18px;
}

.phonetic-text {
  font-size: 16px;
  color: #666;
}

.play-phonetic-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.play-phonetic-btn:hover {
  background: #f0f0f0;
  transform: scale(1.1);
}

.play-phonetic-btn:active {
  transform: scale(0.95);
}

/* 同义词样式 */
.synonyms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.synonym-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f0f7ff;
  border-radius: 16px;
  font-size: 14px;
}

.synonym-content {
  color: #1a73e8;
  font-weight: 500;
}

.synonym-trans {
  color: #666;
}

/* 句子解析按钮 */
.analyze-sentence-btn {
  margin-left: 8px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.analyze-sentence-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.analyze-sentence-btn:active {
  transform: translateY(0);
}

/* 句子解析内容样式 */
.sentence-original,
.sentence-translation {
  font-size: 16px;
  line-height: 1.6;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-top: 8px;
}

.sentence-translation {
  color: #1a73e8;
}

.sentence-structure {
  margin-top: 8px;
}

.structure-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  margin-bottom: 4px;
  background: #f8f9fa;
  border-radius: 6px;
}

.structure-text {
  font-weight: 500;
  color: #333;
  min-width: 100px;
}

.structure-role {
  padding: 2px 8px;
  background: #e3f2fd;
  color: #1976d2;
  border-radius: 4px;
  font-size: 12px;
}

.structure-explanation {
  color: #666;
  font-size: 13px;
}

.grammar-list,
.keywords-list {
  margin-top: 8px;
}

.grammar-item,
.keyword-item {
  padding: 10px;
  margin-bottom: 8px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid #1a73e8;
}

.grammar-point,
.keyword-word {
  font-weight: 500;
  color: #1a73e8;
  margin-bottom: 4px;
}

.grammar-explanation,
.keyword-meaning {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

.keyword-usage {
  margin-top: 4px;
  padding: 6px;
  background: #fff;
  border-radius: 4px;
  font-size: 13px;
  color: #666;
}

.tips-list {
  margin-top: 8px;
  padding-left: 20px;
}

.tips-list li {
  margin-bottom: 6px;
  color: #666;
  line-height: 1.5;
}

/* 弹窗容器 */
.word-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.word-modal.show {
  display: flex;
}

/* 遮罩层 */
.word-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

/* 弹窗内容 */
.word-modal-content {
  position: relative;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
  overflow: hidden;
}

/* 弹窗头部 */
.word-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.word-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.word-actions {
  display: flex;
  gap: 8px;
}

.word-play-btn,
.word-close-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.word-play-btn:hover,
.word-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.word-play-btn:active,
.word-close-btn:active {
  transform: scale(0.95);
}

/* 弹窗主体 */
.word-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* 来源标识 */
.word-source {
  margin-bottom: 16px;
}

.source-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.source-local {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.source-api {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

/* 音标 */
.word-phonetics {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.phonetic-item {
  font-size: 16px;
  color: #6b7280;
  font-family: 'Lucida Sans Unicode', 'Arial Unicode MS', sans-serif;
}

/* 章节 */
.word-section {
  margin-bottom: 24px;
}

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

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 记忆技巧 */
.remember-content {
  padding: 12px 16px;
  background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
  border-radius: 8px;
  color: #2d3436;
  font-size: 14px;
  line-height: 1.6;
}

/* 翻译列表 */
.translations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.translation-item {
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid #667eea;
}

.pos-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #667eea;
  color: white;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 8px;
}

.trans-cn {
  font-size: 15px;
  color: #1f2937;
  margin-top: 6px;
  line-height: 1.6;
}

.trans-en {
  font-size: 13px;
  color: #6b7280;
  margin-top: 4px;
  font-style: italic;
  line-height: 1.5;
}

/* 短语列表 */
.phrases-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phrase-item {
  padding: 10px 12px;
  background: #f0fdf4;
  border-radius: 6px;
  border-left: 3px solid #10b981;
}

.phrase-content {
  font-size: 14px;
  font-weight: 600;
  color: #065f46;
  margin-bottom: 4px;
}

.phrase-trans {
  font-size: 13px;
  color: #059669;
}

/* 例句列表 */
.sentences-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sentence-item {
  padding: 12px;
  background: #eff6ff;
  border-radius: 8px;
  border-left: 3px solid #3b82f6;
}

.sentence-en {
  font-size: 14px;
  color: #1e40af;
  line-height: 1.6;
  margin-bottom: 6px;
}

.sentence-cn {
  font-size: 13px;
  color: #60a5fa;
  line-height: 1.5;
}

/* 同义词列表 */
.synonyms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.synonym-item {
  padding: 8px 12px;
  background: #fef3c7;
  border-radius: 6px;
  font-size: 14px;
  color: #92400e;
}

.synonym-content {
  font-weight: 600;
}

.synonym-trans {
  color: #b45309;
}

/* 同根词列表 */
.cognates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cognate-item {
  padding: 8px 12px;
  background: #f5f3ff;
  border-radius: 6px;
  font-size: 14px;
  color: #5b21b6;
}

.cognate-content {
  font-weight: 600;
}

.cognate-trans {
  color: #7c3aed;
}

/* API 数据样式 */
.meanings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.meaning-item {
  padding: 14px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid #f5576c;
}

.definition {
  font-size: 15px;
  color: #1f2937;
  line-height: 1.6;
  margin-top: 8px;
}

.example {
  font-size: 13px;
  color: #6b7280;
  margin-top: 8px;
  padding: 8px 12px;
  background: white;
  border-radius: 6px;
  font-style: italic;
}

.inline-synonyms,
.inline-antonyms {
  font-size: 13px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 4px;
}

.inline-synonyms {
  background: #fef3c7;
  color: #92400e;
}

.inline-antonyms {
  background: #fee2e2;
  color: #991b1b;
}

/* 加载状态 */
.word-loading {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.word-loading .spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border: 4px solid #f3f4f6;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.word-loading p {
  font-size: 16px;
  margin: 0;
  color: #3b82f6;
}

/* 错误提示 */
.word-error {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.word-error svg {
  margin-bottom: 16px;
  color: #ef4444;
}

.word-error p {
  font-size: 16px;
  margin: 0;
}

/* 字幕中的可点击单词 */
.subtitle-word {
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px dashed transparent;
  padding: 0 2px;
}

.subtitle-word:hover {
  color: #667eea;
  border-bottom-color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 2px;
}

/* 动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .word-modal-content {
    width: 95%;
    max-height: 90vh;
    border-radius: 12px;
  }
  
  .word-modal-header {
    padding: 16px 20px;
  }
  
  .word-title {
    font-size: 24px;
  }
  
  .word-modal-body {
    padding: 20px;
  }
  
  .section-title {
    font-size: 15px;
  }
  
  .translation-item,
  .meaning-item {
    padding: 10px;
  }
  
  .trans-cn,
  .definition {
    font-size: 14px;
  }
}

/* 滚动条样式 */
.word-modal-body::-webkit-scrollbar {
  width: 6px;
}

.word-modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.word-modal-body::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 3px;
}

.word-modal-body::-webkit-scrollbar-thumb:hover {
  background: #764ba2;
}
