* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  background: #f2f4f8;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}
/* 画布容器，完全参照 canvasStyleData 尺寸 800x540 */
.canvas {
  position: relative;
  width: 800px;
  height: 540px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
  /* 保持内部元素的精确像素定位 */
}
/* 所有组件都使用 absolute 定位，基于 left/top 值 (从json里来) */
.comp {
  position: absolute;
  box-sizing: border-box;
  /* 默认字体大小继承canvas的14px */
  font-size: 14px;
}
/* 按钮样式 (VButton) */
.vbutton {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #333;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 400;
  color: #000;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
  padding: 0 6px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.vbutton:hover {
  background: #f0f0f0;
}
.vbutton:active {
  background: #e0e0e0;
}
/* 文字组件 VText */
.vtext {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 24px;
  font-weight: 400;
  color: #000;
  padding: 7px;
  white-space: nowrap;
  line-height: 1.2;
}
/* 矩形组件 RectShape */
.rect {
  border: 1px solid #000;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #999;
  font-size: 14px;
  overflow: hidden;
  /* 保留原有边框和背景透明，用于占位说明 */
}
/* 隐藏原始矩形内的文字，只保留边框和占位提示，但为了视觉清晰，我们降低透明度 */
.rect span {
  opacity: 0.25;
  font-size: 12px;
  pointer-events: none;
  user-select: none;
}
/* 上传按钮特殊——因为要用 input file 触发 */
.file-input {
  display: none;
}
/* 滑块条样式 */
.slider-bar {
  background: #ddd;
  border-radius: 4px;
  border: 1px solid #000;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
/* 滑块手柄 */
.slider-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #333;
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
/* 帧缩略图区域容器 */
.frame-container {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  padding: 6px;
  overflow-y: auto;
  background: #fafafa;
  border: 1px solid #000;
}
.frame-thumb {
  width: 91px;
  height: 131px;
  border: 1px solid #000;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.frame-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: crisp-edges; /* 保持像素锐利 */
}
/* 主图显示区域 */
.main-image-area {
  border: 1px solid #000;
  background: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.main-image-area img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: crisp-edges;
}
/* 控制区域样式——信息栏 */
.info-panel {
  display: flex;
  align-items: center;
  justify-content: space-around;
  border: 1px solid #000;
  background: #fff;
  font-size: 13px;
  padding: 0 8px;
  gap: 8px;
  flex-wrap: nowrap;
}
.info-panel label {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-weight: 400;
  color: #333;
}
.info-panel input {
  width: 56px;
  padding: 2px 4px;
  border: 1px solid #aaa;
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
}
.info-panel input:focus {
  outline: 1px solid #333;
  border-color: #333;
}
/* 滚动条美化 */
.frame-container::-webkit-scrollbar {
  width: 6px;
}
.frame-container::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 3px;
}