body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #f9f9fb;
  margin: 0;
  padding: 2rem;
  color: #333;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

h1 {
  font-weight: 600;
  margin-bottom: 1.5rem;
}

button {
  background: #007aff;
  border: none;
  color: white;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  margin: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #005fcb;
}

.image-container {
  position: relative;
  display: inline-block;
  margin-top: 1rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-container img {
  max-width: 100%;
  height: auto;
  display: block;
}

.rect {
  position: absolute;
  border: 2px solid #007aff;
  background-color: rgba(0, 122, 255, 0.1);
  box-sizing: border-box;
  cursor: move;
  border-radius: 4px;
}

.handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #007aff;
  border-radius: 50%;
  cursor: nwse-resize;
}

.handle.br {
  bottom: -5px;
  right: -5px;
}

.rect-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff3b30;
  color: white;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  line-height: 22px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.rect-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 40px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.3);
  pointer-events: none;
  user-select: none;
}

.slider-container {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #333;
}

.slider-container input[type="range"] {
  width: 150px;
  accent-color: #007aff;
}

#output {
  background: #f2f2f7;
  border-radius: 10px;
  padding: 1rem;
  text-align: left;
  overflow-x: auto;
  white-space: pre-wrap;
  margin-top: 1.5rem;
}
