.tab-btn.active {
  background: white;
  color: #4f46e5;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

.tab-panel.hidden { display: none; }

.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 1rem;
  padding: 2.5rem 1rem;
  text-align: center;
  background: #f8fafc;
  transition: background .15s, border-color .15s;
}
.dropzone.is-drag {
  background: #eef2ff;
  border-color: #6366f1;
}

.preview-wrap {
  position: relative;
  background: #0f172a;
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}
.preview-media {
  display: block;
  max-width: 100%;
  max-height: 480px;
  user-select: none;
}
#wm-video { display: none; }
/* 双保险：is-hidden 加 !important，避免 is-shown 同优先级后定义覆盖，
   导致两个类同时存在时图片/视频都还显示 */
#wm-image.is-hidden, #wm-video.is-hidden { display: none !important; }
#wm-image.is-shown, #wm-video.is-shown { display: block; }

.rect-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.rect-box {
  position: absolute;
  border: 2px solid #ef4444;
  background: rgba(239, 68, 68, .18);
  cursor: pointer;
  pointer-events: auto;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.25);
  transition: background .15s;
}
.rect-box:hover {
  background: rgba(239, 68, 68, .32);
}
.rect-box .rect-tag {
  position: absolute;
  top: -22px;
  left: 0;
  background: #ef4444;
  color: white;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rect-box .rect-tag button {
  background: transparent;
  color: white;
  font-weight: bold;
  line-height: 1;
  font-size: 12px;
}

.rect-pill {
  background: #eef2ff;
  color: #4338ca;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rect-pill button {
  color: #4338ca;
  font-weight: bold;
}

.mg-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .75rem;
  background: #f1f5f9;
  border-radius: .5rem;
  font-size: .875rem;
}
.mg-item button { color: #ef4444; font-size: .75rem; }

.mg-mode-btn.active {
  background: #4f46e5 !important;
  color: white;
}

/* Before/after image compare slider */
.compare {
  position: relative;
  width: 100%;
  max-height: 540px;
  background: #0f172a;
  border-radius: 0.75rem;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
.compare img {
  display: block;
  width: 100%;
  max-height: 540px;
  object-fit: contain;
  pointer-events: none;
}
.compare .compare-after {
  position: absolute;
  inset: 0;
  overflow: hidden;
  width: 50%;
}
.compare .compare-after img {
  width: var(--compare-full-w, 1000px);
  max-width: none;
  height: auto;
}
.compare .compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: white;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4);
  cursor: ew-resize;
}
.compare .compare-handle::after {
  content: "↔";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  color: #4338ca;
  font-size: 18px;
  font-weight: bold;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.compare .compare-label {
  position: absolute;
  top: 8px;
  padding: 2px 8px;
  background: rgba(0,0,0,.55);
  color: white;
  font-size: 11px;
  border-radius: 4px;
}
.compare .compare-label.left { left: 8px; }
.compare .compare-label.right { right: 8px; }