/* 高精度矢量 SVG 查看器（v1.17.0）*/

.dwgz-svg-host {
  --dwgz-svg-bg: #0d0d0d;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 320px;
  background: var(--dwgz-svg-bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  overflow: hidden;
  color: #eee;
  font-size: 13px;
}

.dwgz-svg-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex: 0 0 auto;
}

.dwgz-svg-title {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  opacity: 0.9;
}

.dwgz-svg-btn {
  flex: 0 0 auto;
  min-width: 30px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #eee;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.dwgz-svg-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.dwgz-svg-pct {
  flex: 0 0 auto;
  min-width: 46px;
  text-align: right;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.dwgz-svg-stage {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.dwgz-svg-stage.is-dragging {
  cursor: grabbing;
}

.dwgz-svg-inner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.dwgz-svg-inner svg {
  display: block;
  width: 100%;
  height: 100%;
}

.dwgz-svg-loading,
.dwgz-svg-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 20px;
  opacity: 0.8;
}

.dwgz-svg-error {
  color: #ffb4b4;
}

.dwgz-svg-error a {
  color: #8fd3ff;
}

/* 弹窗 */

.dwgz-svg-mask {
  position: fixed;
  inset: 0;
  z-index: 999900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.82);
  box-sizing: border-box;
}

.dwgz-svg-modal {
  position: relative;
  width: 100%;
  max-width: 1400px;
  height: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.dwgz-svg-host--modal {
  flex: 1 1 auto;
  min-height: 0;
}

.dwgz-svg-close {
  position: absolute;
  top: -2px;
  right: -2px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.dwgz-svg-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.dwgz-svg-host.is-max {
  position: fixed;
  inset: 0;
  z-index: 999800;
  border-radius: 0;
}

body.dwgz-svg-locked {
  overflow: hidden;
}

@media (max-width: 640px) {
  .dwgz-svg-mask { padding: 8px; }
  .dwgz-svg-modal { max-height: 96vh; }
}
