/* ====== 英文词典页面样式 - 薄荷绿马卡龙配色 ====== */

/* 主容器 */
.dictionary-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: auto;
  background: linear-gradient(135deg, #F0FFF4 0%, #E6FFFA 50%, #EBF8FF 100%);
}

/* 顶部工具栏 */
.dict-top-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 32px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(128, 237, 153, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dict-search-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.dict-search-box i {
  position: absolute;
  left: 16px;
  color: #68D391;
  font-size: 1rem;
}

.dict-search-box input {
  width: 100%;
  padding: 12px 44px 12px 44px;
  border: 1px solid #C6F6D5;
  border-radius: 12px;
  font-size: 1.0625rem;
  outline: none;
  transition: all 0.2s;
  background: white;
}

.dict-search-box input:focus {
  border-color: #48BB78;
  box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.15);
}

.dict-filter-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.dict-filter-select {
  padding: 10px 16px;
  background: white;
  border: 1px solid #C6F6D5;
  border-radius: 10px;
  font-size: 1rem;
  color: #4A5568;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.dict-filter-select:focus {
  border-color: #48BB78;
  box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.15);
}

.dict-filter-btn {
  padding: 10px 16px;
  background: white;
  border: 1px solid #C6F6D5;
  border-radius: 10px;
  font-size: 1rem;
  color: #4A5568;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dict-filter-btn:hover {
  background: #F0FFF4;
  border-color: #9AE6B4;
}

.dict-filter-btn i {
  color: #F59E0B;
}

/* 主内容区 */
.dict-main-content {
  display: flex;
  flex: 1;
  overflow: auto;
  gap: 0;
}

/* 左侧术语列表 */
.dict-sidebar {
  width: 340px;
  min-width: 340px;
  background: white;
  border-right: 1px solid #C6F6D5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dict-tabs {
  display: flex;
  flex-wrap: nowrap;
  padding: 14px 16px;
  gap: 8px;
  border-bottom: 1px solid #C6F6D5;
  background: #F7FAFC;
  overflow-x: auto;
}

.dict-tab {
  flex: 1 1 auto;
  min-width: max-content;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 1.0625rem;
  color: #718096;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.dict-tab:hover {
  background: #E6FFFA;
}

.dict-tab.active {
  background: linear-gradient(135deg, #F0FFF4, #E6FFFA);
  color: #38A169;
  font-weight: 600;
}

.dict-count {
  padding: 2px 6px;
  background: rgba(56, 161, 105, 0.15);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
}

.dict-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.dict-item {
  padding: 16px;
  margin-bottom: 8px;
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.dict-item:hover {
  border-color: #9AE6B4;
  box-shadow: 0 2px 8px rgba(72, 187, 120, 0.1);
  transform: translateY(-1px);
}

.dict-item.active {
  border-color: #48BB78;
  background: linear-gradient(135deg, #F0FFF4, #E6FFFA);
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.2);
}

.dict-item-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.dict-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #CBD5E0;
  margin-top: 8px;
  flex-shrink: 0;
}

.dict-item.active .dict-item-dot {
  background: #48BB78;
}

.dict-item h4 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #2D3748;
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.dict-item-chinese {
  font-size: 1.0625rem;
  color: #718096;
  margin: 0 0 12px 16px;
}

.dict-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 16px;
}

.dict-tag {
  padding: 3px 8px;
  background: linear-gradient(135deg, #C6F6D5, #B2F5EA);
  color: #276749;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
}

.dict-item-fav {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #CBD5E0;
  cursor: pointer;
  padding: 4px;
  transition: all 0.2s;
}

.dict-item-fav:hover {
  color: #F59E0B;
}

.dict-item-fav.active {
  color: #F59E0B;
}

.dict-empty-list {
  text-align: center;
  padding: 40px;
  color: #A0AEC0;
}

.dict-footer {
  padding: 16px;
  text-align: center;
  font-size: 1.0625rem;
  color: #718096;
  border-top: 1px solid #C6F6D5;
  background: #F7FAFC;
}

/* 中间详情区 */
.dict-detail {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  background: white;
}

.dict-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #CBD5E0;
}

.dict-empty-state i {
  font-size: 4rem;
  margin-bottom: 16px;
  color: #9AE6B4;
}

.dict-empty-state p {
  font-size: 1rem;
  color: #A0AEC0;
}

.dict-detail-content {
  max-width: 900px;
  margin: 0 auto;
}

.dict-term-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid #C6F6D5;
}

.dict-term-title {
  font-size: 2rem;
  font-weight: 700;
  color: #2D3748;
  margin: 0;
  background: linear-gradient(135deg, #38A169, #48BB78);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dict-term-actions {
  display: flex;
  gap: 12px;
}

.dict-action-btn {
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
  color: #718096;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dict-action-btn:hover {
  background: #F7FAFC;
  border-color: #CBD5E0;
  color: #48BB78;
}

.dict-detail-section {
  margin-bottom: 28px;
  padding: 24px;
  background: linear-gradient(135deg, #F7FAFC, #F0FFF4);
  border-radius: 16px;
  border: 1px solid #C6F6D5;
}

.dict-detail-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #C6F6D5;
}

.dict-detail-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #2D3748;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dict-detail-header h3::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, #48BB78, #38B2AC);
  border-radius: 2px;
}

.dict-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.dict-info-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dict-info-item.full-width {
  grid-column: 1 / -1;
}

.dict-info-item label {
  font-size: 1.0625rem;
  color: #718096;
  font-weight: 500;
}

.dict-value {
  font-size: 1.0625rem;
  color: #2D3748;
  margin: 0;
  line-height: 1.6;
}

.dict-context-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: #4A5568;
  padding: 16px;
  background: white;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
}

.dict-collocations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dict-collocation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: white;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  font-size: 1rem;
  color: #4A5568;
  transition: all 0.2s;
}

.dict-collocation-item:hover {
  border-color: #9AE6B4;
  background: #F0FFF4;
}

.dict-collocation-item i {
  color: #48BB78;
}

.dict-examples-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dict-example-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: white;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
}

.dict-example-number {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #48BB78, #38B2AC);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  flex-shrink: 0;
}

.dict-example-content {
  flex: 1;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: #4A5568;
}

.dict-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 右侧信息栏 */
.dict-info-panel {
  width: 280px;
  min-width: 280px;
  background: white;
  border-left: 1px solid #C6F6D5;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dict-panel-card {
  background: linear-gradient(135deg, #F7FAFC, #F0FFF4);
  border-radius: 12px;
  border: 1px solid #C6F6D5;
  overflow: hidden;
}

.dict-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: white;
  border-bottom: 1px solid #C6F6D5;
}

.dict-panel-header h4 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #2D3748;
  margin: 0;
}

.dict-panel-body {
  padding: 16px;
}

.dict-recent-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.dict-recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.dict-recent-item:hover {
  background: #F0FFF4;
}

.dict-recent-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #CBD5E0;
  flex-shrink: 0;
}

.dict-recent-info {
  flex: 1;
  min-width: 0;
}

.dict-recent-title {
  font-size: 1.0625rem;
  color: #2D3748;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dict-recent-time {
  font-size: 1rem;
  color: #A0AEC0;
}

.dict-view-all-btn {
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  color: #48BB78;
  font-size: 1.0625rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dict-view-all-btn:hover {
  background: #F0FFF4;
  border-radius: 8px;
}

/* 统计信息 */
.dict-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.dict-stat-item {
  text-align: center;
  padding: 16px;
  background: white;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
}

.dict-stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: #48BB78;
  margin-bottom: 4px;
}

.dict-stat-label {
  font-size: 0.9375rem;
  color: #718096;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .dict-main-content {
    flex-direction: column;
  }
  
  .dict-sidebar {
    width: 100%;
    min-width: 100%;
    max-height: 400px;
    border-right: none;
    border-bottom: 1px solid #C6F6D5;
  }
  
  .dict-info-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid #C6F6D5;
  }
  
  .dict-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dict-top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 16px;
  }
  
  .dict-filter-group {
    flex-wrap: wrap;
  }
  
  .dict-detail {
    padding: 16px;
  }
  
  .dict-detail-section {
    padding: 16px;
  }
  
  .dict-term-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .dict-term-title {
    font-size: 1.5rem;
  }
}

/* ====== 划词翻译 & 在线查询 ====== */

.dict-hint-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 32px 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #C6F6D5;
  border-radius: 10px;
  font-size: 0.875rem;
  color: #2F855A;
}

.dict-hint-bar i {
  color: #48BB78;
}

.dict-online-panel {
  margin: 0 32px 16px;
}

.dict-online-card {
  background: #fff;
  border: 1px solid #BEE3F8;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(49, 130, 206, 0.1);
}

.dict-online-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(90deg, #EBF8FF, #E6FFFA);
  border-bottom: 1px solid #BEE3F8;
}

.dict-online-header h4 {
  margin: 0;
  font-size: 0.9375rem;
  color: #2B6CB0;
}

.dict-online-word {
  font-weight: 700;
  color: #2C5282;
}

.dict-online-body {
  padding: 14px 16px;
}

.dict-online-loading {
  padding: 16px;
  text-align: center;
  color: #718096;
  font-size: 0.875rem;
}

/* 浮动划词按钮组 */
.dict-lookup-pin-group {
  position: absolute;
  z-index: 9998;
  display: flex;
  gap: 6px;
}

.dict-lookup-pin {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: #5E5168;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(61, 56, 53, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition: transform 0.15s ease, background 0.15s;
}

.dict-lookup-pin:hover {
  transform: scale(1.06);
  background: #4A3F52;
}

.dict-lookup-pin--note {
  background: #9B7EBD;
}

.dict-lookup-pin--note:hover {
  background: #7A6B8A;
}

/* 查词弹窗 */
.dict-lookup-popup {
  position: absolute;
  z-index: 9999;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.dict-lookup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #F8F5F1;
  border-bottom: 1px solid #E8E4DF;
}

.dict-lookup-word {
  font-weight: 700;
  font-size: 1.0625rem;
  color: #3D3835;
}

.lit-note-popup {
  width: 340px;
}

.lit-note-dict-hint {
  margin-bottom: 10px;
  padding: 8px 10px;
  background: #F0EBF3;
  border-radius: 8px;
  font-size: 0.8125rem;
  color: #5E5168;
  line-height: 1.45;
}

.lit-note-popup .lit-note-textarea {
  width: 100%;
  margin-bottom: 10px;
}

.dict-lookup-close {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  color: #718096;
  cursor: pointer;
  padding: 0 4px;
}

.dict-lookup-body {
  padding: 12px 14px;
  max-height: 280px;
  overflow-y: auto;
  font-size: 0.875rem;
}

.dict-lookup-loading {
  text-align: center;
  color: #718096;
  padding: 20px 0;
}

.dict-lookup-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.dict-lookup-badge.local {
  background: #C6F6D5;
  color: #22543D;
}

.dict-lookup-badge.online {
  background: #BEE3F8;
  color: #2B6CB0;
}

.dict-lookup-phonetic {
  color: #718096;
  font-size: 0.8125rem;
  margin-bottom: 6px;
}

.dict-lookup-cn {
  font-size: 1.125rem;
  font-weight: 700;
  color: #2D3748;
  margin-bottom: 8px;
}

.dict-lookup-context {
  color: #4A5568;
  line-height: 1.55;
  margin-bottom: 8px;
}

.dict-lookup-examples {
  color: #718096;
  font-size: 0.8125rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

.dict-lookup-def {
  margin-bottom: 8px;
  line-height: 1.5;
  color: #4A5568;
}

.dict-lookup-pos {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 6px;
  background: #EDF2F7;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #4A5568;
  font-style: italic;
}

.dict-lookup-ex {
  margin-top: 4px;
  font-size: 0.8125rem;
  color: #718096;
  font-style: italic;
}

.dict-lookup-syn {
  font-size: 0.8125rem;
  color: #718096;
  margin-top: 6px;
}

.dict-lookup-api-note {
  font-size: 0.75rem;
  color: #A0AEC0;
  margin-top: 8px;
}

.dict-lookup-empty {
  color: #718096;
  text-align: center;
  margin: 12px 0;
}

.dict-lookup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #EDF2F7;
}

.settings-dict-toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-secondary, #F7FAFC);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-md, 10px);
  cursor: pointer;
}

.settings-toggle-row span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-toggle-row small {
  color: var(--text-muted, #718096);
  font-size: 0.8125rem;
}

.settings-toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #48BB78;
  flex-shrink: 0;
}
