.vpa-root {
  position: fixed;
  inset: 0;
  z-index: var(--vpa-z-base, 9997);
  pointer-events: none;
}

.vpa-badge,
.vpa-badge-static {
  display: inline-block;
  padding: 0 4px;
  border: 0;
  border-radius: 2px;
  background: rgb(250, 173, 20);
  color: #fff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  line-height: 14px;
  vertical-align: top;
}

.vpa-badge {
  position: fixed;
  left: 0;
  top: 0;
  will-change: transform;
  z-index: calc(var(--vpa-z-base, 9997) + 1);
  pointer-events: auto;
}

.vpa-toolbar {
  position: fixed;
  z-index: calc(var(--vpa-z-base, 9997) + 2);
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgb(15 23 42 / 16%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

.vpa-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.vpa-toolbar button.active {
  background: #172033;
  color: #fff;
}

.vpa-drag {
  width: 24px;
  min-width: 24px !important;
  padding: 0 !important;
  cursor: grab !important;
}

.vpa-popup {
  position: fixed;
  z-index: calc(var(--vpa-z-base, 9997) + 3);
  min-width: 360px;
  min-height: 260px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  overflow: auto;
  border-radius: 4px;
  background: #f0efef;
  box-shadow: 0 18px 54px rgb(15 23 42 / 20%);
  color: #1f2937;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

.vpa-popup-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #d6d3d3;
  user-select: none;
}

.vpa-popup-header strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vpa-popup-header button {
  height: 26px;
  padding: 0 8px;
  border: 1px solid #c8c4c4;
  border-radius: 4px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.vpa-all-popup .vpa-download {
  justify-self: end;
}

.vpa-markdown a {
  color: #075985;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vpa-markdown input[type="checkbox"] {
  margin: 0 5px 0 0;
  vertical-align: middle;
}

.vpa-popup-body {
  padding: 12px;
}

.vpa-markdown {
  color: #2f3743;
  font-size: 13px;
  line-height: 1.6;
}

.vpa-markdown h1 {
  margin: 0 0 16px;
  color: #111827;
  font-size: 20px;
}

.vpa-markdown h2,
.vpa-markdown h3 {
  margin: 14px 0 8px;
  color: #111827;
  font-size: 14px;
}

.vpa-markdown p {
  margin: 0 0 12px;
}

.vpa-markdown ul {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding-left: 20px;
}

.vpa-markdown blockquote {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-left: 3px solid #c7c3c3;
  background: #e8e6e6;
  color: #4b5563;
}

.vpa-markdown code {
  padding: 1px 4px;
  border-radius: 3px;
  background: #e9edf3;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.vpa-markdown pre,
.vpa-mermaid-source,
.vpa-mermaid-error {
  margin: 0 0 12px;
  padding: 10px;
  overflow: auto;
  border: 1px solid #d4d0d0;
  border-radius: 4px;
  background: #fff;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

.vpa-mermaid {
  margin: 0 0 12px;
  overflow: auto;
}

.vpa-mermaid svg {
  max-width: 100%;
}

.vpa-mermaid-error {
  border-color: #fecaca;
  background: #fff5f5;
  color: #991b1b;
}

.vpa-table-wrap {
  margin: 0 0 12px;
  overflow-x: auto;
}

.vpa-table-wrap table {
  width: 100%;
  min-width: 360px;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
}

.vpa-table-wrap th,
.vpa-table-wrap td {
  padding: 7px 9px;
  border: 1px solid #d4d0d0;
  text-align: left;
  vertical-align: top;
}

.vpa-table-wrap th {
  background: #e4e1e1;
  color: #111827;
  font-weight: 800;
}

.vpa-resize {
  position: absolute;
  z-index: 2;
  display: block;
  background: transparent;
}

.vpa-resize-left {
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 8px;
  cursor: ew-resize;
}

.vpa-resize-right {
  top: 12px;
  right: 0;
  bottom: 12px;
  width: 8px;
  cursor: ew-resize;
}

.vpa-resize-bottom {
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 10px;
  cursor: ns-resize;
}

.vpa-resize-bottom-left,
.vpa-resize-bottom-right {
  bottom: 0;
  width: 14px;
  height: 14px;
}

.vpa-resize-bottom-left {
  left: 0;
  cursor: nesw-resize;
}

.vpa-resize-bottom-right {
  right: 0;
  cursor: nwse-resize;
}

.vpa-toast {
  position: fixed;
  left: 50%;
  bottom: 76px;
  z-index: calc(var(--vpa-z-base, 9997) + 4);
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 8px;
  opacity: 0;
  background: #172033;
  color: #fff;
  box-shadow: 0 12px 28px rgb(15 23 42 / 18%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 750;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.vpa-toast.show {
  opacity: 1;
}

.vpa-panel-toggle.is-active {
  border-color: #63b894;
  background: #f2fbf6;
  color: #13724d;
  box-shadow: 0 10px 26px rgb(15 118 82 / 16%);
}

/* 点角标后的区块聚焦框：清晰红框 + 轻微底色，2.5 秒后自动消失 */
.vpa-target-highlight {
  outline: 2px solid #ff2d2d !important;
  outline-offset: 3px;
  border-radius: 4px;
  background-color: rgba(255, 45, 45, 0.06) !important;
  transition: background-color 0.15s ease;
}

/* 区块聚焦框：独立覆盖层，层级高于说明卡片，只描边不挡内容 */
.vpa-target-frame {
  position: fixed;
  z-index: calc(var(--vpa-z-base, 9997) + 6);
  border: 2px solid #ff2d2d;
  border-radius: 4px;
  box-shadow: 0 0 0 3px rgb(255 45 45 / 15%);
  pointer-events: none;
}
