/* AI News 知识卡片浮层 — 精简版
 * 复用 ai-dictionary.json，运行时注入术语标注 + 轻量浮层
 * 只显示 definition_short + why_it_matters，不打断新闻阅读节奏
 */

/* === 术语触发词样式 === */
.term-trigger {
  border-bottom: 1px dashed var(--klein, #002FA7);
  cursor: pointer;
  transition: background 0.15s ease;
  padding-bottom: 1px;
}

.term-trigger:hover {
  background: rgba(0, 47, 167, 0.06);
}

.term-trigger.term-active {
  background: rgba(0, 47, 167, 0.1);
  border-bottom-style: solid;
}

/* === 浮层容器 === */
.glossary-popover {
  position: fixed;
  z-index: 9999;
  max-width: 340px;
  min-width: 280px;
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-top: 3px solid var(--klein, #002FA7);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 18px 20px 16px;
  font-family: 'Noto Sans SC', 'Inter', -apple-system, sans-serif;
  color: #1A1A1A;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.glossary-popover.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* === 浮层内容 === */
.gloss-popover-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #F0F0F0;
}

.gloss-popover-term {
  font-size: 16px;
  font-weight: 700;
  color: var(--klein, #002FA7);
  line-height: 1.3;
}

.gloss-popover-term-zh {
  font-size: 13px;
  color: #6B6B6B;
  margin-left: 6px;
  font-weight: 400;
}

.gloss-popover-cat {
  font-size: 10px;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Inter', sans-serif;
}

.gloss-popover-def {
  font-size: 14px;
  line-height: 1.65;
  color: #1A1A1A;
  margin-bottom: 10px;
}

.gloss-popover-why {
  font-size: 13px;
  line-height: 1.6;
  color: #4A4A4A;
  padding-left: 10px;
  border-left: 2px solid var(--klein, #002FA7);
  margin-bottom: 12px;
  font-style: italic;
}

.gloss-popover-why-label {
  display: block;
  font-size: 10px;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-style: normal;
  font-family: 'Inter', sans-serif;
}

.gloss-popover-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid #F0F0F0;
}

.gloss-popover-related {
  font-size: 11px;
  color: #9CA3AF;
}

.gloss-popover-related strong {
  color: #6B6B6B;
  font-weight: 500;
}

.gloss-popover-close {
  font-size: 11px;
  color: var(--klein, #002FA7);
  cursor: pointer;
  font-weight: 500;
  background: none;
  border: none;
  padding: 2px 6px;
  border-radius: 3px;
}

.gloss-popover-close:hover {
  background: rgba(0, 47, 167, 0.06);
}

/* 空状态 */
.gloss-popover-empty {
  font-size: 13px;
  color: #9CA3AF;
  text-align: center;
  padding: 12px 0;
}

/* 移动端适配 */
@media (max-width: 640px) {
  .glossary-popover {
    max-width: calc(100vw - 32px);
    min-width: 240px;
    left: 16px !important;
    right: 16px;
  }
}
