/* ========== AI 导读 / 思维导图 公共样式 ========== */
/* ---------- AI 摘要悬浮卡片 ---------- */
.ai-summary-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  width: 380px;
  max-height: 70vh;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(1, 82, 147, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: ai-fade-in 0.25s ease-out;
}
@keyframes ai-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ai-summary-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  z-index: 2;
}
.ai-summary-close:hover {
  opacity: 0.8;
}
.ai-summary-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.ai-summary-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 40px 14px 16px;
  background: linear-gradient(135deg, #015293 0%, #2882fe 100%);
  color: #fff;
}
.ai-summary-header p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}
.ai-summary-logo {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  flex: 0 0 22px;
  position: relative;
}
.ai-summary-logo::before {
  content: "AI";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  color: #015293;
}
.ai-summary-content {
  flex: 1;
  min-height: 0;
  padding: 12px 16px 16px;
  overflow-y: auto;
  font-size: 14px;
  color: #333;
  line-height: 1.7;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgba(1, 82, 147, 0.25) transparent;
}
/* WebKit (Chrome / Safari / Edge) */
.ai-summary-content::-webkit-scrollbar {
  width: 6px;
}
.ai-summary-content::-webkit-scrollbar-track {
  background: transparent;
}
.ai-summary-content::-webkit-scrollbar-thumb {
  background: rgba(1, 82, 147, 0.2);
  border-radius: 3px;
}
.ai-summary-content::-webkit-scrollbar-thumb:hover {
  background: rgba(1, 82, 147, 0.4);
}
.ai-summary-content::-webkit-scrollbar-corner {
  background: transparent;
}
.ai-summary-tips {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 12px;
  color: #999;
}
.ai-summary-tips .ai-summary-logo {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: #f0f4fa;
}
.ai-summary-tips .ai-summary-logo::before {
  font-size: 9px;
}
.ai-summary-loading {
  padding: 8px 0;
  font-size: 13px;
  color: #999;
}
.ai-summary-loading::after {
  content: "";
  display: inline-block;
  margin-left: 4px;
  animation: ai-dot 1.2s steps(4, end) infinite;
}
@keyframes ai-dot {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
  100% {
    content: "";
  }
}
.ai-summary-section {
  padding: 6px 0;
}
.ai-summary-section + .ai-summary-section {
  border-top: 1px dashed #e8e8e8;
  margin-top: 6px;
}
.ai-summary-section p {
  margin: 4px 0;
}
.ai-summary-section ul,
.ai-summary-section ol {
  padding-left: 22px;
  margin: 4px 0;
}
.ai-summary-section strong {
  color: #015293;
}
.ai-summary-typing {
  opacity: 0;
  transition: opacity 0.18s ease-out;
}
.ai-summary-typing.show {
  opacity: 1;
}
/* ---------- 思维导图 ---------- */
.map-container {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  background: #fff;
}
.map-container.is-open {
  display: flex;
}
.map-toolbar {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #e8e8e8;
  background: #fafbfc;
}
.map-btn {
  height: 30px;
  padding: 0 14px;
  font-size: 14px;
  color: #015293;
  background: #fff;
  border: 1px solid #015293;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.map-btn:hover {
  background: #015293;
  color: #fff;
}
#mark-map {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  touch-action: none;
  /* 交由 d3-zoom 处理触屏手势 */
}
#mark-map svg {
  width: 100%;
  height: 100%;
}
/* ---------- 思维导图弹窗（layui skin: ai-mindmap-layer） ---------- */
.layui-layer-ai-mindmap-layer .layui-layer-content {
  height: calc(100% - 42px) !important;
  padding: 0 !important;
  overflow: hidden !important;
}
.layui-layer-ai-mindmap-layer .map-container {
  height: 100%;
}
/* ========== H5 适配 (≤ 750px) ========== */
@media screen and (max-width: 750px) {
  .ai-summary-container {
    right: 0;
    left: 0;
    bottom: 0;
    width: auto;
    max-height: 70vh;
    border-radius: 12px 12px 0 0;
  }
  .ai-summary-close {
    width: 36px;
    height: 36px;
    font-size: 26px;
  }
  .ai-summary-header {
    padding: 12px 44px 12px 14px;
  }
  .ai-summary-content {
    padding: 10px 14px 14px;
    font-size: 15px;
  }
  .map-toolbar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
  }
  .map-btn {
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 4px;
  }
}
