/* 勾选框样式 */
.checkbox-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  position: relative;
  padding: 0.25rem;
  margin: -0.25rem;
  border-radius: 0.375rem;
  transition: background-color var(--duration-normal) var(--ease-out);
}

.checkbox-wrapper:hover {
  background-color: var(--hover-bg);
}

.checkbox-wrapper input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 1.5px solid var(--border-subtle);
  border-radius: 0.25rem;
  background: var(--input-bg);
  position: relative;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
  transition: all var(--duration-normal) var(--ease-out);
}

.checkbox-wrapper input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-wrapper input[type="checkbox"]:checked::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 0.625rem;
  height: 0.625rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 1 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 1;
}

.checkbox-wrapper input[type="checkbox"]:not(:checked)::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 0.625rem;
  height: 0.625rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='currentColor'%3E%3Cpath d='M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 1 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  transition: all var(--duration-normal) var(--ease-bounce);
}

.checkbox-wrapper:hover input[type="checkbox"]:not(:checked)::before {
  opacity: 0.1;
  transform: translate(-50%, -50%) scale(1);
}

.checkbox-wrapper input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-color: var(--primary);
}

.checkbox-wrapper input[type="checkbox"]:disabled {
  background-color: var(--input-disabled);
  border-color: var(--border-subtle);
  cursor: not-allowed;
  opacity: 0.6;
}

.checkbox-wrapper:has(input[type="checkbox"]:disabled) {
  cursor: not-allowed;
  opacity: 0.6;
}

/* 列表中的勾选框特殊样式 */
.row.item .checkbox-wrapper {
  padding: 0.125rem;
  margin: 0;
}

.row.item .checkbox-wrapper input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}
